Link to home
Start Free TrialLog in
Avatar of hasmet
hasmet

asked on

RegSaveKey, ERROR_PRIVILEGE_NOT_HELD

I open a reg-key and use RegSaveKey
to save it to a file, but I get
above error. (win2000/and nt4)
all I want is save the current values.
and restore them later for a paticular registry hive.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hasmet
hasmet

ASKER

I need to do it programatically.
is this possible? I tried
ModifyPrivilege code in msdn, but was not successful.
It is possible - see the 'lsapriv' sample in MSDN: http://msdn.microsoft.com/library/psdk/lsapol/lsapol_2d83.htm ("Managing Account Permissions")

and

http://www.mvps.org/win32/lsa/index.html

The sampl eitself is now part of teh PSDK samples, but this site incorporated it in a more comprehensive sample: http://www.mvps.org/win32/lsa/lsa_laar.cpp
Avatar of hasmet

ASKER

well, looks complicated ???
It *is* complicated - but adjusting the samples to suite your needs usually isn't ;-)