Browse Source

Signature suggested by Ingo Scholtes used for CreateDebuggingInterfaceFromVersion

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1098 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
401350568c
  1. 34
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/NativeMethods.cs
  2. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs

34
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/NativeMethods.cs

@ -12,26 +12,18 @@ using System.Text; @@ -12,26 +12,18 @@ using System.Text;
namespace Debugger
{
internal static class NativeMethods
{
// [System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.CER.Success),
internal static class NativeMethods
{
[DllImport("kernel32.dll")]
public static extern bool CloseHandle(IntPtr handle);
[DllImport("mscoree.dll", CharSet=CharSet.Unicode, PreserveSig=false)]
public static extern int CreateDebuggingInterfaceFromVersion(int debuggerVersion, string debuggeeVersion, out Debugger.Interop.CorDebug.ICorDebug cordbg);
public static Debugger.Wrappers.CorDebug.ICorDebug CreateDebuggingInterfaceFromVersion(int debuggerVersion, string debuggeeVersion)
{
Debugger.Interop.CorDebug.ICorDebug rawCorDebug;
CreateDebuggingInterfaceFromVersion(debuggerVersion, debuggeeVersion, out rawCorDebug);
return new Debugger.Wrappers.CorDebug.ICorDebug(rawCorDebug);
}
[DllImport("mscoree.dll", CharSet=CharSet.Unicode)]
public static extern int GetCORVersion([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder szName, Int32 cchBuffer, out Int32 dwLength);
[DllImport("mscoree.dll", CharSet=CharSet.Unicode)]
public static extern int GetRequestedRuntimeVersion(string exeFilename, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pVersion, Int32 cchBuffer, out Int32 dwLength);
}
public static extern bool CloseHandle(IntPtr handle);
[DllImport("mscoree.dll", CharSet=CharSet.Unicode, PreserveSig=false)]
public static extern Debugger.Interop.CorDebug.ICorDebug CreateDebuggingInterfaceFromVersion(int debuggerVersion, string debuggeeVersion);
[DllImport("mscoree.dll", CharSet=CharSet.Unicode)]
public static extern int GetCORVersion([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder szName, Int32 cchBuffer, out Int32 dwLength);
[DllImport("mscoree.dll", CharSet=CharSet.Unicode)]
public static extern int GetRequestedRuntimeVersion(string exeFilename, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pVersion, Int32 cchBuffer, out Int32 dwLength);
}
}

4
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs

@ -86,7 +86,7 @@ namespace Debugger @@ -86,7 +86,7 @@ namespace Debugger
int size;
NativeMethods.GetRequestedRuntimeVersion(exeFilename, null, 0, out size);
StringBuilder sb = new StringBuilder(size);
int hr = NativeMethods.GetRequestedRuntimeVersion(exeFilename, sb, sb.Capacity, out size);
NativeMethods.GetRequestedRuntimeVersion(exeFilename, sb, sb.Capacity, out size);
return sb.ToString();
}
@ -103,7 +103,7 @@ namespace Debugger @@ -103,7 +103,7 @@ namespace Debugger
this.debuggeeVersion = GetDebuggerVersion();
}
corDebug = NativeMethods.CreateDebuggingInterfaceFromVersion(3, this.debuggeeVersion);
corDebug = new ICorDebug(NativeMethods.CreateDebuggingInterfaceFromVersion(3, this.debuggeeVersion));
managedCallback = new ManagedCallback(this);
managedCallbackProxy = new ManagedCallbackProxy(managedCallback);

Loading…
Cancel
Save