mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 21:44:31 +00:00
[NTOS:PS] Add the missing privilege check to NtSetInformationThread:ThreadPriority
This fixes the remaining failure in the NtSetInformationThread test.
This commit is contained in:
parent
4d7062abb6
commit
9fa31e0f9b
|
@ -2033,6 +2033,7 @@ NtSetInformationThread(IN HANDLE ThreadHandle,
|
|||
PVOID *ExpansionSlots;
|
||||
PETHREAD ProcThread;
|
||||
ULONG Alignment;
|
||||
BOOLEAN HasPrivilege;
|
||||
PAGED_CODE();
|
||||
|
||||
/* Check if we were called from user mode */
|
||||
|
@ -2110,6 +2111,20 @@ NtSetInformationThread(IN HANDLE ThreadHandle,
|
|||
break;
|
||||
}
|
||||
|
||||
/* Check for the required privilege */
|
||||
if (Priority >= LOW_REALTIME_PRIORITY)
|
||||
{
|
||||
HasPrivilege = SeCheckPrivilegedObject(SeIncreaseBasePriorityPrivilege,
|
||||
ThreadHandle,
|
||||
THREAD_SET_INFORMATION,
|
||||
PreviousMode);
|
||||
if (!HasPrivilege)
|
||||
{
|
||||
DPRINT1("Privilege to change priority to %lx lacking\n", Priority);
|
||||
return STATUS_PRIVILEGE_NOT_HELD;
|
||||
}
|
||||
}
|
||||
|
||||
/* Reference the thread */
|
||||
Status = ObReferenceObjectByHandle(ThreadHandle,
|
||||
THREAD_SET_INFORMATION,
|
||||
|
|
Loading…
Reference in a new issue