Platform SDK: Access Control

IsValidSid

The IsValidSid function validates a SID by verifying that the revision number is within a known range and that the number of subauthorities is less than the maximum. (A SID is a security identifier.)

BOOL IsValidSid(
  PSID pSid   // SID to verify
);

Parameters

pSid
[in] Pointer to the SID structure to validate. This parameter cannot be NULL.

Return Values

If the SID structure is valid, the return value is nonzero.

If the SID structure is not valid, the return value is zero. There is no extended error information for this function; do not call GetLastError.

Remarks

If pSid is NULL, the application will fail with an access violation.

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, GetSidSubAuthority, GetSidSubAuthorityCount, SID