The SetPrivateObjectSecurity function modifies a private object's security descriptor.
BOOL SetPrivateObjectSecurity(
SECURITY_INFORMATION SecurityInformation, // type of security
// information
PSECURITY_DESCRIPTOR ModificationDescriptor, // address of SD to
// apply to object
PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
// address of object's SD
PGENERIC_MAPPING GenericMapping, // address of access-mapping
// structure
HANDLE Token // handle of client access token
);
On input, this is the current security descriptor of the private object. The function modifies it to produce the new security descriptor. If necessary, the SetPrivateObjectSecurityEx function allocates additional memory to produce a larger security descriptor.
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 SetPrivateObjectSecurity function is successful only if the following conditions are met:
The process calling this function must not be impersonating a client.
Windows NT: Requires version 3.1 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use advapi32.lib.
Client/Server Access Control Overview, Client/Server Access Control Functions, CreatePrivateObjectSecurity, DestroyPrivateObjectSecurity, GENERIC_MAPPING, GetPrivateObjectSecurity, SECURITY_DESCRIPTOR, SECURITY_INFORMATION, SetFileSecurity, SetKernelObjectSecurity, SetUserObjectSecurity