CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2000
    Location
    Oxford, UK.
    Posts
    352

    Unhappy RegEnumKey returns ERROR_ACCESS_DENIED

    Hi folks,
    Can someone tell me what I need to do to enumerate the subkeys of a registry key? Is there a special privilege for this which overrides the dacl or do I need to put an entry in the dacl to allow it?
    I'm currently running with SeRestorePrivilege and SeTakeOwnershipPrivilege.

    xx.
    Last edited by c94wjpn; March 20th, 2012 at 06:32 AM.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: RegEnumKey returns ERROR_ACCESS_DENIED

    You have to RegOpenKeyEx the key which subkeys are to be enumerated with KEY_ENUMERATE_SUB_KEYS access mask.
    You should use RegEnumKeyEx rather than RegEnumKey
    Victor Nijegorodov

  3. #3
    Join Date
    Mar 2000
    Location
    Oxford, UK.
    Posts
    352

    Re: RegEnumKey returns ERROR_ACCESS_DENIED

    Thanks for pointing this out. I am now getting the same error back from RegOpenKeyEx.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured