Allow JAB messages through the Windows message filter before initialising JAB.#10526
Merged
Merged
Conversation
…sing JAB. Internally, the JAB client dll keeps track of Java VMs. This is done via window messages. If a JAB client dll is initialised after a VM, it needs to learn about existing VMs. It does this by broadcasting a message, which is picked up by Java VMs. VMs in turn send a message back to the client DLL. Previously, we allowed messages through the message filter *after* initialising the JAB. That meant that messages from existing Java VMs might be rejected if they were received before the function returned. To fix this, we allow messages through the filter before initialising the JAB.
Contributor
Author
|
Confirmed that this works with an installed signed copy as well. |
Collaborator
|
Wow, thanks for looking into this. This approach is way cleaner than my approach. |
michaelDCurran
approved these changes
Nov 21, 2019
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:
Fixes #10296.
Summary of the issue:
If you start NVDA after a Java app has already started, the Java app is inaccessible to NVDA.
Description of how this pull request fixes the issue:
Internally, the JAB client dll keeps track of Java VMs. This is done via window messages. If a JAB client dll is initialised after a VM, it needs to learn about existing VMs. It does this by broadcasting a message, which is picked up by Java VMs. VMs in turn send a message back to the client DLL. Previously, we allowed messages through the message filter after initialising the JAB. That meant that messages from existing Java VMs might be rejected if they were received before the function returned. To fix this, we allow messages through the filter before initialising the JAB.
Testing performed:
Started Android Studio.
Without the patch, started a source copy of NVDA as admin and confirmed that Android Studio was inaccessible.
With the patch, ran a source copy of NVDA as admin and confirmed that Android Studio was accessible.
Known issues with pull request:
None known. However, it does surprise me that setting up the filter immediately after initialising was breaking things. I would have thought that we'd need a message pump before messages were blocked, and JAB Windows_run doesn't pump as far as I know. Perhaps the filtering actually happens when the message is queued by the VM and that happens before Windows_run returns.
Change log entry:
Bug fixes:
- Java applications started before NVDA are now accessible without the need to restart the Java app. (#10296)