About a Registry Function
I'm having a bit of trouble with Registry Functions in the win32 API. I'm trying to make a workstation manager .DLL that constantly enumerates through certain keys/values in the registry... Here is the code:
HKEY ExplorerPolicies;
RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", NULL, KEY_ALL_ACCESS, &ExplorerPolicies);
char PolicyName[2048];
BYTE PolicyValue[2048];
DWORD PolicyType;
for (int i = 0, retCode = ERROR_SUCCESS; retCode != ERROR_NO_MORE_ITEMS; i++)
{
DWORD PolicyValueSize = sizeof(PolicyValue);
unsigned long PolicyNameSize = sizeof(PolicyName);
retCode = RegEnumValue(ExplorerPolicies, i, PolicyName,
&PolicyNameSize, NULL, &PolicyType, PolicyValue, &PolicyValueSize);
if (retCode == ERROR_SUCCESS)
{
MessageBox(NULL, PolicyName, "Registry Value", MB_ICONINFORMATION);
}
}
Now the problem is that it only recognises half of the values in a key/subkey in the registry... I don't think this is meant to happen- but I've tried almost everything and it's becoming really frustrating.
[edited by - way_out_west on July 25, 2003 11:02:54 AM]
[edited by - way_out_west on July 25, 2003 11:03:56 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement