regsvr32 32-bit vs. 64-bit

Regsvr32 tool is the one to register DLL hosted COM servers with the system, this is what many have learned without even knowing anything about COM.

On 64-bit operating systems DLLs are 32-bit and 64-bit images, and an important thing about them is that there is no way to mix them in a single process. That is, 32-bit DLLs are for 32-bit processes, running inside WOW64 subsystem, 64-bit DLLs are for native processes.

So how comes that running regsvr32 from command line we can register both 32-bit and 64-bit DLLs. Does the system automatically identify image type of the DLL? Yes, the screenshot below illustrates registration of 64-bit DLL from command line “regsvr32 FilterGraphSpy.dll“.

regsvr32 FilterGraphSpy.dll (64-bit)

Process Explorer: regsvr32 Processes

Command line interpreter starts a 32-bit version of regsvr32 tool, which is located in SysWOW64 directory. It detects that provided image is 64-bit and spawns a 64-bit twin from system32 directory, forwarding the registration task to it. The latter loads 64-bit DLL, being native 64-bit process itself, and does the thing.

As simple as that.

One Reply to “regsvr32 32-bit vs. 64-bit”

  1. This post seems to be attacting visitors on unrelated matters:

    Guest: i just want to register autoit dll on 64 bit machine. That dll works for 32 bit machine, but not for 64 bit machine. I am using regsvr32 command

    32-bit apps are running well on 64-bit systems, however this is just a general rule. Your particular 32-bti dll might be missing some dependencies and this is why it does not work. Bitness of 64-bit operating system is unrelated.

Leave a Reply