get CREATE_NO_WINDOW from windows crate

This commit is contained in:
2025-04-17 04:40:06 +01:00
parent 10c840ac4d
commit e328eb91f6
+4 -4
View File
@@ -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();
}