mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 10:33:48 +00:00
implemented SetProcessPriorityBoost() and GetProcessPriorityBoost() (only the kernel32 part)
svn path=/trunk/; revision=10731
This commit is contained in:
parent
001b020926
commit
bc95cf8c84
2 changed files with 54 additions and 30 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: stubs.c,v 1.81 2004/07/30 19:18:39 jimtabor Exp $
|
||||
/* $Id: stubs.c,v 1.82 2004/08/29 14:45:55 weiden Exp $
|
||||
*
|
||||
* KERNEL32.DLL stubs (unimplemented functions)
|
||||
* Remove from this file, if you implement them.
|
||||
|
@ -873,20 +873,6 @@ GetProcessHandleCount(
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
GetProcessPriorityBoost(
|
||||
HANDLE hProcess,
|
||||
PBOOL pDisablePriorityBoost
|
||||
)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
@ -1298,20 +1284,6 @@ SetMessageWaitingIndicator(
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
SetProcessPriorityBoost(
|
||||
HANDLE hProcess,
|
||||
BOOL bDisablePriorityBoost
|
||||
)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: proc.c,v 1.63 2004/07/02 12:18:04 gvg Exp $
|
||||
/* $Id: proc.c,v 1.64 2004/08/29 14:46:02 weiden Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -868,4 +868,56 @@ GetProcessIoCounters(
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
GetProcessPriorityBoost(HANDLE hProcess,
|
||||
PBOOL pDisablePriorityBoost)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
BOOL PriorityBoost;
|
||||
|
||||
Status = NtQueryInformationProcess(hProcess,
|
||||
ProcessPriorityBoost,
|
||||
&PriorityBoost,
|
||||
sizeof(BOOL),
|
||||
NULL);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
*pDisablePriorityBoost = PriorityBoost;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
SetLastErrorByStatus(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
SetProcessPriorityBoost(HANDLE hProcess,
|
||||
BOOL bDisablePriorityBoost)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
BOOL PriorityBoost = (bDisablePriorityBoost ? TRUE : FALSE); /* prevent setting values other than 1 and 0 */
|
||||
|
||||
Status = NtSetInformationProcess(hProcess,
|
||||
ProcessPriorityBoost,
|
||||
&PriorityBoost,
|
||||
sizeof(BOOL));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue