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

Zebediah Figura (she/her) zfigura at codeweavers.com
Sun Mar 21 14:12:23 CDT 2021


On 3/21/21 1:11 PM, Francois Gouget wrote:
> 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(-)
> 

I don't know if any WinRT DLLs end in a three-letter word, but it seems 
not implausible...

Wouldn't it be more consistent and easier just to name the directory 
"windows.media.speech.dll", and the test 
"windows.media.speech.dll_test.exe", and then the rule everywhere 
becomes "if there's no dot in the name already, append .dll or .exe"?

> 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 ))
>       {
> 



More information about the wine-devel mailing list