Skip to content

Commit

Permalink
don't release the win16 lock in defwindowproc if yield_event exists (o…
Browse files Browse the repository at this point in the history
  • Loading branch information
cracyc authored Mar 7, 2023
1 parent 55c3e43 commit 6e224be
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions user/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -3207,7 +3207,9 @@ static LRESULT defwindow_proc_callback(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp
LRESULT *result, void *arg)
{
DWORD count;
ReleaseThunkLock(&count);
HANDLE yevent = kernel_get_thread_data()->yield_event;
if (!yevent)
ReleaseThunkLock(&count);
if (msg == WM_MOUSEWHEEL)
{
enum_scrollbar_data d = { 0 };
Expand All @@ -3218,12 +3220,14 @@ static LRESULT defwindow_proc_callback(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp
{
SendMessage16(HWND_16(hwnd), WM_VSCROLL, d.down ? SB_LINEDOWN : SB_LINEUP, MAKELONG(0, (WORD)HWND_16(d.hwnd)));
SendMessage16(HWND_16(hwnd), WM_VSCROLL, SB_ENDSCROLL, MAKELONG(0, (WORD)HWND_16(d.hwnd)));
RestoreThunkLock(count);
if (!yevent)
RestoreThunkLock(count);
return 0;
}
}
*result = DefWindowProcA(hwnd, msg, wp, lp);
RestoreThunkLock(count);
if (!yevent)
RestoreThunkLock(count);
return *result;
}
/***********************************************************************
Expand Down

0 comments on commit 6e224be

Please sign in to comment.