feat(game): Steam + process-scan OS adapters
Step 2-3 of game detection (game-presence-plan.md). The OS edges feeding the pure seams from the previous commit. - src/game/steam.rs: SteamProbe — reads the live RunningAppID and resolves it to a name via appmanifest_<id>.acf (no binary appinfo.vdf). Pure parse fns (parse_running_app_id / parse_library_paths / parse_app_name) over file contents are unit-tested incl. current+legacy libraryfolders shapes, escaped Windows paths, empty/missing names, and garbage. Roots discovered across native/Flatpak/Snap (Linux) and the registry (Windows); libraries and resolved names cached + mtime-invalidated so the 3s poll doesn't rescan. File reads byte-capped. - src/game/scan.rs: native running-process enumeration — /proc (exe symlink, comm fallback) on Linux, Toolhelp on Windows — feeding the pure match_processes. No sysinfo dep (D7). - Cargo.toml: windows-sys as a direct Windows-only dep for the registry + Toolhelp FFI. No NEW crate — it was already in the lockfile transitively via cpal/rfd, so the audit surface is unchanged. 391 lib tests (+5). Linux: build + clippy --all-targets clean. Windows FFI signatures verified against windows-sys 0.61 source (one *const vs *mut lpReserved fixed) but NOT yet cross-compiled — defer to the post-UI Windows build cycle. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -65,3 +65,12 @@ rfd = { version = "0.17", default-features = false }
|
||||
# Windows audio backend: cpal drives WASAPI for capture/playback behind the
|
||||
# AudioBackend trait (src/audio/cpal_impl.rs). The Linux counterpart is pipewire.
|
||||
cpal = "0.15"
|
||||
# Win32 FFI for game detection (no new crate: windows-sys is already pulled in
|
||||
# transitively by cpal/rfd). Registry reads the Steam RunningAppID + install path;
|
||||
# Toolhelp enumerates running processes for the non-Steam process-scan fallback.
|
||||
windows-sys = { version = "0.61", features = [
|
||||
"Win32_Foundation",
|
||||
"Win32_System_Registry",
|
||||
"Win32_System_Diagnostics_ToolHelp",
|
||||
"Win32_System_Threading",
|
||||
] }
|
||||
|
||||
Reference in New Issue
Block a user