This tip is for Novell Products (eDirectory, IDM, etc.) and third-party applications that observe a dependency on dwmapi.dll with the Vista OS.
When you deploy such an application on a system with Internet Explorer 7 installed, the application library or binary shows a dependency on dwmapi.dll, which cannot be resolved unless you uninstall IE7. Most of the forum discussion on this problems suggest uninstalling IE7 on the, but this is not the right solution. This article explains how this dependency was added to application library/binary and how to handle the situation.
IE7 comes with MS 2003 Server, or it may be downloaded from Internet, or there may be IE7 upgrades that update IEFRAME.DLL in the system32 folder. This IEFRAME.DLL file has a dependency on dwmapi.dll. The dependency chain below shows how the application is hooked to dwmapi.dll.
Our Application => ADVAPI32.DLL => WINSTA.DLL => NETAPI32.DLL => DNSAPI.DLL =>IPHLPAPI.DLL => MPRAPI.DLL => ACTIVEDS.DLL => ADSLDPC.DLL => CREDUI.DLL => SHELL32.DLL => SHDOCVW.DLL => MSHTML.DLL => IEFRAME.DLL => DWMAPI.DLL
So how do you handle the dependency?
DWMAPI.DLL does not exist on any non-Vista box. The only call made into dwmapi.dll is DwmExtendFrameIntoClientArea, which is used to set what parts of the window should be rendered with glass and what should be rendered as opaque. The DwmExtendFrameIntoClientArea function gets called if OSVERSIONINFO.dwMajorVersion returns at least 6, which means you are running your application on Windows Server 2008 or Windows Vista.
Following is a sample that verifies this. (To understand the API’s used in the sample, refer to http://msdn2.microsoft.com/en-us/library/ms724834.... )
// DWMAPI.cpp : Defines the entry point for the console application.
int main(int argc, char* argv)
printf("GetVersionEx Returns %d\n",GetVersionEx(&osvi));
if( osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
printf("dwMajorVersion %d \n",osvi.dwMajorVersion );
If osvi.dwMajorVersion >=6, then your application may require dwmapi.dll at runtime. And in this case, the operating system is Vista or Windows Server 2008, which has dwmapi.dll.
What do you need to if osvi.dwMajorVersion <6?
DWMAPI.DLL is a delay load module. The Windows demand-loading .dll concept prevents it from loading until a call to DwmExtendFrameIntoClientArea is made. This call is never made on a non-Vista box, due to the dwMajorVersion check explained above. If an application or .dll is set up to resolve everything before it runs (i.e., ignore the delay-loaded aspect), then it will fail.
Use late binding, if you are currently using the early binding concept. On the other hand, if it is delay linked, it will never hit this bug. In fact, most standard applications/libraries (e.g., notepad.exe and iexplorer.exe) have this dependency and still work without problems, so your application should work fine.
What you should not do:
* Create your own dwmapi.dll that has DwmExtendFrameIntoClientArea function implementation.
* Ask all users (customers, developers, etc.) to uninstall IE7.
* Change the build system configuration to take care of this dependency during build time. This is because IE7 installed on the deployment box is causing the problem.
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.