1、了解下MiniDumpWriteDump
MiniDumpWriteDump (vs2008)
ImageHlp.h 文件
// …… 4647-4657
BOOL
WINAPI
MiniDumpWriteDump(
IN HANDLE hProcess,
IN DWORD ProcessId,
IN HANDLE hFile,
IN MINIDUMP_TYPE DumpType,
IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL
IN CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, OPTIONAL
IN CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam OPTIONAL
);
//……
hProcess :要为其生成信息的进程的句柄。
此句柄必须具有PROCESS_QUERY_INFORMATION和 PROCESS_VM_READ访问权限。如果要收集句柄信息, 则还需要PROCESS_DUP_HANDLE访问
dump类型 (就是dump文件需要包含哪些信息)
// …… number line 4559-4580
typedef enum _MINIDUMP_TYPE {
MiniDumpNormal = 0x00000000,
MiniDumpWithDataSegs = 0x00000001,
MiniDumpWithFullMemory = 0x00000002,
MiniDumpWithHandleData = 0x00000004,
MiniDumpFilterMemory = 0x00000008,
MiniDumpScanMemory = 0x00000010,
MiniDumpWithUnloadedModules = 0x00000020,
MiniDumpWithIndirectlyReferencedMemory = 0x00000040,
MiniDumpFilterModulePaths = 0x00000080,
MiniDumpWithProcessThreadData = 0x00000100,
MiniDumpWithPrivateReadWriteMemory = 0x00000200,
MiniDumpWithoutOptionalData = 0x00000400,
MiniDumpWithFullMemoryInfo = 0x00000800,
MiniDumpWithThreadInfo = 0x00001000,
MiniDumpWithCodeSegs = 0x00002000,
MiniDumpWithoutAuxiliaryState = 0x00004000,
MiniDumpWithFullAuxiliaryState = 0x00008000,
MiniDumpValidTypeFlags = 0x0000ffff,
} MINIDUMP_TYPE;
MiniDumpNormal:仅包含捕获进程中所有现有线程的堆栈跟踪所需的信息(一般都是用这个)
把WriteMiniDump的多线程保护去掉就正常了,太奇葩了把
minidump吐出来的dump文件为空,文件大小为0
duilib的Dump对象里边有一个临界区对象,有几个函数是被保护起来的。注释掉就好了