diff --git a/crates/xcl/src/vfs.rs b/crates/xcl/src/vfs.rs index 469e6269b..92bb7d43b 100644 --- a/crates/xcl/src/vfs.rs +++ b/crates/xcl/src/vfs.rs @@ -963,11 +963,12 @@ mod tests { std::ptr::null_mut(), ) }; + let error = unsafe { windows_sys::Win32::Foundation::GetLastError() }; assert_eq!(h, windows_sys::Win32::Foundation::INVALID_HANDLE_VALUE); // Windows' own codes are the reference; Wine answers a directory opened with // FILE_FLAG_BACKUP_SEMANTICS and TRUNCATE_EXISTING with ERROR_FILE_EXISTS if !crate::util::under_wine() { - assert_eq!(unsafe { windows_sys::Win32::Foundation::GetLastError() }, expected); + assert_eq!(error, expected); } assert_eq!(v.open_decision("G:\\data", GENERIC_WRITE, TRUNCATE_EXISTING, flags), Decision::Fail(expected)); }