Bernhard Kölbl (@besentv) commented about dlls/threadpoolwinrt/main.c:
+ FIXME("clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out); + return CLASS_E_CLASSNOTAVAILABLE; +} + +HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **factory) +{ + const WCHAR *name = WindowsGetStringRawBuffer(classid, NULL); + + TRACE("classid %s, factory %p.\n", debugstr_hstring(classid), factory); + + *factory = NULL; + + if (!wcscmp(name, RuntimeClass_Windows_System_Threading_ThreadPool)) + { + *factory = &threadpool_factory.IActivationFactory_iface; + IUnknown_AddRef(*factory); `IInspectable_AddRef( (*factory = &threadpool_factory.IActivationFactory_iface) );` makes it a one-liner.
Or alternatively `IInspectable_QueryInterface( &threadpool_factory.IActivationFactory_iface, &IID_IActivationFactory, (void **)factory );` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/891#note_8823