BuildTrusteeWithObjectsAndSidW function (aclapi.h)

The BuildTrusteeWithObjectsAndSid function initializes a TRUSTEE structure with the object-specific access control entry (ACE) information and initializes the remaining members of the structure to default values. The caller also specifies the SID structure that represents the security identifier of the trustee.

Syntax

void BuildTrusteeWithObjectsAndSidW(
  [in, out]      PTRUSTEE_W       pTrustee,
  [in, optional] POBJECTS_AND_SID pObjSid,
  [in, optional] GUID             *pObjectGuid,
  [in, optional] GUID             *pInheritedObjectGuid,
  [in, optional] PSID             pSid
);

Parameters

[in, out] pTrustee

A pointer to a TRUSTEE structure to initialize. The BuildTrusteeWithObjectsAndSid function does not allocate any memory. If this parameter is NULL or a pointer that is not valid, the results are undefined.

[in, optional] pObjSid

A pointer to an OBJECTS_AND_SID structure that contains information about the trustee and the securable object.

[in, optional] pObjectGuid

A pointer to a GUID structure that describes the ObjectType GUID to be added to the TRUSTEE structure.

[in, optional] pInheritedObjectGuid

A pointer to a GUID structure that describes the InheritedObjectType GUID to be added to the TRUSTEE structure.

[in, optional] pSid

A pointer to a SID structure that identifies the trustee.

Return value

None

Remarks

This function does not allocate memory for the TRUSTEE and OBJECTS_AND_SID structures.

For more information about object-specific ACEs, see Object-specific ACEs.

Note

The aclapi.h header defines BuildTrusteeWithObjectsAndSid as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header aclapi.h
Library Advapi32.lib
DLL Advapi32.dll

See also

Access Control

Basic Access Control Functions

BuildTrusteeWithName

BuildTrusteeWithObjectsAndName

BuildTrusteeWithSid

OBJECTS_AND_NAME

Object-specific ACEs

SE_OBJECT_TYPE

SID

TRUSTEE