System.Security.Principal.Win32.IsWellKnownSid C# (CSharp) Méthode

IsWellKnownSid() static private méthode

static private IsWellKnownSid ( System.Security.Principal.SecurityIdentifier sid, WellKnownSidType type ) : bool
sid System.Security.Principal.SecurityIdentifier
type WellKnownSidType
Résultat bool
        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;
            }
        }

Usage Example

Exemple #1
0
        //
        // 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));
        }