Windows 64-bit registry v.s. 32-bit registry

后端 未结 6 1131
逝去的感伤
逝去的感伤 2020-11-27 02:44

I heard on Windows x64 architecture, in order to support to run both x86 and x64 application, there is two separate/different sets of Windows registry -- one for x86 applica

相关标签:
6条回答
  • 2020-11-27 02:57

    I ran into this issue not long ago. The short answer is that if you run a 32 bit application on a 64 bit machine then it's registry keys are located under a Wow6432Node.

    For example, let's say you have an application that stores its registry information under:

    HKEY_LOCAL_MACHINE\SOFTWARE\CompanyX
    

    If you compile your application as a 64 bit binary and run it on a 64 bit machine then the registry keys are in the location above. However, if you compile your application as a 32 bit binary and run it on a 64 bit machine then your registry information is now located here:

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\CompanyX
    

    This means that if you run both the 32 bit and 64 bit versions of your application on the same machine then they will each be looking at a different set of registry keys.

    0 讨论(0)
  • 2020-11-27 03:10

    Here is the Wikipedia article on the WOW64 registry which may give you some of the information you are looking for:

    http://en.wikipedia.org/wiki/WOW64

    0 讨论(0)
  • 2020-11-27 03:10

    How to register .NET assembly to be used as COM in pure 64-bit application?

    Problem: By default, if you enable "Register for COM Interop" in build settings, it DOES NOT register type library for 64-bit.

    Solution: To register your assembly which is not in GAC on a 64-bit machine, open cmd window and do:

    cd c:\windows\microsoft.net\framework64\v2.x.xxxxx
    regasm /codebase "path to your compiled assembly dll"
    

    This will eliminate "Class Not Registered Error" when using native C++ to instanciate .NET assembly as COM object.

    0 讨论(0)
  • 2020-11-27 03:11

    Your understanding is correct. There wouldn't be any need for a x64 app to access the x86 CLSIDs since it could never load those components anyway and vice versa.

    If you want to create component for use by both x86 and x64 then you need to either create a pair of dlls one built for x86 and the other for x64 and register both in their appropriate parts of the registry. The regsrv32.exe in the System32 folder will perversely register the x64 component and the regsrv32.exe in the SysWOW64 folder will register the x86 component.

    Alternatively build a .NET assembly for Any CPU which can used by either CPU architecture.

    0 讨论(0)
  • 2020-11-27 03:12

    I run an x64 bit machine as my desktop; and I have never run into any issues with the different registry configurations.

    Per MSDN, there is apparently a difference: http://msdn.microsoft.com/en-us/library/ms724072(VS.85).aspx

    HTH

    0 讨论(0)
  • 2020-11-27 03:15

    They aren't separate registries--one is a subnode of the other, and the OS does virtualization to make sure that 32bit apps get their keys and 64bit apps get their keys.

    0 讨论(0)
提交回复
热议问题