internal static bool IsWellKnownSid( SecurityIdentifier sid, WellKnownSidType type ) { byte[] BinaryForm = new byte[sid.BinaryLength]; sid.GetBinaryForm(BinaryForm, 0); if (FALSE == Interop.Advapi32.IsWellKnownSid(BinaryForm, (int)type)) { return false; } else { return true; } }
// // Determines whether this SID is a well-known SID of the specified type // // NOTE: although there is a P/Invoke call involved in the implementation of this method, // there is no security risk involved, so no security demand is being made. // public bool IsWellKnown(WellKnownSidType type) { return(Win32.IsWellKnownSid(this, type)); }