Skip to content
New issue

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

PowerToys Run doesn't open if window running as admin is in foreground #4427

Closed
arjunbalgovind opened this issue Jun 22, 2020 · 15 comments
Closed
Labels
Issue-Bug Something isn't working Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@arjunbalgovind
Copy link
Contributor

arjunbalgovind commented Jun 22, 2020

Steps to reproduce

Start PowerToys as admin, and open cmd as admin. Press Alt+Space

Expected behavior

PT Run should appear

Actual behavior

PT Run doesn't appear and window context menu gets opened.

@arjunbalgovind arjunbalgovind added Product-PowerToys Run Improved app launch PT Run (Win+R) Window Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Jun 22, 2020
@crutkas
Copy link
Member

crutkas commented Jun 23, 2020

doesn't KBM have the same issue?

This is elevation issues

@arjunbalgovind
Copy link
Contributor Author

arjunbalgovind commented Jun 23, 2020

@crutkas Yes, but it would work earlier on 0.18.2 because we were using RegisterHotkey and not LL hooks. The other difference is that for KBM you can restart PT as admin and it will work fine, but since the changes in #3451 even if you restart PT as admin, PowerToys Run will run at user privilege, and the hook logic is running in the same process.
The correct workaround would be to move that low level hook logic to runner itself or to another process with same privilege as runner, so that restarting as admin works.

Edit: Edited the repro steps to start PT as admin

@crutkas
Copy link
Member

crutkas commented Jun 23, 2020

we'd have to have a comm channel then to PT Run as the exe for PT Run will always launch non-elevated now

@djibe
Copy link

djibe commented Jun 24, 2020

Hi, same issue but very SEVERE with total Windows 10 v2004 crash.

  1. Probably launch a cmd/software with Administrator privileges
  2. Install latest Powertoys
  3. Set to sleep for the night
  4. When going out of sleep, PT sends message concerning Administrator privileges
    AND Powertoys Run is crashed and cannot be killed.
    Even at shutdown, Windows is unable to kill Run app.
    Force shutdown.
  5. Restart PC, Windows will never boot

Tried everything with Windows Recovery (Safe mode KO, autodiag, sfc /offbootdir, ...chkdsk). Nothing works.
PC totally crashed by Powertoys (Run is probably the one)

NB. Bitdefender Free Antivirus blocked Fusion.dll. I don't know if this can help.

@arjunbalgovind
Copy link
Contributor Author

@djibe Can you open a separate issue for that? The issue I created does not happen in 0.18.2 and it's for tracking a change made in master.

@djibe
Copy link

djibe commented Jun 24, 2020

Done with #4471
Thanks.

@htcfreek
Copy link
Collaborator

We have the same bug on KBM if it is not running as admin. (PT 0.19.0)

@arjunbalgovind
Copy link
Contributor Author

Yes for KBM there isn't much we can do since that is how low level hooks work. But running as admin brings the process to the same privilege level so that fixes it. In launcher however some logic was changed such that PowerLauncher.exe will always run at user level (since running at admin level was causing certain other issues), which is why even if you run PT as admin, PT Run's hotkey has this issue.

@htcfreek
Copy link
Collaborator

The reference of issue 4608 was a mistake of mine.

@htcfreek
Copy link
Collaborator

htcfreek commented Jun 30, 2020

Yes for KBM there isn't much we can do since that is how low level hooks work.

@arjunbalgovind
Maybe we can bring KBM in a extra exe file an run it every time as admin. Then it's fixed.

@Lexikos
Copy link

Lexikos commented Jul 4, 2020

@arjunbalgovind @htcfreek
If the executable which registers the hook uses the uiAccess="true" attribute in its manifest (and meets all of the requirements for that), even without running as admin it would be able to intercept keystrokes destined for elevated apps. See Security Considerations for Assistive Technologies.

@arjunbalgovind
Copy link
Contributor Author

@arjunbalgovind @htcfreek
If the executable which registers the hook uses the uiAccess="true" attribute in its manifest (and meets all of the requirements for that), even without running as admin it would be able to intercept keystrokes destined for elevated apps. See Security Considerations for Assistive Technologies.

@enricogior @crutkas This is something we could consider for all the modules with LL hooks. I had mentioned it earlier as a requirement for solving certain key remap scenarios for KBM in #3192 , but this can also be used to avoid running modules with elevation.

@leo2d
Copy link

leo2d commented Sep 5, 2020

Same issue here:
When I try opening PowerToys Run from a Windows Terminal window running as admin, the PowerToys Run doest not open.

Windows: Version 10.0.19041 Build 19041
PowerToys: 0.21.1

@saahmedm saahmedm added the Priority-3 Bug that is low priority label Sep 11, 2020
@saahmedm saahmedm modified the milestones: InVEST-2009, InVEST-2010 Sep 14, 2020
@saahmedm saahmedm added Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Priority-3 Bug that is low priority labels Oct 5, 2020
@saahmedm
Copy link
Contributor

saahmedm commented Oct 5, 2020

This has been fixed! Update your Powertoys if you haven't yet 😄

@saahmedm saahmedm closed this as completed Oct 5, 2020
@austin-patterson
Copy link

I've noticed that this is absolutely still an issue, exactly as described here. I've noticed this since at least v0.62. Currently I am using v0.70.1 and I cannot launch PT Run while focused on any elevated application. Changing focus is still a workaround but inconvenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests

8 participants