aboutsummaryrefslogtreecommitdiffhomepage
path: root/zluda_inject/src/win.rs
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2021-01-03 18:45:48 +0100
committerGitHub <[email protected]>2021-01-03 18:45:48 +0100
commit2c0e9b912fe341bd1e513614014fa43b666d257d (patch)
treeb5d3aa00a5192230657792833450848ceb557a1a /zluda_inject/src/win.rs
parent659b2c6ec431c3f1103e700a20da4c66467aa35d (diff)
downloadZLUDA-2c0e9b912fe341bd1e513614014fa43b666d257d.tar.gz
ZLUDA-2c0e9b912fe341bd1e513614014fa43b666d257d.zip
Fix Windows ZLUDA injector (#26)
Fix various bugs in injector and redirector, make them more robust and enable building them by default
Diffstat (limited to 'zluda_inject/src/win.rs')
-rw-r--r--zluda_inject/src/win.rs21
1 files changed, 12 insertions, 9 deletions
diff --git a/zluda_inject/src/win.rs b/zluda_inject/src/win.rs
index ec57ffb..4d7fcdd 100644
--- a/zluda_inject/src/win.rs
+++ b/zluda_inject/src/win.rs
@@ -48,15 +48,18 @@ macro_rules! last_ident {
macro_rules! os_call {
($($path:ident)::+ ($($args:expr),*), $success:expr) => {
- let result = unsafe{ $($path)::+ ($($args),+) };
- if !($success)(result) {
- let name = last_ident!($($path),+);
- let err_code = $crate::win::errno();
- Err($crate::win::OsError{
- function: name,
- error_code: err_code as u32,
- message: $crate::win::error_string(err_code)
- })?;
+ {
+ let result = unsafe{ $($path)::+ ($($args),*) };
+ if !($success)(result) {
+ let name = last_ident!($($path),+);
+ let err_code = $crate::win::errno();
+ Err($crate::win::OsError{
+ function: name,
+ error_code: err_code as u32,
+ message: $crate::win::error_string(err_code)
+ })?;
+ }
+ result
}
};
}