mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
- 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:
parent
4c12530bbc
commit
c2a85cd273
3 changed files with 33 additions and 1 deletions
|
@ -222,6 +222,10 @@ KeRundownThread(VOID);
|
|||
|
||||
NTSTATUS KeReleaseThread(PKTHREAD Thread);
|
||||
|
||||
LONG
|
||||
STDCALL
|
||||
KeQueryBasePriorityThread(IN PKTHREAD Thread);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
KeStackAttachProcess (
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue