Read/Enum Permissions

  • Thread starter Thread starter John Bowman
  • Start date Start date
J

John Bowman

Hello,

Is there any way via code (C/C++) to read & enum registry keys under:

HKEY_LOCAL_MACHINE\Ssystem\CurrentControlSet\Enum

These are permission protected by default so even admins cannot
modify/delete then unless they 1st set the permissions. All we need to do
is read and enum the contents of one of the keys under here, but
RegOpenKeyEx() always fails by indicating the File is not found. Is there
some "special" coding/functions that is/are needed to make this work? Any
help would be appreciated.

BTW, At runtime, the code may be running under either an administrator or
user account.

TIA,
 
In said:
Hello,

Is there any way via code (C/C++) to read & enum registry keys
under:

HKEY_LOCAL_MACHINE\Ssystem\CurrentControlSet\Enum

These are permission protected by default so even admins cannot
modify/delete then unless they 1st set the permissions. All we
need to do is read and enum the contents of one of the keys under
here, but RegOpenKeyEx() always fails by indicating the File is
not found. Is there some "special" coding/functions that is/are
needed to make this work? Any help would be appreciated.

BTW, At runtime, the code may be running under either an
administrator or user account.

I can't help with the API calls, but there should be no problem just
Reading. Unless the key does not of course have EVERYONE:READ on it

C:\>reg.exe query HKLM\SYSTEM\CurrentControlSet\enum\usb

! REG.EXE VERSION 2.0

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\enum\usb

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\enum\usb\ROOT_HUB

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\enum\usb\Vid_046d&Pid_0840

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\enum\usb\Vid_051d&Pid_0002

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\enum\usb\Vid_05e3&Pid_0604
 
In said:
Hello,

Is there any way via code (C/C++) to read & enum registry keys
under:

HKEY_LOCAL_MACHINE\Ssystem\CurrentControlSet\Enum

These are permission protected by default so even admins cannot
modify/delete then unless they 1st set the permissions. All we
need to do is read and enum the contents of one of the keys under
here, but RegOpenKeyEx() always fails by indicating the File is
not found. Is there some "special" coding/functions that is/are
needed to make this work? Any help would be appreciated.

BTW, At runtime, the code may be running under either an
administrator or user account.

I can't help with the API calls, but there should be no problem just
Reading. Unless the key does not of course have EVERYONE:READ on it

C:\>reg.exe query HKLM\SYSTEM\CurrentControlSet\enum\usb

! REG.EXE VERSION 2.0

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\enum\usb

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\enum\usb\ROOT_HUB

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\enum\usb\Vid_046d&Pid_0840

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\enum\usb\Vid_051d&Pid_0002

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\enum\usb\Vid_05e3&Pid_0604
 
Mark,

Thanks for the response. That's basically what I was suspecting... that
there's nothing special you need to do. Turns out that permissions were the
prob. On the development system in question, the permissions had been
changed unknown to me - grrr. Once they were put back to "default",
everything worked great.

John
 
Mark,

Thanks for the response. That's basically what I was suspecting... that
there's nothing special you need to do. Turns out that permissions were the
prob. On the development system in question, the permissions had been
changed unknown to me - grrr. Once they were put back to "default",
everything worked great.

John
 
Back
Top