feat: Migrate more PowerShell calls to Rust implementation

This commit is contained in:
xkeyC
2025-12-05 11:06:54 +08:00
parent f6676ed3d8
commit 62b8718dbd
16 changed files with 1377 additions and 357 deletions

View File

@@ -54,7 +54,10 @@ windows = { version = "0.62.2", features = [
"Win32_UI_Shell",
"Win32_System_Com",
"Win32_System_Ole",
"Win32_System_Variant"
"Win32_System_Variant",
"Win32_Security",
"Win32_System_IO",
"Win32_System_Ioctl"
] }
win32job = "2.0.3"
wmi = "0.15"

View File

@@ -527,4 +527,392 @@ fn get_process_path(pid: u32) -> Option<String> {
pub fn get_process_list_by_name(process_name: &str) -> anyhow::Result<Vec<ProcessInfo>> {
println!("get_process_list_by_name (unix): {}", process_name);
Ok(Vec::new())
}
/// Kill processes by name
#[cfg(target_os = "windows")]
pub fn kill_process_by_name(process_name: &str) -> anyhow::Result<u32> {
use windows::Win32::Foundation::CloseHandle;
use windows::Win32::System::Threading::{OpenProcess, TerminateProcess, PROCESS_TERMINATE};
let processes = get_process_list_by_name(process_name)?;
let mut killed_count = 0u32;
for process in processes {
unsafe {
if let Ok(h_process) = OpenProcess(PROCESS_TERMINATE, false, process.pid) {
if !h_process.is_invalid() {
if TerminateProcess(h_process, 0).is_ok() {
killed_count += 1;
}
let _ = CloseHandle(h_process);
}
}
}
}
Ok(killed_count)
}
#[cfg(not(target_os = "windows"))]
pub fn kill_process_by_name(process_name: &str) -> anyhow::Result<u32> {
println!("kill_process_by_name (unix): {}", process_name);
Ok(0)
}
/// Get disk physical sector size for performance
#[cfg(target_os = "windows")]
pub fn get_disk_physical_sector_size(drive_letter: &str) -> anyhow::Result<u32> {
use windows::Win32::Storage::FileSystem::{
CreateFileW, FILE_SHARE_READ, FILE_SHARE_WRITE, OPEN_EXISTING,
};
use windows::Win32::System::IO::DeviceIoControl;
use windows::Win32::System::Ioctl::IOCTL_STORAGE_QUERY_PROPERTY;
use windows::Win32::Foundation::CloseHandle;
use windows::core::HSTRING;
use std::mem;
// STORAGE_PROPERTY_QUERY structure
#[repr(C)]
struct StoragePropertyQuery {
property_id: u32,
query_type: u32,
additional_parameters: [u8; 1],
}
// STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR structure
#[repr(C)]
struct StorageAccessAlignmentDescriptor {
version: u32,
size: u32,
bytes_per_cache_line: u32,
bytes_offset_for_cache_alignment: u32,
bytes_per_logical_sector: u32,
bytes_per_physical_sector: u32,
bytes_offset_for_sector_alignment: u32,
}
let drive_path = format!(r"\\.\{}:", drive_letter.chars().next().unwrap_or('C'));
let drive_path_w = HSTRING::from(&drive_path);
unsafe {
let handle = CreateFileW(
&drive_path_w,
0, // No access needed, just query
FILE_SHARE_READ | FILE_SHARE_WRITE,
None,
OPEN_EXISTING,
windows::Win32::Storage::FileSystem::FILE_FLAGS_AND_ATTRIBUTES(0),
None,
)?;
if handle.is_invalid() {
return Err(anyhow::anyhow!("Failed to open drive"));
}
// StorageAccessAlignmentProperty = 6
let query = StoragePropertyQuery {
property_id: 6,
query_type: 0, // PropertyStandardQuery
additional_parameters: [0],
};
let mut descriptor: StorageAccessAlignmentDescriptor = mem::zeroed();
let mut bytes_returned: u32 = 0;
let result = DeviceIoControl(
handle,
IOCTL_STORAGE_QUERY_PROPERTY,
Some(&query as *const _ as *const std::ffi::c_void),
mem::size_of::<StoragePropertyQuery>() as u32,
Some(&mut descriptor as *mut _ as *mut std::ffi::c_void),
mem::size_of::<StorageAccessAlignmentDescriptor>() as u32,
Some(&mut bytes_returned),
None,
);
let _ = CloseHandle(handle);
if result.is_ok() {
Ok(descriptor.bytes_per_physical_sector)
} else {
Err(anyhow::anyhow!("DeviceIoControl failed"))
}
}
}
#[cfg(not(target_os = "windows"))]
pub fn get_disk_physical_sector_size(drive_letter: &str) -> anyhow::Result<u32> {
println!("get_disk_physical_sector_size (unix): {}", drive_letter);
Ok(0)
}
/// Create a desktop shortcut
#[cfg(target_os = "windows")]
pub fn create_desktop_shortcut(target_path: &str, shortcut_name: &str) -> anyhow::Result<()> {
use windows::core::{HSTRING, Interface, BSTR};
use windows::Win32::System::Com::{
CoCreateInstance, CoInitializeEx, CoUninitialize,
CLSCTX_INPROC_SERVER, COINIT_APARTMENTTHREADED,
};
use windows::Win32::UI::Shell::{IShellLinkW, ShellLink, SHGetKnownFolderPath, FOLDERID_Desktop};
use windows::Win32::System::Com::IPersistFile;
unsafe {
let _ = CoInitializeEx(None, COINIT_APARTMENTTHREADED);
let result = (|| -> anyhow::Result<()> {
// Get desktop path
let desktop_path = SHGetKnownFolderPath(&FOLDERID_Desktop, windows::Win32::UI::Shell::KNOWN_FOLDER_FLAG(0), None)?;
let desktop_str = desktop_path.to_string()?;
// Create ShellLink instance
let shell_link: IShellLinkW = CoCreateInstance(
&ShellLink,
None,
CLSCTX_INPROC_SERVER,
)?;
// Set target path
let target_w = HSTRING::from(target_path);
shell_link.SetPath(&target_w)?;
// Get IPersistFile interface
let persist_file: IPersistFile = shell_link.cast()?;
// Create shortcut file path
let shortcut_path = format!("{}\\{}", desktop_str, shortcut_name);
let shortcut_w = BSTR::from(&shortcut_path);
// Save shortcut
persist_file.Save(windows::core::PCWSTR(shortcut_w.as_ptr()), true)?;
Ok(())
})();
CoUninitialize();
result
}
}
#[cfg(not(target_os = "windows"))]
pub fn create_desktop_shortcut(target_path: &str, shortcut_name: &str) -> anyhow::Result<()> {
println!("create_desktop_shortcut (unix): {} -> {}", target_path, shortcut_name);
Ok(())
}
/// Run a program with admin privileges (UAC)
#[cfg(target_os = "windows")]
pub fn run_as_admin(program: &str, args: &str) -> anyhow::Result<()> {
use windows::core::HSTRING;
use windows::Win32::UI::Shell::ShellExecuteW;
use windows::Win32::UI::WindowsAndMessaging::SW_SHOWNORMAL;
let operation = HSTRING::from("runas");
let file = HSTRING::from(program);
let parameters = HSTRING::from(args);
unsafe {
let result = ShellExecuteW(
None,
&operation,
&file,
&parameters,
None,
SW_SHOWNORMAL,
);
// ShellExecuteW returns a value > 32 on success
if result.0 as usize > 32 {
Ok(())
} else {
Err(anyhow::anyhow!("ShellExecuteW failed with code: {}", result.0 as usize))
}
}
}
#[cfg(not(target_os = "windows"))]
pub fn run_as_admin(program: &str, args: &str) -> anyhow::Result<()> {
println!("run_as_admin (unix): {} {}", program, args);
Ok(())
}
/// Start a program (without waiting)
#[cfg(target_os = "windows")]
pub fn start_process(program: &str, args: Vec<String>) -> anyhow::Result<()> {
use std::process::Command;
Command::new(program)
.args(&args)
.spawn()?;
Ok(())
}
#[cfg(not(target_os = "windows"))]
pub fn start_process(program: &str, args: Vec<String>) -> anyhow::Result<()> {
println!("start_process (unix): {} {:?}", program, args);
Ok(())
}
// ============== NVME Patch Functions ==============
const NVME_REGISTRY_PATH: &str = r"SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device";
const NVME_VALUE_NAME: &str = "ForcedPhysicalSectorSizeInBytes";
/// Check if NVME patch is applied
#[cfg(target_os = "windows")]
pub fn check_nvme_patch_status() -> anyhow::Result<bool> {
use windows::Win32::System::Registry::{
RegOpenKeyExW, RegQueryValueExW, RegCloseKey,
HKEY_LOCAL_MACHINE, KEY_READ, REG_VALUE_TYPE,
};
use windows::core::{HSTRING, PCWSTR};
unsafe {
let path = HSTRING::from(NVME_REGISTRY_PATH);
let mut hkey = std::mem::zeroed();
// Try to open the registry key
if RegOpenKeyExW(
HKEY_LOCAL_MACHINE,
PCWSTR(path.as_ptr()),
Some(0),
KEY_READ,
&mut hkey,
).is_err() {
return Ok(false);
}
// Query the value
let value_name = HSTRING::from(NVME_VALUE_NAME);
let mut buffer = [0u8; 1024];
let mut size = buffer.len() as u32;
let mut value_type = REG_VALUE_TYPE::default();
let result = if RegQueryValueExW(
hkey,
PCWSTR(value_name.as_ptr()),
None,
Some(&mut value_type),
Some(buffer.as_mut_ptr()),
Some(&mut size),
).is_ok() {
// Check if the value contains "* 4095"
// REG_MULTI_SZ is stored as null-terminated wide strings
let data = String::from_utf16_lossy(
std::slice::from_raw_parts(buffer.as_ptr() as *const u16, size as usize / 2)
);
data.contains("* 4095")
} else {
false
};
let _ = RegCloseKey(hkey);
Ok(result)
}
}
#[cfg(not(target_os = "windows"))]
pub fn check_nvme_patch_status() -> anyhow::Result<bool> {
Ok(false)
}
/// Add NVME patch to registry
#[cfg(target_os = "windows")]
pub fn add_nvme_patch() -> anyhow::Result<()> {
use windows::Win32::System::Registry::{
RegOpenKeyExW, RegSetValueExW, RegCloseKey,
HKEY_LOCAL_MACHINE, KEY_WRITE, REG_MULTI_SZ,
};
use windows::core::{HSTRING, PCWSTR};
unsafe {
let path = HSTRING::from(NVME_REGISTRY_PATH);
let mut hkey = std::mem::zeroed();
// Open the registry key with write access
let open_result = RegOpenKeyExW(
HKEY_LOCAL_MACHINE,
PCWSTR(path.as_ptr()),
Some(0),
KEY_WRITE,
&mut hkey,
);
if open_result.is_err() {
return Err(anyhow::anyhow!("Failed to open registry key: {:?}", open_result));
}
// Prepare the value: "* 4095" as REG_MULTI_SZ (double null terminated)
let value_str = "* 4095\0\0";
let value_wide: Vec<u16> = value_str.encode_utf16().collect();
let value_name = HSTRING::from(NVME_VALUE_NAME);
let result = RegSetValueExW(
hkey,
PCWSTR(value_name.as_ptr()),
Some(0),
REG_MULTI_SZ,
Some(std::slice::from_raw_parts(
value_wide.as_ptr() as *const u8,
value_wide.len() * 2,
)),
);
let _ = RegCloseKey(hkey);
if result.is_err() {
return Err(anyhow::anyhow!("Failed to set registry value: {:?}", result));
}
Ok(())
}
}
#[cfg(not(target_os = "windows"))]
pub fn add_nvme_patch() -> anyhow::Result<()> {
Err(anyhow::anyhow!("NVME patch is only supported on Windows"))
}
/// Remove NVME patch from registry
#[cfg(target_os = "windows")]
pub fn remove_nvme_patch() -> anyhow::Result<()> {
use windows::Win32::System::Registry::{
RegOpenKeyExW, RegDeleteValueW, RegCloseKey,
HKEY_LOCAL_MACHINE, KEY_WRITE,
};
use windows::Win32::Foundation::ERROR_FILE_NOT_FOUND;
use windows::core::{HSTRING, PCWSTR};
unsafe {
let path = HSTRING::from(NVME_REGISTRY_PATH);
let mut hkey = std::mem::zeroed();
// Open the registry key with write access
let open_result = RegOpenKeyExW(
HKEY_LOCAL_MACHINE,
PCWSTR(path.as_ptr()),
Some(0),
KEY_WRITE,
&mut hkey,
);
if open_result.is_err() {
return Err(anyhow::anyhow!("Failed to open registry key: {:?}", open_result));
}
let value_name = HSTRING::from(NVME_VALUE_NAME);
let result = RegDeleteValueW(
hkey,
PCWSTR(value_name.as_ptr()),
);
let _ = RegCloseKey(hkey);
// It's OK if the value doesn't exist
if result.is_err() && result != ERROR_FILE_NOT_FOUND {
return Err(anyhow::anyhow!("Failed to delete registry value: {:?}", result));
}
Ok(())
}
}

View File

@@ -37,7 +37,7 @@ flutter_rust_bridge::frb_generated_boilerplate!(
default_rust_auto_opaque = RustAutoOpaqueNom,
);
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.11.1";
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1317751362;
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1161621087;
// Section: executor
@@ -45,6 +45,48 @@ flutter_rust_bridge::frb_generated_default_handler!();
// Section: wire_funcs
fn wire__crate__api__win32_api__add_nvme_patch_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "add_nvme_patch",
port: Some(port_),
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
},
move || {
move |context| {
transform_result_dco::<_, _, flutter_rust_bridge::for_generated::anyhow::Error>(
(move || {
let output_ok = crate::api::win32_api::add_nvme_patch()?;
Ok(output_ok)
})(),
)
}
},
)
}
fn wire__crate__api__win32_api__check_nvme_patch_status_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "check_nvme_patch_status",
port: Some(port_),
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
},
move || {
move |context| {
transform_result_dco::<_, _, flutter_rust_bridge::for_generated::anyhow::Error>(
(move || {
let output_ok = crate::api::win32_api::check_nvme_patch_status()?;
Ok(output_ok)
})(),
)
}
},
)
}
fn wire__crate__api__ort_api__clear_all_models_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
) {
@@ -66,6 +108,34 @@ fn wire__crate__api__ort_api__clear_all_models_impl(
},
)
}
fn wire__crate__api__win32_api__create_desktop_shortcut_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
target_path: impl CstDecode<String>,
shortcut_name: impl CstDecode<String>,
) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "create_desktop_shortcut",
port: Some(port_),
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
},
move || {
let api_target_path = target_path.cst_decode();
let api_shortcut_name = shortcut_name.cst_decode();
move |context| {
transform_result_dco::<_, _, flutter_rust_bridge::for_generated::anyhow::Error>(
(move || {
let output_ok = crate::api::win32_api::create_desktop_shortcut(
&api_target_path,
&api_shortcut_name,
)?;
Ok(output_ok)
})(),
)
}
},
)
}
fn wire__crate__api__http_api__dns_lookup_ips_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
host: impl CstDecode<String>,
@@ -156,6 +226,31 @@ fn wire__crate__api__http_api__fetch_impl(
},
)
}
fn wire__crate__api__win32_api__get_disk_physical_sector_size_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
drive_letter: impl CstDecode<String>,
) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "get_disk_physical_sector_size",
port: Some(port_),
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
},
move || {
let api_drive_letter = drive_letter.cst_decode();
move |context| {
transform_result_dco::<_, _, flutter_rust_bridge::for_generated::anyhow::Error>(
(move || {
let output_ok = crate::api::win32_api::get_disk_physical_sector_size(
&api_drive_letter,
)?;
Ok(output_ok)
})(),
)
}
},
)
}
fn wire__crate__api__http_api__get_faster_url_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
urls: impl CstDecode<Vec<String>>,
@@ -341,6 +436,30 @@ fn wire__crate__api__win32_api__get_system_memory_size_gb_impl(
},
)
}
fn wire__crate__api__win32_api__kill_process_by_name_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
process_name: impl CstDecode<String>,
) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "kill_process_by_name",
port: Some(port_),
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
},
move || {
let api_process_name = process_name.cst_decode();
move |context| {
transform_result_dco::<_, _, flutter_rust_bridge::for_generated::anyhow::Error>(
(move || {
let output_ok =
crate::api::win32_api::kill_process_by_name(&api_process_name)?;
Ok(output_ok)
})(),
)
}
},
)
}
fn wire__crate__api__ort_api__load_translation_model_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
model_path: impl CstDecode<String>,
@@ -546,6 +665,27 @@ fn wire__crate__api__unp4k_api__p4k_open_impl(
},
)
}
fn wire__crate__api__win32_api__remove_nvme_patch_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "remove_nvme_patch",
port: Some(port_),
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
},
move || {
move |context| {
transform_result_dco::<_, _, flutter_rust_bridge::for_generated::anyhow::Error>(
(move || {
let output_ok = crate::api::win32_api::remove_nvme_patch()?;
Ok(output_ok)
})(),
)
}
},
)
}
fn wire__crate__api__win32_api__resolve_shortcut_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
lnk_path: impl CstDecode<String>,
@@ -599,6 +739,32 @@ fn wire__crate__api__asar_api__rsi_launcher_asar_data_write_main_js_impl(
},
)
}
fn wire__crate__api__win32_api__run_as_admin_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
program: impl CstDecode<String>,
args: impl CstDecode<String>,
) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "run_as_admin",
port: Some(port_),
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
},
move || {
let api_program = program.cst_decode();
let api_args = args.cst_decode();
move |context| {
transform_result_dco::<_, _, flutter_rust_bridge::for_generated::anyhow::Error>(
(move || {
let output_ok =
crate::api::win32_api::run_as_admin(&api_program, &api_args)?;
Ok(output_ok)
})(),
)
}
},
)
}
fn wire__crate__api__win32_api__send_notify_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
summary: impl CstDecode<Option<String>>,
@@ -723,6 +889,32 @@ fn wire__crate__api__rs_process__start_impl(
},
)
}
fn wire__crate__api__win32_api__start_process_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
program: impl CstDecode<String>,
args: impl CstDecode<Vec<String>>,
) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "start_process",
port: Some(port_),
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
},
move || {
let api_program = program.cst_decode();
let api_args = args.cst_decode();
move |context| {
transform_result_dco::<_, _, flutter_rust_bridge::for_generated::anyhow::Error>(
(move || {
let output_ok =
crate::api::win32_api::start_process(&api_program, api_args)?;
Ok(output_ok)
})(),
)
}
},
)
}
fn wire__crate__api__ort_api__translate_text_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
model_key: impl CstDecode<String>,
@@ -2893,6 +3085,20 @@ mod io {
}
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__win32_api__add_nvme_patch(
port_: i64,
) {
wire__crate__api__win32_api__add_nvme_patch_impl(port_)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__win32_api__check_nvme_patch_status(
port_: i64,
) {
wire__crate__api__win32_api__check_nvme_patch_status_impl(port_)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__ort_api__clear_all_models(
port_: i64,
@@ -2900,6 +3106,15 @@ mod io {
wire__crate__api__ort_api__clear_all_models_impl(port_)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__win32_api__create_desktop_shortcut(
port_: i64,
target_path: *mut wire_cst_list_prim_u_8_strict,
shortcut_name: *mut wire_cst_list_prim_u_8_strict,
) {
wire__crate__api__win32_api__create_desktop_shortcut_impl(port_, target_path, shortcut_name)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__http_api__dns_lookup_ips(
port_: i64,
@@ -2937,6 +3152,14 @@ mod io {
)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__win32_api__get_disk_physical_sector_size(
port_: i64,
drive_letter: *mut wire_cst_list_prim_u_8_strict,
) {
wire__crate__api__win32_api__get_disk_physical_sector_size_impl(port_, drive_letter)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__http_api__get_faster_url(
port_: i64,
@@ -2998,6 +3221,14 @@ mod io {
wire__crate__api__win32_api__get_system_memory_size_gb_impl(port_)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__win32_api__kill_process_by_name(
port_: i64,
process_name: *mut wire_cst_list_prim_u_8_strict,
) {
wire__crate__api__win32_api__kill_process_by_name_impl(port_, process_name)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__ort_api__load_translation_model(
port_: i64,
@@ -3068,6 +3299,13 @@ mod io {
wire__crate__api__unp4k_api__p4k_open_impl(port_, p4k_path)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__win32_api__remove_nvme_patch(
port_: i64,
) {
wire__crate__api__win32_api__remove_nvme_patch_impl(port_)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__win32_api__resolve_shortcut(
port_: i64,
@@ -3085,6 +3323,15 @@ mod io {
wire__crate__api__asar_api__rsi_launcher_asar_data_write_main_js_impl(port_, that, content)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__win32_api__run_as_admin(
port_: i64,
program: *mut wire_cst_list_prim_u_8_strict,
args: *mut wire_cst_list_prim_u_8_strict,
) {
wire__crate__api__win32_api__run_as_admin_impl(port_, program, args)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__win32_api__send_notify(
port_: i64,
@@ -3129,6 +3376,15 @@ mod io {
)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__win32_api__start_process(
port_: i64,
program: *mut wire_cst_list_prim_u_8_strict,
args: *mut wire_cst_list_String,
) {
wire__crate__api__win32_api__start_process_impl(port_, program, args)
}
#[unsafe(no_mangle)]
pub extern "C" fn frbgen_starcitizen_doctor_wire__crate__api__ort_api__translate_text(
port_: i64,