#ifndef _NTRTL_H
NTSYSAPI
NTSTATUS
NTAPI
RtlInitializeSid(
_Out_ PSID Sid,
_In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
_In_ UCHAR SubAuthorityCount
);
View code on GitHub
// ntifs.h
NTSYSAPI NTSTATUS RtlInitializeSid(
[out] PSID Sid,
[in] PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
[in] UCHAR SubAuthorityCount
);
View the official Windows Driver Kit DDI reference
This function is documented in Windows Driver Kit.
The RtlInitializeSid routine initializes a security identifier (SID) structure.
Sid
[out]Pointer to a caller-allocated SID structure to be initialized.
IdentifierAuthority
[in]Pointer to an SID_IDENTIFIER_AUTHORITY structure to set in the SID structure.
SubAuthorityCount
[in]Number of subauthorities to set in the SID. Subauthority values must be set separately, as described in the following Remarks section.
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. |
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 Windows security model for driver developers and the documentation on these topics in the Windows SDK.