Can someone advise why the below is creating a file with 0 Bytes? And solutions that correct this? I'm fairly new to VC++.
SE_BACKUP_NAME privilege is taken earlier in other code. - It has been tested and works fine.
Thank you.
//save_loc3 = "c:\InstalogRegBackup\backup_20126141314\hklm_hardware.bak"
long resultC1 = ::RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"HARDWARE", 0, KEY_READ, &hKey);
std::cout << "Value of GetLastError() is: " << GetLastError() << endl; // "0" is output to screen!
std::wcout << "Value of resultC1 is: " << resultC1 << endl; // "0" is output to screen.
long resultC2 = ::RegSaveKeyW(hKey, save_loc3, NULL); //no errors on this line
std::cout << "Value of GetLastError() is: " << GetLastError() << endl; // "0" is output to screen!
std::wcout << "Value of resultC2 is: " << resultC2 << endl; // "1314" is output to screen! (a required priviledge is not held by the client) also saved file is 0 Bytes?!