Problems Creating a Key under HKEY_LOCAL_MACHINE in Vista
Posted on 2008-06-18
We have written a C++ application that creates a registry key to store information in. On XP computers it works fine and on most Vista computers (Home Premium) it works fine. However on some Vista Computers it will not create the key. Otherwise the program works fine, but the key is never created.
The key we're creating is in HKEY_LOCAL_MACHINE\SOFTWARE. The command we're using to create it is
LONG lRes = RegCreateKeyEx(HKEY_LOCAL_MACHINE, "Software\\OurKey\0", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &RegKey, NULL);
The user is logged in as an administrator. Does anybody have any Ideas why, in only a few cases, the key is not created?