-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[FileLocksmith]Query system processes if elevated #21688
[FileLocksmith]Query system processes if elevated #21688
Conversation
@niels9001 , is the added |
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.
Tested locally, LGTM. Added a suggestion
src/modules/FileLocksmith/FileLocksmithLibInterop/NtdllExtensions.cpp
Outdated
Show resolved
Hide resolved
{ | ||
public object Convert(object value, Type targetType, object parameter, string language) | ||
{ | ||
return NativeMethods.PidToUser((uint)value); | ||
string user = ((string)value).ToUpperInvariant().TrimEnd('\0').Trim(); |
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 believe we no longer have to trim \0
|
<FontIcon | ||
Margin="0,0,8,0" | ||
Glyph="" | ||
Foreground="Yellow" |
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.
Is this visible in light mode? If not we should bind against a theme resource for the InfoBarIconBackgrond
. You can look at the PT Run plugin list code for an example on how to do it.
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.
Good catch!
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.
Foreground="{ThemeResource InfoBarWarningSeverityIconBackground}"
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.
Thank you! :) Very helpful!
Those are good ideas. Can you please create a UI improvement issue for 1 and 2? Those are a bit more code involved and should be separated. |
Yeah, the elevated detection logic could be better. |
@jaimecbernardo |
I'll try to include that in this PR, since it also uses elevation. Thank you! |
…ons.cpp Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
Hi, I've included the requested changes to the username function, added proper elevation detection similar to our other C++ utils and used a theme approppriate color. Thanks for your reviews and help! |
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.
Nice!
@jaimecbernardo |
* [FileLocksmith]Query system processes if elevated * Show warning if user is a system user * Make text in the file list selectable * Update src/modules/FileLocksmith/FileLocksmithLibInterop/NtdllExtensions.cpp Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com> * Trim \0 no longer required * Correct elevation detection logic * Use theme approppriate colors Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
Summary of the Pull Request
File Locksmith can't see processes that belong to the system user.
This PR allows that when running elevated.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
Tried it on the Windows folder running as elevated and verified the system processes are shown.