views:

200

answers:

1

Are there WinAPI functions that do the same what can do standard Windows utility reg.exe with import/export flags?

I'm know that there are RegSaveKey and RegRestoreKey functions, but the calling process must have additional privileges SE_RESTORE_NAME and SE_BACKUP_NAME. This means that it is necessary to ask user to elevate process (show UAC dialog).

Seems to be that reg.exe does not require such privileges for HKCU keys. But starting reg.exe with some arguments is not good idea if there are appropriate WinAPI.

UPD: Brief reverse engineering has shown that reg.exe use internal parse functions. Still may be are there .NET functions that does not require additional privileges?

+1  A: 

Unfortunately there is not. The RegSaveKey/RegRestoreKey functions also use a binary format, not the text format used by reg.exe.

Murray