[CSRSRV] Use the PROCESS_PRIORITY_NORMAL_FOREGROUND constant instead of hardcoding its value (== 9).

This commit is contained in:
Hermès Bélusca-Maïto 2022-04-20 03:20:18 +02:00
parent 27453fb759
commit 944b942eb2
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 8 additions and 8 deletions

View file

@ -51,9 +51,9 @@ VOID
NTAPI
CsrSetToNormalPriority(VOID)
{
KPRIORITY BasePriority = (8 + 1) + 4;
KPRIORITY BasePriority = PROCESS_PRIORITY_NORMAL_FOREGROUND + 4;
/* Set the Priority */
/* Set the base priority */
NtSetInformationProcess(NtCurrentProcess(),
ProcessBasePriority,
&BasePriority,
@ -79,7 +79,7 @@ VOID
NTAPI
CsrSetToShutdownPriority(VOID)
{
KPRIORITY BasePriority = (8 + 1) + 6;
KPRIORITY BasePriority = PROCESS_PRIORITY_NORMAL_FOREGROUND + 6;
BOOLEAN Old;
/* Get the shutdown privilege */
@ -88,7 +88,7 @@ CsrSetToShutdownPriority(VOID)
FALSE,
&Old)))
{
/* Set the Priority */
/* Set the base priority */
NtSetInformationProcess(NtCurrentProcess(),
ProcessBasePriority,
&BasePriority,
@ -612,7 +612,7 @@ CsrCreateProcess(IN HANDLE hProcess,
CsrProcess->ProcessHandle = hProcess;
CsrProcess->ShutdownLevel = 0x280;
/* Set the Priority to Background */
/* Set the priority to Background */
CsrSetBackgroundPriority(CsrProcess);
/* Insert the Process */

View file

@ -41,7 +41,7 @@ _main(int argc,
char *envp[],
int DebugFlag)
{
KPRIORITY BasePriority = (8 + 1) + 4;
KPRIORITY BasePriority = PROCESS_PRIORITY_NORMAL_FOREGROUND + 4;
NTSTATUS Status;
#if defined (_X86_)
ULONG Response;
@ -49,11 +49,11 @@ _main(int argc,
UNREFERENCED_PARAMETER(envp);
UNREFERENCED_PARAMETER(DebugFlag);
/* Set the Priority */
/* Set the base priority */
NtSetInformationProcess(NtCurrentProcess(),
ProcessBasePriority,
&BasePriority,
sizeof(KPRIORITY));
sizeof(BasePriority));
#if defined (_X86_)
/* Give us IOPL so that we can access the VGA registers */