diff --git a/crates/xcl/src/vfs_hooks.rs b/crates/xcl/src/vfs_hooks.rs index 34c3001..d4fe5ab 100644 --- a/crates/xcl/src/vfs_hooks.rs +++ b/crates/xcl/src/vfs_hooks.rs @@ -39,7 +39,9 @@ impl Guard { } impl Drop for Guard { fn drop(&mut self) { + let e = unsafe { windows_sys::Win32::Foundation::GetLastError() }; IN_HOOK.with(|c| c.set(false)); + unsafe { windows_sys::Win32::Foundation::SetLastError(e) }; } }