Commit d6096057 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

dbghelp: Rename internal field (system -> host).

parent 0c7a09cb
...@@ -378,7 +378,7 @@ static BOOL check_live_target(struct process* pcs, BOOL wow64, BOOL child_wow64) ...@@ -378,7 +378,7 @@ static BOOL check_live_target(struct process* pcs, BOOL wow64, BOOL child_wow64)
peb_addr += 0x1000; peb_addr += 0x1000;
if (!ReadProcessMemory(pcs->handle, peb_addr, &peb32, sizeof(peb32), NULL)) return FALSE; if (!ReadProcessMemory(pcs->handle, peb_addr, &peb32, sizeof(peb32), NULL)) return FALSE;
base = *(const DWORD*)((const char*)&peb32 + 0x460 /* CloudFileFlags */); base = *(const DWORD*)((const char*)&peb32 + 0x460 /* CloudFileFlags */);
pcs->is_system_64bit = FALSE; pcs->is_host_64bit = FALSE;
if (read_process_memory(pcs, peb32.ProcessParameters + 0x48, &env32, sizeof(env32))) env = env32; if (read_process_memory(pcs, peb32.ProcessParameters + 0x48, &env32, sizeof(env32))) env = env32;
} }
if (pcs->is_64bit || base == 0) if (pcs->is_64bit || base == 0)
...@@ -388,7 +388,7 @@ static BOOL check_live_target(struct process* pcs, BOOL wow64, BOOL child_wow64) ...@@ -388,7 +388,7 @@ static BOOL check_live_target(struct process* pcs, BOOL wow64, BOOL child_wow64)
if (!pcs->is_64bit) peb_addr -= 0x1000; /* PEB32 => PEB64 */ if (!pcs->is_64bit) peb_addr -= 0x1000; /* PEB32 => PEB64 */
if (!ReadProcessMemory(pcs->handle, peb_addr, &peb, sizeof(peb), NULL)) return FALSE; if (!ReadProcessMemory(pcs->handle, peb_addr, &peb, sizeof(peb), NULL)) return FALSE;
base = *(const DWORD64*)&peb.CloudFileFlags; base = *(const DWORD64*)&peb.CloudFileFlags;
pcs->is_system_64bit = TRUE; pcs->is_host_64bit = TRUE;
if (pcs->is_64bit) if (pcs->is_64bit)
ReadProcessMemory(pcs->handle, ReadProcessMemory(pcs->handle,
(char *)(ULONG_PTR)peb.ProcessParameters + FIELD_OFFSET(RTL_USER_PROCESS_PARAMETERS, Environment), (char *)(ULONG_PTR)peb.ProcessParameters + FIELD_OFFSET(RTL_USER_PROCESS_PARAMETERS, Environment),
......
...@@ -517,7 +517,7 @@ struct process ...@@ -517,7 +517,7 @@ struct process
void* buffer; void* buffer;
BOOL is_64bit; BOOL is_64bit;
BOOL is_system_64bit; BOOL is_host_64bit;
}; };
static inline BOOL read_process_memory(const struct process *process, UINT64 addr, void *buf, size_t size) static inline BOOL read_process_memory(const struct process *process, UINT64 addr, void *buf, size_t size)
......
...@@ -1345,7 +1345,7 @@ static BOOL elf_search_auxv(const struct process* pcs, unsigned type, ULONG_PTR* ...@@ -1345,7 +1345,7 @@ static BOOL elf_search_auxv(const struct process* pcs, unsigned type, ULONG_PTR*
{ {
char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME]; char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME];
SYMBOL_INFO*si = (SYMBOL_INFO*)buffer; SYMBOL_INFO*si = (SYMBOL_INFO*)buffer;
const unsigned ptr_size = pcs->is_system_64bit ? 8 : 4; const unsigned ptr_size = pcs->is_host_64bit ? 8 : 4;
UINT64 envp; UINT64 envp;
UINT64 addr; UINT64 addr;
UINT64 str; UINT64 str;
...@@ -1385,7 +1385,7 @@ static BOOL elf_search_auxv(const struct process* pcs, unsigned type, ULONG_PTR* ...@@ -1385,7 +1385,7 @@ static BOOL elf_search_auxv(const struct process* pcs, unsigned type, ULONG_PTR*
if (str) break; if (str) break;
} }
if (pcs->is_system_64bit) if (pcs->is_host_64bit)
{ {
struct struct
{ {
...@@ -1479,7 +1479,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs, ...@@ -1479,7 +1479,7 @@ static BOOL elf_enum_modules_internal(const struct process* pcs,
char bufstr[256]; char bufstr[256];
ULONG_PTR lm_addr; ULONG_PTR lm_addr;
if (pcs->is_system_64bit) if (pcs->is_host_64bit)
{ {
struct struct
{ {
......
...@@ -134,7 +134,7 @@ WCHAR *get_wine_loader_name(struct process *pcs) ...@@ -134,7 +134,7 @@ WCHAR *get_wine_loader_name(struct process *pcs)
unsigned len; unsigned len;
name = process_getenv(pcs, L"WINELOADER"); name = process_getenv(pcs, L"WINELOADER");
if (!name) name = pcs->is_system_64bit ? L"wine64" : L"wine"; if (!name) name = pcs->is_host_64bit ? L"wine64" : L"wine";
len = lstrlenW(name); len = lstrlenW(name);
/* WINELOADER isn't properly updated in Wow64 process calling inside Windows env block /* WINELOADER isn't properly updated in Wow64 process calling inside Windows env block
...@@ -145,14 +145,14 @@ WCHAR *get_wine_loader_name(struct process *pcs) ...@@ -145,14 +145,14 @@ WCHAR *get_wine_loader_name(struct process *pcs)
if (altname) if (altname)
{ {
memcpy(altname, name, len * sizeof(WCHAR)); memcpy(altname, name, len * sizeof(WCHAR));
if (pcs->is_system_64bit && len >= 2 && memcmp(name + len - 2, L"64", 2 * sizeof(WCHAR)) != 0) if (pcs->is_host_64bit && len >= 2 && memcmp(name + len - 2, L"64", 2 * sizeof(WCHAR)) != 0)
{ {
lstrcpyW(altname + len, L"64"); lstrcpyW(altname + len, L"64");
/* in multi-arch wow configuration, wine64 doesn't exist */ /* in multi-arch wow configuration, wine64 doesn't exist */
if (GetFileAttributesW(altname) == INVALID_FILE_ATTRIBUTES) if (GetFileAttributesW(altname) == INVALID_FILE_ATTRIBUTES)
altname[len] = L'\0'; altname[len] = L'\0';
} }
else if (!pcs->is_system_64bit && len >= 2 && !memcmp(name + len - 2, L"64", 2 * sizeof(WCHAR))) else if (!pcs->is_host_64bit && len >= 2 && !memcmp(name + len - 2, L"64", 2 * sizeof(WCHAR)))
altname[len - 2] = '\0'; altname[len - 2] = '\0';
else else
altname[len] = '\0'; altname[len] = '\0';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment