From: Robert Wilhelm robert.wilhelm@gmx.net
--- dlls/wshom.ocx/network.c | 19 ++++++++++++++++++- dlls/wshom.ocx/tests/wshom.c | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/dlls/wshom.ocx/network.c b/dlls/wshom.ocx/network.c index dcc52c02ed7..737a12033f0 100644 --- a/dlls/wshom.ocx/network.c +++ b/dlls/wshom.ocx/network.c @@ -16,6 +16,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#define COBJMACROS + +#include "dispex.h" #include "wshom_private.h" #include "wshom.h"
@@ -33,7 +36,21 @@ static HRESULT WINAPI WshNetwork2_QueryInterface(IWshNetwork2 *iface, REFIID rii IsEqualGUID(riid, &IID_IWshNetwork2)) { *ppv = iface; - }else { + } + else if (IsEqualGUID(riid, &IID_IDispatchEx)) + { + TRACE("Interface IDispatchEx not supported - returning NULL\n"); + *ppv = NULL; + return E_NOINTERFACE; + } + else if (IsEqualGUID( riid, &IID_IObjectWithSite )) + { + TRACE("Interface IObjectWithSite not supported - returning NULL\n"); + *ppv = NULL; + return E_NOINTERFACE; + } + else + { FIXME("Unknown iface %s\n", debugstr_guid(riid)); *ppv = NULL; return E_NOINTERFACE; diff --git a/dlls/wshom.ocx/tests/wshom.c b/dlls/wshom.ocx/tests/wshom.c index d84eb0441ff..5b3b7f81720 100644 --- a/dlls/wshom.ocx/tests/wshom.c +++ b/dlls/wshom.ocx/tests/wshom.c @@ -700,6 +700,8 @@ static void test_wshnetwork(void)
check_interface(disp, &IID_IWshNetwork, TRUE); check_interface(disp, &IID_IWshNetwork2, TRUE); + check_interface(disp, &IID_IDispatchEx, FALSE); + check_interface(disp, &IID_IObjectWithSite, FALSE);
IDispatch_Release(disp); }
From: Robert Wilhelm robert.wilhelm@gmx.net
--- dlls/wshom.ocx/network.c | 15 +++++++++++++-- dlls/wshom.ocx/wshom_main.c | 3 ++- dlls/wshom.ocx/wshom_private.h | 1 + 3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/wshom.ocx/network.c b/dlls/wshom.ocx/network.c index 737a12033f0..c0ec7ba4e13 100644 --- a/dlls/wshom.ocx/network.c +++ b/dlls/wshom.ocx/network.c @@ -89,8 +89,19 @@ static HRESULT WINAPI WshNetwork2_GetTypeInfo(IWshNetwork2 *iface, UINT iTInfo, static HRESULT WINAPI WshNetwork2_GetIDsOfNames(IWshNetwork2 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { - FIXME("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId); - return E_NOTIMPL; + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId); + + hr = get_typeinfo(IWshNetwork2_tid, &typeinfo); + if(SUCCEEDED(hr)) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId); + ITypeInfo_Release(typeinfo); + } + + return hr; }
static HRESULT WINAPI WshNetwork2_Invoke(IWshNetwork2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, diff --git a/dlls/wshom.ocx/wshom_main.c b/dlls/wshom.ocx/wshom_main.c index aed9f2dedf4..dda72f2796e 100644 --- a/dlls/wshom.ocx/wshom_main.c +++ b/dlls/wshom.ocx/wshom_main.c @@ -40,7 +40,8 @@ static REFIID tid_ids[] = { &IID_IWshEnvironment, &IID_IWshExec, &IID_IWshShell3, - &IID_IWshShortcut + &IID_IWshShortcut, + &IID_IWshNetwork2 };
static HRESULT load_typelib(void) diff --git a/dlls/wshom.ocx/wshom_private.h b/dlls/wshom.ocx/wshom_private.h index c2a66bf0610..709b8817342 100644 --- a/dlls/wshom.ocx/wshom_private.h +++ b/dlls/wshom.ocx/wshom_private.h @@ -33,6 +33,7 @@ typedef enum tid_t { IWshExec_tid, IWshShell3_tid, IWshShortcut_tid, + IWshNetwork2_tid, LAST_tid } tid_t;
From: Robert Wilhelm robert.wilhelm@gmx.net
--- dlls/wshom.ocx/network.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/dlls/wshom.ocx/network.c b/dlls/wshom.ocx/network.c index c0ec7ba4e13..b085be7b1e6 100644 --- a/dlls/wshom.ocx/network.c +++ b/dlls/wshom.ocx/network.c @@ -26,6 +26,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(wshom);
+static IWshNetwork2 WshNetwork2; + static HRESULT WINAPI WshNetwork2_QueryInterface(IWshNetwork2 *iface, REFIID riid, void **ppv) { TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), ppv); @@ -107,9 +109,21 @@ static HRESULT WINAPI WshNetwork2_GetIDsOfNames(IWshNetwork2 *iface, REFIID riid static HRESULT WINAPI WshNetwork2_Invoke(IWshNetwork2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - FIXME("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid), + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); - return E_NOTIMPL; + + hr = get_typeinfo(IWshNetwork2_tid, &typeinfo); + if(SUCCEEDED(hr)) + { + hr = ITypeInfo_Invoke(typeinfo, &WshNetwork2, dispIdMember, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); + ITypeInfo_Release(typeinfo); + } + + return hr; }
static HRESULT WINAPI WshNetwork2_get_UserDomain(IWshNetwork2 *iface, BSTR *user_domain)
Nikolay Sivov (@nsivov) commented about dlls/wshom.ocx/network.c:
- {
TRACE("Interface IDispatchEx not supported - returning NULL\n");
*ppv = NULL;
return E_NOINTERFACE;
- }
- else if (IsEqualGUID( riid, &IID_IObjectWithSite ))
- {
TRACE("Interface IObjectWithSite not supported - returning NULL\n");
*ppv = NULL;
return E_NOINTERFACE;
- }
- else
- { FIXME("Unknown iface %s\n", debugstr_guid(riid)); *ppv = NULL; return E_NOINTERFACE;
I think it's easier to make this a warning instead.