winedbg: Adjust the parameters of the backend read/write routines to
match those of ReadProcessMemory/WriteProcessMemory, since those are
the ones actually used.
diff --git a/programs/winedbg/be_alpha.c b/programs/winedbg/be_alpha.c
index 21c3bf2..8d2fb4d 100644
--- a/programs/winedbg/be_alpha.c
+++ b/programs/winedbg/be_alpha.c
@@ -87,7 +87,7 @@
void* addr, unsigned long* val, unsigned size)
{
unsigned long xbp;
- unsigned long sz;
+ SIZE_T sz;
switch (type)
{
diff --git a/programs/winedbg/be_i386.c b/programs/winedbg/be_i386.c
index c7521fe..e82216e 100644
--- a/programs/winedbg/be_i386.c
+++ b/programs/winedbg/be_i386.c
@@ -467,7 +467,7 @@
void* addr, unsigned long* val, unsigned size)
{
unsigned char ch;
- unsigned long sz;
+ SIZE_T sz;
unsigned long* pr;
int reg;
unsigned long bits;
@@ -517,7 +517,7 @@
CONTEXT* ctx, enum be_xpoint_type type,
void* addr, unsigned long val, unsigned size)
{
- unsigned long sz;
+ SIZE_T sz;
unsigned char ch;
switch (type)
diff --git a/programs/winedbg/be_ppc.c b/programs/winedbg/be_ppc.c
index db3b5d5..fcd92a7 100644
--- a/programs/winedbg/be_ppc.c
+++ b/programs/winedbg/be_ppc.c
@@ -100,7 +100,7 @@
void* addr, unsigned long* val, unsigned size)
{
unsigned long xbp;
- unsigned long sz;
+ SIZE_T sz;
switch (type)
{
@@ -121,7 +121,7 @@
CONTEXT* ctx, enum be_xpoint_type type,
void* addr, unsigned long val, unsigned size)
{
- unsigned long sz;
+ SIZE_T sz;
switch (type)
{
diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h
index c51ccc6..1452ff6 100644
--- a/programs/winedbg/debugger.h
+++ b/programs/winedbg/debugger.h
@@ -218,8 +218,8 @@
struct be_process_io
{
BOOL (*close_process)(struct dbg_process*, BOOL);
- BOOL (WINAPI *read)(HANDLE, const void*, void*, DWORD, DWORD*);
- BOOL (WINAPI *write)(HANDLE, void*, const void*, DWORD, DWORD*);
+ BOOL (WINAPI *read)(HANDLE, const void*, void*, SIZE_T, SIZE_T*);
+ BOOL (WINAPI *write)(HANDLE, void*, const void*, SIZE_T, SIZE_T*);
};
extern struct dbg_process* dbg_curr_process;
diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
index 45a4522..e6b61e9 100644
--- a/programs/winedbg/gdbproxy.c
+++ b/programs/winedbg/gdbproxy.c
@@ -1302,7 +1302,7 @@
char *addr;
unsigned int len, blk_len, nread;
char buffer[32];
- unsigned long r = 0;
+ SIZE_T r = 0;
assert(gdbctx->in_trap);
/* FIXME:check in_packet_len for reading %p,%x */
@@ -1334,7 +1334,7 @@
unsigned int len, blk_len;
char* ptr;
char buffer[32];
- unsigned long w;
+ SIZE_T w;
assert(gdbctx->in_trap);
ptr = memchr(gdbctx->in_packet, ':', gdbctx->in_packet_len);
diff --git a/programs/winedbg/memory.c b/programs/winedbg/memory.c
index fca6e3d..da964a4 100644
--- a/programs/winedbg/memory.c
+++ b/programs/winedbg/memory.c
@@ -231,7 +231,7 @@
BOOL memory_get_string(struct dbg_process* pcs, void* addr, BOOL in_debuggee,
BOOL unicode, char* buffer, int size)
{
- DWORD sz;
+ SIZE_T sz;
WCHAR* buffW;
buffer[0] = 0;
@@ -262,7 +262,7 @@
BOOL memory_get_string_indirect(struct dbg_process* pcs, void* addr, BOOL unicode, char* buffer, int size)
{
void* ad;
- DWORD sz;
+ SIZE_T sz;
buffer[0] = 0;
if (addr &&
diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c
index b976117..c2dec5f 100644
--- a/programs/winedbg/stack.c
+++ b/programs/winedbg/stack.c
@@ -127,9 +127,14 @@
static BOOL CALLBACK stack_read_mem(HANDLE hProc, DWORD addr,
PVOID buffer, DWORD size, PDWORD written)
{
+ SIZE_T sz;
+ BOOL ret;
+
struct dbg_process* pcs = dbg_get_process_h(hProc);
if (!pcs) return FALSE;
- return pcs->process_io->read(hProc, (const void*)addr, buffer, size, written);
+ ret = pcs->process_io->read(hProc, (const void*)addr, buffer, size, &sz);
+ if (written != NULL) *written = sz;
+ return ret;
}
/******************************************************************