Piotr Caban piotr@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?
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@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.