DUMP文件很实用 留下来
1 LONG WINAPI MyUnhandledExceptionFilter( _EXCEPTION_POINTERS *ExceptionInfo );
2
3 //在程序里面调用
4 SetUnhandledExceptionFilter(&MyUnhandledExceptionFilter);
5 //来设置
6 LONG WINAPI MyUnhandledExceptionFilter( _EXCEPTION_POINTERS *ExceptionInfo )
7 {
8 HANDLE lhDumpFile = CreateFile(_T("DumpFile.dmp"), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL ,NULL);
9
10 MINIDUMP_EXCEPTION_INFORMATION loExceptionInfo;
11
12 loExceptionInfo.ExceptionPointers = ExceptionInfo;
13
14 loExceptionInfo.ThreadId = GetCurrentThreadId();
15
16 loExceptionInfo.ClientPointers = TRUE;
17
18 MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(),lhDumpFile, MiniDumpNormal, &loExceptionInfo, NULL, NULL);
19
20 CloseHandle(lhDumpFile);
21
22 return EXCEPTION_EXECUTE_HANDLER;
23 }
posted on 2009-08-27 18:08
李佳 阅读(196)
评论(0) 编辑 收藏 引用 所属分类:
调试技巧