ntdll: Restore stack guard and prevent stack from shrinking.
This commit is contained in:
parent
6990ecaafd
commit
6b2c9505c6
|
@ -1618,8 +1618,12 @@ BOOL virtual_handle_stack_fault( void *addr )
|
|||
if (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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue