[FileLocksmith]Query system processes if elevated
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
- [x] Closes: #21661
- [x] Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
- [ ] Tests: Added/updated and all pass
- [x] Localization: All end user facing strings can be localized
- [ ] Dev docs: Added/updated
- [ ] New binaries: Added on the required places
- [ ] JSON for signing for new binaries
- [ ] WXS for installer for new binaries and localization folder
- [ ] YML for CI pipeline for new test projects
- [ ] YML for signed pipeline
- [ ] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx
Detailed Description of the Pull Request / Additional comments
- When running elevated, ask for SeDebugPrivilege for the File Locksmith process in order to be able to view files used by system processes.
- The user of each process is now sent with the process results instead of queried from the UI, so moved this function accordingly and removed the interop function from the API.
- Add a warning in UI when listing a system process.
- Also make the list of files selected by the context menu selectable as a minor fix.
Validation Steps Performed
Tried it on the Windows folder running as elevated and verified the system processes are shown.
@niels9001 , is the added Glyph="" (warning) icon something we can use safely here? (wondering because of the asian fonts conflict)
- Should we show a warning bar (even if results are empty) when running as normal user that maybe some results are missing because of not enough permission?
- Can we add a warning/confirmation message that is shown when you close the process owned by a different user or the system/nt-service, ... user?
- Small bug also existing in v0.64.0: If you restart it as admin and the uac is disabled the "run elevated" icon isn't shown after restart. It should still be shown if you don't have admin permission.
- Should we show a warning bar (even if results are empty) when running as normal user that maybe some results are missing because of not enough permission?
- Can we add a warning/confirmation message that is shown when you close the process owned by a different user or the system/nt-service, ... user?
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.
- Small bug also existing in v0.64.0: If you restart it as admin and the uac is disabled the "run elevated" icon isn't shown after restart. It should still be shown if you don't have admin permission.
Yeah, the elevated detection logic could be better.
@jaimecbernardo I will open the ui improvements issues tomorrow or on Sunday. Should I open an issue for the elevation logic improvement too?
@jaimecbernardo I will open the ui improvements issues tomorrow or on Sunday. Should I open an issue for the elevation logic improvement too?
I'll try to include that in this PR, since it also uses elevation. Thank you!
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!
- Should we show a warning bar (even if results are empty) when running as normal user that maybe some results are missing because of not enough permission?
- Can we add a warning/confirmation message that is shown when you close the process owned by a different user or the system/nt-service, ... user?
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.
@jaimecbernardo I have opened the issues.