mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +00:00
Fix SetThreadPriority()
svn path=/trunk/; revision=4626
This commit is contained in:
parent
ad70cd4bbe
commit
340ee78475
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -483,27 +483,14 @@ WINBOOL STDCALL
|
||||||
SetThreadPriority(HANDLE hThread,
|
SetThreadPriority(HANDLE hThread,
|
||||||
int nPriority)
|
int nPriority)
|
||||||
{
|
{
|
||||||
THREAD_BASIC_INFORMATION ThreadBasic;
|
ULONG Prio = nPriority;
|
||||||
ULONG DataWritten;
|
|
||||||
NTSTATUS Status;
|
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,
|
Status = NtSetInformationThread(hThread,
|
||||||
ThreadBasicInformation,
|
ThreadBasePriority,
|
||||||
&ThreadBasic,
|
&Prio,
|
||||||
sizeof(THREAD_BASIC_INFORMATION));
|
sizeof(ULONG));
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastErrorByStatus(Status);
|
SetLastErrorByStatus(Status);
|
||||||
|
|
Loading…
Reference in a new issue