将Feature/XP.Common和Feature/XP.Hardware分支合并至Develop/XP.forHardwareAndCommon,完善XPapp注册和相关硬件类库通用类库功能。
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
namespace XP.Common.Dump.Native
|
||||
{
|
||||
/// <summary>
|
||||
/// MiniDump 类型标志,用于 MiniDumpWriteDump 的 dumpType 参数
|
||||
/// MiniDump type flags for MiniDumpWriteDump dumpType parameter
|
||||
/// </summary>
|
||||
[Flags]
|
||||
internal enum MiniDumpType : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// 仅包含基本信息 | Basic information only
|
||||
/// </summary>
|
||||
MiniDumpNormal = 0x00000000,
|
||||
|
||||
/// <summary>
|
||||
/// 包含数据段信息 | Include data segment information
|
||||
/// </summary>
|
||||
MiniDumpWithDataSegs = 0x00000001,
|
||||
|
||||
/// <summary>
|
||||
/// 包含完整内存信息(Full Dump 使用)| Include full memory (used for Full Dump)
|
||||
/// </summary>
|
||||
MiniDumpWithFullMemory = 0x00000002,
|
||||
|
||||
/// <summary>
|
||||
/// 包含句柄信息 | Include handle information
|
||||
/// </summary>
|
||||
MiniDumpWithHandleData = 0x00000004,
|
||||
|
||||
/// <summary>
|
||||
/// 包含线程信息 | Include thread information
|
||||
/// </summary>
|
||||
MiniDumpWithThreadInfo = 0x00001000,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
|
||||
namespace XP.Common.Dump.Native
|
||||
{
|
||||
/// <summary>
|
||||
/// Windows 原生方法 P/Invoke 声明 | Windows native method P/Invoke declarations
|
||||
/// </summary>
|
||||
internal static class NativeMethods
|
||||
{
|
||||
/// <summary>
|
||||
/// 将进程的 Mini Dump 写入指定文件 | Write a Mini Dump of the process to the specified file
|
||||
/// </summary>
|
||||
[DllImport("dbghelp.dll", SetLastError = true)]
|
||||
internal static extern bool MiniDumpWriteDump(
|
||||
IntPtr hProcess,
|
||||
uint processId,
|
||||
SafeHandle hFile,
|
||||
uint dumpType,
|
||||
IntPtr exceptionParam,
|
||||
IntPtr userStreamParam,
|
||||
IntPtr callbackParam);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user