Don't fail scaling on unreadable integrity level when elevated#1428
Don't fail scaling on unreadable integrity level when elevated#1428Kamefrede wants to merge 1 commit into
Conversation
| } | ||
| } else if (currentIL >= SECURITY_MANDATORY_HIGH_RID && | ||
| !Win32Helper::GetWindowProcessHandle(hWnd)) { | ||
| Logger::Get().Warn("Cannot read source window integrity level; process is elevated, proceeding anyway"); |
There was a problem hiding this comment.
I don't know Mandarin and I didn't want to put an AI translated message here, so if anyone could advise I'd be grateful
|
Thanks for the contribution. The integrity level check exists to prevent operations such as changing the cursor position or foreground window from being blocked by UIPI. This is especially important for windowed mode scaling. When Magpie is running with administrator privileges, refusing to scale if it cannot obtain a handle to the game process is intentional (although I agree the current error message is misleading). The reasoning is that if a game has protection mechanisms in place, attempting to manipulate its window is inherently risky, and there’s no guarantee those operations will succeed. You can certainly modify the code to force scaling, but you'll need to do so at your own risk. |
|
I see, I wasn't aware of that. |
Description
SrcTracker::Setrejects scaling withScalingError:LowIntegrityLeveland shows the run as administrator toast in two different scenarios, and treats them indetically:The second scenario occurs when a handle to the source process can't be opened (
GetProcessHandleFromHwndreturnsERROR_ACCESS_DENIED). This is common on games protected by anti-cheat driver.When this happens, Magpie prompts the user saying that for it to scale the window it needs to be running as administrator, which can be misleading in case if it is already running as administrator.
Change
When the integrity level can't be read because the process handle can't be opened and Magpie is running with elevated privileges, log a warning and proceed instead of failing.
This should be ok in most scenarios as
Windows.Graphics.Captureoperates at the compositor level and does not need the source process.Video
Before the change
devenv_z7pUX6dZpK.mp4
After the change
devenv_yBgyBZUyhp.mp4