Closed Bug 649236 Opened 9 years ago Closed 9 years ago

AccessibleObjectFromEvent not working in-process in 64 bit builds

Categories

(Core :: Disability Access APIs, defect)

x86
Windows 7
defect
Not set

Tracking

()

VERIFIED FIXED
mozilla8

People

(Reporter: Jamie, Assigned: surkov)

References

Details

(Keywords: access)

Attachments

(1 file, 1 obsolete file)

AccessibleObjectFromEvent() works fine out-of-process in 64 bit builds. However, in-process, it seems to return an oleacc client accessible instead of a Gecko accessible. I have no idea why this is the case. As far as Gecko is concerned, WM_GETOBJECT should be received and handled the same way, regardless of whether it's in-process or out-of-process.

Marking as unconfirmed because this needs to be tested/verified outside of NVDA code. I'd use Accprobe, but I'm pretty sure it can't do in-context events for 64 bit processes.

Related NVDA ticket: http://www.nvda-project.org/ticket/1454
It seems to be AccessibleObjectFromWindow with the actual problem, though AccessibleObjectFromEvent calls it internally.
A work around has been implemented in NVDA changeset:main,4474 which replaces a call to AccessibleObjectFromEvent with custom code that  sends WM_GETOBJECT, calls ObjectFromLresult, and tries accChild. All the things that I'd think AccessibleObjectFromEvent/AccessibleObjectFromWindow would do normally.
this allows NVDA to render buffers for 64 bit Mozilla Gecko documents.
Although further testing needs to be done to prove this, I don't think this bug can be Gecko specific.
Flags: in-litmus-
Actually, after further investigation, the bug is Gecko's. when gecko handles WM_GETOBJECT it checks lParam to see if its OBJID_CLIENT: http://mxr.mozilla.org/mozilla-central/source/widget/src/windows/nsWindow.cpp#5236
However,  MSDN states in http://msdn.microsoft.com/en-us/library/dd373892%28v=vs.85%29.aspx that the lParam must be cast to DWORD before comparison with one of the OBJID constants as on 64 bit Windows not doing this can cause issues with the sign extension.
My own testing with a custom 64 bit window proc handling WM_GETOBJECT confirms that  the comparison does fail when AccessibleObjectFromWindow is called from 64 bit to 64 bit, but not called from 32 bit to 32 bit or 32 bit to 64 bit.
I do not understand yet why my own custom code I implemented in NVDA which sends the WM_GETOBJECT message manually gets around the bug.
Marking as new given Mick's thorough testing and findings.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to comment #3)
> Marking as new given Mick's thorough testing and findings.

guys, you've passed more than half of road :) after verbal patch description one step is to upload patch and ask for review ;) Thank you for doing this!
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
Attachment #542408 - Flags: review?(roc)
Attachment #542408 - Flags: feedback?(mick)
Attached patch patchSplinter Review
the previous one is wrong
Attachment #542408 - Attachment is obsolete: true
Attachment #542408 - Flags: review?(roc)
Attachment #542408 - Flags: feedback?(mick)
Attachment #542409 - Flags: review?(roc)
Attachment #542409 - Flags: feedback?(mick)
Comment on attachment 542409 [details] [diff] [review]
patch

Review of attachment 542409 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #542409 - Flags: review?(roc) → review+
landed http://hg.mozilla.org/mozilla-central/rev/62cb7ce43f42
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
Attachment #542409 - Flags: feedback?(mick)
Mick verified fixed in Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:8.0a1) Gecko/20110720 Firefox/8.0a1
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.