Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

32-bit DLL "may not compatible" on Server 2008, but works on Server 2003

Tags:

We have a project that compiles to a 32-bit COM DLL and to a 64-bit COM DLL (the same one from my earlier question). When I register both on my Windows 7 machine, both register successfully. When I register both on a Windows Server 2003 machine, both register successfully.

But when I try to register the DLLs on a Windows Server 2008 R2 standard SP1 machine, the 64-bit DLL registers successfully, but the 32-bit DLL fails with the message (sic):

The module ""%1"" may not compatible with the version of Windows that you're running. Check if the module is compatible with an x86 (32-bit) or x64 (64-bit) version of regsvr32.exe.

I don't think a 32-bit DLL can be compatible with WS2003 and Win7 but not WS2008. That makes no sense.

What might be happening?

like image 742
Null Pointers etc. Avatar asked Mar 26 '12 20:03

Null Pointers etc.


1 Answers

The version of Regsvr32.exe must match the 32-/64-bitness of the dll you're trying to register. The 64-bit regsvr32 cannot load a 32-bit dll, and vice versa.

You may need explicitly call the 32-bit version of regsrv32 located in %systemroot%\SysWoW64\regsvr32.exe.

From http://support.microsoft.com/kb/249873

Regsvr32.exe is included with Microsoft Internet Explorer 3.0 or later versions, Windows 95 OEM Service Release 2 (OSR2) or later versions, and Windows NT 4.0 Service Pack 5 (SP5) or later versions. Regsvr32.exe is installed in the System (Windows Me/Windows 98/Windows 95) or System32 (Windows NT/Windows XP/Windows Vista/Windows 7) folder.

Note On a 64-bit version of a Windows operating system, there are two versions of the Regsv32.exe file:

  • The 64-bit version is %systemroot%\System32\regsvr32.exe.
  • The 32-bit version is %systemroot%\SysWoW64\regsvr32.exe.

Regsvr32.exe usage RegSvr32.exe has the following command-line options: Regsvr32 [/u] [/n] [/i[:cmdline]] dllname

/u - Unregister server /i - Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall /n - do not call DllRegisterServer; this option must be used with /i /s – Silent; display no message boxes (added with Windows XP and Windows Vista) When you use Regsvr32.exe, it attempts to load the component and call its DLLSelfRegister function. If this attempt is successful, Regsvr32.exe displays a dialog box that indicates success. If the attempt is unsuccessful, Regsvr32.exe returns an error message. This may include a Win32 error code. For more information, click the following article number to view the article in the Microsoft Knowledge Base: 193625 WinInet error codes (12001 through 12156)

like image 105
nullforce Avatar answered Oct 21 '22 01:10

nullforce