#ifndef _NTRTL_H
/**
* The RtlLengthRequiredSid routine returns the length, in bytes, required to store a security identifier (SID) with the specified number of subauthorities.
*
* \param SubAuthorityCount The number of subauthorities the SID will contain.
* \return ULONG The number of bytes required to hold the SID.
* \sa https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtllengthrequiredsid
* \remarks Computes 8 + 4 * SubAuthorityCount bytes. The implementation returns 0xFFFFFFFF when the count exceeds 0x3FFFFFF7; this arithmetic helper does not enforce the structural limit of 15 subauthorities used by SID initialization.
*/
NTSYSAPI
ULONG
NTAPI
RtlLengthRequiredSid(
_In_ ULONG SubAuthorityCount
);
View code on GitHub// ntifs.h
NTSYSAPI ULONG RtlLengthRequiredSid(
[in] ULONG SubAuthorityCount
);
View the official Windows Driver Kit DDI referenceThis function is documented in Windows Driver Kit.
The RtlLengthRequiredSid routine returns the length, in bytes, of the buffer required to store a security identifier (SID) with a specified number of subauthorities.
SubAuthorityCount [in]The number of subauthorities to be stored in the SID.
RtlLengthRequiredSid returns the length, in bytes, of the buffer required to store the SID structure.
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.