mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 03:46:38 +00:00
MmGrowKernelStack: go back to the ASSERT and add a fixed check
svn path=/trunk/; revision=41106
This commit is contained in:
parent
a49c349111
commit
ced40baa7b
1 changed files with 8 additions and 4 deletions
|
@ -258,11 +258,15 @@ MmGrowKernelStack(PVOID StackPointer)
|
|||
{
|
||||
PETHREAD Thread = PsGetCurrentThread();
|
||||
|
||||
/* Make sure we have reserved space for our grow */
|
||||
if (((PCHAR)Thread->Tcb.StackBase - (PCHAR)Thread->Tcb.StackLimit) >
|
||||
(KERNEL_LARGE_STACK_SIZE + PAGE_SIZE))
|
||||
/* Make sure the stack did not overflow */
|
||||
ASSERT(((PCHAR)Thread->Tcb.StackBase - (PCHAR)Thread->Tcb.StackLimit) <=
|
||||
(KERNEL_LARGE_STACK_SIZE + PAGE_SIZE));
|
||||
|
||||
/* Check if we have reserved space for our grow */
|
||||
if ((PCHAR)Thread->Tcb.StackBase - (PCHAR)Thread->Tcb.StackLimit +
|
||||
KERNEL_STACK_SIZE > KERNEL_LARGE_STACK_SIZE)
|
||||
{
|
||||
return STATUS_NO_MEMORY;
|
||||
return STATUS_STACK_OVERFLOW;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue