Kaydet (Commit) 732ec36e authored tarafından Michael Stahl's avatar Michael Stahl

winaccessibility: let CoCreateInstance calls find the components

The COM services are not found because they are not registered in the
registry via regsvr32 (doing that is unnecessary since the components
are only instantiated by winaccessibility code and undesirable since
that would likely register the IAccessible2 types too, breaking A11y
tools) and the special manifest resource #97 that ActivateActContext()
tries to load does not exist in UAccCOM.dll; this would need to be a
XML manifest, the *.rgs and *.tlb that are already included as
individual resources won't work.

After reading ATL headers for hours it is immediately obvious that the
COM components can simply be registered by a call to
CComModule::RegisterClassObjects() from DllMain; this just requires
actually loading the UAccCOM library from somewhere so the DllMain runs.

Change-Id: Id58b754835cd2f1bcada37e5639a6b6042a42fd5
üst d04c970e
...@@ -66,10 +66,14 @@ extern "C" ...@@ -66,10 +66,14 @@ extern "C"
if (dwReason == DLL_PROCESS_ATTACH) if (dwReason == DLL_PROCESS_ATTACH)
{ {
_Module.Init(ObjectMap, hInstance, &LIBID_UACCCOMLib); _Module.Init(ObjectMap, hInstance, &LIBID_UACCCOMLib);
_Module.RegisterClassObjects(CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE);
DisableThreadLibraryCalls(hInstance); DisableThreadLibraryCalls(hInstance);
} }
else if (dwReason == DLL_PROCESS_DETACH) else if (dwReason == DLL_PROCESS_DETACH)
{
_Module.RevokeClassObjects();
_Module.Term(); _Module.Term();
}
return TRUE; // ok return TRUE; // ok
} }
......
...@@ -267,6 +267,14 @@ Reference< XInterface > SAL_CALL create_MSAAServiceImpl( Reference< XComponentCo ...@@ -267,6 +267,14 @@ Reference< XInterface > SAL_CALL create_MSAAServiceImpl( Reference< XComponentCo
} }
} }
// load UAccCOM library so its DllMain can register its COM components
static HMODULE h = LoadLibrary("UAccCOM.dll");
if (!h)
{
assert(false);
return 0;
}
Reference< XMSAAService > xAccMgr( new MSAAServiceImpl() ); Reference< XMSAAService > xAccMgr( new MSAAServiceImpl() );
AccessBridgeUpdateOldTopWindows( xAccMgr ); AccessBridgeUpdateOldTopWindows( xAccMgr );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment