From e328eb91f663e54b7e6132e834df47b362755cac Mon Sep 17 00:00:00 2001 From: futile Date: Thu, 17 Apr 2025 04:40:06 +0100 Subject: [PATCH] get `CREATE_NO_WINDOW` from `windows` crate --- src/features/game_networking.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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(); }