MmGrowKernelStack: go back to the ASSERT and add a fixed check

svn path=/trunk/; revision=41106
This commit is contained in:
Timo Kreuzer 2009-05-24 23:17:48 +00:00
parent a49c349111
commit ced40baa7b

View file

@ -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;
}
/*