[PATCH] wdscore: Implement CurrentIP.

Stefan Dösinger stefandoesinger at gmail.com
Fri Jan 21 03:11:01 CST 2022



> Am 21.01.2022 um 11:47 schrieb Giovanni Mascellani <gmascellani at codeweavers.com>:
> 
> Hi,
> 
> Il 21/01/22 05:32, Jinoh Kang ha scritto:
>> "CurrentIP at 0" is a mangled symbol. The "@0" suffix means "this function follows the
>> __stdcall calling convention, and it accepts 0 bytes of arguments."
>> However, export symbols are usually exported as unmangled names. Try:
>>   DECLSPEC_IMPORT extern void *WINAPI CurrentIP(void);
> 
> Trying this on top of Mohamad's v3 patch doesn't fix the problem:

You can always resolve it manually it with GetProcAddress. Afaiu that's preferred anyway, especially for undocumented functions. A quick grep over the Wine code finds only one case of a WINAPI extern void thing in a test:

stefan at retina wine % grep -r "extern " . | grep tests | grep WINAPI
./dlls/imagehlp/tests/testdll.c:extern DWORD WINAPI StrCmpCA(const char *, const char *);

And looking at the file, StrCmpCA isn't used at all in this file, so this line is dead code - unless there is some PE file inspection magic I missed with my (terrible) grep-foo.

If you import things via the import library (wdscore.lib, if it exists), it connects the decorated import to the undecorated export: https://stackoverflow.com/questions/38710243/dll-using-stdcall-without-name-decoration-why-does-it-even-work/38711640

Afaiu linking at build time to a .dll without a .lib is a gcc/mingw-ism anyway. Visual Studio wouldn't allow you to do that. You either need a .lib file or use LoadLibrary + GetProcAddress. Wine doesn't build a libwdscore.a and I can't find a wdscore.lib in my Visual Studio installation.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20220121/b2668120/attachment.sig>


More information about the wine-devel mailing list