http://cvs.winehq.org/patch.py?id=19897 (shlfolder.c test)

Saulius Krasuckas saulius2 at ar.fi.lt
Sat Sep 3 12:16:30 CDT 2005


* On Sat, 3 Sep 2005, Saulius Krasuckas wrote:
> * On Sat, 3 Sep 2005, Paul Vriens wrote:
> > 
> > this change to shell32/tests/shlfolder.c fails on Win98/WinNT and 
> > W2KProf because ILFindLastID is not exported on those platforms.
> > 
> > I tried to change shlfolder.c to test for the export, but that shows 
> > that it's not exported on Wine either ? The .spec file says different.
> 
> I have made pretty trivial change and it worksforme.  See below.
> 
>  
> --- dlls/shell32/tests/shlfolder.c	29 Aug 2005 21:45:49 -0000	1.34
> +++ dlls/shell32/tests/shlfolder.c	3 Sep 2005 16:48:35 -0000
> @@ -46,6 +46,7 @@ static IMalloc *ppM;
>  static HRESULT (WINAPI *pSHBindToParent)(LPCITEMIDLIST, REFIID, LPVOID*, LPCITEMIDLIST*);
>  static BOOL (WINAPI *pSHGetSpecialFolderPathW)(HWND, LPWSTR, int, BOOL);
>  static HRESULT (WINAPI *pStrRetToBufW)(STRRET*,LPCITEMIDLIST,LPWSTR,UINT);
> +static LPITEMIDLIST (WINAPI *pILFindLastID)(LPCITEMIDLIST);
>  
>  static void init_function_pointers(void)
>  {
> @@ -57,6 +58,7 @@ static void init_function_pointers(void)
>      {
>          pSHBindToParent = (void*)GetProcAddress(hmod, "SHBindToParent");
>          pSHGetSpecialFolderPathW = (void*)GetProcAddress(hmod, "SHGetSpecialFolderPathW");
> +        pILFindLastID = (void *)GetProcAddress(hmod, "ILFindLastID");

Hehehe, now I see it dies by cathing exeption when ir tries to read 
0x00000000, though "make test" doesn't say this is an error.

Alexandre, is this intentional behaviour of an in-tree testing framework? 
(to treat crashes during "make test" as a success)

Paul, it seems you were right -- Wine doesn't export this by name.  I 
guess we need to copy in a more robust run-time linking code from the 
dlls/shell32/shellpath.c file and to access function by its number (16):

$ grep -C1 ILFindLast dlls/shell32/shell32.spec 
|  15 stdcall -noname ILGetDisplayName(ptr ptr)
|  16 stdcall -noname ILFindLastID(ptr)
|  17 stdcall -noname ILRemoveLastID(ptr)


I going to buy some food now.  If no one is going to send a patch during 
next 40 minutes, I will be ready to do this. :-)



More information about the wine-devel mailing list