Platform SDK: Access Control

GetLengthSid

The GetLengthSid function returns the length, in bytes, of a valid SID. (A SID is a security identifier.)

DWORD GetLengthSid(
  PSID pSid   // SID to query
);

Parameters

pSid
[in] Pointer to the SID structure whose length is returned. The structure is assumed to be valid.

Return Values

If the SID structure is valid, the return value is the length, in bytes, of the SID structure.

If the SID structure is not valid, the return value is undefined. Before calling GetLengthSid, pass the SID to the IsValidSid function to verify that it is valid.

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, GetSidLengthRequired, GetSidSubAuthorityCount, IsValidSid, SID