mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user