RtlAllocateAndInitializeSid - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H

/**
 * The RtlAllocateAndInitializeSid routine allocates and initializes a security identifier (SID) with up to eight subauthorities.
 *
 * \param IdentifierAuthority A pointer to the SID_IDENTIFIER_AUTHORITY for the new SID.
 * \param SubAuthorityCount The number of subauthorities to place in the SID.
 * \param SubAuthority0 The first subauthority value.
 * \param SubAuthority1 The second subauthority value.
 * \param SubAuthority2 The third subauthority value.
 * \param SubAuthority3 The fourth subauthority value.
 * \param SubAuthority4 The fifth subauthority value.
 * \param SubAuthority5 The sixth subauthority value.
 * \param SubAuthority6 The seventh subauthority value.
 * \param SubAuthority7 The eighth subauthority value.
 * \param Sid A pointer to a variable that receives the allocated SID.
 * \return NTSTATUS Successful or errant status.
 * \sa https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlallocateandinitializesid
 * \remarks The fixed-argument form supports 0 through 8 subauthorities and returns STATUS_INVALID_SID for a larger count before allocating. Output is published only after successful allocation/initialization; release it with RtlFreeSid.
 */
_Must_inspect_result_
NTSYSAPI
NTSTATUS
NTAPI
RtlAllocateAndInitializeSid(
    _In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
    _In_ UCHAR SubAuthorityCount,
    _In_ ULONG SubAuthority0,
    _In_ ULONG SubAuthority1,
    _In_ ULONG SubAuthority2,
    _In_ ULONG SubAuthority3,
    _In_ ULONG SubAuthority4,
    _In_ ULONG SubAuthority5,
    _In_ ULONG SubAuthority6,
    _In_ ULONG SubAuthority7,
    _Outptr_ PSID *Sid
    );

#endif

View code on GitHub
// ntifs.h

NTSYSAPI NTSTATUS RtlAllocateAndInitializeSid(
  PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
  UCHAR                     SubAuthorityCount,
  ULONG                     SubAuthority0,
  ULONG                     SubAuthority1,
  ULONG                     SubAuthority2,
  ULONG                     SubAuthority3,
  ULONG                     SubAuthority4,
  ULONG                     SubAuthority5,
  ULONG                     SubAuthority6,
  ULONG                     SubAuthority7,
  PSID                      *Sid
);
View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (nf-ntifs-rtlallocateandinitializesid)

RtlAllocateAndInitializeSid function

Description

The RtlAllocateAndInitializeSid routine is reserved for system use. See RtlCopySid and RtlInitializeSid.

Parameters

IdentifierAuthority

Reserved.

SubAuthorityCount

Reserved.

SubAuthority0

Reserved.

SubAuthority1

Reserved.

SubAuthority2

Reserved.

SubAuthority3

Reserved.

SubAuthority4

Reserved.

SubAuthority5

Reserved.

SubAuthority6

Reserved.

SubAuthority7

Reserved.

Sid

Reserved.

Return value

Reserved.