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 |
|
|
Library |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 3/7/2012
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.
- 5/23/2009
- Thomas Lee
C# syntax
[DllImport("advapi32.dll", CharSet=CharSet.Unicode, SetLastError=true)]
internal static extern int IsWellKnownSid(byte[] sid, int type);