Skip to content

Commit

Permalink
Merge pull request #1310 from cracyc/taskswitch
Browse files Browse the repository at this point in the history
post a message in taskswitch to wake task if needed, don't yield in d…
  • Loading branch information
otya128 authored Aug 7, 2023
2 parents beec22f + b2e6931 commit e9e8773
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
24 changes: 12 additions & 12 deletions gdi/gdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3476,19 +3476,12 @@ BOOL16 WINAPI GetRasterizerCaps16( LPRASTERIZER_STATUS lprs, UINT16 cbNumBytes )
INT16 WINAPI EnumFontFamilies16( HDC16 hDC, LPCSTR lpFamily,
FONTENUMPROC16 efproc, LPARAM lpData )
{
LOGFONT16 lf, *plf;

if (lpFamily)
{
if (!*lpFamily) return 1;
lstrcpynA( lf.lfFaceName, lpFamily, LF_FACESIZE );
lf.lfCharSet = DEFAULT_CHARSET;
lf.lfPitchAndFamily = 0;
plf = &lf;
}
else plf = NULL;
struct callback16_info info;

return EnumFontFamiliesEx16( hDC, plf, efproc, lpData, 0 );
info.proc = (FARPROC16)efproc;
info.param = lpData;
info.result = 1;
return EnumFontFamiliesA(HDC_32(hDC), lpFamily, enum_font_callback, (LPARAM)&info);
}


Expand Down Expand Up @@ -5296,3 +5289,10 @@ BOOL WINAPI DllEntryPoint(DWORD fdwReason, HINSTANCE hinstDLL, WORD ds,
}
return TRUE;
}

HFONT16 WINAPI GetSystemIconFont16()
{
// only known to be used by Simplified Chinese progman
// uses SPI_GETICONTITLELOGFONT if this returns 0
return 0;
}
3 changes: 2 additions & 1 deletion gdi/gdi.exe16.spec
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@
106 pascal SetBitmapBits(word long ptr) SetBitmapBits16
# ??? (not even in W1.1)
117 pascal SetDCOrg(word s_word s_word) SetDCOrg16
118 stub InternalCreateDC # W1.1, W2.0
# 118 stub InternalCreateDC # W1.1, W2.0
118 pascal -ret16 GetSystemIconFont() GetSystemIconFont16
119 pascal -ret16 AddFontResource(str) AddFontResource16
120 stub GetContinuingTextExtent # W1.1, W2.0
121 pascal -ret16 Death(word) Death16
Expand Down
1 change: 1 addition & 0 deletions krnl386/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@ BOOL WINAPI TaskSwitch16(HTASK16 htask, SEGPTR dwNewCSIP)
BOOL s = TaskSetCSIP16(htask, SELECTOROF(dwNewCSIP), OFFSETOF(dwNewCSIP));
if (s)
{
PostThreadMessageA(HTASK_32(htask), 0, 0, 0);
DirectedYield16(htask);
}
return s;
Expand Down
9 changes: 6 additions & 3 deletions user/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#include "wine/winuser16.h"
#include "wownt32.h"
#include "user_private.h"
#include "wine/server.h"
#include "wine/debug.h"
#include "wine/exception.h"
#include "../krnl386/kernel16_private.h"

WINE_DEFAULT_DEBUG_CHANNEL(win);

Expand Down Expand Up @@ -2970,11 +2970,14 @@ HWND16 WINAPI FindWindowEx16( HWND16 parent, HWND16 child, LPCSTR className, LPC
LRESULT def_frame_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 (hwnd == (HWND)arg)
arg = NULL;
*result = DefFrameProcA(hwnd, (HWND)arg, msg, wp, lp);
RestoreThunkLock(count);
if (!yevent)
RestoreThunkLock(count);
return *result;
}
/***********************************************************************
Expand Down

0 comments on commit e9e8773

Please sign in to comment.