- Implement KeQueryBasePriorityThread to return the actual Base Priority Increment (or Saturation Increment) to NtQueryInformationThread. The value win32 works with is actually (usually) the difference between process and thread Base Priorities.

This fixes another WINE test.

svn path=/trunk/; revision=17231
This commit is contained in:
Alex Ionescu 2005-08-09 06:23:16 +00:00
parent 4c12530bbc
commit c2a85cd273
3 changed files with 33 additions and 1 deletions

View file

@ -222,6 +222,10 @@ KeRundownThread(VOID);
NTSTATUS KeReleaseThread(PKTHREAD Thread);
LONG
STDCALL
KeQueryBasePriorityThread(IN PKTHREAD Thread);
VOID
STDCALL
KeStackAttachProcess (

View file

@ -1026,6 +1026,34 @@ KeSetSystemAffinityThread(IN KAFFINITY Affinity)
}
}
LONG
STDCALL
KeQueryBasePriorityThread(IN PKTHREAD Thread)
{
LONG BasePriorityIncrement;
KIRQL OldIrql;
PKPROCESS Process;
/* Lock the Dispatcher Database */
OldIrql = KeAcquireDispatcherDatabaseLock();
/* Get the Process */
Process = Thread->ApcStatePointer[0]->Process;
/* Calculate the BPI */
BasePriorityIncrement = Thread->BasePriority - Process->BasePriority;
/* If saturation occured, return the SI instead */
if (Thread->Saturation) BasePriorityIncrement = (HIGH_PRIORITY + 1) / 2 *
Thread->Saturation;
/* Release Lock */
KeReleaseDispatcherDatabaseLock(OldIrql);
/* Return Increment */
return BasePriorityIncrement;
}
/*
* @implemented
*/

View file

@ -1329,7 +1329,7 @@ NtQueryInformationThread (IN HANDLE ThreadHandle,
u.TBI.ClientId = Thread->Cid;
u.TBI.AffinityMask = Thread->Tcb.Affinity;
u.TBI.Priority = Thread->Tcb.Priority;
u.TBI.BasePriority = Thread->Tcb.BasePriority;
u.TBI.BasePriority = KeQueryBasePriorityThread(&Thread->Tcb);
break;
case ThreadTimes: