Platform SDK: Access Control

GetSidSubAuthority

The GetSidSubAuthority function returns a pointer to a specified subauthority in a SID. The subauthority value is a relative identifier (RID). (A SID is a security identifier.)

PDWORD GetSidSubAuthority(
  PSID pSid,            // security identifier
  DWORD nSubAuthority   // index of subauthority
);

Parameters

pSid
[in] Pointer to the SID structure from which a pointer to a subauthority is to be returned.
nSubAuthority
[in] Specifies an index value identifying the subauthority array element whose address the function will return. The function performs no validation tests on this value. An application can call the GetSidSubAuthorityCount function to discover the range of acceptable values.

Return Values

If the function succeeds, the return value is a pointer to the specified SID subauthority. To get extended error information, call GetLastError.

If the function fails, the return value is undefined. The function fails if the specified SID structure is invalid or if the index value specified by the nSubAuthority parameter is out of bounds.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Header: Declared in Winbase.h; include Windows.h.
  Library: Use Advapi32.lib.

See Also

Access Control Overview, Access Control Functions, GetLengthSid, GetSidIdentifierAuthority, GetSidLengthRequired, GetSidSubAuthorityCount, IsValidSid, SID