Re: deleting a registry ke
- From: "Doron Holan [MSFT]" <doronh@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 12 Oct 2007 09:55:49 -0700
you can only delete a key if there are no subkeys. so, if you want to do this in a driver you have to enumerate all of the subkeys recursively and delete every one of them. this is what regedit does. BUT, this should not be done in the driver, recursion is not good b/c there is very limited stack space and the interfaces are a bit more difficult to deal with compared to user mode (for instance there is a RegDeleteTree in Vista which does it all for you instead of recursing). the reset to a default config should really be done by a UM helper application/service.
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian" <Brian@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:34A3931F-4AE8-4E3F-8EC9-6D652CDA22A7@xxxxxxxxxxxxxxxx
I save some device specific information in the registry that is created with
ACCESS_ALL. Sometimes it is necessary go back to default configuration, so I
would like to delete the information. I am opening an handle to the key and
calling ZwDeleteKey, but I get an error with the status that I can't delete
it (0xC0000121). The information has a tree structure (the key itself
contains sub keys) and it also contains values. Is this the reason the
delete fails? I can delete the node easily enough using regedit, why can't I
delete it in my driver entry?
.
- Prev by Date: Re: How user wait for kernel?
- Next by Date: Re: can symbolicname be used to get handle
- Previous by thread: Re: How user wait for kernel?
- Next by thread: can symbolicname be used to get handle
- Index(es):
Relevant Pages
|