[programs/winetest] Extend PATH if we have dll's that only come with .NET (Try2)
Paul Vriens
paul.vriens.wine at gmail.com
Wed Feb 25 05:09:12 CST 2009
Nicolas Le Cam wrote:
>>>> +
>>>> + /* We have a dll that cannot be found through
>>>> LoadLibraryExA.
>>>> This
>>>> + * is the case for .NET provided dll's. We will add the
>>>> directory
>>>> + * where the dll resides to the PATH variable when dealing
>>>> with
>>>> + * the tests for this dll.
>>>> + */
>>>> + GetModuleFileNameA(dll, dllpath, MAX_PATH);
>>>> + *strrchr(dllpath, '\\') = '\0';
>>>> + wine_tests[nr_of_files].maindllpath =
>>>> xmalloc(strlen(dllpath) +
>>>> 1);
>>>> + strcpy(wine_tests[nr_of_files].maindllpath, dllpath);
>>>> + }
>>> This won't work if test needs more than one dll found through
>>> LoadLibraryShim
>>>
>> Not sure what you mean as LoadLibraryShim will only return 1 dll.
>
> I mean if the test imports more than one dll that can only be found by
> LoadLibraryShim it will replace the first PATH you retrieved by the
> second one, and a message will be displayed for the first d. In my
> test I did something like that :
>
> else
> {
> char dllpath[MAX_PATH];
>
> /* We have a dll that cannot be found through LoadLibraryExA. This
> * is the case for .NET provided dll's. We will add the directory
> * where the dll resides to the PATH variable when dealing with
> * the tests for this dll.
> */
> GetModuleFileNameA(dll, dllpath, MAX_PATH);
> *strrchr(dllpath, '\\') = '\0';
> if (!wine_tests[nr_of_files].maindllpath)
> wine_tests[nr_of_files].maindllpath = strmake ( NULL,
> ";%s", dllpath);
> else
> {
> char *newpath = wine_tests[nr_of_files].maindllpath;
>
> wine_tests[nr_of_files].maindllpath = strmake ( NULL,
> "%s;%s", newpath, dllpath);
> free(newpath);
> }
> }
>
> and wine_tests[nr_of_files].maindllpath = NULL; wasn't set in extract_test_proc
>
I still don't get it.
The only dll that we try to load is the main dll. We don't care about all the
other imports.
--
Cheers,
Paul.
More information about the wine-devel
mailing list