[PATCH] [TaskMngr]: let the debug channels work again

Eric Pouech eric.pouech at wanadoo.fr
Sat Apr 7 03:47:46 CDT 2007


- while I was at it, simplified the symbol lookup for the debug options

A+
---

 programs/taskmgr/dbgchnl.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/programs/taskmgr/dbgchnl.c b/programs/taskmgr/dbgchnl.c
index 9671469..1102606 100644
--- a/programs/taskmgr/dbgchnl.c
+++ b/programs/taskmgr/dbgchnl.c
@@ -157,22 +157,22 @@ static int change_channel_CB(HANDLE hPro
     return 1;
 }
 
-static void* get_symbol(HANDLE hProcess, const char* name, const char* lib)
+static void* get_symbol(HANDLE hProcess, const char* name)
 {
     char                buffer[sizeof(IMAGEHLP_SYMBOL) + 256];
     SYMBOL_INFO*        si = (SYMBOL_INFO*)buffer;
     void*               ret = NULL;
 
-    pSymSetOptions(SYMOPT_DEFERRED_LOADS | SYMOPT_PUBLICS_ONLY);
-    /* FIXME: the TRUE option is due to the face that dbghelp requires it
+    /* also ask for wine extensions (loading symbols from ELF files) */
+    pSymSetOptions(SYMOPT_DEFERRED_LOADS | SYMOPT_PUBLICS_ONLY | 0x40000000);
+    /* FIXME: the TRUE option is due to the fact that dbghelp requires it
      * when loading an ELF module
      */
     if (pSymInitialize(hProcess, NULL, TRUE))
     {
         si->SizeOfStruct = sizeof(*si);
         si->MaxNameLen = sizeof(buffer) - sizeof(IMAGEHLP_SYMBOL);
-        if (pSymLoadModule(hProcess, NULL, lib, NULL, 0, 0) &&
-            pSymFromName(hProcess, name, si))
+        if (pSymFromName(hProcess, name, si))
             ret = (void*)(ULONG_PTR)si->Address;
         pSymCleanup(hProcess);
     }
@@ -193,7 +193,7 @@ static int enum_channel(HANDLE hProcess,
     int                         ret = 1;
     void*                       addr;
 
-    if (!(addr = get_symbol(hProcess, "debug_options", "libwine.so"))) return -1;
+    if (!(addr = get_symbol(hProcess, "libwine.so.1!debug_options"))) return -1;
 
     while (ret && addr && ReadProcessMemory(hProcess, addr, &channel, sizeof(channel), NULL))
     {



More information about the wine-patches mailing list