diff --git a/src/raw/windows.rs b/src/raw/windows.rs index b8f0ea5..084d91c 100644 --- a/src/raw/windows.rs +++ b/src/raw/windows.rs @@ -129,7 +129,7 @@ pub unsafe fn get_sym(handle: Handle, name: &CStr) -> Result<*mut (), Error> { #[inline] pub unsafe fn open_lib(name: &OsStr) -> Result { let wide_name: Vec = name.encode_wide().chain(Some(0)).collect(); - let _guard = ErrorModeGuard::new(); + let _guard = ErrorModeGuard::new()?; let handle = kernel32::LoadLibraryW(wide_name.as_ptr()); if handle.is_null() { Err(Error::OpeningLibraryError(get_win_error()))