c++ - How to use the RegLoadKey function to load the NTUSER.DAT file from the Default User? -


i thought use regloadkey load ntuser.dat file located in c:\users\default folder using code:

hkey hkey = hkey_local_machine;     lpctstr lpsubkey = l"software\\load";     lpctstr lpfile = l"c:\\users\\default\\ntuser";      long r=regloadkey(hkey, lpsubkey, lpfile); 

it did not work. can tell me how have use function load ntuser.dat file hklm\software\load sub-key?

thanks!

as @xearinox mentioned need privilages (se_backup_name , se_restore_name)

also must load ntuser.dat, otherwise create new registry hive. , lpsubkey can first level after hkey.

so should set privilages , load this:

long ret = regloadkey(hkey_local_machine, l"load", l"c:\\users\\default\\ntuser.dat"); 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -