https://bugs.winehq.org/show_bug.cgi?id=48480
Bug ID: 48480 Summary: dlls/krnl386.exe16 - thunk.c argument logic incorrect for CallProcEx32W16 Product: Wine Version: 5.0-rc6 Hardware: x86 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: dirk.niggemann@gmail.com
CallProcEx32W16 takes a 'nrofargs' argument which may have the hight bit set by the caller (CPEX_DEST_CDECL). Internally the function processes nrofargs in a for loop but does not clear the high bit before looping.
This line (2475):
for (i=0;i<nrofargs;i++)
This needs to be changed to support correct argument counting to:
for (i=0;i<(nrofargs & ~CPEX_DEST_CDECL);i++)
Otherwise this routine crashes when called with CPEX_DEST_CDECL set.