- 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.
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
Modified: trunk/reactos/ntoskrnl/ke/kthread.c
Modified: trunk/reactos/ntoskrnl/ps/query.c
_____
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
--- trunk/reactos/ntoskrnl/include/internal/ke.h 2005-08-09
05:54:57 UTC (rev 17230)
+++ trunk/reactos/ntoskrnl/include/internal/ke.h 2005-08-09
06:23:16 UTC (rev 17231)
@@ -222,6 +222,10 @@
NTSTATUS KeReleaseThread(PKTHREAD Thread);
+LONG
+STDCALL
+KeQueryBasePriorityThread(IN PKTHREAD Thread);
+
VOID
STDCALL
KeStackAttachProcess (
_____
Modified: trunk/reactos/ntoskrnl/ke/kthread.c
--- trunk/reactos/ntoskrnl/ke/kthread.c 2005-08-09 05:54:57 UTC (rev
17230)
+++ trunk/reactos/ntoskrnl/ke/kthread.c 2005-08-09 06:23:16 UTC (rev
17231)
@@ -1026,6 +1026,34 @@
}
}
+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
*/
_____
Modified: trunk/reactos/ntoskrnl/ps/query.c
--- trunk/reactos/ntoskrnl/ps/query.c 2005-08-09 05:54:57 UTC (rev
17230)
+++ trunk/reactos/ntoskrnl/ps/query.c 2005-08-09 06:23:16 UTC (rev
17231)
@@ -1329,7 +1329,7 @@
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:
Show replies by date