Registry key permissions...

  • Thread starter Thread starter Jose Cintron
  • Start date Start date
J

Jose Cintron

I'm looking for a way to obtain the ACL for a specific registry key. For example if I want the permissions of
HKLM\SOFTWARE\Microsoft

I would get something like
Administrators Full Control
Creator Owner Special Permissions (List of special permissions here)
Power Users Read
Special Permissions (List of special permissions here)
SYSTEM Full Control
Users Read

In general terms what I want is something that would return a structure similar to the following for file ACLs

Set wmiSecuritySettings = wmiServices.Get ("Win32_LogicalFileSecuritySetting.Path='" & fname & "'")
intRetVal = wmiSecuritySettings.GetSecurityDescriptor(wmiSecurityDescriptor)

Any suggestions other than using the ADsSecurity.DLL (which is not shipped with WinXP). I cannot install any SW on the box where this will be running.
 
Jose Cintron said:
I'm looking for a way to obtain the ACL for a specific registry key. For
example if I want the permissions of
HKLM\SOFTWARE\Microsoft
I would get something like
Administrators Full Control
Creator Owner Special Permissions (List of special permissions
here)
Power Users Read
Special Permissions (List of special permissions
here)
SYSTEM Full Control
Users Read

In general terms what I want is something that would return a structure
similar to the following for file ACLs

Set wmiSecuritySettings = wmiServices.Get
("Win32_LogicalFileSecuritySetting.Path='" & fname & "'")
intRetVal =
wmiSecuritySettings.GetSecurityDescriptor(wmiSecurityDescriptor)

Any suggestions other than using the ADsSecurity.DLL (which is not shipped
with WinXP).
I cannot install any SW on the box where this will be running.

GetNamedSecurityInfo or GetSecurityInfo

PS : Please don't post in HTML in newsgroups.

Arnaud
MVP - VC
 
Ok this is what I have so far...

void main(void)
{
DWORD result;
PSECURITY_DESCRIPTOR pSD = NULL;
PACL pACL = NULL;

result = GetNamedSecurityInfo(TEXT("CLASSES_ROOT\\arzfile"),
SE_REGISTRY_KEY, \
DACL_SECURITY_INFORMATION, NULL, NULL, &pACL, NULL,
&pSD);
}

How do I interpret the values returned in pACL and pSD?
 
Back
Top