On Saturday 02 August 2025 21:29:19 LIU Hao wrote:
> 在 2025-8-2 19:01, LIU Hao 写道:
> > What do these functions do? They are not exported from modern
> > kernel32.dll, so programs that attempt to call such functions will fail
> > to start.
> For example, this function is disassembled from Kernel32.dll from Windows 98 
> SE:
> 
>    bff9347b <Callback20>:
>    bff9347b: 5a                            pop     edx
>    bff9347c: 87 54 24 10                   xchg    dword ptr [esp + 0x10], edx
>    bff93480: 68 87 34 f9 bf                push    0xbff93487
>    bff93485: ff e2                         jmp     edx
>    bff93487: c3                            ret
> 
> 
> Therefore a function call in the form `Callback(1, 2, 3, 4, target)` will be
> redirected to `target(1, 2, 3, 4)`, where both use `__stdcall` convention.

Older WinSDK have thunk32.lib import library which imports them from
kernel32.dll. Seems that those functions from 32-bit kernel32.dll
library are used for calling 16-bit windows libraries. Part of older
WinSDK is some MS compiler tool which generates assembly source code
which calls those functions.

So those functions are either called by autogenerated code by MS tools,
or possibly also by inline asm code in C source files.

I send this change for a completeness to enable import symbols which are
available in older WinSDK.


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to