-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Don't open exclusive handles when reading shortcuts #37635
Conversation
d790a1a
to
b009d53
Compare
cc @zadjii-msft |
We should be sure this fix is in cmdpal |
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.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
src/modules/launcher/Wox.Infrastructure/ShellLinkHelper.cs:141
- [nitpick] Consider centralizing the STGM_* constants into a shared utility or header if they are used elsewhere, which would improve maintainability and clarity.
const int STGM_SHARE_DENY_NONE = 0x00000040;
src/modules/launcher/Wox.Infrastructure/ShellLinkHelper.cs:145
- Ensure that unit tests are updated or added to cover scenarios where the shortcut file is accessed concurrently so that the change in sharing mode does not introduce regressions.
((IPersistFile)link).Load(path, STGM_READ | STGM_SHARE_DENY_NONE);
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.
Yu will help on try out the fix
I'm not sure, but seems I can still repo this issues with your fix. Repo steps:
|
Thank you for trying this out @moooyo. I couldn't build an installer locally so I was planning to use the CI to get it and validate the change. If that doesn't solve it, it might mean that the exclusive handle is coming from another place. Does powertoys open desktop shortcuts from somewhere else ? |
Did you check the program plugin? It scans the desktop shortcuts. |
Closing in favor of #37654 |
This updates the
ShellLinkHelper
logic to pass theSTGM_SHARE_DENY_NONE
when reading desktop shortcuts to make sure that powertoys doesn't interfere with other programs.See: microsoft/WSL#11276 (comment)
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed