GetSidLengthRequired function

The GetSidLengthRequired function returns the length, in bytes, of the buffer required to store a SID with a specified number of subauthorities.

Syntax

DWORD GetSidLengthRequired(
  UCHAR nSubAuthorityCount
);

Parameters

nSubAuthorityCount

Specifies the number of subauthorities to be stored in the SID structure.

Return Value

The return value is the length, in bytes, of the buffer required to store the SID structure. This function cannot fail.

Remarks

The SID structure specified in nSubAuthorityCount uses a 32-bit RID value. For applications that require longer RID values, use CreateWellKnownSid and related functions.

Requirements

   
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header securitybaseapi.h (include Windows.h)
Library Advapi32.lib
DLL Advapi32.dll

See Also

Access Control Overview

AllocateAndInitializeSid

Basic Access Control Functions

CreateWellKnownSid

GetLengthSid

GetSidIdentifierAuthority

GetSidSubAuthority

GetSidSubAuthorityCount

InitializeSid

IsValidSid

SID