Sorry for not replying to e-mails about this -- I was on vacation on a cruise.
When I'm back to Montreal I'll write a driver to test if this is
correct or not -- but definitely this is better.
Best regards,
Alex Ionescu
On Mon, May 25, 2009 at 1:17 AM, <tkreuzer(a)svn.reactos.org> wrote:
Author: tkreuzer
Date: Mon May 25 03:17:48 2009
New Revision: 41106
URL:
http://svn.reactos.org/svn/reactos?rev=41106&view=rev
Log:
MmGrowKernelStack: go back to the ASSERT and add a fixed check
Modified:
trunk/reactos/ntoskrnl/mm/procsup.c
Modified: trunk/reactos/ntoskrnl/mm/procsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/procsup.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] Mon May 25 03:17:48 2009
@@ -258,11 +258,15 @@
{
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))
- {
- return STATUS_NO_MEMORY;
+ /* 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_STACK_OVERFLOW;
}
/*