From c84d28ca735a4f98cf92e4f589f58e9d66556d28 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Tue, 4 Nov 2014 14:26:32 -0500 Subject: [PATCH] [mscorlib] Marshal.GetExceptionForHR() takes an `errorInfo` parameter. Parameter names are part of the ABI because of C#4 named parameter. Consequently, they *must* be consistent with .NET, and .NET a parameter name of "errorInfo", *not* "errorInfoPtr" [0]: public static Exception GetExceptionForHR( int errorCode, IntPtr errorInfo ) Change the parameter name from `errorCodeInfo` to `errorCode` so that the parameter name is consistent with .NET. [0]: http://msdn.microsoft.com/en-us/library/3xade62s(v=vs.100).aspx --- .../System.Runtime.InteropServices/Marshal.cs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs index 243984706ce..48c5db2ea62 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs @@ -1583,33 +1583,33 @@ namespace System.Runtime.InteropServices return GetExceptionForHR (errorCode, IntPtr.Zero); } - public static Exception GetExceptionForHR (int errorCode, IntPtr errorInfoPtr) + public static Exception GetExceptionForHR (int errorCode, IntPtr errorInfo) { - IErrorInfo errorInfo = null; - if (errorInfoPtr != (IntPtr)(-1)) { - if (errorInfoPtr == IntPtr.Zero) { - if (GetErrorInfo (0, out errorInfo) != 0) { - errorInfo = null; + IErrorInfo info = null; + if (errorInfo != (IntPtr)(-1)) { + if (errorInfo == IntPtr.Zero) { + if (GetErrorInfo (0, out info) != 0) { + info = null; } } else { - errorInfo = Marshal.GetObjectForIUnknown (errorInfoPtr) as IErrorInfo; + info = Marshal.GetObjectForIUnknown (errorInfo) as IErrorInfo; } } - if (errorInfo is ManagedErrorInfo && ((ManagedErrorInfo)errorInfo).Exception.hresult == errorCode) { - return ((ManagedErrorInfo)errorInfo).Exception; + if (info is ManagedErrorInfo && ((ManagedErrorInfo) info).Exception.hresult == errorCode) { + return ((ManagedErrorInfo) info).Exception; } Exception e = ConvertHrToException (errorCode); - if (errorInfo != null && e != null) { + if (info != null && e != null) { uint helpContext; - errorInfo.GetHelpContext (out helpContext); + info.GetHelpContext (out helpContext); string str; - errorInfo.GetSource (out str); + info.GetSource (out str); e.Source = str; - errorInfo.GetDescription (out str); + info.GetDescription (out str); e.SetMessage (str); - errorInfo.GetHelpFile (out str); + info.GetHelpFile (out str); if (helpContext == 0) { e.HelpLink = str; -- 2.25.1