InitializeSid

  BOOL InitializeSid(Sid, IdentifierAuthority, SubAuthorityCount)    
  PSID Sid;    
  PSID_IDENTIFIER_AUTHORITY IdentifierAuthority;    
  BYTE SubAuthorityCount;    

The InitializeSid function initializes an SID security identifier data structure.

Although InitializeSid sets the SID's number of sub-authorities, it does not set the sub-authority values. This must be done separately, using such functions as GetSidSubAuthority.

Parameters

Sid

Pointer to an SID data structure that the function will initialize.

Never manipulate an SID directly. Use the SID API functions, listed below in the See Also section.

IdentifierAuthority

Pointer to an SID_IDENTIFIER_AUTHORITY data structure to set in the SID. The SID_IDENTIFIER_AUTHORITY data structure has the following form:

typedef struct _SID_IDENTIFIER_AUTHORITY { /* sia */

BYTE Value[6];

} SID_IDENTIFIER_AUTHORITY ;

SubAuthorityCount

Specifies the number of sub-authorities to set in the SID. The sub-authority values must be set separately.

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information.

See Also

CopySid, EqualSid, GetLengthSid, IsValidSid, GetSidIdentifierAuthority, GetSidLengthRequired, GetSidSubAuthority, GetSidSubAuthorityCount

SID_IDENTIFIER_AUTHORITY, SID_TYPE