mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 06:27:38 +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;
|
PVOID *ExpansionSlots;
|
||||||
PETHREAD ProcThread;
|
PETHREAD ProcThread;
|
||||||
ULONG Alignment;
|
ULONG Alignment;
|
||||||
|
BOOLEAN HasPrivilege;
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Check if we were called from user mode */
|
/* Check if we were called from user mode */
|
||||||
|
@ -2110,6 +2111,20 @@ NtSetInformationThread(IN HANDLE ThreadHandle,
|
||||||
break;
|
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 */
|
/* Reference the thread */
|
||||||
Status = ObReferenceObjectByHandle(ThreadHandle,
|
Status = ObReferenceObjectByHandle(ThreadHandle,
|
||||||
THREAD_SET_INFORMATION,
|
THREAD_SET_INFORMATION,
|
||||||
|
|
Loading…
Reference in a new issue