Commit df357055 authored by Alexandre Julliard's avatar Alexandre Julliard

Don't crash in DirectedYield16 if no other task is running.

parent 15344ee7
......@@ -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;
}
TRACE("%04x: DirectedYield(%04x)\n", pCurTask->hSelf, hTask );
pCurTask->hYieldTo = hTask;
OldYield16();
if (pCurTask->flags & TDBF_WIN32)
{
FIXME("called for Win32 thread (%04x)!\n", NtCurrentTeb()->teb_sel);
return;
}
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 );
}
}
/***********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment