dbghelp: Fix a couple of casts on 64bit platforms.
This commit is contained in:
parent
c300f215b1
commit
b037912c9d
|
@ -479,7 +479,7 @@ static BOOL CALLBACK reg_cb64to32(HANDLE hProcess, ULONG action, ULONG64 data, U
|
|||
case CBA_DEFERRED_SYMBOL_LOAD_FAILURE:
|
||||
case CBA_DEFERRED_SYMBOL_LOAD_PARTIAL:
|
||||
case CBA_DEFERRED_SYMBOL_LOAD_START:
|
||||
idsl64 = (IMAGEHLP_DEFERRED_SYMBOL_LOAD64*)(DWORD)data;
|
||||
idsl64 = (IMAGEHLP_DEFERRED_SYMBOL_LOAD64*)(DWORD_PTR)data;
|
||||
if (!validate_addr64(idsl64->BaseOfImage))
|
||||
return FALSE;
|
||||
idsl.SizeOfStruct = sizeof(idsl);
|
||||
|
|
|
@ -498,7 +498,7 @@ extern BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_
|
|||
BOOL* is_unmatched);
|
||||
|
||||
/* pe_module.c */
|
||||
extern BOOL pe_load_nt_header(HANDLE hProc, DWORD base, IMAGE_NT_HEADERS* nth);
|
||||
extern BOOL pe_load_nt_header(HANDLE hProc, DWORD64 base, IMAGE_NT_HEADERS* nth);
|
||||
extern struct module*
|
||||
pe_load_native_module(struct process* pcs, const WCHAR* name,
|
||||
HANDLE hFile, DWORD base, DWORD size);
|
||||
|
|
|
@ -654,7 +654,7 @@ static enum location_error
|
|||
compute_location(dwarf2_traverse_context_t* ctx, struct location* loc,
|
||||
HANDLE hproc, const struct location* frame)
|
||||
{
|
||||
unsigned long stack[64];
|
||||
DWORD_PTR stack[64];
|
||||
unsigned stk;
|
||||
unsigned char op;
|
||||
BOOL piece_found = FALSE;
|
||||
|
@ -767,12 +767,12 @@ compute_location(dwarf2_traverse_context_t* ctx, struct location* loc,
|
|||
}
|
||||
if (hproc)
|
||||
{
|
||||
DWORD addr = stack[stk--];
|
||||
DWORD deref;
|
||||
DWORD_PTR addr = stack[stk--];
|
||||
DWORD_PTR deref;
|
||||
|
||||
if (!ReadProcessMemory(hproc, (void*)addr, &deref, sizeof(deref), NULL))
|
||||
{
|
||||
WARN("Couldn't read memory at %x\n", addr);
|
||||
WARN("Couldn't read memory at %lx\n", addr);
|
||||
return loc_err_cant_read;
|
||||
}
|
||||
stack[++stk] = deref;
|
||||
|
|
|
@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
|
|||
|
||||
struct dump_memory
|
||||
{
|
||||
ULONG base;
|
||||
ULONG64 base;
|
||||
ULONG size;
|
||||
ULONG rva;
|
||||
};
|
||||
|
@ -42,7 +42,7 @@ struct dump_memory
|
|||
struct dump_module
|
||||
{
|
||||
unsigned is_elf;
|
||||
ULONG base;
|
||||
ULONG64 base;
|
||||
ULONG size;
|
||||
DWORD timestamp;
|
||||
DWORD checksum;
|
||||
|
@ -251,7 +251,7 @@ static BOOL fetch_thread_info(struct dump_context* dc, int thd_idx,
|
|||
* Add a module to a dump context
|
||||
*/
|
||||
static BOOL add_module(struct dump_context* dc, const WCHAR* name,
|
||||
DWORD base, DWORD size, DWORD timestamp, DWORD checksum,
|
||||
DWORD64 base, DWORD size, DWORD timestamp, DWORD checksum,
|
||||
BOOL is_elf)
|
||||
{
|
||||
if (!dc->modules)
|
||||
|
@ -272,7 +272,7 @@ static BOOL add_module(struct dump_context* dc, const WCHAR* name,
|
|||
return FALSE;
|
||||
}
|
||||
if (is_elf ||
|
||||
!GetModuleFileNameExW(dc->hProcess, (HMODULE)base,
|
||||
!GetModuleFileNameExW(dc->hProcess, (HMODULE)(DWORD_PTR)base,
|
||||
dc->modules[dc->num_modules].name,
|
||||
sizeof(dc->modules[dc->num_modules].name) / sizeof(WCHAR)))
|
||||
lstrcpynW(dc->modules[dc->num_modules].name, name,
|
||||
|
@ -834,7 +834,7 @@ static unsigned dump_memory_info(struct dump_context* dc)
|
|||
{
|
||||
len = min(dc->mem[i].size - pos, sizeof(tmp));
|
||||
if (ReadProcessMemory(dc->hProcess,
|
||||
(void*)(dc->mem[i].base + pos),
|
||||
(void*)(DWORD_PTR)(dc->mem[i].base + pos),
|
||||
tmp, len, NULL))
|
||||
WriteFile(dc->hFile, tmp, len, &written, NULL);
|
||||
}
|
||||
|
|
|
@ -432,13 +432,13 @@ struct module* pe_load_native_module(struct process* pcs, const WCHAR* name,
|
|||
* pe_load_nt_header
|
||||
*
|
||||
*/
|
||||
BOOL pe_load_nt_header(HANDLE hProc, DWORD base, IMAGE_NT_HEADERS* nth)
|
||||
BOOL pe_load_nt_header(HANDLE hProc, DWORD64 base, IMAGE_NT_HEADERS* nth)
|
||||
{
|
||||
IMAGE_DOS_HEADER dos;
|
||||
|
||||
return ReadProcessMemory(hProc, (char*)base, &dos, sizeof(dos), NULL) &&
|
||||
return ReadProcessMemory(hProc, (char*)(DWORD_PTR)base, &dos, sizeof(dos), NULL) &&
|
||||
dos.e_magic == IMAGE_DOS_SIGNATURE &&
|
||||
ReadProcessMemory(hProc, (char*)(base + dos.e_lfanew),
|
||||
ReadProcessMemory(hProc, (char*)(DWORD_PTR)(base + dos.e_lfanew),
|
||||
nth, sizeof(*nth), NULL) &&
|
||||
nth->Signature == IMAGE_NT_SIGNATURE;
|
||||
}
|
||||
|
|
|
@ -261,7 +261,7 @@ static BOOL stack_walk(struct stack_walk_callback* cb, LPSTACKFRAME frame)
|
|||
WARN("Bad stack frame 0x%08x\n", p);
|
||||
goto done_err;
|
||||
}
|
||||
curr_switch = (DWORD)frame16.frame32;
|
||||
curr_switch = (DWORD_PTR)frame16.frame32;
|
||||
|
||||
if (!sw_read_mem(cb, curr_switch, &ch, sizeof(ch)))
|
||||
curr_switch = 0xFFFFFFFF;
|
||||
|
@ -327,7 +327,7 @@ static BOOL stack_walk(struct stack_walk_callback* cb, LPSTACKFRAME frame)
|
|||
WARN("Bad stack frame 0x%08x\n", p);
|
||||
goto done_err;
|
||||
}
|
||||
curr_switch = (DWORD)frame16.frame32;
|
||||
curr_switch = (DWORD_PTR)frame16.frame32;
|
||||
curr_mode = stm_32bit;
|
||||
if (!sw_read_mem(cb, curr_switch, &ch, sizeof(ch)))
|
||||
curr_switch = 0;
|
||||
|
|
|
@ -702,7 +702,7 @@ static void symt_fill_sym_info(const struct module_pair* pair,
|
|||
case VT_UI4: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.ulVal; break;
|
||||
case VT_UI2: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.uiVal; break;
|
||||
case VT_UI1: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.bVal; break;
|
||||
case VT_I1 | VT_BYREF: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.byref; break;
|
||||
case VT_I1 | VT_BYREF: sym_info->Value = (ULONG64)(DWORD_PTR)data->u.value.n1.n2.n3.byref; break;
|
||||
case VT_EMPTY: sym_info->Value = 0; break;
|
||||
default:
|
||||
FIXME("Unsupported variant type (%u)\n", data->u.value.n1.n2.vt);
|
||||
|
|
Loading…
Reference in New Issue