ReactOS 0.4.15-dev-7788-g1ad9096
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
23static 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
30extern "C"
32#define DPFLTR_ERROR_LEVEL 0
33
34void xfprintf(FILE* stream, const char *fmt, ...)
35{
36 va_list ap;
37
38 va_start(ap, fmt);
41 va_end(ap);
42}
43
44
45
46static 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;
59 if ((ctx.ContextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER)
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 rbp:%p rsp:%p" NEWLINE,
66 ctx.Rax, ctx.Rbx, ctx.Rcx, ctx.Rdx, ctx.Rsi, ctx.Rdi, ctx.Rbp, ctx.Rsp);
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#elif defined(_M_ARM)
70 xfprintf(output, "r0:%p r1:%p r2:%p r3:%p r4:%p r5:%p r6:%p" NEWLINE,
71 ctx.R0, ctx.R1, ctx.R2, ctx.R3, ctx.R4, ctx.R5, ctx.R6);
72 xfprintf(output, "r7:%p r8:%p r9:%p r10:%p r11:%p r12:%p" NEWLINE,
73 ctx.R7, ctx.R8, ctx.R9, ctx.R10, ctx.R11, ctx.R12);
74#else
75#error Unknown architecture
76#endif
77 }
78
79 if ((ctx.ContextFlags & CONTEXT_CONTROL) == CONTEXT_CONTROL)
80 {
81#if defined(_M_IX86)
82 xfprintf(output, "eip:%p esp:%p ebp:%p" NEWLINE,
83 ctx.Eip, ctx.Esp, ctx.Ebp);
84#elif defined(_M_AMD64)
85 xfprintf(output, "rip:%p rsp:%p rbp:%p" NEWLINE,
86 ctx.Rip, ctx.Rsp, ctx.Rbp);
87#elif defined(_M_ARM)
88 xfprintf(output, "sp:%p lr:%p pc:%p cpsr:%p" NEWLINE,
89 ctx.Sp, ctx.Lr, ctx.Pc, ctx.Cpsr);
90#else
91#error Unknown architecture
92#endif
93 }
94
96 {
97#if defined(_M_IX86) || defined(_M_AMD64)
98 xfprintf(output, "dr0:%p dr1:%p dr2:%p dr3:%p dr6:%p dr7:%p" NEWLINE,
99 ctx.Dr0, ctx.Dr1, ctx.Dr2, ctx.Dr3, ctx.Dr6, ctx.Dr7);
100#elif defined(_M_ARM)
101 for (int n = 0; n < ARM_MAX_BREAKPOINTS; ++n)
102 xfprintf(output, "Bvr%d:%p%s", n, ctx.Bvr[n], ((n + 1) == ARM_MAX_BREAKPOINTS) ? NEWLINE : " ");
103 for (int n = 0; n < ARM_MAX_BREAKPOINTS; ++n)
104 xfprintf(output, "Bcr%d:%p%s", n, ctx.Bcr[n], ((n + 1) == ARM_MAX_BREAKPOINTS) ? NEWLINE : " ");
105
106 for (int n = 0; n < ARM_MAX_WATCHPOINTS; ++n)
107 xfprintf(output, "Wvr%d:%p%s", n, ctx.Wvr[n], ((n + 1) == ARM_MAX_WATCHPOINTS) ? NEWLINE : " ");
108 for (int n = 0; n < ARM_MAX_WATCHPOINTS; ++n)
109 xfprintf(output, "Wcr%d:%p%s", n, ctx.Wcr[n], ((n + 1) == ARM_MAX_WATCHPOINTS) ? NEWLINE : " ");
110#else
111#error Unknown architecture
112#endif
113 }
114
116}
117
119{
120 PrintSystemInfo(output, data);
121 xfprintf(output, NEWLINE "*----> Task List <----*" NEWLINE NEWLINE);
123 if (hSnap != INVALID_HANDLE_VALUE)
124 {
126 pe.dwSize = sizeof(pe);
127 if (Process32First(hSnap, &pe))
128 {
129 do
130 {
131 xfprintf(output, "%5d: %ls" NEWLINE, pe.th32ProcessID, pe.szExeFile);
132 } while (Process32Next(hSnap, &pe));
133 }
134 CloseHandle(hSnap);
135 }
136
137 xfprintf(output, NEWLINE "*----> Module List <----*" NEWLINE NEWLINE);
138 std::sort(data.Modules.begin(), data.Modules.end(), SortModules);
139
140 ModuleData mainModule(NULL);
141 mainModule.Update(data.ProcessHandle);
142 xfprintf(output, "(%p - %p) %ls" NEWLINE,
143 mainModule.BaseAddress,
144 (PBYTE)mainModule.BaseAddress + mainModule.Size,
145 data.ProcessPath.c_str());
146
147 for (size_t n = 0; n < data.Modules.size(); ++n)
148 {
149 ModuleData& mod = data.Modules[n];
150 if (!mod.Unloaded)
151 {
152 mod.Update(data.ProcessHandle);
153 xfprintf(output, "(%p - %p) %s" NEWLINE,
154 mod.BaseAddress,
155 (PBYTE)mod.BaseAddress + mod.Size,
156 mod.ModuleName.c_str());
157 }
158 }
159
161
162 // First print the thread that crashed
163 ThreadMap::iterator crash = data.Threads.find(data.ThreadID);
164 if (crash != data.Threads.end())
165 PrintThread(output, data, crash->first, crash->second);
166
167 // Print the other threads
168 for (ThreadMap::iterator it = data.Threads.begin(); it != data.Threads.end(); ++it)
169 {
170 if (it->first != data.ThreadID)
171 PrintThread(output, data, it->first, it->second);
172 }
174}
175
176
177int abort(FILE* output, int err)
178{
179 if (output != stdout)
180 fclose(output);
181 else
182 _getch();
183
184 return err;
185}
186
187std::wstring Settings_GetOutputPath(void)
188{
189 WCHAR Buffer[MAX_PATH] = L"";
191 BOOL UseDefaultPath = TRUE;
192
193 CRegKey key;
194 if (key.Open(HKEY_CURRENT_USER, L"SOFTWARE\\ReactOS\\Crash Reporter", KEY_READ) == ERROR_SUCCESS &&
195 key.QueryStringValue(L"Dump Directory", Buffer, &BufferSize) == ERROR_SUCCESS)
196 {
197 UseDefaultPath = FALSE;
198 }
199
200 if (UseDefaultPath)
201 {
203 {
204 return std::wstring();
205 }
206 }
207
208 return std::wstring(Buffer);
209}
210
212{
213 CRegKey key;
214 if (key.Open(HKEY_CURRENT_USER, L"SOFTWARE\\ReactOS\\Crash Reporter", KEY_READ) != ERROR_SUCCESS)
215 {
216 return FALSE;
217 }
218
219 DWORD Value;
220 if (key.QueryDWORDValue(L"Minidump", Value) != ERROR_SUCCESS)
221 {
222 return FALSE;
223 }
224
225 return (Value != 0);
226}
227
229{
230 HRESULT hr = S_OK;
231
232 WCHAR DumpFilePath[MAX_PATH] = L"";
233 StringCchCopyW(DumpFilePath, _countof(DumpFilePath), LogFilePath);
234 PathRemoveExtensionW(DumpFilePath);
235 PathAddExtensionW(DumpFilePath, L".dmp");
236
238 if (hDumpFile == INVALID_HANDLE_VALUE)
239 {
241 }
242
243 ThreadData& Thread = data.Threads[data.ThreadID];
244 Thread.Update();
245 PCONTEXT ContextPointer = &Thread.Context;
246
247 MINIDUMP_EXCEPTION_INFORMATION DumpExceptionInfo = {0};
248 EXCEPTION_POINTERS ExceptionPointers = {0};
249 ExceptionPointers.ExceptionRecord = &data.ExceptionInfo.ExceptionRecord;
250 ExceptionPointers.ContextRecord = ContextPointer;
251
252 DumpExceptionInfo.ThreadId = data.ThreadID;
253 DumpExceptionInfo.ExceptionPointers = &ExceptionPointers;
254 DumpExceptionInfo.ClientPointers = FALSE;
255
256 BOOL DumpSucceeded = MiniDumpWriteDump(data.ProcessHandle, data.ProcessID, hDumpFile, MiniDumpNormal, &DumpExceptionInfo, NULL, NULL);
257 if (!DumpSucceeded)
258 {
259 // According to MSDN, this value is already an HRESULT, so don't convert it again.
260 hr = GetLastError();
261 }
262
263 CloseHandle(hDumpFile);
264 return hr;
265}
266
268{
269 int argc;
271
272 DWORD pid = 0;
273 WCHAR Filename[50];
274 FILE* output = NULL;
275 SYSTEMTIME st;
277
278
279 for (int n = 0; n < argc; ++n)
280 {
281 WCHAR* arg = argv[n];
282
283 if (!wcscmp(arg, L"-i"))
284 {
285 /* FIXME: Installs as the postmortem debugger. */
286 }
287 else if (!wcscmp(arg, L"-g"))
288 {
289 }
290 else if (!wcscmp(arg, L"-p"))
291 {
292 if (n + 1 < argc)
293 {
294 pid = wcstoul(argv[n+1], NULL, 10);
295 n++;
296 }
297 }
298 else if (!wcscmp(arg, L"-e"))
299 {
300 if (n + 1 < argc)
301 {
302 data.Event = (HANDLE)(ULONG_PTR)_wcstoui64(argv[n+1], NULL, 10);
303 n++;
304 }
305 }
306 else if (!wcscmp(arg, L"-?"))
307 {
308 MessageBoxA(NULL, szUsage, "ReactOS Crash Reporter", MB_OK);
309 return abort(output, 0);
310 }
311 else if (!wcscmp(arg, L"/?"))
312 {
313 xfprintf(stdout, "%s\n", szUsage);
314 return abort(stdout, 0);
315 }
316 }
317
318 if (!pid)
319 {
320 MessageBoxA(NULL, szUsage, "ReactOS Crash Reporter", MB_OK);
321 return abort(stdout, 0);
322 }
323
324 GetLocalTime(&st);
325
326 std::wstring OutputPath = Settings_GetOutputPath();
327 BOOL HasPath = (OutputPath.size() != 0);
328
329 if (!PathIsDirectoryW(OutputPath.c_str()))
330 {
331 int res = SHCreateDirectoryExW(NULL, OutputPath.c_str(), NULL);
333 {
334 xfprintf(stdout, "Could not create output directory, not writing dump\n");
335 MessageBoxA(NULL, "Could not create directory to write crash report.", "ReactOS Crash Reporter", MB_ICONERROR | MB_OK);
336 return abort(stdout, 0);
337 }
338 }
339
340 if (HasPath &&
341 SUCCEEDED(StringCchPrintfW(Filename, _countof(Filename), L"Appcrash_%d-%02d-%02d_%02d-%02d-%02d.txt",
342 st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond)))
343 {
344 OutputPath += L"\\";
345 OutputPath += Filename;
346 output = _wfopen(OutputPath.c_str(), L"wb");
347 }
348 if (!output)
349 output = stdout;
350
351
353 return abort(output, -2);
354
355 /* We should not kill it? */
357
358 DEBUG_EVENT evt;
359 if (!WaitForDebugEvent(&evt, 30000))
360 return abort(output, -3);
361
363
364 while (UpdateFromEvent(evt, data))
365 {
367
368 if (!WaitForDebugEvent(&evt, 30000))
369 return abort(output, -4);
370 }
371
372 PrintBugreport(output, data);
373 if (Settings_GetShouldWriteDump() && HasPath)
374 {
375 WriteMinidump(OutputPath.c_str(), data);
376 }
377
378 TerminateProcess(data.ProcessHandle, data.ExceptionInfo.ExceptionRecord.ExceptionCode);
379
380 CStringW FormattedMessage;
381 FormattedMessage.Format(IDS_USER_ALERT_MESSAGE, data.ProcessName.c_str(), OutputPath.c_str());
382 CStringW DialogTitle;
383 DialogTitle.LoadString(hInstance, IDS_APP_TITLE);
384
385 MessageBoxW(NULL, FormattedMessage.GetString(), DialogTitle.GetString(), MB_OK);
386
387 return abort(output, 0);
388}
static int argc
Definition: ServiceArgs.c:12
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
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 ACPI_STATUS const char UINT32 const char const char UINT32 ComponentId
Definition: acpixf.h:1281
static const char szUsage[]
Definition: main.cpp:23
static void PrintThread(FILE *output, DumpData &data, DWORD tid, ThreadData &thread)
Definition: main.cpp:51
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR cmdLine, INT)
Definition: main.cpp:267
NTSYSAPI ULONG NTAPI vDbgPrintEx(_In_ ULONG ComponentId, _In_ ULONG Level, _In_z_ PCCH Format, _In_ va_list ap)
void xfprintf(FILE *stream, const char *fmt,...)
Definition: main.cpp:34
std::wstring Settings_GetOutputPath(void)
Definition: main.cpp:187
BOOL Settings_GetShouldWriteDump(void)
Definition: main.cpp:211
#define DPFLTR_ERROR_LEVEL
Definition: main.cpp:32
HRESULT WriteMinidump(LPCWSTR LogFilePath, DumpData &data)
Definition: main.cpp:228
void PrintBugreport(FILE *output, DumpData &data)
Definition: main.cpp:118
static bool SortModules(const ModuleData &left, const ModuleData &right)
Definition: main.cpp:46
#define IDS_USER_ALERT_MESSAGE
Definition: resource.h:11
#define IDS_APP_TITLE
Definition: resource.h:10
static HANDLE thread
Definition: service.c:33
#define NTSYSAPI
Definition: ntoskrnl.h:12
HINSTANCE hInstance
Definition: charmap.c:19
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:639
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:818
Definition: bufpool.h:45
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
@ MiniDumpNormal
Definition: compat.h:1266
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
BOOL WINAPI DebugSetProcessKillOnExit(IN BOOL KillOnExit)
Definition: debugger.c:542
BOOL WINAPI ContinueDebugEvent(IN DWORD dwProcessId, IN DWORD dwThreadId, IN DWORD dwContinueStatus)
Definition: debugger.c:413
BOOL WINAPI DebugActiveProcess(IN DWORD dwProcessId)
Definition: debugger.c:445
BOOL WINAPI WaitForDebugEvent(IN LPDEBUG_EVENT lpDebugEvent, IN DWORD dwMilliseconds)
Definition: debugger.c:590
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1532
LPWSTR WINAPI GetCommandLineW(VOID)
Definition: proc.c:2013
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
BOOL WINAPI Process32First(HANDLE hSnapshot, LPPROCESSENTRY32 lppe)
Definition: toolhelp.c:951
BOOL WINAPI Process32Next(HANDLE hSnapshot, LPPROCESSENTRY32 lppe)
Definition: toolhelp.c:1040
HANDLE WINAPI CreateToolhelp32Snapshot(DWORD dwFlags, DWORD th32ProcessID)
Definition: toolhelp.c:1255
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2558
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:823
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1723
#define assert(x)
Definition: debug.h:53
bool UpdateFromEvent(DEBUG_EVENT &evt, DumpData &data)
Definition: drwtsn32.cpp:56
void PrintStackBacktrace(FILE *output, DumpData &data, ThreadData &thread)
Definition: stacktrace.cpp:36
void BeginStackBacktrace(DumpData &data)
Definition: stacktrace.cpp:14
#define NEWLINE
Definition: drwtsn32.h:53
void PrintSystemInfo(FILE *output, DumpData &data)
Definition: sysinfo.cpp:56
void EndStackBacktrace(DumpData &data)
Definition: stacktrace.cpp:22
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:939
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble n
Definition: glext.h:7729
GLuint res
Definition: glext.h:9613
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
__in PVOID ContextPointer
Definition: handleapi.cpp:679
static int mod
Definition: i386-dis.c:1288
#define abort()
Definition: i386-dis.c:34
#define stdout
Definition: stdio.h:99
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
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:942
#define CREATE_ALWAYS
Definition: disk.h:72
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
static TfClientId tid
#define argv
Definition: mplay32.c:18
#define _In_z_
Definition: ms_sal.h:313
#define _In_
Definition: ms_sal.h:308
#define CONTEXT_DEBUG_REGISTERS
Definition: nt_native.h:1373
#define CONTEXT_CONTROL
Definition: nt_native.h:1369
#define KEY_READ
Definition: nt_native.h:1023
#define CONTEXT_INTEGER
Definition: nt_native.h:1370
#define GENERIC_WRITE
Definition: nt_native.h:90
CONST CHAR * PCCH
Definition: ntbasedef.h:392
#define DBG_CONTINUE
Definition: ntstatus.h:47
#define L(x)
Definition: ntvdm.h:50
#define PathAddExtensionW
Definition: pathcch.h:305
BYTE * PBYTE
Definition: pedump.c:66
#define err(...)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define ARM_MAX_WATCHPOINTS
Definition: ke.h:232
#define ARM_MAX_BREAKPOINTS
Definition: ke.h:231
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
Definition: shell32_main.c:80
int _getch()
Definition: getch.c:16
int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES sec)
Definition: shlfileop.cpp:905
HRESULT hr
Definition: shlfolder.c:183
@ SHGFP_TYPE_CURRENT
Definition: shlobj.h:2134
#define CSIDL_DESKTOP
Definition: shlobj.h:2158
#define _countof(array)
Definition: sndvol32.h:68
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
void Update(HANDLE hProcess)
Definition: drwtsn32.cpp:20
DWORD Size
Definition: drwtsn32.h:15
void * BaseAddress
Definition: drwtsn32.h:14
DWORD dwDebugEventCode
Definition: winbase.h:788
DWORD dwThreadId
Definition: winbase.h:790
DWORD dwProcessId
Definition: winbase.h:789
PEXCEPTION_RECORD ExceptionRecord
Definition: rtltypes.h:200
PCONTEXT ContextRecord
Definition: rtltypes.h:201
struct _EXCEPTION_RECORD * ExceptionRecord
Definition: compat.h:210
PEXCEPTION_POINTERS ExceptionPointers
Definition: dbghelp.h:774
WORD wYear
Definition: winbase.h:905
WORD wMonth
Definition: winbase.h:906
WORD wHour
Definition: winbase.h:909
WORD wSecond
Definition: winbase.h:911
WORD wMinute
Definition: winbase.h:910
WORD wDay
Definition: winbase.h:908
Definition: dsound.c:943
Definition: copy.c:22
Definition: parse.h:23
CHAR szExeFile[MAX_PATH]
Definition: tlhelp32.h:70
DWORD th32ProcessID
Definition: tlhelp32.h:63
#define TH32CS_SNAPPROCESS
Definition: tlhelp32.h:26
#define NTAPI
Definition: typedefs.h:36
PVOID HANDLE
Definition: typedefs.h:73
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CREATE_PROCESS_DEBUG_EVENT
Definition: winbase.h:104
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
#define WINAPI
Definition: msvc.h:6
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36
#define HKEY_CURRENT_USER
Definition: winreg.h:11
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:787
#define MB_OK
Definition: winuser.h:790
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:56
unsigned __int64 CDECL _wcstoui64(const wchar_t *nptr, wchar_t **endptr, int base)
Definition: wtoi64.c:200
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185