RtlInitializeSid function

The RtlInitializeSid routine initializes a security identifier (SID) structure.

Syntax

NTSYSAPI NTSTATUS RtlInitializeSid(
  PSID                      Sid,
  PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
  UCHAR                     SubAuthorityCount
);

Parameters

Sid

Pointer to a caller-allocated SID structure to be initialized.

IdentifierAuthority

Pointer to an SID_IDENTIFIER_AUTHORITY structure to set in the SID structure.

SubAuthorityCount

Number of subauthorities to set in the SID. Subauthority values must be set separately, as described in the following Remarks section.

Return Value

RtlInitializeSid returns one of the following:

Return code Description
STATUS_SUCCESS
The SID was successfully initialized.
STATUS_INVALID_PARAMETER
The specified SubAuthorityCount value is invalid.

Remarks

Although RtlInitializeSid sets the number of subauthorities for the SID, it does not set the subauthority values. This must be done separately by calling RtlSubAuthoritySid.

For more information about security and access control, see the documentation on these topics in the Microsoft Windows SDK.

Requirements

   
Minimum supported client This routine is available on Microsoft Windows 2000 and later.
Target Platform Universal
Header ntifs.h (include Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe (kernel mode); Ntdll.dll (user mode)
IRQL "< DISPATCH_LEVEL"

See Also

RtlSubAuthoritySid

SID

SID_IDENTIFIER_AUTHORITY