Module: wine Branch: master Commit: e0e0af801eca60690aeb280de4fe53287822e18e URL: http://source.winehq.org/git/wine.git/?a=commit;h=e0e0af801eca60690aeb280de4...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Mon May 19 18:51:15 2014 +0400
netprofm: Added IConnectionPointContainer stub for INetworkListManager.
---
dlls/netprofm/list.c | 59 +++++++++++++++++++++++++++++++++++++++++++- dlls/netprofm/tests/list.c | 6 +++++ 2 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/dlls/netprofm/list.c b/dlls/netprofm/list.c index d5940f4..b9ab1cc 100644 --- a/dlls/netprofm/list.c +++ b/dlls/netprofm/list.c @@ -16,13 +16,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#define COBJMACROS + #include "config.h" #include <stdarg.h> #include "windef.h" #include "winbase.h" -#define COBJMACROS #include "initguid.h" #include "objbase.h" +#include "ocidl.h" #include "netlistmgr.h"
#include "wine/debug.h" @@ -34,9 +36,15 @@ struct list_manager { INetworkListManager INetworkListManager_iface; INetworkCostManager INetworkCostManager_iface; + IConnectionPointContainer IConnectionPointContainer_iface; LONG refs; };
+static inline struct list_manager *impl_from_IConnectionPointContainer(IConnectionPointContainer *iface) +{ + return CONTAINING_RECORD(iface, struct list_manager, IConnectionPointContainer_iface); +} + static inline struct list_manager *impl_from_INetworkCostManager( INetworkCostManager *iface ) { @@ -147,6 +155,10 @@ static HRESULT WINAPI list_manager_QueryInterface( { *obj = &mgr->INetworkCostManager_iface; } + else if (IsEqualGUID( riid, &IID_IConnectionPointContainer )) + { + *obj = &mgr->IConnectionPointContainer_iface; + } else { FIXME( "interface %s not implemented\n", debugstr_guid(riid) ); @@ -285,6 +297,50 @@ static const INetworkListManagerVtbl list_manager_vtbl = list_manager_GetConnectivity };
+static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface, + REFIID riid, void **ppv) +{ + struct list_manager *This = impl_from_IConnectionPointContainer( iface ); + return INetworkListManager_QueryInterface(&This->INetworkListManager_iface, riid, ppv); +} + +static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface) +{ + struct list_manager *This = impl_from_IConnectionPointContainer( iface ); + return INetworkListManager_AddRef(&This->INetworkListManager_iface); +} + +static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface) +{ + struct list_manager *This = impl_from_IConnectionPointContainer( iface ); + return INetworkListManager_Release(&This->INetworkListManager_iface); +} + +static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface, + IEnumConnectionPoints **ppEnum) +{ + struct list_manager *This = impl_from_IConnectionPointContainer( iface ); + FIXME("(%p)->(%p): stub\n", This, ppEnum); + return E_NOTIMPL; +} + +static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface, + REFIID riid, IConnectionPoint **cp) +{ + struct list_manager *This = impl_from_IConnectionPointContainer( iface ); + FIXME("(%p)->(%s %p): stub\n", This, debugstr_guid(riid), cp); + return E_NOTIMPL; +} + +static const struct IConnectionPointContainerVtbl cpc_vtbl = +{ + ConnectionPointContainer_QueryInterface, + ConnectionPointContainer_AddRef, + ConnectionPointContainer_Release, + ConnectionPointContainer_EnumConnectionPoints, + ConnectionPointContainer_FindConnectionPoint +}; + HRESULT list_manager_create( void **obj ) { struct list_manager *mgr; @@ -294,6 +350,7 @@ HRESULT list_manager_create( void **obj ) if (!(mgr = HeapAlloc( GetProcessHeap(), 0, sizeof(*mgr) ))) return E_OUTOFMEMORY; mgr->INetworkListManager_iface.lpVtbl = &list_manager_vtbl; mgr->INetworkCostManager_iface.lpVtbl = &cost_manager_vtbl; + mgr->IConnectionPointContainer_iface.lpVtbl = &cpc_vtbl; mgr->refs = 1;
*obj = &mgr->INetworkListManager_iface; diff --git a/dlls/netprofm/tests/list.c b/dlls/netprofm/tests/list.c index 1619d06..ce4891a 100644 --- a/dlls/netprofm/tests/list.c +++ b/dlls/netprofm/tests/list.c @@ -21,11 +21,13 @@ #define COBJMACROS #include "initguid.h" #include "objbase.h" +#include "ocidl.h" #include "netlistmgr.h" #include "wine/test.h"
static void test_INetworkListManager( void ) { + IConnectionPointContainer *cpc; INetworkListManager *mgr; INetworkCostManager *cost_mgr; NLM_CONNECTIVITY connectivity; @@ -74,6 +76,10 @@ static void test_INetworkListManager( void ) INetworkCostManager_Release( cost_mgr ); }
+ hr = INetworkListManager_QueryInterface( mgr, &IID_IConnectionPointContainer, (void**)&cpc ); + ok( hr == S_OK, "got %08x\n", hr ); + IConnectionPointContainer_Release( cpc ); + INetworkListManager_Release( mgr ); }