summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--talpid-ipc/src/win.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/talpid-ipc/src/win.rs b/talpid-ipc/src/win.rs
index 0549368bf8..0b39282348 100644
--- a/talpid-ipc/src/win.rs
+++ b/talpid-ipc/src/win.rs
@@ -143,11 +143,7 @@ pub fn deny_network_access<T: AsRef<OsStr>>(ipc_path: T) -> Result<(), io::Error
)
};
if result != ERROR_SUCCESS {
- // A non-zero error code in WinError.h
- return Err(io::Error::new(
- io::ErrorKind::Other,
- format!("SetEntriesInAclW failed: {}", result),
- ));
+ return Err(io::Error::from_raw_os_error(result as i32));
}
let result = unsafe {
@@ -165,11 +161,7 @@ pub fn deny_network_access<T: AsRef<OsStr>>(ipc_path: T) -> Result<(), io::Error
unsafe { LocalFree(new_dacl as *mut _) };
if result != ERROR_SUCCESS {
- // A non-zero error code in WinError.h
- return Err(io::Error::new(
- io::ErrorKind::Other,
- format!("SetSecurityInfo failed: {}", result),
- ));
+ return Err(io::Error::from_raw_os_error(result as i32));
}
Ok(())