Microsoft.Protocols.TestSuites.Common.NativeMethods.RpcExceptionCode C# (CSharp) Method

RpcExceptionCode() public static method

Get the RPC Exception Code
public static RpcExceptionCode ( SEHException e ) : uint
e System.Runtime.InteropServices.SEHException /// Exception object
return uint
        public static uint RpcExceptionCode(SEHException e)
        {
            uint errorCode = 0;
            Type sehType = typeof(SEHException);
            FieldInfo xcodeField = sehType.BaseType.BaseType.BaseType.GetField("_xcode", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
            if (xcodeField != null)
            {
                int code = (int)xcodeField.GetValue(e);
                errorCode = (uint)code;
            }

            return errorCode;
        }