Rémi Bernon : dbghelp: Read process memory using target addresses, not debugger.

Alexandre Julliard julliard at winehq.org
Fri Dec 4 14:36:04 CST 2020


Module: wine
Branch: master
Commit: 8ec843e77b3b921a9b9be1397af6ba77b3ba797d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=8ec843e77b3b921a9b9be1397af6ba77b3ba797d

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Fri Dec  4 17:34:08 2020 +0100

dbghelp: Read process memory using target addresses, not debugger.

This fixes "wine winedbg --gdb winecfg" not working anymore.

There was a regression since f40195cd9206, but the environment read was
broken before.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dbghelp/dbghelp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c
index e38687412eb..00d7b61fbd8 100644
--- a/dlls/dbghelp/dbghelp.c
+++ b/dlls/dbghelp/dbghelp.c
@@ -311,8 +311,8 @@ static BOOL check_live_target(struct process* pcs)
     {
         PEB peb;
         if (!ReadProcessMemory(pcs->handle, pbi.PebBaseAddress, &peb, sizeof(peb), NULL)) return FALSE;
-        if (!ReadProcessMemory(pcs->handle, &peb.CloudFileFlags, &base, sizeof(base), NULL)) return FALSE;
-        ReadProcessMemory(pcs->handle, &peb.ProcessParameters->Environment, &env, sizeof(env), NULL);
+        if (!ReadProcessMemory(pcs->handle, (char *)pbi.PebBaseAddress + FIELD_OFFSET(PEB, CloudFileFlags), &base, sizeof(base), NULL)) return FALSE;
+        ReadProcessMemory(pcs->handle, (char *)peb.ProcessParameters + FIELD_OFFSET(RTL_USER_PROCESS_PARAMETERS, Environment), &env, sizeof(env), NULL);
     }
 
     /* read debuggee environment block */




More information about the wine-cvs mailing list