Alexandre Julliard : dbghelp: The main executable is now always named "wine ".

Alexandre Julliard julliard at winehq.org
Wed Mar 11 10:04:22 CDT 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Mar 10 18:22:43 2009 +0100

dbghelp: The main executable is now always named "wine".

---

 dlls/dbghelp/dbghelp_private.h |    3 +--
 dlls/dbghelp/elf_module.c      |    7 ++-----
 dlls/dbghelp/module.c          |   16 +++++-----------
 3 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h
index 0345a3f..132a6b9 100644
--- a/dlls/dbghelp/dbghelp_private.h
+++ b/dlls/dbghelp/dbghelp_private.h
@@ -431,8 +431,7 @@ extern DWORD WINAPI addr_to_linear(HANDLE hProcess, HANDLE hThread, ADDRESS* add
 /* module.c */
 extern const WCHAR      S_ElfW[];
 extern const WCHAR      S_WineLoaderW[];
-extern const WCHAR      S_WinePThreadW[];
-extern const WCHAR      S_WineKThreadW[];
+extern const WCHAR      S_WineW[];
 extern const WCHAR      S_SlashW[];
 
 extern struct module*
diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c
index 30b7a3c..820c972 100644
--- a/dlls/dbghelp/elf_module.c
+++ b/dlls/dbghelp/elf_module.c
@@ -1492,9 +1492,7 @@ static BOOL elf_search_loader(struct process* pcs, struct elf_info* elf_info)
     const char*         ptr;
 
     /* All binaries are loaded with WINELOADER (if run from tree) or by the
-     * main executable (either wine-kthread or wine-pthread)
-     * FIXME: the heuristic used to know whether we need to load wine-pthread
-     * or wine-kthread is not 100% safe
+     * main executable
      */
     if ((ptr = getenv("WINELOADER")))
     {
@@ -1504,8 +1502,7 @@ static BOOL elf_search_loader(struct process* pcs, struct elf_info* elf_info)
     }
     else
     {
-        ret = elf_search_and_load_file(pcs, S_WineKThreadW, 0, elf_info) ||
-            elf_search_and_load_file(pcs, S_WinePThreadW, 0, elf_info);
+        ret = elf_search_and_load_file(pcs, S_WineW, 0, elf_info);
     }
     return ret;
 }
diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c
index fcdea2e..a7af0f5 100644
--- a/dlls/dbghelp/module.c
+++ b/dlls/dbghelp/module.c
@@ -37,8 +37,7 @@ const WCHAR        S_WineLoaderW[]  = {'<','w','i','n','e','-','l','o','a','d','
 static const WCHAR S_DotSoW[]       = {'.','s','o','\0'};
 static const WCHAR S_DotPdbW[]      = {'.','p','d','b','\0'};
 static const WCHAR S_DotDbgW[]      = {'.','d','b','g','\0'};
-const WCHAR        S_WinePThreadW[] = {'w','i','n','e','-','p','t','h','r','e','a','d','\0'};
-const WCHAR        S_WineKThreadW[] = {'w','i','n','e','-','k','t','h','r','e','a','d','\0'};
+const WCHAR        S_WineW[]        = {'w','i','n','e',0};
 const WCHAR        S_SlashW[]       = {'/','\0'};
 
 static const WCHAR S_AcmW[] = {'.','a','c','m','\0'};
@@ -87,9 +86,7 @@ static void module_fill_module(const WCHAR* in, WCHAR* out, size_t size)
     out[len] = '\0';
     if (len > 4 && (l = match_ext(out, len)))
         out[len - l] = '\0';
-    else if (len > 12 &&
-             (!strcmpiW(out + len - 12, S_WinePThreadW) ||
-              !strcmpiW(out + len - 12, S_WineKThreadW)))
+    else if (len > 4 && !strcmpiW(out + len - 4, S_WineW))
         lstrcpynW(out, S_WineLoaderW, size);
     else
     {
@@ -428,13 +425,10 @@ enum module_type module_get_type_by_name(const WCHAR* name)
     if (len > 4 && !strncmpiW(name + len - 4, S_DotDbgW, 4))
         return DMT_DBG;
 
-    /* wine-[kp]thread is also an ELF module */
-    if (((len > 12 && name[len - 13] == '/') || len == 12) &&
-        (!strncmpiW(name + len - 12, S_WinePThreadW, 12) ||
-         !strncmpiW(name + len - 12, S_WineKThreadW, 12)))
-    {
+    /* wine is also an ELF module */
+    if (((len > 4 && name[len - 5] == '/') || len == 4) && !strcmpiW(name + len - 4, S_WineW))
         return DMT_ELF;
-    }
+
     return DMT_PE;
 }
 




More information about the wine-cvs mailing list