Propagate allocation failures from idle process and thread setup
This commit is contained in:
@@ -20,12 +20,13 @@
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTAPI
|
||||
VOID
|
||||
XTSTATUS
|
||||
PS::Process::CreateIdleProcess(IN PKPROCESSOR_CONTROL_BLOCK Prcb)
|
||||
{
|
||||
ULONG_PTR PageDirectory[2];
|
||||
PKPROCESS IdleProcess;
|
||||
PKTHREAD IdleThread;
|
||||
XTSTATUS Status;
|
||||
|
||||
/* Get initial IDLE thread */
|
||||
IdleThread = Prcb->CurrentThread;
|
||||
@@ -37,7 +38,14 @@ PS::Process::CreateIdleProcess(IN PKPROCESSOR_CONTROL_BLOCK Prcb)
|
||||
PageDirectory[0] = 0;
|
||||
PageDirectory[1] = 0;
|
||||
|
||||
/* Initialize Idle process and Idle thread */
|
||||
KE::KProcess::InitializeIdleProcess(IdleProcess, PageDirectory);
|
||||
KE::KThread::InitializeIdleThread(IdleProcess, IdleThread, Prcb, AR::ProcessorSupport::GetBootStack());
|
||||
/* Initialize IDLE process */
|
||||
Status = KE::KProcess::InitializeIdleProcess(IdleProcess, PageDirectory);
|
||||
if(Status != STATUS_SUCCESS)
|
||||
{
|
||||
/* Failed to initialize IDLE process, return status code */
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* Initialize IDLE thread */
|
||||
return KE::KThread::InitializeIdleThread(IdleProcess, IdleThread, Prcb, AR::ProcessorSupport::GetBootStack());
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ PS::Thread::CreateIdleThread(IN PKPROCESSOR_CONTROL_BLOCK Prcb,
|
||||
Status = MM::Allocator::AllocatePool(NonPagedPool, sizeof(ETHREAD), (PVOID*)&IdleThread);
|
||||
if(Status != STATUS_SUCCESS)
|
||||
{
|
||||
/* Allocation failed, return the status code */
|
||||
/* Memory allocation failed, return the status code */
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -50,8 +50,5 @@ PS::Thread::CreateIdleThread(IN PKPROCESSOR_CONTROL_BLOCK Prcb,
|
||||
Prcb->IdleThread = &IdleThread->ThreadControlBlock;
|
||||
|
||||
/* Initialize the IDLE thread */
|
||||
KE::KThread::InitializeIdleThread(IdleProcess, &IdleThread->ThreadControlBlock, Prcb, Stack);
|
||||
|
||||
/* Return success */
|
||||
return STATUS_SUCCESS;
|
||||
return KE::KThread::InitializeIdleThread(IdleProcess, &IdleThread->ThreadControlBlock, Prcb, Stack);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user