-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Launch elevated instances via shell:AppFolder #14637
Merged
+64
−9
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
62017c0
Launch elevated instances via shell:AppFolder
jboelter 145dd52
length() -> size()
jboelter 039307f
make spell check happy
jboelter 9c794e6
make argc const to satisfy audit mode build
jboelter f69a69e
add wargv to recognized words
jboelter 74c4b0c
Minimized scope of changes and use WIL
jboelter 1aa94bb
fix spelling
jboelter 405e89e
simplification to only change elevate-shim
jboelter f94b4e9
make audit mode happy
jboelter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the previous
pCmdLine
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found an innocuous bug in how the first parameter,
new-tab
, was dropped when passed to elevate-shim.exe by wWinMain given how it's launched byCreateProcess
. It appears wWinMain is assuming param zero is the executable path even if it's not.However, the elevate-shim process is launched with a command line that doesn't include the executable path.
terminal/src/cascadia/TerminalApp/TerminalPage.cpp
Lines 4118 to 4135 in 8e04169
This is the !peb from elevate-shim.exe when launched from a dev build of terminal as an appx (I setup Windbg Preview as the post-mortem debugger and put a DebugBreak() at the top of elevate-shim to break in easily). Notice the
CommandLine
is missing the executable filepath as the first argument. You can also see this in Process Monitor.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeeeeeeeep that's totally on me. We probably could fix that down in TerminalPage.cpp, but 🤷