Allow passing task handles to GetThreadQueue() and SetFastQueue().

This commit is contained in:
Ulrich Weigand 1999-01-20 13:35:34 +00:00 committed by Alexandre Julliard
parent 0be24af74d
commit 901ca36b19

View file

@ -1244,7 +1244,14 @@ HQUEUE16 WINAPI SetThreadQueue( DWORD thread, HQUEUE16 hQueue )
*/
HQUEUE16 WINAPI GetThreadQueue( DWORD thread )
{
THDB *thdb = thread? THREAD_IdToTHDB( thread ) : THREAD_Current();
THDB *thdb = NULL;
if ( !thread )
thdb = THREAD_Current();
else if ( HIWORD(thread) )
thdb = THREAD_IdToTHDB( thread );
else if ( IsTask( (HTASK16)thread ) )
thdb = ((TDB *)GlobalLock16( (HANDLE16)thread ))->thdb;
return (HQUEUE16)(thdb? thdb->teb.queue : 0);
}
@ -1253,7 +1260,14 @@ HQUEUE16 WINAPI GetThreadQueue( DWORD thread )
*/
VOID WINAPI SetFastQueue( DWORD thread, HANDLE32 hQueue )
{
THDB *thdb = thread? THREAD_IdToTHDB( thread ) : THREAD_Current();
THDB *thdb = NULL;
if ( !thread )
thdb = THREAD_Current();
else if ( HIWORD(thread) )
thdb = THREAD_IdToTHDB( thread );
else if ( IsTask( (HTASK16)thread ) )
thdb = ((TDB *)GlobalLock16( (HANDLE16)thread ))->thdb;
if ( thdb ) thdb->teb.queue = (HQUEUE16) hQueue;
}