提交 d910a8a0 编写于 作者: J Jared Parsons 提交者: Jared Parsons

Respond to PR feedback

上级 94fb7374
......@@ -6,6 +6,7 @@
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Win32.SafeHandles;
namespace RunTests
{
......@@ -40,7 +41,7 @@ private enum DumpType : uint
private static extern bool MiniDumpWriteDump(
IntPtr hProcess,
uint processId,
IntPtr hFile,
SafeFileHandle hFile,
uint dumpType,
IntPtr exceptionParam,
IntPtr userStreamParam,
......@@ -53,14 +54,14 @@ internal static void WriteDump(Process process, string dumpFilePath)
var success = MiniDumpWriteDump(
process.Handle,
(uint)process.Id,
stream.SafeFileHandle.DangerousGetHandle(),
stream.SafeFileHandle,
(uint)(DumpType.MiniDumpNormal | DumpType.MiniDumpWithFullMemory | DumpType.MiniDumpWithFullMemoryInfo),
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero);
if (!success)
{
throw new Exception("Could not create dump");
throw new Exception($"Creating the minidump failed with error code {Marshal.GetLastWin32Error()}");
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册