[PATCH] wdscore: Implement CurrentIP.

Mohamad Al-Jaf mohamadaljaf at gmail.com
Tue Jan 18 18:59:50 CST 2022


Hi,

> Does the compiler emit any warning?

No, no warnings.

> Remember that if it makes your life easier, you can directly define cur
> and ret of type char*.

Thanks, it does make it easier and more readable. Doing this causes no
warnings:

    char *cur;
    char *ret;

    cur = (char*)&test_CurrentIP;
    ret = (char*)CurrentIP();

> Well, I think you can just probably just declare it in the source,
> either in the test function or outside of it. There's some examples of
> that in existing tests, see e.g:

I see, thanks for the examples. I took a look at them and put this in
tests/main.c:

extern void *WINAPI CurrentIP(void);

Doing this, the 64-bit test compiles without a problem, but the 32-bit runs
into this problem:

/usr/lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld:
dlls/wdscore/tests/main.cross.o: in function `test_CurrentIP':
src/wine-staging-32-build/../wine-staging/dlls/wdscore/tests/main.c:33:
undefined reference to `CurrentIP at 0'
/usr/lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld:
/src/wine-staging-32-build/../wine-staging/dlls/wdscore/tests/main.c:33:
undefined reference to `CurrentIP at 0'
collect2: error: ld returned 1 exit status
winegcc: /usr/bin/i686-w64-mingw32-gcc failed
make[1]: *** [Makefile:228478: dlls/wdscore/tests/wdscore_test.exe] Error 2

Removing WINAPI from the declaration allows it to compile:

extern void *CurrentIP(void);

I don't understand why this is happening. What am I missing? The same error
happens if I add a header file and import it. The dll wlanapi also has a
void* function (void *WINAPI WlanAllocateMemory) and I don't see anything
that might be missing in wdscore. Is there a missing header? I tried adding
windows.h and other headers from similar dlls but it still says undefined
reference to CurrentIP. Why would it work on 64-bit but not 32-bit?

I had a similar problem in the past with
UiaRaiseAutomationPropertyChangedEvent but that was due to an incorrect
spec file parameter. As far as I know, the spec parameter should be empty
for 0 arguments and this is indeed how it is with other dlls:

./dlls/powrprof/powrprof.spec:2:@ stdcall CanUserWritePwrScheme ()
./dlls/user32/user32.spec:365:@ stdcall GetProgmanWindow ()
./dlls/ws2_32/ws2_32.spec:71:@ stdcall WSACreateEvent ()

Sorry for all the questions, I hope I'm not annoying anyone.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20220118/bfbed0a6/attachment.htm>


More information about the wine-devel mailing list