Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- programs/dllhost/dllhost.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/programs/dllhost/dllhost.c b/programs/dllhost/dllhost.c index 691f233906a..681a20a6bb5 100644 --- a/programs/dllhost/dllhost.c +++ b/programs/dllhost/dllhost.c @@ -98,8 +98,14 @@ static ULONG WINAPI factory_Release(IClassFactory *iface) static HRESULT WINAPI factory_CreateInstance(IClassFactory *iface, IUnknown *punkouter, REFIID iid, void **ppv) { - FIXME("(%p,%p,%s,%p): stub\n", iface, punkouter, wine_dbgstr_guid(iid), ppv); - return E_NOTIMPL; + struct factory *factory = impl_from_IClassFactory(iface); + + TRACE("(%p,%p,%s,%p)\n", iface, punkouter, wine_dbgstr_guid(iid), ppv); + + if (punkouter) + return CLASS_E_NOAGGREGATION; + + return CoGetClassObject(&factory->clsid, CLSCTX_INPROC_SERVER, NULL, iid, ppv); }
static HRESULT WINAPI factory_LockServer(IClassFactory *iface, BOOL lock)
On Thu, Feb 24, 2022 at 11:50:43AM +0300, Dmitry Timoshkov wrote:
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
programs/dllhost/dllhost.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/programs/dllhost/dllhost.c b/programs/dllhost/dllhost.c index 691f233906a..681a20a6bb5 100644 --- a/programs/dllhost/dllhost.c +++ b/programs/dllhost/dllhost.c @@ -98,8 +98,14 @@ static ULONG WINAPI factory_Release(IClassFactory *iface) static HRESULT WINAPI factory_CreateInstance(IClassFactory *iface, IUnknown *punkouter, REFIID iid, void **ppv) {
- FIXME("(%p,%p,%s,%p): stub\n", iface, punkouter, wine_dbgstr_guid(iid), ppv);
- return E_NOTIMPL;
- struct factory *factory = impl_from_IClassFactory(iface);
- TRACE("(%p,%p,%s,%p)\n", iface, punkouter, wine_dbgstr_guid(iid), ppv);
- if (punkouter)
return CLASS_E_NOAGGREGATION;
- return CoGetClassObject(&factory->clsid, CLSCTX_INPROC_SERVER, NULL, iid, ppv);
Shouldn't this ask for IID_IClassFactory, from which CreateInstance is called? You can also pass punkouter to the inproc CreateInstance; see the link you sent me:
https://docs.microsoft.com/en-us/windows/win32/com/writing-a-custom-surrogat...
Huw.
Hi Huw,
thanks for the review!
Huw Davies huw@codeweavers.com wrote:
diff --git a/programs/dllhost/dllhost.c b/programs/dllhost/dllhost.c index 691f233906a..681a20a6bb5 100644 --- a/programs/dllhost/dllhost.c +++ b/programs/dllhost/dllhost.c @@ -98,8 +98,14 @@ static ULONG WINAPI factory_Release(IClassFactory *iface) static HRESULT WINAPI factory_CreateInstance(IClassFactory *iface, IUnknown *punkouter, REFIID iid, void **ppv) {
- FIXME("(%p,%p,%s,%p): stub\n", iface, punkouter, wine_dbgstr_guid(iid), ppv);
- return E_NOTIMPL;
- struct factory *factory = impl_from_IClassFactory(iface);
- TRACE("(%p,%p,%s,%p)\n", iface, punkouter, wine_dbgstr_guid(iid), ppv);
- if (punkouter)
return CLASS_E_NOAGGREGATION;
- return CoGetClassObject(&factory->clsid, CLSCTX_INPROC_SERVER, NULL, iid, ppv);
Shouldn't this ask for IID_IClassFactory, from which CreateInstance is called? You can also pass punkouter to the inproc CreateInstance; see the link you sent me:
https://docs.microsoft.com/en-us/windows/win32/com/writing-a-custom-surrogat...
Actually this patch could be dropped because according to the results I get with this patch set IClassFactory::CreateInstance() is never called under Wine during the surrogate invocation, and if really necessary could be implemented the way you (and MSDN) suggest. Other patches in the series should apply cleanly without this patch.
On Tue, Mar 08, 2022 at 01:10:15PM +0300, Dmitry Timoshkov wrote:
Huw Davies huw@codeweavers.com wrote:
Shouldn't this ask for IID_IClassFactory, from which CreateInstance is called? You can also pass punkouter to the inproc CreateInstance; see the link you sent me:
https://docs.microsoft.com/en-us/windows/win32/com/writing-a-custom-surrogat...
Actually this patch could be dropped because according to the results I get with this patch set IClassFactory::CreateInstance() is never called under Wine during the surrogate invocation, and if really necessary could be implemented the way you (and MSDN) suggest. Other patches in the series should apply cleanly without this patch.
Hi Dmitry,
Does it all go via IMarshal then?
I guess we can leave this out in that case. Since I've signed off the first three patches, could you wait for those to go in and then send 5-8?
Huw.
Huw Davies huw@codeweavers.com wrote:
On Tue, Mar 08, 2022 at 01:10:15PM +0300, Dmitry Timoshkov wrote:
Huw Davies huw@codeweavers.com wrote:
Shouldn't this ask for IID_IClassFactory, from which CreateInstance is called? You can also pass punkouter to the inproc CreateInstance; see the link you sent me:
https://docs.microsoft.com/en-us/windows/win32/com/writing-a-custom-surrogat...
Actually this patch could be dropped because according to the results I get with this patch set IClassFactory::CreateInstance() is never called under Wine during the surrogate invocation, and if really necessary could be implemented the way you (and MSDN) suggest. Other patches in the series should apply cleanly without this patch.
Hi Dmitry,
Does it all go via IMarshal then?
Looks like that, yes. At least that's true for the application I'm working on, and everything seems to work just fine.
I guess we can leave this out in that case. Since I've signed off the first three patches, could you wait for those to go in and then send 5-8?
Sure, sound good. Thanks.