Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56260
-- v8: mmsystem: Simulate a hardware interrupt in MMSYSTDRV_Callback3216. krnl386: Add a WOWCallback16Ex flag to simulate a hardware interrupt.
From: Alex Henrie alexhenrie24@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56260 --- dlls/krnl386.exe16/wowthunk.c | 8 ++++---- include/wownt32.h | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/krnl386.exe16/wowthunk.c b/dlls/krnl386.exe16/wowthunk.c index b729c38e8f1..6962e041fc8 100644 --- a/dlls/krnl386.exe16/wowthunk.c +++ b/dlls/krnl386.exe16/wowthunk.c @@ -460,9 +460,9 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags, *((SEGPTR *)stack) = call16_ret_addr; cbArgs += sizeof(SEGPTR);
- _EnterWin16Lock(); + if (!(dwFlags & WCB16_INTERRUPT)) _EnterWin16Lock(); wine_call_to_16_regs( context, cbArgs, call16_handler ); - _LeaveWin16Lock(); + if (!(dwFlags & WCB16_INTERRUPT)) _LeaveWin16Lock();
if (TRACE_ON(relay)) { @@ -500,10 +500,10 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags, * the callee to do so; after the routine has returned, the 16-bit * stack pointer is always reset to the position it had before. */ - _EnterWin16Lock(); + if (!(dwFlags & WCB16_INTERRUPT)) _EnterWin16Lock(); ret = wine_call_to_16( (FARPROC16)vpfn16, cbArgs, call16_handler ); if (pdwRetCode) *pdwRetCode = ret; - _LeaveWin16Lock(); + if (!(dwFlags & WCB16_INTERRUPT)) _LeaveWin16Lock();
if (TRACE_ON(relay)) { diff --git a/include/wownt32.h b/include/wownt32.h index 0afe23d360a..b95dce97171 100644 --- a/include/wownt32.h +++ b/include/wownt32.h @@ -149,6 +149,9 @@ WORD WINAPI WOWHandle16(HANDLE,WOW_HANDLE_TYPE);
/* Wine extensions: call register function, context ptr is passed in the return value LPDWORD */ #define WCB16_REGS 2 +/* Wine extension: simulate a hardware interrupt by running the callback without waiting for the + * current task to yield */ +#define WCB16_INTERRUPT 4
DWORD WINAPI WOWCallback16(DWORD,DWORD); BOOL WINAPI WOWCallback16Ex(DWORD,DWORD,DWORD,LPVOID,LPDWORD);
From: Alex Henrie alexhenrie24@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56260 --- dlls/mmsystem.dll16/message16.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/mmsystem.dll16/message16.c b/dlls/mmsystem.dll16/message16.c index b12b9b94327..f201b807c3f 100644 --- a/dlls/mmsystem.dll16/message16.c +++ b/dlls/mmsystem.dll16/message16.c @@ -838,7 +838,7 @@ static LRESULT CALLBACK MMSYSTDRV_Callback3216(struct mmsystdrv_thunk* thunk, HD args[2] = LOWORD(dwParam1); args[1] = HIWORD(dwParam2); args[0] = LOWORD(dwParam2); - return WOWCallback16Ex(thunk->callback, WCB16_PASCAL, sizeof(args), args, NULL); + return WOWCallback16Ex(thunk->callback, WCB16_PASCAL | WCB16_INTERRUPT, sizeof(args), args, NULL); case CALLBACK_EVENT: TRACE("Event(%08lx) !\n", thunk->callback); SetEvent((HANDLE)thunk->callback);
On Thu Feb 20 04:41:23 2025 +0000, Alexandre Julliard wrote:
Please don't add Wine-specific exports. You could simply pass a new flag to WOWCallback16Ex.
Thanks for the suggestion. I didn't realize that there was precedent for Wine-specific WOWCallback16Ex flags, but now I see that `WCB16_REGS` is also a Wine extension.