[This is preliminary documentation and subject to change.]
The CreatePrivateObjectSecurityEx function allocates and initializes a self-relative security descriptor for a new private object. A protected server calls this function when it creates a new private object.
The CreatePrivateObjectSecurityEx function is identical to the CreatePrivateObjectSecurity function except for the following:
BOOL CreatePrivateObjectSecurityEx(
PSECURITY_DESCRIPTOR ParentDescriptor,
// security descriptor of parent object
PSECURITY_DESCRIPTOR CreatorDescriptor,
// current security descriptor of object
PSECURITY_DESCRIPTOR *NewDescriptor,
// receives the new security descriptor
GUID * ObjectType, // type of object
BOOL IsContainerObject, // identifies container objects
ULONG AutoInheritFlags, // identifies container objects
HANDLE Token, // identifies container objects
PGENERIC_MAPPING GenericMapping // map generic to specific rights
);
Value | Meaning |
---|---|
SEF_DACL_AUTO_INHERIT | |
If this flag is set, the new DACL contains ACEs inherited from the DACL of the ParentDescriptor, as well as any explicit ACEs specified in the DACL of the CreatorDescriptor. If this flag is not set, the new DACL does not inherit ACEs. | |
SEF_SACL_AUTO_INHERIT | |
If this flag is set, the new SACL contains ACEs inherited from the SACL of the ParentDescriptor, as well as any explicit ACEs specified in the SACL of the CreatorDescriptor. If this flag is not set, the new SACL does not inherit ACEs. | |
SEF_DEFAULT_DESCRIPTOR_FOR_OBJECT | |
If this flag is set, the CreatorDescriptor is the default descriptor for the type of object specified by ObjectType. As such, the CreatorDescriptor is ignored if the ParentDescriptor has any object-specific ACEs for the type of object specified by the ObjectType-parameter. If no such ACEs are inherited, the CreatorDescriptor is handled as though this flag were not specified. | |
SEF_AVOID_PRIVILEGE_CHECK | |
If this flag is set, the function does not perform privilege checking. The Token parameter can be NULL. This flag is useful while implementing automatic inheritance to avoid checking privileges on each child updated. |
The client token contains default security information, such as the default owner, primary group, and DACL. The function uses these defaults if the information is not in the input security descriptors. The token must be open for TOKEN_QUERY access.
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 CreatePrivateObjectSecurity function is identical to calling the CreatePrivateObjectSecurityEx function with ObjectType set to NULL and AutoInheritFlags set to zero.
The AutoInheritFlags are distinct from the similarly named bits in the Control member of the SECURITY_DESCRIPTOR structure. For an explanation of the control bits, see SECURITY_DESCRIPTOR_CONTROL.
If AutoInheritFlags specifies the SEF_DACL_AUTO_INHERIT bit, the function applies the following rules to the DACL in the new security descriptor:
If AutoInheritFlags specifies the SEF_SACL_AUTO_INHERIT bit, the function applies similar rules to the new SACL.
To create a security descriptor for a new object, call CreatePrivateObjectSecurityEx with ParentDescriptor set to the security descriptor of the parent container and CreatorDescriptor set to the security descriptor proposed by the creator of the object.
To verify the current security descriptor on an object, call CreatePrivateObjectSecurityEx with ParentDescriptor set to the security descriptor of the parent container and CreatorDescriptor set to the current security descriptor of the object. This call ensures that the ACEs are appropriately inherited from parent to child security descriptors.
If the CreatorDescriptor security descriptor contains a SACL, Token must have the SE_SECURITY_NAME privilege enabled, and the caller's token must have the SE_AUDIT_NAME privilege enabled. The CreatePrivateObjectSecurityEx function checks these privileges, and may generate audits if they are not enabled.
Windows NT: Requires version 5.0 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, DestroyPrivateObjectSecurity, GENERIC_MAPPING, GetPrivateObjectSecurity, GetTokenInformation, OpenProcessToken, SECURITY_DESCRIPTOR, SECURITY_IMPERSONATION_LEVEL, SetPrivateObjectSecurityEx