ntdll: Restore stack guard and prevent stack from shrinking.

This commit is contained in:
Piotr Caban 2011-04-12 15:10:05 +02:00 committed by Alexandre Julliard
parent 6990ecaafd
commit 6b2c9505c6
1 changed files with 6 additions and 2 deletions

View File

@ -1618,8 +1618,12 @@ BOOL virtual_handle_stack_fault( void *addr )
if (vprot & VPROT_GUARD) if (vprot & VPROT_GUARD)
{ {
VIRTUAL_SetProt( view, page, page_size, vprot & ~VPROT_GUARD ); VIRTUAL_SetProt( view, page, page_size, vprot & ~VPROT_GUARD );
if ((char *)page + page_size == NtCurrentTeb()->Tib.StackLimit) NtCurrentTeb()->Tib.StackLimit = page;
NtCurrentTeb()->Tib.StackLimit = page; if ((char *)page >= (char *)NtCurrentTeb()->DeallocationStack + 2*page_size)
{
vprot = view->prot[((char *)page - page_size - (char *)view->base) >> page_shift];
VIRTUAL_SetProt( view, (char *)page - page_size, page_size, vprot | VPROT_GUARD );
}
ret = TRUE; ret = TRUE;
} }
} }