mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-23 08:50:27 +01:00
Fix AccessDenied in Steam Detection
This commit is contained in:
parent
e52459d02d
commit
76c93c81e5
|
|
@ -29,3 +29,4 @@ It does help this project on being supported.
|
|||
- Append `controller_blacklist` to `config.vdf` if missing
|
||||
- Add configurable BackPanel keys (allowed mappings are subject to change)
|
||||
- Fix delay in X360Rumble: Do not send repeated haptic if disabled
|
||||
- Fix `AccessDenied` in Steam Detection
|
||||
|
|
|
|||
|
|
@ -27,17 +27,8 @@ namespace SteamController.Helpers
|
|||
var value = GetValue<int>(ActiveProcessKey, PIDValue);
|
||||
if (value is null)
|
||||
return null;
|
||||
try
|
||||
{
|
||||
using (var process = Process.GetProcessById(value.Value))
|
||||
{
|
||||
return !process.HasExited;
|
||||
}
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
using (var process = SteamProcess)
|
||||
return process is not null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -102,12 +93,14 @@ namespace SteamController.Helpers
|
|||
return null;
|
||||
try
|
||||
{
|
||||
return Process.GetProcessById(value.Value);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
return null;
|
||||
var process = Process.GetProcessById(value.Value);
|
||||
if (!process.ProcessName.Equals("Steam", StringComparison.CurrentCultureIgnoreCase))
|
||||
return null;
|
||||
if (process.HasExited)
|
||||
return null;
|
||||
return process;
|
||||
}
|
||||
catch { return null; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue