System.Net.SecurityStatusAdapterPal.GetInteropFromSecurityStatusPal C# (CSharp) Method

GetInteropFromSecurityStatusPal() static private method

static private GetInteropFromSecurityStatusPal ( System.Net.SecurityStatusPal status ) : Interop.SECURITY_STATUS
status System.Net.SecurityStatusPal
return Interop.SECURITY_STATUS
        internal static Interop.SECURITY_STATUS GetInteropFromSecurityStatusPal(SecurityStatusPal status)
        {
            Interop.SECURITY_STATUS interopStatus;
            if (!s_statusDictionary.TryGetBackward(status.ErrorCode, out interopStatus))
            {
                Debug.Fail("Unknown SecurityStatus value: " + status);
                throw new InternalException();
            }
            return interopStatus;
        }
    }

Usage Example

Beispiel #1
0
        public static Exception GetException(SecurityStatusPal status)
        {
            int win32Code = (int)SecurityStatusAdapterPal.GetInteropFromSecurityStatusPal(status);

            return(new Win32Exception(win32Code));
        }