-
Notifications
You must be signed in to change notification settings - Fork 60
/
MiniDumper.h
34 lines (25 loc) · 945 Bytes
/
MiniDumper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef MINIDUMPER_H
#define MINIDUMPER_H
#include <windows.h>
// 无法验证代码来源(dumper),据说是电驴的部分代码,私有项目请注意授权
class CMiniDumper
{
public:
CMiniDumper(bool bPromptUserForMiniDump);
~CMiniDumper(void);
private:
static LONG WINAPI unhandledExceptionHandler(struct _EXCEPTION_POINTERS *pExceptionInfo);
void setMiniDumpFileName(void);
bool getImpersonationToken(HANDLE* phToken);
BOOL enablePrivilege(LPCTSTR pszPriv, HANDLE hToken, TOKEN_PRIVILEGES* ptpOld);
BOOL restorePrivilege(HANDLE hToken, TOKEN_PRIVILEGES* ptpOld);
LONG writeMiniDump(_EXCEPTION_POINTERS *pExceptionInfo );
_EXCEPTION_POINTERS *m_pExceptionInfo;
TCHAR m_szMiniDumpPath[MAX_PATH];
TCHAR m_szAppPath[MAX_PATH];
TCHAR m_szAppBaseName[MAX_PATH];
bool m_bPromptUserForMiniDump;
static CMiniDumper* s_pMiniDumper;
static LPCRITICAL_SECTION s_pCriticalSection;
};
#endif // MINIDUMPER_H