I am using the following function
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentSet\\WebServices\\Netlogon", 0,KEY_READ, &hKey) == ERROR_SUCCESS)
to open the key.
This function returns SUCCESS indicating that it has opened the key. However when I try to read one of the values under this key by using the following function
DWORD DataType ; DWORD DataSize;DWORD lpData;
::RegQueryValueExW(hKey, KEYNAME, NULL, &DataType, ( LPBYTE )&lpData, &DataSize);
it does nothing the value in lpData remains zero where as the value should be 2.
Any ideas to what might be going wrong.