Closed Bug 1414790 Opened 7 years ago Closed 2 years ago

IID_ISimpleDOMNode is not working with Windows 7

Categories

(Core :: Disability Access APIs, defect, P5)

57 Branch
x86_64
Windows 7
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: rajeshcode, Unassigned)

Details

(Keywords: regression)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36

Steps to reproduce:

I am trying to find the URLs in Mozilla Firefox beta 57.0b14, but "QueryService" API is failing with error code 127 on Windows 7 machines. And it works fine with Windows 8 and Windows 10 machines, Sample code is given below:

// header files
#include "ISimpleDOMNode.h"
#include "ISimpleDOMText.h"
#include "ISimpleDOMDocument.h"

// GUIDs
const GUID refguid = {0x0c539790, 0x12e4, 0x11cf, 0xb6, 0x61, 0x00, 0xaa, 0x00, 0x4c, 0xd6, 0xd8};
const IID IID_ISimpleDOMNode= {0x1814ceeb,0x49e2,0x407f,0xaf,0x99,0xfa,0x75,0x5a,0x7d,0x26,0x07};
const IID IID_ISimpleDOMText= {0x4e747be5,0x2052,0x4265,0x8a,0xf0,0x8e,0xca,0xd7,0xaa,0xd1,0xc0};
const IID IID_ISimpleDOMDocument= {0x0D68D6D0,0xD93D,0x4d08,0xA3,0x0D,0xF0,0x0D,0xD1,0xF4,0x5B,0x24};

 #ifndef NAVRELATION_EMBEDS
	#define NAVRELATION_EMBEDS 0x1009 
 #endif
/////////////////////////////////////

IAccessible *pAccBrowser = NULL;
hr = AccessibleObjectFromWindow(hwnd, OBJID_CLIENT, IID_IAccessible, (void**)&pAccBrowser); //SUCCESS
hr = pAccBrowser->accNavigate(NAVRELATION_EMBEDS,vtStart,&vtResult); //SUCCESS
IDispatch *pDisp = vtResult.pdispVal;
IAccessible *pAccDoc = NULL; 
hr = pDisp->QueryInterface(IID_IAccessible,(void **)&pAccDoc); //SUCCESS
IServiceProvider *pServProv = NULL; 
hr = pAccDoc->QueryInterface(IID_IServiceProvider, (void **)&pServProv); //SUCCESS
ISimpleDOMNode *pNode = NULL; 
hr = pServProv->QueryService(refguid, IID_ISimpleDOMNode,(void **)&pNode); //FAILED with error code 127 on Windows 7 machines


Actual results:

IID_ISimpleDOMNode failed with error code 127 on Windows 7 machines


Expected results:

IID_ISimpleDOMNode is will successfully return the pointer on Windows 7 machines
Severity: normal → critical
Component: Untriaged → Disability Access
OS: Unspecified → Windows 7
Hardware: Unspecified → x86_64
Severity: critical → major
Component: Disability Access → Disability Access APIs
Product: Firefox → Core
We had another report of this from our contact at Baum, who reported that QueryService for ISimpleDOM returned 0x8007007e (The specified module could not be found). We consider ISimpleDOM deprecated, but it seems it's still widely used and this is regressing clients.
Keywords: regression
Hello Jamie, we are still using "ISimpleDOM" for finding the URLs in Firefox window, and also facing this issue.
I do plan to look into this. Having said that, if you only want URLs, there's no need to use ISimpleDOM. Instead, IAccessible::accValue on a document or link will give you its URL. You shoul dprefer IAccessible* methods wherever possible over ISimpleDOM. Thanks.
Rajesh, I assume you're trying this out-of-process? If so, is it possible the bitness of your app and Firefox do not match; i.e. your app is 32 bit and Firefox is 64 bit?

Using ISimpleDOM out-of-process requires a COM proxy dll to be registered. Moreover, proxy dlls are architecture specific. For example, if you have 64 bit Firefox and a 32 bit accessibility client, you must have *both* a 64 bit and a 32 bit proxy dll registered. However, Firefox will *only* install a proxy dll matching Firefox's build architecture; e.g. 64 bit Firefox only installs a 64 bit proxy.

As to why you get this error specifically, my guess is that you previously had 32 bit Firefox installed and you then replaced it with (or updated to) 64 bit Firefox. In that case, the 32 bit registration might still be present, but the dll would no longer be on your system.
Flags: needinfo?(rajeshcode)
Priority: -- → P5
(In reply to James Teh [:Jamie] from comment #4)
> Rajesh, I assume you're trying this out-of-process? If so, is it possible
> the bitness of your app and Firefox do not match; i.e. your app is 32 bit
> and Firefox is 64 bit?
> 
> Using ISimpleDOM out-of-process requires a COM proxy dll to be registered.
> Moreover, proxy dlls are architecture specific. For example, if you have 64
> bit Firefox and a 32 bit accessibility client, you must have *both* a 64 bit
> and a 32 bit proxy dll registered. However, Firefox will *only* install a
> proxy dll matching Firefox's build architecture; e.g. 64 bit Firefox only
> installs a 64 bit proxy.
> 
> As to why you get this error specifically, my guess is that you previously
> had 32 bit Firefox installed and you then replaced it with (or updated to)
> 64 bit Firefox. In that case, the 32 bit registration might still be
> present, but the dll would no longer be on your system.


1. Yes, you are correct - our application is 32 bit and Firefox is 64 bit. But please note that before this issue with Windows 7 OS, everything works fine with 64-bit Firefox.

2. If possible kindly tell us the name of COM proxy dll you are referring, so that we can register it through "regsvr32" command.
Flags: needinfo?(rajeshcode)
we are also getting the following error codes:

hr = pServProv->QueryService(refguid, IID_ISimpleDOMNode,(void **)&pNode); //FAILED with error code 193 and 14007 on Windows 7 machines
(In reply to Rajesh VR from comment #5)
> 1. Yes, you are correct - our application is 32 bit and Firefox is 64 bit.
> But please note that before this issue with Windows 7 OS, everything works
> fine with 64-bit Firefox.

It was never possible for ISimpleDOM to work without correct proxy dlls being registered. Also, as I noted above, Firefox only ships with a proxy dll matching its architecture; i.e. 64 bit Firefox ships with a 64 bit proxy dll. This has not changed. At a guess, I'd say there was a previous 32 bit Firefox installed that was since removed/cleaned up (perhaps even by Firefox itself).

> 2. If possible kindly tell us the name of COM proxy dll you are referring,
> so that we can register it through "regsvr32" command.

The dll is called Accessiblemarshal.dll. However, because you have a 32 bit app, you'll also need a 32 bit version of that dll registered, as well as the 64 bit version registered by Firefox. Unfortunately, the only way you can get the 32 bit dll would be to extract or install a 32 bit version of Firefox.

(In reply to Rajesh VR from comment #6)
> we are also getting the following error codes:
> 
> hr = pServProv->QueryService(refguid, IID_ISimpleDOMNode,(void **)&pNode);
> //FAILED with error code 193 and 14007 on Windows 7 machines

Under what circumstances are you getting these errors? These were not errors you listed before. Are these decimal or hexadecimal HRESULT codes?

Finally, please note that ISimpleDOM is deprecated (and has been so for many years now), especially for out-of-process clients. If you only want URLs, please use IAccessible::accValue.
(In reply to James Teh [:Jamie] from comment #7)
> (In reply to Rajesh VR from comment #5)
> > 1. Yes, you are correct - our application is 32 bit and Firefox is 64 bit.
> > But please note that before this issue with Windows 7 OS, everything works
> > fine with 64-bit Firefox.
> 
> It was never possible for ISimpleDOM to work without correct proxy dlls
> being registered. Also, as I noted above, Firefox only ships with a proxy
> dll matching its architecture; i.e. 64 bit Firefox ships with a 64 bit proxy
> dll. This has not changed. At a guess, I'd say there was a previous 32 bit
> Firefox installed that was since removed/cleaned up (perhaps even by Firefox
> itself).
> 
> > 2. If possible kindly tell us the name of COM proxy dll you are referring,
> > so that we can register it through "regsvr32" command.
> 
> The dll is called Accessiblemarshal.dll. However, because you have a 32 bit
> app, you'll also need a 32 bit version of that dll registered, as well as
> the 64 bit version registered by Firefox. Unfortunately, the only way you
> can get the 32 bit dll would be to extract or install a 32 bit version of
> Firefox.
> 
> (In reply to Rajesh VR from comment #6)
> > we are also getting the following error codes:
> > 
> > hr = pServProv->QueryService(refguid, IID_ISimpleDOMNode,(void **)&pNode);
> > //FAILED with error code 193 and 14007 on Windows 7 machines
> 
> Under what circumstances are you getting these errors? These were not errors
> you listed before. Are these decimal or hexadecimal HRESULT codes?
> 
> Finally, please note that ISimpleDOM is deprecated (and has been so for many
> years now), especially for out-of-process clients. If you only want URLs,
> please use IAccessible::accValue.


1. We got you. Thanks.

2. We tried to register "Accessiblemarshal.dll" as you suggested and now its working fine on 64 bit Windows 8.1 and 10. We are planning to include this 32 bi "Accessiblemarshal.dll" into our installer pack and register it on 64 bit OS. So does this dll file varies from Firefox released build versions?

3. Error code 193 and 14007 are the return values of "GetLastError" API.
Here is the HRESULT value of "QueryService" with ISimpleDOMNode:

Windows 7 (32 bit) -> Error code= 183, HRESULT= 0x80040155
Windows 10 (64 bit) -> Error code= 14007, HRESULT= 0x80040154

4. We need to find UniqueID for each browser tabs. Any idea how we can achieve this?

Hey Rajesh,
Can you still reproduce this issue or should we close it?

Flags: needinfo?(rajeshcode)

Redirect a needinfo that is pending on an inactive user to the triage owner.
:Jamie, since the bug has high severity, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(rajeshcode) → needinfo?(jteh)

To answer the one remaining question here for the record: in theory, AccessibleMarshal.dll could change between Firefox versions. In practice, it hasn't changed for many years and isn't likely to change in future given that it's deprecated.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(jteh)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.