Hi Bernhard,
On 3/5/22 20:54, Bernhard Kölbl wrote:
+void STDMETHODCALLTYPE
speech_synthesizer_get_activation_factory(IActivationFactory **factory)
+{
- *factory = &windows_media_speech.IActivationFactory_iface;
+}
I'd suggest to make a global extern pointer variable to one of the factory interface directly, it'll be shorter. For instance something like "synthesizer_factory" or "synthesizer_statics" seems short and explicit enough.
HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void
**out)
{ FIXME("clsid %s, riid %s, out %p stub!\n",
debugstr_guid(clsid), debugstr_guid(riid), out);
@@ -580,7 +38,7 @@ HRESULT WINAPI DllGetActivationFactory(HSTRING
classid, IActivationFactory **fac
return CLASS_E_CLASSNOTAVAILABLE; }
- *factory = &windows_media_speech.IActivationFactory_iface;
- speech_synthesizer_get_activation_factory(factory); IUnknown_AddRef(*factory); return S_OK; }
And here, you can then also use IInspectable_QueryInterface to retrieve the IActivationFactory iface from the pointer while increasing the refcount at the same time, and getting an HRESULT too.
Of course, if you expose the IActivationFactory pointer, QueryInterface isn't really needed, but I found that sometimes exposing another of the statics iface can be useful, and DllGetActivationFactory is the only place where the IActivationFactory is needed.