UIA client detection is broken on Windows 10
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox118 | --- | fixed |
People
(Reporter: Jamie, Assigned: Jamie)
References
Details
Attachments
(1 file)
UIA client detection has been broken for quite some time on both Windows 10 and Windows 11. Bug 1838123 replaced the old detection code with a new implementation which works on Windows 11. Unfortunately, it doesn't work on Windows 10.
| Assignee | ||
Comment 1•2 years ago
|
||
On Windows 10:
- UIA named pipes initially aren't created for Firefox, even though they are created for other processes. This suggests that pipes aren't used for the UIA -> IA2 proxy.
- If I press control+o to bring up the Windows open file dialog (which includes controls that have a native UIA implementation), a UIA pipe does get created.
- HOOKUTIL_SYNC_MSG is received and the HOOK_SHMEM section does get created.
- Switching back to the old UIA detection code (by reverting the patch in bug 1838123) and changing HOOKUTIL_MSG to HOOKUTIL_SYNC_MSG makes UIA detection work.
Out of curiosity, I confirmed that on Windows 11 where the pipe does get created, the HOOK_SHMEM section is never created. So, it seems the UIA -> IA2 proxy communicates using the pipe in Windows 11, but not in Windows 10. Windows 10 also shows HookBasedServerConnection stuff in the stack where Gecko a11y gets instantiated, whereas Windows 11 does not.
I'm not quite sure how to deal with this yet. One option is obviously to reinstate the old detection code in such a way that it coexists with the new detection code, enabling the old code for Windows 10 and the new code for Windows 11. This is going to be pretty ugly though. I'd also prefer to avoid this because we'll likely have a native UIA implementation at some point, after which this would no longer be needed.
Another option is to use UIA natively somehow so that the pipe gets created. However, we still need the UIA -> IA2 proxy for now and I don't think those two things can coexist on the same object. Maybe the root object could somehow be native UIA but delegate to the UIA -> IA2 proxy for children? I'm not sure if that's possible.
| Assignee | ||
Comment 2•2 years ago
|
||
Maybe the root object could somehow be native UIA
Nope. This would break NVDA, since it would then prefer UIA over IA2. :(
| Assignee | ||
Comment 3•2 years ago
|
||
Even with the old UIA detection code, blocking doesn't work. If I put narrator.exe in the block list, start Narrator and start Firefox, our hook runs and tries to block UIA, but it doesn't actually work; Gecko a11y gets instantiated and Narrator still works just fine. It looks like our hook somehow gets the message after UIA has already instantiated a11y. Maybe our hook ends up after the UIA hook, but we supposedly have code to deal with that.
I'm not convinced blocking like this could work anyway. We might block the first message, but we only try this hook detection a max of 5 times. It seems likely that a client might legitimately poke us more than 5 times; e.g. a client which responds to focus events might query for every focus event.
| Assignee | ||
Comment 4•2 years ago
|
||
The new detection code introduced in bug 1838123 doesn't work on Windows 10.
This patch:
- Splits the Windows 11 code into its own function.
- Refactors the system handle enumeration code into its own function which can be called with a lambda, since it is needed for both Windows 11 and Windows 10.
- Adds code to detect clients on Windows 10 based on the old detection code before bug 1838123, with some noteworthy changes:
- Hooking the UIA window message doesn't work; our hook runs too late. It also doesn't work well for blocking; some clients will very likely poke us more than the maximum attempts in the old code (5 times).
- Instead, we run this code as part of LazyInstantiator::ShouldInstantiate, just as we do for all other client detection.
- This means we use the same UIA detection caching strategy; i.e. reset on foreground changes.
- It also means we reuse the same instantiator setting and block listing code in LazyInstantiator.
Comment 6•2 years ago
|
||
Backed out for causing bustage on CompatibilityUIA.cpp
- backout: https://hg.mozilla.org/integration/autoland/rev/3951ba8d46ada1b519bccbff6c94ced52fd96cd0
- push: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&revision=e57e57aa46ba569fccaca07dd281244588a3bfcf
- failure log: https://treeherder.mozilla.org/logviewer?job_id=425379196&repo=autoland&lineNumber=9998
[task 2023-08-09T10:43:48.313Z] 10:43:48 INFO - /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang-cl -fms-compatibility-version=19.29 -Xclang -std=c++17 -Xclang -ivfsoverlay -Xclang /builds/worker/fetches/vs/overlay.yaml -FoCompatibilityUIA.obj -c -I/builds/worker/workspace/obj-build/dist/stl_wrappers -guard:cf -DNDEBUG=1 -DTRIMMED=1 -DUNICODE -D_UNICODE -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -D_SECURE_ATL -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DWIN32 -D_WIN32 -D_WINDOWS -DWIN32_LEAN_AND_MEAN -DWINAPI_NO_BUNDLED_LIBRARIES -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API[............................]
[task 2023-08-09T10:43:48.313Z] 10:43:48 ERROR - /builds/worker/checkouts/gecko/accessible/windows/msaa/CompatibilityUIA.cpp(213,3): error: unknown type name 'nsAutoHandle'
[task 2023-08-09T10:43:48.313Z] 10:43:48 INFO - nsAutoHandle section;
[task 2023-08-09T10:43:48.313Z] 10:43:48 INFO - ^
[task 2023-08-09T10:43:48.313Z] 10:43:48 ERROR - /builds/worker/checkouts/gecko/accessible/windows/msaa/CompatibilityUIA.cpp(238,3): error: no template named 'nsTHashSet'
[task 2023-08-09T10:43:48.313Z] 10:43:48 INFO - nsTHashSet<uint32_t> nonSectionObjTypes;
[task 2023-08-09T10:43:48.313Z] 10:43:48 INFO - ^
[task 2023-08-09T10:43:48.313Z] 10:43:48 ERROR - /builds/worker/checkouts/gecko/accessible/windows/msaa/CompatibilityUIA.cpp(239,14): error: use of undeclared identifier 'nsVoidPtrHashKey'
[task 2023-08-09T10:43:48.313Z] 10:43:48 INFO - nsTHashMap<nsVoidPtrHashKey, DWORD> objMap;
[task 2023-08-09T10:43:48.313Z] 10:43:48 INFO - ^
[task 2023-08-09T10:43:48.313Z] 10:43:48 ERROR - /builds/worker/checkouts/gecko/accessible/windows/msaa/CompatibilityUIA.cpp(330,7): error: use of undeclared identifier 'IsWin11OrLater'
[task 2023-08-09T10:43:48.313Z] 10:43:48 INFO - if (IsWin11OrLater()) {
[task 2023-08-09T10:43:48.313Z] 10:43:48 INFO - ^
[task 2023-08-09T10:43:48.313Z] 10:43:48 ERROR - /builds/worker/checkouts/gecko/accessible/windows/msaa/CompatibilityUIA.cpp(55,3): error: unknown type name 'nsAutoHandle'
[task 2023-08-09T10:43:48.313Z] 10:43:48 INFO - nsAutoHandle baseNamedObjects(rawBaseNamedObjects);
[task 2023-08-09T10:43:48.313Z] 10:43:48 INFO - ^
[task 2023-08-09T10:43:48.313Z] 10:43:48 INFO - 5 errors generated.
[task 2023-08-09T10:43:48.313Z] 10:43:48 ERROR - gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:661: CompatibilityUIA.obj] Error 1
| Assignee | ||
Updated•2 years ago
|
Comment 8•2 years ago
|
||
| bugherder | ||
Description
•