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

RpcExceptionCode() private static method

Get the RPC Exception Code
private static RpcExceptionCode ( SEHException e ) : uint
e System.Runtime.InteropServices.SEHException Exception object
return uint
        private static uint RpcExceptionCode(SEHException e)
        {
            uint errorCode = 0;
            Type sehType = typeof(SEHException);
            System.Reflection.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;
        }