Try to open with KEY_ALL_ACCESS instead of WRITE_OWNER.
-Subbu
Mathieu Routhier wrote:
Do you know how to do it using RegEdit? You need to modify the permissions
to this key [right-click]. Maybe you know all of this already? Sorry,
until now, I never had to delete such keys programmatically.Mathieu Routhier
-----Original Message-----
From: Gordon [mailto:xxxxx@sunplus.com.tw]
Sent: Tuesday, February 25, 2003 10:18 PM
To: NT Developers Interest List
Subject: [ntdev] NTDEV:How to delete Windows XP registry key with
ACCESS_DENIED error?Dear All:
I want to delete following registry key in Windows XP:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_0733&Pid_0430
I use “SHDeleteKey” function to delete registry key, and it return
“ERROR_ACCESS_DENIED”.
I have tried to use “SetPrivilege” in MSDN library to set
SE_TAKE_OWNERSHIP_NAME
and use
RegOpenKeyEx(HKEY_LOCAL_MACHINE,
“SYSTEM\CurrentControlSet\Enum\USB\Vid_0733&Pid_0430”,
0, WRITE_OWNER,&hKey);
to get handle. However, it still failed.How can I delete this registry key? Is there any sample code to do it?
Thanks for any replying!Gordon
You are currently subscribed to ntdev as: xxxxx@guillemot.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@india.hp.com
To unsubscribe send a blank email to xxxxx@lists.osr.com