From df357055e296b8252c279bba325e4f26c1254481 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 13 Dec 2002 00:39:17 +0000 Subject: [PATCH] Don't crash in DirectedYield16 if no other task is running. --- loader/task.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/loader/task.c b/loader/task.c index bd4d5738cef..4316614d509 100644 --- a/loader/task.c +++ b/loader/task.c @@ -720,18 +720,20 @@ void WINAPI DirectedYield16( HTASK16 hTask ) { TDB *pCurTask = TASK_GetCurrent(); - if (pCurTask->flags & TDBF_WIN32) + if (!pCurTask) OldYield16(); + else { - FIXME("called for Win32 thread (%04x)!\n", NtCurrentTeb()->teb_sel); - return; + if (pCurTask->flags & TDBF_WIN32) + { + FIXME("called for Win32 thread (%04x)!\n", NtCurrentTeb()->teb_sel); + return; + } + + TRACE("%04x: DirectedYield(%04x)\n", pCurTask->hSelf, hTask ); + pCurTask->hYieldTo = hTask; + OldYield16(); + TRACE("%04x: back from DirectedYield(%04x)\n", pCurTask->hSelf, hTask ); } - - TRACE("%04x: DirectedYield(%04x)\n", pCurTask->hSelf, hTask ); - - pCurTask->hYieldTo = hTask; - OldYield16(); - - TRACE("%04x: back from DirectedYield(%04x)\n", pCurTask->hSelf, hTask ); } /***********************************************************************