Esempio n. 1
0
        internal static bool IsTokenRestrictedWrapper(IntPtr token)
        {
            bool isRestricted;
            uint result = SNINativeMethodWrapper.UnmanagedIsTokenRestricted(token, out isRestricted);

            if (result != 0)
            {
                Marshal.ThrowExceptionForHR(unchecked ((int)result));
            }

            return(isRestricted);
        }
Esempio n. 2
0
        internal static bool IsTokenRestrictedWrapper(IntPtr token)
        {
#if MANAGED_SNI
            throw new PlatformNotSupportedException("The Win32NativeMethods.IsTokenRestrictedWrapper is not supported on non-Windows platform");
#else
            bool isRestricted;
            uint result = SNINativeMethodWrapper.UnmanagedIsTokenRestricted(token, out isRestricted);

            if (result != 0)
            {
                Marshal.ThrowExceptionForHR(unchecked ((int)result));
            }

            return(isRestricted);
#endif
        }