Module: wine Branch: master Commit: 6b2c9505c6a84f53798aa9509ef75bb4e1b86d56 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6b2c9505c6a84f53798aa9509e...
Author: Piotr Caban piotr@codeweavers.com Date: Tue Apr 12 15:10:05 2011 +0200
ntdll: Restore stack guard and prevent stack from shrinking.
---
dlls/ntdll/virtual.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 0913b71..d88b734 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -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; } }