VC ++ RegSaveKey创建0字节的文件?

时间:2013-06-24 22:14:07

标签: visual-c++ registry save byte

有人可以建议下面为什么创建一个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?!

0 个答案:

没有答案