This helps Champions of Anteria to start.
The game zeros the data below the current stack pointer in its threads for some reason and established the bottom of the stack roughly like that: ``` VirtualQuery(esp, &d); stack_bottom = d.AllocationBase; while (1) { VirtualQuery(stack_bottom, &d); stack_bottom += d.RegionSize; if (d.State & MEM_RESERVE) continue; if (!(d.State & MEM_COMMIT)) continue; if (d.Protect & PAGE_GUARD) continue; break; } stack_bottom -= d.RegionSize; ```
That depends on the first page(s) at the bottom of the stack to be reserved but uncommitted (which is the case on Windows and basically covered by the existing tests). On Windows also the initially uncommitted stack part all goes as reserved followed by guard page and committed stack area; on Wine the stack currently looks like fully reserved but we still have guard page pattern in the bottom which I think we can mark the same way even if not currently moving stack bottom dynamically.