I found the source of my problem.
In order to make TieRegistry work well on 64-bit Windows, and access the correct registry hive, we used the solution
suggested by Tony B. Okusanya (also quoted
here). However, this solution adds both KEY_WOW64_64KEY and KEY_WOW64_32KEY to the access parameter, which is not logical – either you want to access the 64-bit registry and use KEY_WOW64_64KEY or you want the 32-bit registry and use KEY_WOW64_32KEY. Using both doesn’t make any sense.
Nevertheless, in previous versions of Windows, as well as Windows 7, it seems that when RegOpenKeyEx notices that the KEY_WOW64_64KEY flag is set in the access parameter, it uses the 64-bit registry, and ignores the KEY_WOW64_32KEY flag. Windows Server 2008 R2, on the other hand, doesn’t ignore the KEY_WOW64_32KEY flag, and if both flags are set, opening the registry key fail, and Win32API::Registry.regLastError returns the error “The parameter is incorrect”.
Removing “|KEY_WOW64_32KEY” from our changed TieRegistry.pm solved the problem and caused our application to work again.
Regards,
splintor