// JP opened flex table

Click to See Complete Forum and Search --> : couple of registry questions


tootypegs
July 10th, 2008, 06:26 PM
Hi, I have a couple of questions but i'l start with this one. I am trying to read a key from the registry of type REG_BINARY. I have got the following code but it doesn't seem to print anything out for me, can anyone see what i'm doing wrong? I kind of hacked at my previous code for keys of type REG_SZ which is probs not a good starting point.

Any help will be appreciated



HKEY hKey8;

if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SYSTEM\\MountedDevices", 0, KEY_READ, &hKey8) == ERROR_SUCCESS)
{
BYTE buffer[512];
DWORD dwType = REG_BINARY, dwSize = sizeof(buffer);
RegQueryValueExA(hKey8, "\??\Volume{f2ee7e24-fa58-11db-9559-0011f511d1a9}", NULL, &dwType, buffer, &dwSize);
cout << "Key value is: " << buffer << endl;

RegCloseKey(hKey8);

VladimirF
July 10th, 2008, 08:34 PM
RegQueryValueExA(hKey8, "\??\Volume{f2ee7e24-fa58-11db-9559-0011f511d1a9}", NULL, &dwType, buffer, &dwSize);You forgot to double-up backslashes.

//JP added flex table