ReactOS  0.4.11-dev-946-g431643b
main.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: Dr. Watson crash reporter
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: Entrypoint / main print function
5  * COPYRIGHT: Copyright 2017 Mark Jansen (mark.jansen@reactos.org)
6  */
7 
8 #include "precomp.h"
9 #include <winuser.h>
10 #include <algorithm>
11 #include <shlobj.h>
12 #include <shlwapi.h>
13 #include <tchar.h>
14 #include <strsafe.h>
15 #include <tlhelp32.h>
16 #include <dbghelp.h>
17 #include <conio.h>
18 #include <atlbase.h>
19 #include <atlstr.h>
20 #include "resource.h"
21 
22 
23 static const char szUsage[] = "Usage: DrWtsn32 [-i] [-g] [-p dddd] [-e dddd] [-?]\n"
24  " -i: Install DrWtsn32 as the postmortem debugger\n"
25  " -g: Ignored, Provided for compatibility with WinDbg and CDB.\n"
26  " -p dddd: Attach to process dddd.\n"
27  " -e dddd: Signal the event dddd.\n"
28  " -?: This help.\n";
29 
30 extern "C"
32 #define DPFLTR_ERROR_LEVEL 0
33 
34 void xfprintf(FILE* stream, const char *fmt, ...)
35 {
36  va_list ap;
37 
38  va_start(ap, fmt);
39  vfprintf(stream, fmt, ap);
40  vDbgPrintEx(-1, DPFLTR_ERROR_LEVEL, fmt, ap);
41  va_end(ap);
42 }
43 
44 
45 
46 static bool SortModules(const ModuleData& left, const ModuleData& right)
47 {
48  return left.BaseAddress < right.BaseAddress;
49 }
50 
52 {
53  thread.Update();
54 
55  xfprintf(output, NEWLINE "State Dump for Thread Id 0x%x%s" NEWLINE NEWLINE, tid,
56  (tid == data.ThreadID) ? " (CRASH)" : "");
57 
58  const CONTEXT& ctx = thread.Context;
60  {
61 #if defined(_M_IX86)
62  xfprintf(output, "eax:%p ebx:%p ecx:%p edx:%p esi:%p edi:%p" NEWLINE,
63  ctx.Eax, ctx.Ebx, ctx.Ecx, ctx.Edx, ctx.Esi, ctx.Edi);
64 #elif defined(_M_AMD64)
65  xfprintf(output, "rax:%p rbx:%p rcx:%p rdx:%p rsi:%p rdi:%p" NEWLINE,
66  ctx.Rax, ctx.Rbx, ctx.Rcx, ctx.Rdx, ctx.Rsi, ctx.Rdi);
67  xfprintf(output, "r8:%p r9:%p r10:%p r11:%p r12:%p r13:%p r14:%p r15:%p" NEWLINE,
68  ctx.R8, ctx.R9, ctx.R10, ctx.R11, ctx.R12, ctx.R13, ctx.R14, ctx.R15);
69 #else
70 #error Unknown architecture
71 #endif
72  }
73 
75  {
76 #if defined(_M_IX86)
77  xfprintf(output, "eip:%p esp:%p ebp:%p" NEWLINE,
78  ctx.Eip, ctx.Esp, ctx.Ebp);
79 #elif defined(_M_AMD64)
80  xfprintf(output, "rip:%p rsp:%p rbp:%p" NEWLINE,
81  ctx.Rip, ctx.Rsp, ctx.Rbp);
82 #else
83 #error Unknown architecture
84 #endif
85  }
86 
88  {
89 #if defined(_M_IX86) || defined(_M_AMD64)
90  xfprintf(output, "dr0:%p dr1:%p dr2:%p dr3:%p dr6:%p dr7:%p" NEWLINE,
91  ctx.Dr0, ctx.Dr1, ctx.Dr2, ctx.Dr3, ctx.Dr6, ctx.Dr7);
92 #else
93 #error Unknown architecture
94 #endif
95  }
96 
97  PrintStackBacktrace(output, data, thread);
98 }
99 
101 {
102  PrintSystemInfo(output, data);
103  xfprintf(output, NEWLINE "*----> Task List <----*" NEWLINE NEWLINE);
105  if (hSnap != INVALID_HANDLE_VALUE)
106  {
107  PROCESSENTRY32 pe;
108  pe.dwSize = sizeof(pe);
109  if (Process32First(hSnap, &pe))
110  {
111  do
112  {
113  xfprintf(output, "%5d: %ls" NEWLINE, pe.th32ProcessID, pe.szExeFile);
114  } while (Process32Next(hSnap, &pe));
115  }
116  CloseHandle(hSnap);
117  }
118 
119  xfprintf(output, NEWLINE "*----> Module List <----*" NEWLINE NEWLINE);
120  std::sort(data.Modules.begin(), data.Modules.end(), SortModules);
121 
122  ModuleData mainModule(NULL);
123  mainModule.Update(data.ProcessHandle);
124  xfprintf(output, "(%p - %p) %ls" NEWLINE,
125  mainModule.BaseAddress,
126  (PBYTE)mainModule.BaseAddress + mainModule.Size,
127  data.ProcessPath.c_str());
128 
129  for (size_t n = 0; n < data.Modules.size(); ++n)
130  {
131  ModuleData& mod = data.Modules[n];
132  if (!mod.Unloaded)
133  {
134  mod.Update(data.ProcessHandle);
135  xfprintf(output, "(%p - %p) %s" NEWLINE,
136  mod.BaseAddress,
137  (PBYTE)mod.BaseAddress + mod.Size,
138  mod.ModuleName.c_str());
139  }
140  }
141 
142  BeginStackBacktrace(data);
143 
144  // First print the thread that crashed
145  ThreadMap::iterator crash = data.Threads.find(data.ThreadID);
146  if (crash != data.Threads.end())
147  PrintThread(output, data, crash->first, crash->second);
148 
149  // Print the other threads
150  for (ThreadMap::iterator it = data.Threads.begin(); it != data.Threads.end(); ++it)
151  {
152  if (it->first != data.ThreadID)
153  PrintThread(output, data, it->first, it->second);
154  }
155  EndStackBacktrace(data);
156 }
157 
158 
159 int abort(FILE* output, int err)
160 {
161  if (output != stdout)
162  fclose(output);
163  else
164  _getch();
165 
166  return err;
167 }
168 
169 std::wstring Settings_GetOutputPath(void)
170 {
171  WCHAR Buffer[MAX_PATH] = L"";
172  ULONG BufferSize = _countof(Buffer);
173  BOOL UseDefaultPath = FALSE;
174 
175  CRegKey key;
176  if (key.Open(HKEY_CURRENT_USER, L"SOFTWARE\\ReactOS\\Crash Reporter", KEY_READ) != ERROR_SUCCESS)
177  {
178  UseDefaultPath = TRUE;
179  }
180 
181  if (key.QueryStringValue(L"Dump Directory", Buffer, &BufferSize) != ERROR_SUCCESS)
182  {
183  UseDefaultPath = TRUE;
184  }
185 
186  if (UseDefaultPath)
187  {
189  {
190  return std::wstring();
191  }
192  }
193 
194  return std::wstring(Buffer);
195 }
196 
198 {
199  CRegKey key;
200  if (key.Open(HKEY_CURRENT_USER, L"SOFTWARE\\ReactOS\\Crash Reporter", KEY_READ) != ERROR_SUCCESS)
201  {
202  return FALSE;
203  }
204 
205  DWORD Value;
206  if (key.QueryDWORDValue(L"Minidump", Value) != ERROR_SUCCESS)
207  {
208  return FALSE;
209  }
210 
211  return (Value != 0);
212 }
213 
215 {
216  HRESULT hr = S_OK;
217 
218  WCHAR DumpFilePath[MAX_PATH] = L"";
219  StringCchCopyW(DumpFilePath, _countof(DumpFilePath), LogFilePath);
220  PathRemoveExtensionW(DumpFilePath);
221  PathAddExtensionW(DumpFilePath, L".dmp");
222 
224  if (hDumpFile == INVALID_HANDLE_VALUE)
225  {
227  }
228 
229  ThreadData& Thread = data.Threads[data.ThreadID];
230  Thread.Update();
231  PCONTEXT ContextPointer = &Thread.Context;
232 
233  MINIDUMP_EXCEPTION_INFORMATION DumpExceptionInfo = {0};
234  EXCEPTION_POINTERS ExceptionPointers = {0};
235  ExceptionPointers.ExceptionRecord = &data.ExceptionInfo.ExceptionRecord;
236  ExceptionPointers.ContextRecord = ContextPointer;
237 
238  DumpExceptionInfo.ThreadId = data.ThreadID;
239  DumpExceptionInfo.ExceptionPointers = &ExceptionPointers;
240  DumpExceptionInfo.ClientPointers = FALSE;
241 
242  BOOL DumpSucceeded = MiniDumpWriteDump(data.ProcessHandle, data.ProcessID, hDumpFile, MiniDumpNormal, &DumpExceptionInfo, NULL, NULL);
243  if (!DumpSucceeded)
244  {
245  // According to MSDN, this value is already an HRESULT, so don't convert it again.
246  hr = GetLastError();
247  }
248 
249  CloseHandle(hDumpFile);
250  return hr;
251 }
252 
254 {
255  int argc;
257 
258  DWORD pid = 0;
259  WCHAR Filename[50];
260  FILE* output = NULL;
261  SYSTEMTIME st;
262  DumpData data;
263 
264 
265  for (int n = 0; n < argc; ++n)
266  {
267  WCHAR* arg = argv[n];
268 
269  if (!wcscmp(arg, L"-i"))
270  {
271  /* FIXME: Installs as the postmortem debugger. */
272  }
273  else if (!wcscmp(arg, L"-g"))
274  {
275  }
276  else if (!wcscmp(arg, L"-p"))
277  {
278  if (n + 1 < argc)
279  {
280  pid = wcstoul(argv[n+1], NULL, 10);
281  n++;
282  }
283  }
284  else if (!wcscmp(arg, L"-e"))
285  {
286  if (n + 1 < argc)
287  {
288  data.Event = (HANDLE)(ULONG_PTR)_wcstoui64(argv[n+1], NULL, 10);
289  n++;
290  }
291  }
292  else if (!wcscmp(arg, L"-?"))
293  {
294  MessageBoxA(NULL, szUsage, "ReactOS Crash Reporter", MB_OK);
295  return abort(output, 0);
296  }
297  else if (!wcscmp(arg, L"/?"))
298  {
299  xfprintf(stdout, "%s\n", szUsage);
300  return abort(stdout, 0);
301  }
302  }
303 
304  if (!pid)
305  {
306  MessageBoxA(NULL, szUsage, "ReactOS Crash Reporter", MB_OK);
307  return abort(stdout, 0);
308  }
309 
310  GetLocalTime(&st);
311 
312  std::wstring OutputPath = Settings_GetOutputPath();
313  BOOL HasPath = (OutputPath.size() != 0);
314 
315  if (!PathIsDirectoryW(OutputPath.c_str()))
316  {
317  int res = SHCreateDirectoryExW(NULL, OutputPath.c_str(), NULL);
318  if (res != ERROR_SUCCESS && res != ERROR_ALREADY_EXISTS)
319  {
320  xfprintf(stdout, "Could not create output directory, not writing dump\n");
321  MessageBoxA(NULL, "Could not create directory to write crash report.", "ReactOS Crash Reporter", MB_ICONERROR | MB_OK);
322  return abort(stdout, 0);
323  }
324  }
325 
326  if (HasPath &&
327  SUCCEEDED(StringCchPrintfW(Filename, _countof(Filename), L"Appcrash_%d-%02d-%02d_%02d-%02d-%02d.txt",
328  st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond)))
329  {
330  OutputPath += L"\\";
331  OutputPath += Filename;
332  output = _wfopen(OutputPath.c_str(), L"wb");
333  }
334  if (!output)
335  output = stdout;
336 
337 
338  if (!DebugActiveProcess(pid))
339  return abort(output, -2);
340 
341  /* We should not kill it? */
343 
344  DEBUG_EVENT evt;
345  if (!WaitForDebugEvent(&evt, 30000))
346  return abort(output, -3);
347 
349 
350  while (UpdateFromEvent(evt, data))
351  {
353 
354  if (!WaitForDebugEvent(&evt, 30000))
355  return abort(output, -4);
356  }
357 
358  PrintBugreport(output, data);
359  if (Settings_GetShouldWriteDump() && HasPath)
360  {
361  WriteMinidump(OutputPath.c_str(), data);
362  }
363 
365 
366  CStringW FormattedMessage;
367  FormattedMessage.Format(IDS_USER_ALERT_MESSAGE, data.ProcessName.c_str(), OutputPath.c_str());
368  CStringW DialogTitle;
369  DialogTitle.LoadString(hInstance, IDS_APP_TITLE);
370 
371  MessageBoxW(NULL, FormattedMessage.GetString(), DialogTitle.GetString(), MB_OK);
372 
373  return abort(output, 0);
374 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1702
int abort(FILE *output, int err)
Definition: main.cpp:159
static int argc
Definition: ServiceArgs.c:12
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
BOOL WINAPI Process32First(HANDLE hSnapshot, LPPROCESSENTRY32 lppe)
Definition: toolhelp.c:951
PEXCEPTION_POINTERS ExceptionPointers
Definition: dbghelp.h:767
#define TRUE
Definition: types.h:120
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
#define CloseHandle
Definition: compat.h:398
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
ULONG Esp
Definition: nt_native.h:1479
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR cmdLine, INT)
Definition: main.cpp:253
#define ERROR_SUCCESS
Definition: deptool.c:10
std::wstring ProcessName
Definition: drwtsn32.h:40
ULONG Eip
Definition: nt_native.h:1476
DWORD dwThreadId
Definition: winbase.h:768
BOOL Settings_GetShouldWriteDump(void)
Definition: main.cpp:197
WORD wMonth
Definition: winbase.h:871
void Update(HANDLE hProcess)
Definition: drwtsn32.cpp:20
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
#define KEY_READ
Definition: nt_native.h:1023
#define CSIDL_DESKTOP
Definition: shlobj.h:1876
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD dwProcessId
Definition: winbase.h:767
#define _countof(array)
Definition: fontsub.cpp:30
_STLP_MOVE_TO_STD_NAMESPACE void sort(_RandomAccessIter __first, _RandomAccessIter __last)
Definition: _algo.c:993
#define HKEY_CURRENT_USER
Definition: winreg.h:11
void Update()
Definition: drwtsn32.cpp:39
BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile, MINIDUMP_TYPE DumpType, PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, PMINIDUMP_CALLBACK_INFORMATION CallbackParam)
Definition: minidump.c:852
ULONG Ecx
Definition: nt_native.h:1467
BOOL WINAPI ContinueDebugEvent(IN DWORD dwProcessId, IN DWORD dwThreadId, IN DWORD dwContinueStatus)
Definition: debugger.c:448
CHAR szExeFile[MAX_PATH]
Definition: tlhelp32.h:70
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define assert(x)
Definition: debug.h:53
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:668
void EndStackBacktrace(DumpData &data)
Definition: stacktrace.cpp:22
static bool SortModules(const ModuleData &left, const ModuleData &right)
Definition: main.cpp:46
void xfprintf(FILE *stream, const char *fmt,...)
Definition: main.cpp:34
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
std::wstring Settings_GetOutputPath(void)
Definition: main.cpp:169
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
static const char szUsage[]
Definition: main.cpp:23
#define NTSYSAPI
Definition: ntoskrnl.h:14
BOOL WINAPI Process32Next(HANDLE hSnapshot, LPPROCESSENTRY32 lppe)
Definition: toolhelp.c:1040
int32_t INT
Definition: typedefs.h:56
BOOL WINAPI DebugSetProcessKillOnExit(IN BOOL KillOnExit)
Definition: debugger.c:577
ULONG Dr7
Definition: nt_native.h:1439
static char ** argv
Definition: ServiceArgs.c:11
ULONG Dr3
Definition: nt_native.h:1437
#define DBG_CONTINUE
Definition: ntstatus.h:47
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:925
FILE * stdout
uint32_t ULONG_PTR
Definition: typedefs.h:63
_Check_return_ __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
int WINAPI MessageBoxA(_In_opt_ HWND, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_ UINT)
DWORD ExceptionCode
Definition: compat.h:196
BOOL WINAPI PathAddExtensionW(LPWSTR lpszPath, LPCWSTR lpszExtension)
Definition: path.c:2617
GLuint n
Definition: s_context.h:57
WORD wYear
Definition: winbase.h:870
HINSTANCE hInstance
Definition: charmap.c:20
ULONG R8
Definition: compat.h:343
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define va_end(ap)
Definition: acmsvcex.h:90
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:818
LPWSTR WINAPI GetCommandLineW(VOID)
Definition: proc.c:2043
#define GENERIC_WRITE
Definition: nt_native.h:90
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
ULONG Esi
Definition: nt_native.h:1464
CONTEXT Context
Definition: drwtsn32.h:26
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
Definition: shell32_main.c:76
ULONG Dr1
Definition: nt_native.h:1435
WORD wMinute
Definition: winbase.h:875
DWORD dwDebugEventCode
Definition: winbase.h:766
smooth NULL
Definition: ftsmooth.c:416
ULONG Edx
Definition: nt_native.h:1466
ULONG R9
Definition: compat.h:344
char * va_list
Definition: acmsvcex.h:78
Definition: bufpool.h:45
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:276
LONG QueryDWORDValue(LPCTSTR pszValueName, DWORD &dwValue)
Definition: atlbase.h:1134
ULONG Dr2
Definition: nt_native.h:1436
ULONG Ebx
Definition: nt_native.h:1465
ULONG ContextFlags
Definition: compat.h:331
DWORD ThreadID
Definition: drwtsn32.h:42
PCONTEXT ContextRecord
Definition: rtltypes.h:197
DWORD Size
Definition: drwtsn32.h:15
CONST CHAR * PCCH
Definition: ntbasedef.h:399
#define CONTEXT_CONTROL
Definition: compat.h:265
unsigned int BOOL
Definition: ntddk_ex.h:94
bool Unloaded
Definition: drwtsn32.h:16
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
ULONG R11
Definition: ke.h:266
LONG HRESULT
Definition: typedefs.h:77
std::wstring ProcessPath
Definition: drwtsn32.h:39
#define MAX_PATH
Definition: compat.h:26
PCXSTR GetString() const
Definition: atlsimpstr.h:361
LONG Open(HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM samDesired=KEY_READ|KEY_WRITE)
Definition: atlbase.h:1078
#define BufferSize
Definition: classpnp.h:419
PVOID HANDLE
Definition: typedefs.h:71
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint left
Definition: glext.h:7726
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
LONG QueryStringValue(LPCTSTR pszValueName, LPTSTR pszValue, ULONG *pnChars)
Definition: atlbase.h:1157
DWORD ProcessID
Definition: drwtsn32.h:41
NTSYSAPI ULONG NTAPI vDbgPrintEx(_In_ ULONG ComponentId, _In_ ULONG Level, _In_z_ PCCH Format, _In_ va_list ap)
GLdouble GLdouble right
Definition: glext.h:10859
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
DWORD th32ProcessID
Definition: tlhelp32.h:63
static void PrintThread(FILE *output, DumpData &data, DWORD tid, ThreadData &thread)
Definition: main.cpp:51
WORD wSecond
Definition: winbase.h:876
HRESULT WriteMinidump(LPCWSTR LogFilePath, DumpData &data)
Definition: main.cpp:214
static HANDLE thread
Definition: service.c:33
BOOL WINAPI WaitForDebugEvent(IN LPDEBUG_EVENT lpDebugEvent, IN DWORD dwMilliseconds)
Definition: debugger.c:625
ThreadMap Threads
Definition: drwtsn32.h:45
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static const WCHAR L[]
Definition: oid.c:1087
Definition: parse.h:22
EXCEPTION_RECORD ExceptionRecord
Definition: winbase.h:729
HKEY key
Definition: reg.c:42
#define MB_ICONERROR
Definition: winuser.h:781
#define GENERIC_READ
Definition: compat.h:124
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
void PrintBugreport(FILE *output, DumpData &data)
Definition: main.cpp:100
#define err(...)
ULONG Eax
Definition: nt_native.h:1468
void PrintSystemInfo(FILE *output, DumpData &data)
Definition: sysinfo.cpp:52
#define WINAPI
Definition: msvc.h:20
#define _In_
Definition: no_sal2.h:204
WORD wDay
Definition: winbase.h:873
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
void * BaseAddress
Definition: drwtsn32.h:14
#define S_OK
Definition: intsafe.h:59
#define CREATE_ALWAYS
Definition: disk.h:72
#define IDS_USER_ALERT_MESSAGE
Definition: resource.h:11
#define DPFLTR_ERROR_LEVEL
Definition: main.cpp:32
#define _In_z_
Definition: no_sal2.h:239
int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES sec)
Definition: shlfileop.cpp:845
void BeginStackBacktrace(DumpData &data)
Definition: stacktrace.cpp:14
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1562
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
WORD wHour
Definition: winbase.h:874
ULONG Dr6
Definition: nt_native.h:1438
#define TH32CS_SNAPPROCESS
Definition: tlhelp32.h:26
bool UpdateFromEvent(DEBUG_EVENT &evt, DumpData &data)
Definition: drwtsn32.cpp:56
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define MB_OK
Definition: winuser.h:784
#define IDS_APP_TITLE
Definition: resource.h:10
ULONG R12
Definition: ke.h:267
HANDLE WINAPI CreateToolhelp32Snapshot(DWORD dwFlags, DWORD th32ProcessID)
Definition: toolhelp.c:1255
#define CreateFileW
Definition: compat.h:400
std::string ModuleName
Definition: drwtsn32.h:13
ULONG Dr0
Definition: nt_native.h:1434
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2085
ModuleList Modules
Definition: drwtsn32.h:44
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
void PrintStackBacktrace(FILE *output, DumpData &data, ThreadData &thread)
Definition: stacktrace.cpp:36
GLuint res
Definition: glext.h:9613
unsigned int ULONG
Definition: retypes.h:1
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:506
ULONG R10
Definition: compat.h:345
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 const char UINT32 const char const char UINT32 ComponentId
Definition: acpixf.h:1269
#define CREATE_PROCESS_DEBUG_EVENT
Definition: winbase.h:104
PEXCEPTION_RECORD ExceptionRecord
Definition: rtltypes.h:196
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
BOOL WINAPI DebugActiveProcess(IN DWORD dwProcessId)
Definition: debugger.c:480
#define NEWLINE
Definition: drwtsn32.h:53
WCHAR * LPWSTR
Definition: xmlstorage.h:184
int _getch()
Definition: getch.c:16
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
BYTE * PBYTE
Definition: pedump.c:66
static TfClientId tid
Definition: dsound.c:943
HANDLE ProcessHandle
Definition: drwtsn32.h:43
ULONG Ebp
Definition: nt_native.h:1475
#define CONTEXT_INTEGER
Definition: compat.h:266
#define CONTEXT_DEBUG_REGISTERS
Definition: compat.h:268
#define SUCCEEDED(hr)
Definition: intsafe.h:57
ULONG Edi
Definition: nt_native.h:1463
static int mod
Definition: i386-dis.c:1273
HANDLE Event
Definition: drwtsn32.h:47
EXCEPTION_DEBUG_INFO ExceptionInfo
Definition: drwtsn32.h:46