Skip to content

Commit

Permalink
chore(lib): update windows crate
Browse files Browse the repository at this point in the history
  • Loading branch information
progre committed May 11, 2024
1 parent db6b585 commit c6bd9be
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 85 deletions.
109 changes: 75 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,22 @@ tracing-subscriber = { version = "0.3.17", features = [
"env-filter",
"local-time"
] }
windows = { version = "0.56.0", features = [
"Win32_Foundation",
"Win32_Graphics_Direct3D9",
"Win32_Graphics_Gdi",
"Win32_Security",
"Win32_Storage_FileSystem",
"Win32_System_Console",
"Win32_System_Diagnostics_Debug",
"Win32_System_Diagnostics_ToolHelp",
"Win32_System_LibraryLoader",
"Win32_System_Memory",
"Win32_System_ProcessStatus",
"Win32_System_SystemInformation",
"Win32_System_SystemServices",
"Win32_System_Threading",
"Win32_UI_Input_KeyboardAndMouse",
"Win32_UI_Shell",
"Win32_UI_WindowsAndMessaging",
] }
2 changes: 1 addition & 1 deletion archives/th19padlight/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ crate-type = ['cdylib']
[dependencies]
anyhow.workspace = true
junowen-lib.workspace = true
windows = { version = "0.52.0", features = [
windows = { workspace = true, features = [
"Win32_Foundation",
"Win32_Graphics_Direct3D9",
"Win32_Graphics_Gdi",
Expand Down
17 changes: 1 addition & 16 deletions junowen-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,4 @@ toml = "0.8.0"
tracing.workspace = true
uuid = "1.5.0"
webrtc = "0.9.0"
windows = { version = "0.52.0", features = [
"Win32_Foundation",
"Win32_Graphics_Direct3D9",
"Win32_Graphics_Gdi",
"Win32_Security",
"Win32_Storage_FileSystem",
"Win32_System_Console",
"Win32_System_Diagnostics_Debug",
"Win32_System_Diagnostics_ToolHelp",
"Win32_System_LibraryLoader",
"Win32_System_Memory",
"Win32_System_ProcessStatus",
"Win32_System_SystemInformation",
"Win32_System_SystemServices",
"Win32_System_Threading",
] }
windows.workspace = true
5 changes: 3 additions & 2 deletions junowen-lib/src/find_process_id.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::mem::size_of;
use std::mem::{size_of, transmute};

use anyhow::{anyhow, Result};
use windows::Win32::System::Diagnostics::ToolHelp::{
Expand All @@ -24,7 +24,8 @@ fn find_process_id_in_snapshot(snapshot: SafeHandle, exe_file: &str) -> Option<u
return None;
}
loop {
let current = String::from_utf8_lossy(&pe.szExeFile);
let current =
String::from_utf8_lossy(unsafe { transmute::<&[i8], &[u8]>(&pe.szExeFile[..]) });
if current.contains(exe_file) {
return Some(pe.th32ProcessID);
}
Expand Down
19 changes: 1 addition & 18 deletions junowen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,4 @@ tracing-appender = "0.2.2"
tracing-subscriber.workspace = true
urlencoding = "2.1.3"
webrtc = "0.9.0"
windows = { version = "0.52.0", features = [
"Win32_Foundation",
"Win32_Graphics_Direct3D9",
"Win32_Graphics_Gdi",
"Win32_Security",
"Win32_Storage_FileSystem",
"Win32_System_Console",
"Win32_System_Diagnostics_Debug",
"Win32_System_Diagnostics_ToolHelp",
"Win32_System_LibraryLoader",
"Win32_System_Memory",
"Win32_System_ProcessStatus",
"Win32_System_SystemInformation",
"Win32_System_SystemServices",
"Win32_System_Threading",
"Win32_UI_Input_KeyboardAndMouse",
"Win32_UI_Shell",
] }
windows.workspace = true
15 changes: 1 addition & 14 deletions th19loader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,7 @@ winres = "0.1"
[dependencies]
anyhow.workspace = true
junowen-lib = { path = "../junowen-lib" }
windows = { version = "0.52.0", features = [
"Win32_Foundation",
"Win32_Graphics_Direct3D9",
"Win32_System_Console",
"Win32_System_Diagnostics_Debug",
"Win32_System_Diagnostics_ToolHelp",
"Win32_System_LibraryLoader",
"Win32_System_Memory",
"Win32_System_ProcessStatus",
"Win32_System_SystemInformation",
"Win32_System_SystemServices",
"Win32_System_Threading",
"Win32_UI_WindowsAndMessaging",
] }
windows.workspace = true

[package.metadata.winres]
LegalCopyright = "© Progre"
Expand Down

0 comments on commit c6bd9be

Please sign in to comment.