|
|
От: |
Macr0s
|
|
| Дата: | 29.01.07 07:30 | ||
| Оценка: | |||
DWORD GetNamedSecurityInfo(
LPTSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
PSID* ppsidOwner,
PSID* ppsidGroup,
PACL* ppDacl,
PACL* ppSacl,
PSECURITY_DESCRIPTOR* ppSecurityDescriptor
);Немного теорииpObjectName
[in] Pointer to a null-terminated string that specifies the name of the object from which to retrieve security information. For descriptions of the string formats for the different object types, see SE_OBJECT_TYPE.
SecurityInfo
[in] A set of SECURITY_INFORMATION bit flags that indicate the type of security information to retrieve.
ppSacl
[out] Pointer to a variable that receives a pointer to the SACL in the returned security descriptor. The returned pointer is valid only if you set the SACL_SECURITY_INFORMATION flag. This parameter can be NULL if you do not need the SACL.
Пример будет выглядеть как-то так:system access control list
(SACL) An ACL that controls the generation of audit messages for attempts to access a securable object.
char* lpKeyName=new char[260];
strcpy(lpKeyName,"MACHINE\\Software\\");
ACL sAcl;
PSECURITY_DESCRIPTOR sd;
GetNamedSecurityInfo(lpKeyName,SE_REGISTRY_KEY,SACL_SECURITY_INFORMATION,NULL,NULL,NULL,&sAcl,&sd);