Skip to content

Commit e9e8773

Browse files
authored
Merge pull request #1310 from cracyc/taskswitch
post a message in taskswitch to wake task if needed, don't yield in d…
2 parents beec22f + b2e6931 commit e9e8773

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

gdi/gdi.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3476,19 +3476,12 @@ BOOL16 WINAPI GetRasterizerCaps16( LPRASTERIZER_STATUS lprs, UINT16 cbNumBytes )
34763476
INT16 WINAPI EnumFontFamilies16( HDC16 hDC, LPCSTR lpFamily,
34773477
FONTENUMPROC16 efproc, LPARAM lpData )
34783478
{
3479-
LOGFONT16 lf, *plf;
3480-
3481-
if (lpFamily)
3482-
{
3483-
if (!*lpFamily) return 1;
3484-
lstrcpynA( lf.lfFaceName, lpFamily, LF_FACESIZE );
3485-
lf.lfCharSet = DEFAULT_CHARSET;
3486-
lf.lfPitchAndFamily = 0;
3487-
plf = &lf;
3488-
}
3489-
else plf = NULL;
3479+
struct callback16_info info;
34903480

3491-
return EnumFontFamiliesEx16( hDC, plf, efproc, lpData, 0 );
3481+
info.proc = (FARPROC16)efproc;
3482+
info.param = lpData;
3483+
info.result = 1;
3484+
return EnumFontFamiliesA(HDC_32(hDC), lpFamily, enum_font_callback, (LPARAM)&info);
34923485
}
34933486

34943487

@@ -5296,3 +5289,10 @@ BOOL WINAPI DllEntryPoint(DWORD fdwReason, HINSTANCE hinstDLL, WORD ds,
52965289
}
52975290
return TRUE;
52985291
}
5292+
5293+
HFONT16 WINAPI GetSystemIconFont16()
5294+
{
5295+
// only known to be used by Simplified Chinese progman
5296+
// uses SPI_GETICONTITLELOGFONT if this returns 0
5297+
return 0;
5298+
}

gdi/gdi.exe16.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@
106106
106 pascal SetBitmapBits(word long ptr) SetBitmapBits16
107107
# ??? (not even in W1.1)
108108
117 pascal SetDCOrg(word s_word s_word) SetDCOrg16
109-
118 stub InternalCreateDC # W1.1, W2.0
109+
# 118 stub InternalCreateDC # W1.1, W2.0
110+
118 pascal -ret16 GetSystemIconFont() GetSystemIconFont16
110111
119 pascal -ret16 AddFontResource(str) AddFontResource16
111112
120 stub GetContinuingTextExtent # W1.1, W2.0
112113
121 pascal -ret16 Death(word) Death16

krnl386/kernel.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,7 @@ BOOL WINAPI TaskSwitch16(HTASK16 htask, SEGPTR dwNewCSIP)
11731173
BOOL s = TaskSetCSIP16(htask, SELECTOROF(dwNewCSIP), OFFSETOF(dwNewCSIP));
11741174
if (s)
11751175
{
1176+
PostThreadMessageA(HTASK_32(htask), 0, 0, 0);
11761177
DirectedYield16(htask);
11771178
}
11781179
return s;

user/window.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
#include "wine/winuser16.h"
2222
#include "wownt32.h"
2323
#include "user_private.h"
24-
#include "wine/server.h"
2524
#include "wine/debug.h"
2625
#include "wine/exception.h"
26+
#include "../krnl386/kernel16_private.h"
2727

2828
WINE_DEFAULT_DEBUG_CHANNEL(win);
2929

@@ -2970,11 +2970,14 @@ HWND16 WINAPI FindWindowEx16( HWND16 parent, HWND16 child, LPCSTR className, LPC
29702970
LRESULT def_frame_proc_callback(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, LRESULT *result, void *arg)
29712971
{
29722972
DWORD count;
2973-
ReleaseThunkLock(&count);
2973+
HANDLE yevent = kernel_get_thread_data()->yield_event;
2974+
if (!yevent)
2975+
ReleaseThunkLock(&count);
29742976
if (hwnd == (HWND)arg)
29752977
arg = NULL;
29762978
*result = DefFrameProcA(hwnd, (HWND)arg, msg, wp, lp);
2977-
RestoreThunkLock(count);
2979+
if (!yevent)
2980+
RestoreThunkLock(count);
29782981
return *result;
29792982
}
29802983
/***********************************************************************

0 commit comments

Comments
 (0)