winedbg: Add wrappers for Read/WriteProcessMemory to fix the mingw build.
This commit is contained in:
parent
84ccadeeee
commit
8d0cb61bc7
|
@ -237,9 +237,9 @@ struct dbg_process
|
|||
struct be_process_io
|
||||
{
|
||||
BOOL (*close_process)(struct dbg_process*, BOOL);
|
||||
BOOL (WINAPI *read)(HANDLE, const void*, void*, SIZE_T, SIZE_T*);
|
||||
BOOL (WINAPI *write)(HANDLE, void*, const void*, SIZE_T, SIZE_T*);
|
||||
BOOL (WINAPI *get_selector)(HANDLE, DWORD, LDT_ENTRY*);
|
||||
BOOL (*read)(HANDLE, const void*, void*, SIZE_T, SIZE_T*);
|
||||
BOOL (*write)(HANDLE, void*, const void*, SIZE_T, SIZE_T*);
|
||||
BOOL (*get_selector)(HANDLE, DWORD, LDT_ENTRY*);
|
||||
};
|
||||
|
||||
extern struct dbg_process* dbg_curr_process;
|
||||
|
|
|
@ -111,11 +111,23 @@ struct gdb_context
|
|||
unsigned long wine_segs[3]; /* load addresses of the ELF wine exec segments (text, bss and data) */
|
||||
};
|
||||
|
||||
static BOOL tgt_process_gdbproxy_read(HANDLE hProcess, const void* addr,
|
||||
void* buffer, SIZE_T len, SIZE_T* rlen)
|
||||
{
|
||||
return ReadProcessMemory( hProcess, addr, buffer, len, rlen );
|
||||
}
|
||||
|
||||
static BOOL tgt_process_gdbproxy_write(HANDLE hProcess, void* addr,
|
||||
const void* buffer, SIZE_T len, SIZE_T* wlen)
|
||||
{
|
||||
return WriteProcessMemory( hProcess, addr, buffer, len, wlen );
|
||||
}
|
||||
|
||||
static struct be_process_io be_process_gdbproxy_io =
|
||||
{
|
||||
NULL, /* we shouldn't use close_process() in gdbproxy */
|
||||
ReadProcessMemory,
|
||||
WriteProcessMemory
|
||||
tgt_process_gdbproxy_read,
|
||||
tgt_process_gdbproxy_write
|
||||
};
|
||||
|
||||
/* =============================================== *
|
||||
|
|
|
@ -1004,10 +1004,27 @@ static BOOL tgt_process_active_close_process(struct dbg_process* pcs, BOOL kill)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL tgt_process_active_read(HANDLE hProcess, const void* addr,
|
||||
void* buffer, SIZE_T len, SIZE_T* rlen)
|
||||
{
|
||||
return ReadProcessMemory( hProcess, addr, buffer, len, rlen );
|
||||
}
|
||||
|
||||
static BOOL tgt_process_active_write(HANDLE hProcess, void* addr,
|
||||
const void* buffer, SIZE_T len, SIZE_T* wlen)
|
||||
{
|
||||
return WriteProcessMemory( hProcess, addr, buffer, len, wlen );
|
||||
}
|
||||
|
||||
static BOOL tgt_process_active_get_selector(HANDLE hThread, DWORD sel, LDT_ENTRY* le)
|
||||
{
|
||||
return GetThreadSelectorEntry( hThread, sel, le );
|
||||
}
|
||||
|
||||
static struct be_process_io be_process_active_io =
|
||||
{
|
||||
tgt_process_active_close_process,
|
||||
ReadProcessMemory,
|
||||
WriteProcessMemory,
|
||||
GetThreadSelectorEntry,
|
||||
tgt_process_active_read,
|
||||
tgt_process_active_write,
|
||||
tgt_process_active_get_selector
|
||||
};
|
||||
|
|
|
@ -84,8 +84,8 @@ static inline struct tgt_process_minidump_data* private_data(struct dbg_process*
|
|||
return pcs->pio_data;
|
||||
}
|
||||
|
||||
static BOOL WINAPI tgt_process_minidump_read(HANDLE hProcess, const void* addr,
|
||||
void* buffer, SIZE_T len, SIZE_T* rlen)
|
||||
static BOOL tgt_process_minidump_read(HANDLE hProcess, const void* addr,
|
||||
void* buffer, SIZE_T len, SIZE_T* rlen)
|
||||
{
|
||||
void* stream;
|
||||
|
||||
|
@ -125,8 +125,8 @@ static BOOL WINAPI tgt_process_minidump_read(HANDLE hProcess, const void* addr,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL WINAPI tgt_process_minidump_write(HANDLE hProcess, void* addr,
|
||||
const void* buffer, SIZE_T len, SIZE_T* wlen)
|
||||
static BOOL tgt_process_minidump_write(HANDLE hProcess, void* addr,
|
||||
const void* buffer, SIZE_T len, SIZE_T* wlen)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -447,7 +447,7 @@ static BOOL tgt_process_minidump_close_process(struct dbg_process* pcs, BOOL kil
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL WINAPI tgt_process_minidump_get_selector(HANDLE hThread, DWORD sel, LDT_ENTRY* le)
|
||||
static BOOL tgt_process_minidump_get_selector(HANDLE hThread, DWORD sel, LDT_ENTRY* le)
|
||||
{
|
||||
/* so far, pretend all selectors are valid, and mapped to a 32bit flat address space */
|
||||
memset(le, 0, sizeof(*le));
|
||||
|
|
|
@ -33,14 +33,14 @@
|
|||
|
||||
static struct be_process_io be_process_module_io;
|
||||
|
||||
static BOOL WINAPI tgt_process_module_read(HANDLE hProcess, const void* addr,
|
||||
void* buffer, SIZE_T len, SIZE_T* rlen)
|
||||
static BOOL tgt_process_module_read(HANDLE hProcess, const void* addr,
|
||||
void* buffer, SIZE_T len, SIZE_T* rlen)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL WINAPI tgt_process_module_write(HANDLE hProcess, void* addr,
|
||||
const void* buffer, SIZE_T len, SIZE_T* wlen)
|
||||
static BOOL tgt_process_module_write(HANDLE hProcess, void* addr,
|
||||
const void* buffer, SIZE_T len, SIZE_T* wlen)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ static BOOL tgt_process_module_close_process(struct dbg_process* pcs, BOOL kill)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL WINAPI tgt_process_module_get_selector(HANDLE hThread, DWORD sel, LDT_ENTRY* le)
|
||||
static BOOL tgt_process_module_get_selector(HANDLE hThread, DWORD sel, LDT_ENTRY* le)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue