Retrieves a copy of the security descriptor for the specified object.
| Parameter | Description |
|---|---|
hObject |
A handle to the object for which to retrieve security information. |
ObjectType |
A value from the SE_OBJECT_TYPE enumeration that indicates the type of object.
|
SecurityInfo |
A set of bit flags that indicate the types of security information to retrieve.
This parameter can be a combination of SECURITY_INFORMATION flags.
|
ppsidOwner |
A pointer to a pointer to a security identifier (SID) that receives the object's owner. If this parameter is NULL, the owner information is not retrieved. |
ppsidGroup |
A pointer to a pointer to a SID that receives the object's primary group. If this parameter is NULL, the primary group information is not retrieved. |
ppDacl |
A pointer to a pointer to an access control list (ACL) that receives the object's system access control list (SACL). If this parameter is NULL, the SACL information is not retrieved. |
ppSacl |
A pointer to a pointer to an ACL that receives the object's discretionary access control list (DACL). If this parameter is NULL, the DACL information is not retrieved. |
ppSecurityDescriptor |
A pointer to a pointer to a SECURITY_DESCRIPTOR structure that receives a copy of the object's security descriptor.
If this parameter is NULL, the security descriptor information is not retrieved.
|
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The caller must have the appropriate access rights to retrieve the requested security information. For example, to retrieve the SACL, the caller must have ACCESS_SYSTEM_SECURITY access right.
The memory pointed to by ppsidOwner, ppsidGroup, ppDacl, ppSacl, and ppSecurityDescriptor is allocated by the system. The caller must free this memory by calling LocalFree when it is no longer needed.
If you are retrieving the security descriptor for a file object, consider using the GetFileSecurity function instead of GetSecurityInfo.
| Redistributable package | Windows Vista, Windows XP Professional x64 Edition, Windows XP, Windows 2000 Professional, Windows 2000 Server, Windows 2000 Advanced Server |
|---|---|
| Header | winnt.h (include Winnt.h) |
| Library | Advapi32.lib |
| DLL | Advapi32.dll |