I'm trying to save the contents of a particular registry key to a file using the RegSaveKey() API:
HKEY key;
LRESULT result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\MyProduct", 0, KEY_ACCESS_ALL, &key);
result = RegSaveKey(key, L"c:\temp\saved.reg", NULL);
However, RegSaveKey() is returning ERROR_PRIVILEGE_NOT_HELD
. The SDK documentation says that "The calling process must have the SE_BACKUP_NAME
privilege enabled". The process is running as either a local administrator or as a service.
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…