On Fri Aug 5 17:36:23 2022 +0000, Tobias G��rgens wrote:
OK, I have two questions about that, probably both dumb, but well, I want to get smarter: a) I used IMPORTS instead of IMPORTLIB; what's the difference? It still seems to work b) what is the "-import" flag then used for in spec files? e.g. the "version" module uses it, I just copied it thinking it was the right way to do it :D Anyway, it also compiles for me without, so I'll remove it
Right, I misspoke. Using IMPORTS is the right thing to do, IMPORTLIB is a name of import library. The "-import" flag means a different thing. For example in kernel32.spec there is `@ stdcall -import ActivateActCtx(ptr ptr)`, this line means that kernel32 will have an export called "ActivateActCtx", but its actual implementation is elsewhere (in this case it's in kernelbase). `-import` will create an actual stub function in kernel32, that would immediately call real one from kernelbase. This is different from forwarding that's also used in some modules. Forwarding syntax would be `@ stdcall ActivateActCtx(ptr ptr) kernelbase.ActivateActCtx`, and won't create an actual function in kernel32, so GetProcAddress(kernel32, ...) == GetProcAddress(kernelbase, ...). With `-import` GetProcAddress() will return different addresses.