Tests: under_wine() clobbers the calling thread's GetLastError() #1125
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#1125
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@mahfuzinam0045-spec on GitHub · 2026-11-24 12:09 UTC · original
The first invocation of \crate::util::under_wine()\ looks up \wine_get_version\ in
tdll.dll\ using \GetProcAddress. On native Windows, \wine_get_version\ does not exist in
tdll.dll, so \GetProcAddress\ fails and Windows \SetLastError\ mutates the thread's last error to \127\ (\ERROR_PROC_NOT_FOUND).
When \under_wine()\ is called before checking \GetLastError()\ (or inside a code path where Win32 errors are queried), the caller's last error is clobbered. This was previously observed in \ runcate_existing_validation_errors\ (commit
d78597d), where a local workaround was introduced in \fs.rs, but \under_wine()\ itself was never updated to preserve \GetLastError().github-bot referenced this issue2026-11-26 04:44:22 +00:00