mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Fix SetThreadPriority()
svn path=/trunk/; revision=4626
This commit is contained in:
parent
ad70cd4bbe
commit
340ee78475
1 changed files with 6 additions and 19 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: thread.c,v 1.38 2003/04/29 02:16:59 hyperion Exp $
|
||||
/* $Id: thread.c,v 1.39 2003/04/30 22:00:41 gvg Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -483,27 +483,14 @@ WINBOOL STDCALL
|
|||
SetThreadPriority(HANDLE hThread,
|
||||
int nPriority)
|
||||
{
|
||||
THREAD_BASIC_INFORMATION ThreadBasic;
|
||||
ULONG DataWritten;
|
||||
ULONG Prio = nPriority;
|
||||
NTSTATUS Status;
|
||||
|
||||
Status = NtQueryInformationThread(hThread,
|
||||
ThreadBasicInformation,
|
||||
&ThreadBasic,
|
||||
sizeof(THREAD_BASIC_INFORMATION),
|
||||
&DataWritten);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus(Status);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
ThreadBasic.BasePriority = nPriority;
|
||||
|
||||
Status = NtSetInformationThread(hThread,
|
||||
ThreadBasicInformation,
|
||||
&ThreadBasic,
|
||||
sizeof(THREAD_BASIC_INFORMATION));
|
||||
ThreadBasePriority,
|
||||
&Prio,
|
||||
sizeof(ULONG));
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus(Status);
|
||||
|
|
Loading…
Reference in a new issue