nvda
38962092 - Fix in-process COM proxy registration (#20301)

Commit
63 days ago
Fix in-process COM proxy registration (#20301) ### Link to issue number: <!-- Use Closes/Fixes/Resolves #xxx to link this PR to the issue it is responding to. --> Based on top of @jcsteh's pr #20297 which addresses a deadlock between ia2support uninstallation and NVDA helper remote re-initialization. Fixes #16020 Fixes #16207 ### Summary of the issue: Sometimes reading in text input fields in Chrome / Firefox, such as the Chat GPT input field, suddenly stops working and just says blank. Sometimes when restarting NVDA, explorer or other apps will crash. Both of these are most likely related to issues with how in-process COM proxy registerations occur in NVDA. this PR attempts to clean up the registration code to avoid these. ### Description of user facing changes: ### Description of developer facing changes: ### Description of development approach: * comProxyRegistration.cpp: Cache the generated proxy CLSID which is used when registering the proxy's class object, so that the proxy CLSID is the same value across all threads, and therefore calling CoRegisterPSClsid to point an interface to the proxy can be done from multiple threads even though it is process-wide. * When restoring the interface proxy registrations on termination, don't force interfaces with no backup over to the standard marshaller. It is safer to just leave it dangling - an invalid CLSID is better than the wrong one. * ia2support.cpp: when terminating, restore all the interface pointers on one bulk action, rather than when unregistering on each thread, otherwise interface pointers would be restored multiple times. ### Testing strategy: * [x] Test try build for a long time to ensure that Chat GPT input field and others in Chrome / Firefox does not suddenly become unusable. ### Known issues with pull request: ### Code Review Checklist: <!-- This checklist is a reminder of things commonly forgotten in a new PR. Authors, please do a self-review of this pull-request. Check items to confirm you have thought about the relevance of the item. Where items are missing (eg unit / system tests), please explain in the PR. To check an item `- [ ]` becomes `- [x]`, note spacing. You can also check the checkboxes after the PR is created. A detailed explanation of this checklist is available here: https://github.com/nvaccess/nvda/blob/master/projectDocs/dev/githubPullRequestTemplateExplanationAndExamples.md#code-review-checklist --> - [x] Documentation: - Change log entry - User Documentation - Developer / Technical Documentation - Context sensitive help for GUI changes - [x] Testing: - Unit tests - System (end to end) tests - Manual testing - [x] UX of all users considered: - Speech - Braille - Low Vision - Different web browsers - Localization in other languages / culture than English - [x] API is compatible with existing add-ons. - [x] Security precautions taken. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Sean Budd <sean@nvaccess.org>
Parents
Loading