We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Borderless Gaming will freeze when you lock the computer screen, possibly in other scenarios that fit the same criteria.
GetForegroundWindow may return NULL under certain conditions, one of which, is when the lock screen is active.
Then GetWindowThreadProcessId will return NULL too (Which happens to be a valid PID, the System Idle process) ,
Then when it tries to create a ProcessDetails class, for an invalid process, which tries to get the window title for an invalid window.
Borderless-Gaming/BorderlessGaming.Logic/Windows/ForegroundManager.cs
Lines 33 to 35 in 3cc4dc6
It will then hang indefinitely trying to do so here:
Borderless-Gaming/BorderlessGaming.Logic/Models/ProcessDetails.cs
Lines 56 to 59 in 3cc4dc6
Checks for NULL/Invalid handles need to be introduced:
An early return here:
Line 33 in 3cc4dc6
var handle = Native.GetForegroundWindow(); if(handle == IntPtr.Zero) return;
And maybe a short circuit here:
if ((_windowHandle != IntPtr.Zero) && !Native.IsWindow(_windowHandle)) { _windowHandle = Native.GetMainWindowForProcess(Proc).GetAwaiter().GetResult(); }
Or ensure a ProcessDetails class can't be created for an invalid process/window
9.5.6.1328 - git 3cc4dc6
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Requirements
Summary
Borderless Gaming will freeze when you lock the computer screen, possibly in other scenarios that fit the same criteria.
Steps to reproduce
Technical details
GetForegroundWindow may return NULL under certain conditions, one of which, is when the lock screen is active.
Then GetWindowThreadProcessId will return NULL too (Which happens to be a valid PID, the System Idle process) ,
Then when it tries to create a ProcessDetails class, for an invalid process, which tries to get the window title for an invalid window.
Borderless-Gaming/BorderlessGaming.Logic/Windows/ForegroundManager.cs
Lines 33 to 35 in 3cc4dc6
It will then hang indefinitely trying to do so here:
Borderless-Gaming/BorderlessGaming.Logic/Models/ProcessDetails.cs
Lines 56 to 59 in 3cc4dc6
Checks for NULL/Invalid handles need to be introduced:
An early return here:
Borderless-Gaming/BorderlessGaming.Logic/Windows/ForegroundManager.cs
Line 33 in 3cc4dc6
And maybe a short circuit here:
Borderless-Gaming/BorderlessGaming.Logic/Models/ProcessDetails.cs
Lines 56 to 59 in 3cc4dc6
Or ensure a ProcessDetails class can't be created for an invalid process/window
version
9.5.6.1328 - git 3cc4dc6
The text was updated successfully, but these errors were encountered: