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