NVDA no longer becomes unusable when interacting with a protected process such as 1Password#18948
Merged
Conversation
…h access denied, as the process living for ever, avoiding the endless PermissionError exceptions making NVDA unusable. Processes such as 1Password disallow waiting on the process.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes NVDA becoming unusable when interacting with protected processes like 1Password by properly handling access denied errors when checking process liveness.
- Adds graceful handling of ERROR_ACCESS_DENIED when waiting on process handles
- Implements a
_liveForEverflag to mark protected processes as permanently alive - Logs debug warnings for access denied scenarios instead of crashing
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| source/winKernel.py | Adds ERROR_ACCESS_DENIED constant for error handling |
| source/appModuleHandler.py | Implements _liveForEver flag and error handling for protected processes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
seanbudd
approved these changes
Sep 19, 2025
Member
Author
|
We could, but would involve checking where it was used, changing
references, possible deprecations. I'd prefer to just fix this
particular bug in this pr :)
|
SaschaCowley
approved these changes
Sep 19, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Link to issue number:
None
Summary of the issue:
During the conversion to 64 bit, the ctypes definition of WaitForSingleObject was tightened up. This caused related errors in NVDA previously hidden to be surfaced, such as continuing to keep an appModule alive with an invalid process handle. this was addressed.
However, a similar issue was also surfaced where although we successfully open a process, asking for the SYNCHRONIZE access right, once we go to check if the process is dead by calling
WaitforSingleObject(handle, 0)this fails with access denied. We never actually got the SYNCHRONIZE access right.This is most serious when trying to interact with 1Password, where it becomes totally unusable and NVDA continuously torws the error:
This error is also randomly seen from time to time when alt tabbing between windows. There may be another protected Windows process which happens to be noticed by NVDA.
Description of user facing changes:
NVDA no longer becomes unusable when interacting with a protected process.
Description of developer facing changes:
Description of development approach:
AppModule.isAlive: specifically handle the case when WaitForSingleObject fails, and the related error is ERROR_ACCESS_DENIED. Log a debugWarning the first time, but then set a special
_liveForEverinstance variable on the AppModule to true, communicating to isAlive that it should no longer check. We are not going to magically get access, so all we can do is assume it continues to be alive.The debugWarning looks like:
Testing strategy:
Known issues with pull request:
AppModules for Protected processes will stay around for the lifetime of NvDA. In 1Password's case, its process seems to stay around a lot anyway. And any other protected process probably has no specific appModule.
Code Review Checklist: