in reply to Win32 Registry permissions

You don't report $^E so we are left to just guess what category the failure falls into.

I think you would need WRITE_DAC access in order to write permission settings (and READ_CONTROL to read them). WRITE_DAC is included as part of KEY_ALL_ACCESS but not KEY_WRITE (READ_CONTROL is included in nearly every defined access mask). See WinNT.h (part of MS SDKs) for more about how these values relate to each other.

- tye        

Replies are listed 'Best First'.
Re^2: Win32 Registry permissions ($^E)
by runrig (Abbot) on Nov 15, 2006 at 08:09 UTC
    You don't report $^E...
    D'oh. Sorry. It was "Access is denied" on the RegSetKeySecurity. It works now using KEY_ALL_ACCESS. And now, is there a way to automatically propagate permissions to subkeys, or do I need to individually set permissions on all of the subkeys?

      I vaguely recall that keys (and directories) can be set to "whatever permissions my parent has" (and modified from there), but if those subkeys aren't already set that way, then you'd still have to go set them all.

      - tye