Commit 60cdc8f
Fix Windows x86_64 CI: align CONTEXT to 16 bytes for GetThreadContext/SetThreadContext
Root cause: The windows-sys crate defines CONTEXT with #[repr(C)] which
only provides 8-byte natural alignment on x86_64. However, the Windows
API documentation states: "The CONTEXT structure must be 16-byte aligned
when used with GetThreadContext and SetThreadContext functions."
This explains why ALL i686 Windows targets passed (i686 CONTEXT has no
16-byte alignment requirement) while ALL x86_64 Windows targets failed
(GetThreadContext/SetThreadContext return 0 on misaligned CONTEXT).
Fix: Use a #[repr(C, align(16))] wrapper (AlignedContext) to ensure
the CONTEXT struct is properly 16-byte aligned on x86_64.
Agent-Logs-Url: https://github.com/acl-dev/open-coroutine/sessions/e3e0796e-c5d6-4538-92c8-b0fe0fd582af
Co-authored-by: loongs-zhang <38336731+loongs-zhang@users.noreply.github.com>1 parent d450196 commit 60cdc8f
1 file changed
Lines changed: 17 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
226 | 234 | | |
227 | 235 | | |
228 | 236 | | |
| |||
242 | 250 | | |
243 | 251 | | |
244 | 252 | | |
245 | | - | |
246 | 253 | | |
247 | 254 | | |
248 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
249 | 258 | | |
250 | 259 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
| 260 | + | |
| 261 | + | |
255 | 262 | | |
256 | 263 | | |
| 264 | + | |
| 265 | + | |
257 | 266 | | |
258 | 267 | | |
259 | 268 | | |
260 | 269 | | |
261 | 270 | | |
262 | | - | |
| 271 | + | |
263 | 272 | | |
264 | 273 | | |
265 | 274 | | |
| |||
295 | 304 | | |
296 | 305 | | |
297 | 306 | | |
298 | | - | |
| 307 | + | |
299 | 308 | | |
300 | 309 | | |
301 | 310 | | |
| |||
0 commit comments