Disable Registry Reflection: How and Why

14. February 2006 04:35 by Csaborio in General  //  Tags:   //   Comments (0)
During our interoperability sessions we have talked plenty about the WoW64. We have touched base on topics such as changes that happen in the file system and in the registry. Of particular interest is the topic of registry reflection, which is the mirroring of keys from the 32-bit and 64-bit sections of the registry so that they share same information. If you recall, one of the many reasons why registry reflection happens is so that an out-of-process COM LocalServer (aka COM EXE) can be accessed by a 32-bit or 64-bit application. Even though this works like a charm, there are some cases in which you might not want your COM LocalServer to be registered to both 32-bit binaries and 64-bit binaries. Since Windows Server 2003 SP1, you can disable registry reflection on a specific key by using the following function: RegDisableReflectionKey http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regdisablereflectionkey.asp By doing so, when this key is registered, it will not be reflected. Why on Earth would you want to do something like this? Say for example you are registering a 64-bit COM server that handles and sends data segments that are bigger than 4 GB to the caller. You would not want this COM server being accessed by a 32-bit application at all. That’s one I can think on top of my head, can you think of any other reasons on why you would like to use this function?