Authorization Functions


GetLengthSid Function

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

Syntax

C++
DWORD WINAPI GetLengthSid(
  __in  PSID pSid
);

Parameters

pSid [in]

A pointer to the SID structure whose length is returned. The structure is assumed to be valid.

Return Value

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 the SID is valid.

Examples

For an example that uses this function, see Getting the Logon SID.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll

See Also

Access Control Overview
Basic Access Control Functions
GetSidLengthRequired
GetSidSubAuthorityCount
IsValidSid
SID

Send comments about this topic to Microsoft

Build date: 9/11/2009

Tags :


Page view tracker