We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5837340 commit 0c4110eCopy full SHA for 0c4110e
src/backends/windows.rs
@@ -127,10 +127,13 @@ pub unsafe fn guess_os_stack_limit() -> Option<usize> {
127
// FIXME: we could read stack base from the TIB, specifically the 3rd element of it.
128
type QueryT = windows_sys::Win32::System::Memory::MEMORY_BASIC_INFORMATION;
129
let mut mi = std::mem::MaybeUninit::<QueryT>::uninit();
130
- VirtualQuery(
+ let res = VirtualQuery(
131
psm::stack_pointer() as *const _,
132
mi.as_mut_ptr(),
133
std::mem::size_of::<QueryT>() as usize,
134
);
135
+ if res == 0 {
136
+ return None;
137
+ }
138
Some(mi.assume_init().AllocationBase as usize + get_thread_stack_guarantee() + 0x1000)
139
}
0 commit comments