[PATCH] winetest: Guess when to append the .dll extension.

Francois Gouget fgouget at codeweavers.com
Sun Mar 21 13:11:54 CDT 2021


WineTest derives the dll name from the test executable filename. However
the '.dll' extension is omitted in the executable filename. So if the
guessed library name does not already have a three-letter extension
(such as .ocx, .sys, etc.), assume it should have the '.dll' extension.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
This allows WineTest to retrieve the version information for 
windows.media.speech.dll.
This is pretty ugly but at least it's a simple patch. Plus three 
letters should be enough for any library extension ;-)
---
 programs/winetest/main.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index 225e9a2548b..6056dee2a75 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -901,7 +901,7 @@ extract_test_proc (HMODULE hModule, LPCSTR lpszType, LPSTR lpszName, LONG_PTR lP
     char filename[MAX_PATH];
     WCHAR dllnameW[MAX_PATH];
     HMODULE dll;
-    DWORD err;
+    DWORD err, len;
     HANDLE actctx;
     ULONG_PTR cookie;
     BOOL run;
@@ -912,6 +912,14 @@ extract_test_proc (HMODULE hModule, LPCSTR lpszType, LPSTR lpszName, LONG_PTR lP
     CharLowerA(lpszName);
     strcpy(dllname, lpszName);
     *strstr(dllname, testexe) = 0;
+    len = strlen(dllname);
+    if (len >= 4 && dllname[len - 4] != '.')
+    {
+        /* If there is not a 3 characters extension already,
+         * assume it should be .dll.
+         */
+        strcat(dllname, ".dll");
+    }
 
     if (test_filtered_out( lpszName, NULL ))
     {
-- 
2.20.1



More information about the wine-devel mailing list