ReactOS 0.4.15-dev-7846-g8ba6c66
drwtsn32.cpp File Reference
#include "precomp.h"
#include <psapi.h>
Include dependency graph for drwtsn32.cpp:

Go to the source code of this file.

Macros

#define MS_VC_EXCEPTION_THREAD_NAME   0x406d1388
 

Functions

bool UpdateFromEvent (DEBUG_EVENT &evt, DumpData &data)
 

Macro Definition Documentation

◆ MS_VC_EXCEPTION_THREAD_NAME

#define MS_VC_EXCEPTION_THREAD_NAME   0x406d1388

Definition at line 11 of file drwtsn32.cpp.

Function Documentation

◆ UpdateFromEvent()

bool UpdateFromEvent ( DEBUG_EVENT evt,
DumpData data 
)

Definition at line 56 of file drwtsn32.cpp.

57{
58 switch(evt.dwDebugEventCode)
59 {
61 {
62 data.ProcessPath.resize(MAX_PATH*2);
63 DWORD len = GetModuleFileNameExW(evt.u.CreateProcessInfo.hProcess, NULL, &data.ProcessPath[0], data.ProcessPath.size());
64 if (len)
65 {
66 data.ProcessPath.resize(len);
67 std::string::size_type pos = data.ProcessPath.find_last_of(L"\\/");
68 if (pos != std::string::npos)
69 data.ProcessName = data.ProcessPath.substr(pos+1);
70 }
71 else
72 {
73 data.ProcessPath = L"??";
74 }
75 if (data.ProcessName.empty())
76 data.ProcessName = data.ProcessPath;
77
79 data.ProcessID = evt.dwProcessId;
80 data.ProcessHandle = evt.u.CreateProcessInfo.hProcess;
82 }
83 break;
85 data.Threads[evt.dwThreadId] = ThreadData(evt.u.CreateThread.hThread);
86 break;
88 {
89 ThreadMap::iterator it = data.Threads.find(evt.dwThreadId);
90 if (it != data.Threads.end())
91 {
92 data.Threads.erase(it);
93 }
94 }
95 break;
98 for (size_t n = 0; n < data.Modules.size(); ++n)
99 {
100 if (data.Modules[n].BaseAddress == evt.u.LoadDll.lpBaseOfDll)
101 {
102 data.Modules[n].Unloaded = false;
103 return true;
104 }
105 }
106 data.Modules.push_back(ModuleData(evt.u.LoadDll.lpBaseOfDll));
107 break;
109 for (size_t n = 0; n < data.Modules.size(); ++n)
110 {
111 if (data.Modules[n].BaseAddress == evt.u.UnloadDll.lpBaseOfDll)
112 data.Modules[n].Unloaded = true;
113 }
114 break;
115 case OUTPUT_DEBUG_STRING_EVENT: // ignore
116 break;
118 if (evt.u.Exception.dwFirstChance)
119 {
121 {
123 if (!data.FirstBPHit)
124 {
125 data.FirstBPHit = true;
126
127 if (data.Event)
128 {
129 SetEvent(data.Event);
130 CloseHandle(data.Event);
131 data.Event = NULL;
132 }
133 return true;
134 }
135 break;
137 /* Thread name */
138 return true;
139 case DBG_CONTROL_C:
141 return true;
142 }
143 }
144 data.ExceptionInfo = evt.u.Exception;
145 data.ThreadID = evt.dwThreadId;
146 return false;
148 //assert(FALSE);
149 return false;
150 case RIP_EVENT:
151 //assert(FALSE);
152 return false;
153 default:
154 assert(false);
155 }
156 return true;
157}
#define NULL
Definition: types.h:112
#define CloseHandle
Definition: compat.h:739
#define GetModuleFileNameExW(w, x, y, z)
Definition: compat.h:922
#define MAX_PATH
Definition: compat.h:34
#define assert(x)
Definition: debug.h:53
#define MS_VC_EXCEPTION_THREAD_NAME
Definition: drwtsn32.cpp:11
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble n
Definition: glext.h:7729
GLenum GLsizei len
Definition: glext.h:6722
#define DBG_CONTROL_BREAK
Definition: ntstatus.h:55
#define DBG_CONTROL_C
Definition: ntstatus.h:52
#define L(x)
Definition: ntvdm.h:50
UNLOAD_DLL_DEBUG_INFO UnloadDll
Definition: winbase.h:798
union _DEBUG_EVENT::@3274 u
DWORD dwDebugEventCode
Definition: winbase.h:788
DWORD dwThreadId
Definition: winbase.h:790
DWORD dwProcessId
Definition: winbase.h:789
LOAD_DLL_DEBUG_INFO LoadDll
Definition: winbase.h:797
EXCEPTION_DEBUG_INFO Exception
Definition: winbase.h:792
CREATE_PROCESS_DEBUG_INFO CreateProcessInfo
Definition: winbase.h:794
CREATE_THREAD_DEBUG_INFO CreateThread
Definition: winbase.h:793
EXCEPTION_RECORD ExceptionRecord
Definition: winbase.h:751
DWORD ExceptionCode
Definition: compat.h:208
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define RIP_EVENT
Definition: winbase.h:110
#define CREATE_PROCESS_DEBUG_EVENT
Definition: winbase.h:104
#define LOAD_DLL_DEBUG_EVENT
Definition: winbase.h:107
#define EXIT_PROCESS_DEBUG_EVENT
Definition: winbase.h:106
#define OUTPUT_DEBUG_STRING_EVENT
Definition: winbase.h:109
#define EXCEPTION_DEBUG_EVENT
Definition: winbase.h:102
#define CREATE_THREAD_DEBUG_EVENT
Definition: winbase.h:103
#define UNLOAD_DLL_DEBUG_EVENT
Definition: winbase.h:108
#define EXCEPTION_BREAKPOINT
Definition: winbase.h:313
#define EXIT_THREAD_DEBUG_EVENT
Definition: winbase.h:105

Referenced by wWinMain().