diff --git a/src/features/game_networking.rs b/src/features/game_networking.rs index 9ac9a2d..3bab108 100644 --- a/src/features/game_networking.rs +++ b/src/features/game_networking.rs @@ -3,9 +3,9 @@ use crate::util::consts::{ENHANCED, LEGACY}; use std::{os::windows::process::CommandExt, path::Path, process::Command}; use sysinfo::System; +use windows::Win32::System::Threading::CREATE_NO_WINDOW; const FILTER_NAME: &str = "[GTA Tools] Block all traffic for GTA V"; -const CREATE_NO_WINDOW: u32 = 0x0800_0000; fn get_game_exe_path(sysinfo: &mut System) -> Option<&Path> { sysinfo.refresh_all(); @@ -37,7 +37,7 @@ pub fn block_all(sysinfo: &mut System) { "protocol=ANY", &format!("program={exe_path}"), ]) - .creation_flags(CREATE_NO_WINDOW) + .creation_flags(CREATE_NO_WINDOW.0) .spawn() .unwrap(); Command::new("netsh") @@ -52,7 +52,7 @@ pub fn block_all(sysinfo: &mut System) { "protocol=ANY", &format!("program={exe_path}"), ]) - .creation_flags(CREATE_NO_WINDOW) + .creation_flags(CREATE_NO_WINDOW.0) .spawn() .unwrap(); } @@ -66,7 +66,7 @@ pub fn unblock_all() { "rule", &format!("name={FILTER_NAME}"), ]) - .creation_flags(CREATE_NO_WINDOW) + .creation_flags(CREATE_NO_WINDOW.0) .spawn() .unwrap(); }