mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[NTOS:EX] Do not ignore PsCreateSystemThread return value
CORE-17637
This commit is contained in:
parent
93c0d324e0
commit
cf1a95a588
1 changed files with 26 additions and 14 deletions
|
@ -254,6 +254,7 @@ ExpCreateWorkerThread(WORK_QUEUE_TYPE WorkQueueType,
|
|||
HANDLE hThread;
|
||||
ULONG Context;
|
||||
KPRIORITY Priority;
|
||||
NTSTATUS Status;
|
||||
|
||||
/* Check if this is going to be a dynamic thread */
|
||||
Context = WorkQueueType;
|
||||
|
@ -262,13 +263,19 @@ ExpCreateWorkerThread(WORK_QUEUE_TYPE WorkQueueType,
|
|||
if (Dynamic) Context |= EX_DYNAMIC_WORK_THREAD;
|
||||
|
||||
/* Create the System Thread */
|
||||
PsCreateSystemThread(&hThread,
|
||||
THREAD_ALL_ACCESS,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
ExpWorkerThreadEntryPoint,
|
||||
UlongToPtr(Context));
|
||||
Status = PsCreateSystemThread(&hThread,
|
||||
THREAD_ALL_ACCESS,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
ExpWorkerThreadEntryPoint,
|
||||
UlongToPtr(Context));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Well... */
|
||||
DPRINT1("Failed to create worker thread: 0x%08x\n", Status);
|
||||
return;
|
||||
}
|
||||
|
||||
/* If the thread is dynamic */
|
||||
if (Dynamic)
|
||||
|
@ -519,6 +526,7 @@ ExpInitializeWorkerThreads(VOID)
|
|||
HANDLE ThreadHandle;
|
||||
PETHREAD Thread;
|
||||
ULONG i;
|
||||
NTSTATUS Status;
|
||||
|
||||
/* Setup the stack swap support */
|
||||
ExInitializeFastMutex(&ExpWorkerSwapinMutex);
|
||||
|
@ -576,13 +584,17 @@ ExpInitializeWorkerThreads(VOID)
|
|||
ExpCreateWorkerThread(HyperCriticalWorkQueue, FALSE);
|
||||
|
||||
/* Create the balance set manager thread */
|
||||
PsCreateSystemThread(&ThreadHandle,
|
||||
THREAD_ALL_ACCESS,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
ExpWorkerThreadBalanceManager,
|
||||
NULL);
|
||||
Status = PsCreateSystemThread(&ThreadHandle,
|
||||
THREAD_ALL_ACCESS,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
ExpWorkerThreadBalanceManager,
|
||||
NULL);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0);
|
||||
}
|
||||
|
||||
/* Get a pointer to it for the shutdown process */
|
||||
ObReferenceObjectByHandle(ThreadHandle,
|
||||
|
|
Loading…
Reference in a new issue