Eric Pouech : dbghelp: Rewrite SymGetModuleBase so that it relies on 64 bit version.

Alexandre Julliard julliard at winehq.org
Mon Mar 29 09:57:49 CDT 2010


Module: wine
Branch: master
Commit: 0c2401369c20ebe7e69cc3c9f1ff419ee249a3e4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0c2401369c20ebe7e69cc3c9f1ff419ee249a3e4

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Sat Mar 27 09:09:02 2010 +0100

dbghelp: Rewrite SymGetModuleBase so that it relies on 64 bit version.

---

 dlls/dbghelp/module.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c
index eadc67a..8f12fef 100644
--- a/dlls/dbghelp/module.c
+++ b/dlls/dbghelp/module.c
@@ -1034,13 +1034,10 @@ BOOL  WINAPI SymGetModuleInfoW64(HANDLE hProcess, DWORD64 dwAddr,
  */
 DWORD WINAPI SymGetModuleBase(HANDLE hProcess, DWORD dwAddr)
 {
-    struct process*     pcs = process_find_by_handle(hProcess);
-    struct module*      module;
+    DWORD64     ret;
 
-    if (!pcs) return 0;
-    module = module_find_by_addr(pcs, dwAddr, DMT_UNKNOWN);
-    if (!module) return 0;
-    return module->module.BaseOfImage;
+    ret = SymGetModuleBase64(hProcess, dwAddr);
+    return validate_addr64(ret) ? ret : 0;
 }
 
 /***********************************************************************
@@ -1048,8 +1045,13 @@ DWORD WINAPI SymGetModuleBase(HANDLE hProcess, DWORD dwAddr)
  */
 DWORD64 WINAPI SymGetModuleBase64(HANDLE hProcess, DWORD64 dwAddr)
 {
-    if (!validate_addr64(dwAddr)) return 0;
-    return SymGetModuleBase(hProcess, (DWORD)dwAddr);
+    struct process*     pcs = process_find_by_handle(hProcess);
+    struct module*      module;
+
+    if (!pcs) return 0;
+    module = module_find_by_addr(pcs, dwAddr, DMT_UNKNOWN);
+    if (!module) return 0;
+    return module->module.BaseOfImage;
 }
 
 /******************************************************************




More information about the wine-cvs mailing list