internal static SecurityStatusPal GetSecurityStatusPalFromInterop(Interop.SecurityStatus win32SecurityStatus)
        {
            SecurityStatusPalErrorCode statusCode;

            if (!s_statusDictionary.TryGetForward(win32SecurityStatus, out statusCode))
            {
                Debug.Fail("Unknown Interop.SecurityStatus value: " + win32SecurityStatus);
                throw new InternalException();
            }
            return(new SecurityStatusPal(statusCode));
        }
Esempio n. 2
0
        internal static SecurityStatusPal GetSecurityStatusPalFromInterop(Interop.SECURITY_STATUS win32SecurityStatus, bool attachException = false)
        {
            SecurityStatusPalErrorCode statusCode;

            if (!s_statusDictionary.TryGetForward(win32SecurityStatus, out statusCode))
            {
                Debug.Fail("Unknown Interop.SecurityStatus value: " + win32SecurityStatus);
                throw new InternalException(win32SecurityStatus);
            }

            if (attachException)
            {
                return(new SecurityStatusPal(statusCode, new Win32Exception((int)win32SecurityStatus)));
            }
            else
            {
                return(new SecurityStatusPal(statusCode));
            }
        }