I have a program encoded by someone else. It has a RegGetValue function, which is used as:
uFuncReturnValue = RegOpenKeyExA( HKEY_LOCAL_MACHINE, acSubKey, NULL, KEY_READ | KEY_WRITE, &hRegistry ); //Store signature of the disk in the first 32 bytes of structVal if( uFuncReturnValue != ERROR_SUCCESS ) { printf("Unable to open registry with error %u\n", uFuncReturnValue); exit(EXIT_FAILURE);; } uFuncReturnValue = RegGetValueA( hRegistry, NULL, "\\DosDevices\\C:", RRF_RT_REG_BINARY, NULL, (LPVOID)&structVal, &dwSize );
This block of code works fine in Windows 7, but returns an error on startup in Windows XP (32 bits). Since 32-bit xp does not have a RegGetValue function, so I'm trying to use RegQueryValueEX , but I am having trouble passing arguments to this function. I think you need to use something like:
uFuncReturnValue = RegQueryValueExA ( hRegistry, "\\DosDevices\\J:", NULL, NULL, (LPBYTE) &structVal, &dwSize );
But something is wrong here, because the code compiles successfully, but when I execute it, I get a message:
The program '(128) myProgram.exe: Native "exited with code 1 (0x1).
Can anyone help me here?
windows registry
baltoro
source share