Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cant delete subkeys of \SYSTEM\ControlSet001\Enum\

Status
Not open for further replies.

skinah

Programmer
Oct 3, 2001
17
AU
can anyone give me some help tracking down the reason why my function i wrote deletes all other areas of the registry perfectly yet it just wont allow me to remove any subkeys from this branch...

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum

if anyones knows the trick to it please give me a pointer in the right direction.

thanks.
 
Take a look in MSDN at the function RegDeleteKey/RegDeleteKeyEx

Ion Filipski
1c.bmp
 
Thats what I am using already and its not working. As i wrote it works on all other areas except this one area.

I am beginning to look into RegSetKeySecurity but its way over my head on how to use the command. Can anyone confirm this is the reason and give me an example on how to use the RegSetKeySecurity ? I dont understand the MSDN articles on this command and cant find any good example code from which to learn from.
 
Just a copy/paste from MSDN:
RegDeleteKey
...
...
Remarks
A deleted key is not removed until the last handle to it has been closed.
.....
The subkey to be deleted must not have subkeys. To delete a key and all its subkeys, you need to recursively enumerate the subkeys and delete them individually. To recursively delete keys, use the SHDeleteKey function.


Ion Filipski
1c.bmp
 
thanks for replying but thats not it. it works in all other areas of the registry but this one area and it HAS to do with something along the lines of RegSetKeySecurity ACE's SID's and DACL.

I have checked the permissions for the keys in regedit and it is showing me that I am correct as the SYSTEM has full acess but not EVERYONE to delete the key.


How do I change permissions via c++ programming ?
 
type in MSDN RegSetKeySecurity and read. If you experience some troubles, put questions right there.

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top