有人可以建议为什么下面会创建一个 0 字节的文件吗?以及纠正这个问题的解决方案?我对 VC++ 还很陌生。
SE_BACKUP_NAME 特权在其他代码中较早被采用。- 它已经过测试并且工作正常。
谢谢你。
//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?!