[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
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 */