<div dir="ltr"><div dir="ltr"><div>Hi,</div><div><br></div><div>> Does the compiler emit any warning?</div><div><br></div><div>No, no warnings.</div><div><br></div><div>> Remember that if it makes your life easier, you can directly define cur</div>> and ret of type char*.</div><div dir="ltr"><br></div><div>Thanks, it does make it easier and more readable. Doing this causes no warnings:</div><div><br></div><div>    char *cur;<br>    char *ret;<br><br>    cur = (char*)&test_CurrentIP;<br>    ret = (char*)CurrentIP();<br></div><div><br></div><div>> Well, I think you can just probably just declare it in the source,</div>> either in the test function or outside of it. There's some examples of<br>> that in existing tests, see e.g:<div><br></div><div>I see, thanks for the examples. I took a look at them and put this in tests/main.c:</div><div><br></div><div>extern void *WINAPI CurrentIP(void);</div><div><br></div><div>Doing this, the 64-bit test compiles without a problem, but the 32-bit runs into this problem:<br><div><br></div><div>/usr/lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld: dlls/wdscore/tests/main.cross.o: in function `test_CurrentIP':<br>src/wine-staging-32-build/../wine-staging/dlls/wdscore/tests/main.c:33: undefined reference to `CurrentIP@0'<br>/usr/lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld: <br>/src/wine-staging-32-build/../wine-staging/dlls/wdscore/tests/main.c:33: undefined reference to `CurrentIP@0'<br>collect2: error: ld returned 1 exit status<br>winegcc: /usr/bin/i686-w64-mingw32-gcc failed<br>make[1]: *** [Makefile:228478: dlls/wdscore/tests/wdscore_test.exe] Error 2<br></div><div><br></div><div>Removing WINAPI from the declaration allows it to compile:</div><div><br></div><div>extern void *CurrentIP(void);<br></div><div><br></div><div>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?</div><div><br></div><div>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:</div><div><br></div><div>./dlls/powrprof/powrprof.spec:2:@ stdcall CanUserWritePwrScheme ()<br>./dlls/user32/user32.spec:365:@ stdcall GetProgmanWindow ()<br>./dlls/ws2_32/ws2_32.spec:71:@ stdcall WSACreateEvent ()<br></div><div><br></div><div>Sorry for all the questions, I hope I'm not annoying anyone.</div>
</div></div>