This topic has not yet been rated - Rate this topic

IsWellKnownSid function

Applies to: desktop apps only

The IsWellKnownSid function compares a SID to a well-known SID and returns TRUE if they match.

Syntax

BOOL WINAPI IsWellKnownSid(
  __in  PSID pSid,
  __in  WELL_KNOWN_SID_TYPE WellKnownSidType
);

Parameters

pSid [in]

A pointer to the SID to test.

WellKnownSidType [in]

Member of the WELL_KNOWN_SID_TYPE enumeration to compare with the SID at pSid.

Return value

Returns TRUE if the SID at pSid matches the well-known SID indicated by WellKnownSidType.

Otherwise, returns FALSE.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Winbase.h (include Windows.h)

Library

Advapi32.lib

DLL

Advapi32.dll

See also

CreateWellKnownSid
SID
WELL_KNOWN_SID_TYPE

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Alternatives to unmanaged code

As an alternative to using this unmanaged API in your managed code, consider looking at the system.security.principal.wellknownsidtype enumeration. You might find this easier to use than an unmanaged API.

C# syntax
[DllImport("advapi32.dll", CharSet=CharSet.Unicode, SetLastError=true)]
internal static extern int IsWellKnownSid(byte[] sid, int type);
vb.net syntax
<DllImport("advapi32.dll", CharSet:=CharSet.Unicode, SetLastError:=True)> _
Public Shared Function IsWellKnownSid(ByVal sid As Byte(), ByVal type As Integer) As Integer
End Function