13#include "DebugServer2/Base.h"
19#define DS2_EXCEPTION_UNCAUGHT_COM 0x800706BA
20#define DS2_EXCEPTION_UNCAUGHT_USER 0xE06D7363
21#define DS2_EXCEPTION_UNCAUGHT_WINRT 0x40080201
22#define DS2_EXCEPTION_VC_THREAD_NAME_SET 0x406D1388
24#if !defined(HAVE_WaitForDebugEventEx)
25#define WaitForDebugEventEx WaitForDebugEvent
29#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
40#if !defined(HAVE_GetWindowsDirectoryW)
41WINBASEAPI UINT WINAPI GetWindowsDirectoryW(
42 _Out_ LPWSTR lpBuffer,
47#if !defined(HAVE_GetModuleHandleA)
48WINBASEAPI HMODULE WINAPI GetModuleHandleA(
49 _In_opt_ LPCSTR lpModuleName
53#if !defined(HAVE_GetModuleHandleW)
54WINBASEAPI HMODULE WINAPI GetModuleHandleW(
55 _In_opt_ LPCWSTR lpModuleName
59#if !defined(HAVE_struct__STARTUPINFOW)
60typedef struct _STARTUPINFOW {
71 DWORD dwFillAttribute;
79} STARTUPINFOW, *LPSTARTUPINFOW;
82#if !defined(HAVE_struct__PROCESS_INFORMATION)
83typedef struct _PROCESS_INFORMATION {
88} PROCESS_INFORMATION, *LPPROCESS_INFORMATION;
91#if !defined(HAVE_TerminateThread)
92WINBASEAPI BOOL WINAPI TerminateThread(
93 _Inout_ HANDLE hThread,
98#if !defined(HAVE_SetThreadContext)
99WINBASEAPI BOOL WINAPI SetThreadContext(
101 _In_
const CONTEXT *lpContext
105#if !defined(HAVE_ReadProcessMemory)
106WINBASEAPI BOOL WINAPI ReadProcessMemory(
107 _In_ HANDLE hProcess,
108 _In_ LPCVOID lpBaseAddress,
109 _Out_ LPVOID lpBuffer,
111 _Out_ SIZE_T *lpNumberOfBytesRead
115#if !defined(HAVE_WriteProcessMemory)
116WINBASEAPI BOOL WINAPI WriteProcessMemory(
117 _In_ HANDLE hProcess,
118 _In_ LPVOID lpBaseAddress,
119 _In_ LPCVOID lpBuffer,
121 _Out_ SIZE_T *lpNumberOfBytesWritten
125#if !defined(HAVE_ContinueDebugEvent)
126WINBASEAPI BOOL WINAPI ContinueDebugEvent(
127 _In_ DWORD dwProcessId,
128 _In_ DWORD dwThreadId,
129 _In_ DWORD dwContinueStatus
133#if !defined(HAVE_DebugActiveProcess)
134WINBASEAPI BOOL WINAPI DebugActiveProcess(
135 _In_ DWORD dwProcessId
139#if !defined(HAVE_DebugActiveProcessStop)
140WINBASEAPI BOOL WINAPI DebugActiveProcessStop(
141 _In_ DWORD dwProcessId
145#if !defined(HAVE_VirtualAllocEx)
146WINBASEAPI LPVOID WINAPI VirtualAllocEx(
147 _In_ HANDLE hProcess,
148 _In_opt_ LPVOID lpAddress,
150 _In_ DWORD flAllocationType,
155#if !defined(HAVE_VirtualFreeEx)
156WINBASEAPI BOOL WINAPI VirtualFreeEx(
157 _In_ HANDLE hProcess,
158 _In_ LPVOID lpAddress,
160 _In_ DWORD dwFreeType
164#if !defined(HAVE_VirtualQueryEx)
165WINBASEAPI SIZE_T WINAPI VirtualQueryEx(
166 _In_ HANDLE hProcess,
167 _In_opt_ LPCVOID lpAddress,
168 _Out_ PMEMORY_BASIC_INFORMATION lpBuffer,
173#if !defined(TH32CS_SNAPTHREAD)
174#define TH32CS_SNAPTHREAD 0x00000004
177#if !defined(HAVE_PTOP_LEVEL_EXCEPTION_FILTER)
178typedef LONG (WINAPI *PTOP_LEVEL_EXCEPTION_FILTER)(
179 _In_
struct _EXCEPTION_POINTERS *ExceptionInfo
183#if !defined(HAVE_LPTOP_LEVEL_EXCEPTION_FILTER)
184typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;