Re: msvcrt: Added _resetstkoflw implementation
Piotr Caban <piotr(a)codeweavers.com> writes:
+/********************************************************************* + * _resetstkoflw (MSVCRT.@) + */ +int CDECL _resetstkoflw(void) +{ + MEMORY_BASIC_INFORMATION mbi; + SYSTEM_INFO info; + DWORD prot; + void *alloc; + + GetSystemInfo(&info); + if(!VirtualQuery(&mbi, &mbi, sizeof(mbi))) + return 0; + + alloc = VirtualAlloc((char*)mbi.BaseAddress, info.dwPageSize, MEM_COMMIT, PAGE_READWRITE); + if(!alloc) + return 0; + + return VirtualProtect(alloc, info.dwPageSize, PAGE_GUARD|PAGE_READWRITE, &prot);
This doesn't make sense to me, why do you need a VirtualAlloc in there? And what about the limits in the TEB? -- Alexandre Julliard julliard(a)winehq.org
On 04/19/11 18:04, Alexandre Julliard wrote:
This doesn't make sense to me, why do you need a VirtualAlloc in there? It's not needed.
And what about the limits in the TEB? StackLimit is updated by virtual_handle_stack_fault before _resetstkoflw exits. Should I update it explicitly in _resetstkoflw function?
Cheers, Piotr
Piotr Caban <piotr(a)codeweavers.com> writes:
StackLimit is updated by virtual_handle_stack_fault before _resetstkoflw exits. Should I update it explicitly in _resetstkoflw function?
I suppose you can assume you'll get a stack fault at that point. A comment to that effect would be a good idea. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Piotr Caban