Hans Leidekker : netprofm: Implement INetworkConnection::GetNetwork.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Sep 2 10:23:15 CDT 2015


Module: wine
Branch: master
Commit: 91835d94e9ee5cfc1e29f7354cd331f19d6c3788
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=91835d94e9ee5cfc1e29f7354cd331f19d6c3788

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Sep  2 10:42:29 2015 +0200

netprofm: Implement INetworkConnection::GetNetwork.

---

 dlls/netprofm/list.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/dlls/netprofm/list.c b/dlls/netprofm/list.c
index 6afe13e..0aaeff8 100644
--- a/dlls/netprofm/list.c
+++ b/dlls/netprofm/list.c
@@ -67,6 +67,7 @@ struct connection
     LONG                   refs;
     struct list            entry;
     GUID                   id;
+    INetwork              *network;
     VARIANT_BOOL           connected_to_internet;
     VARIANT_BOOL           connected;
 };
@@ -934,6 +935,7 @@ static ULONG WINAPI connection_Release(
 
     if (!(refs = InterlockedDecrement( &connection->refs )))
     {
+        INetwork_Release( connection->network );
         list_remove( &connection->entry );
         heap_free( connection );
     }
@@ -989,8 +991,13 @@ static HRESULT WINAPI connection_GetNetwork(
     INetworkConnection *iface,
     INetwork **ppNetwork )
 {
-    FIXME( "%p, %p\n", iface, ppNetwork );
-    return E_NOTIMPL;
+    struct connection *connection = impl_from_INetworkConnection( iface );
+
+    TRACE( "%p, %p\n", iface, ppNetwork );
+
+    *ppNetwork = connection->network;
+    INetwork_AddRef( *ppNetwork );
+    return S_OK;
 }
 
 static HRESULT WINAPI connection_get_IsConnectedToInternet(
@@ -1088,6 +1095,7 @@ static struct connection *create_connection( const GUID *id )
     ret->INetworkConnection_iface.lpVtbl     = &connection_vtbl;
     ret->refs                  = 1;
     ret->id                    = *id;
+    ret->network               = NULL;
     ret->connected             = VARIANT_FALSE;
     ret->connected_to_internet = VARIANT_FALSE;
     list_init( &ret->entry );
@@ -1139,6 +1147,9 @@ static void init_networks( struct list_manager *mgr )
             connection->connected_to_internet = VARIANT_TRUE;
         }
 
+        connection->network = &network->INetwork_iface;
+        INetwork_AddRef( connection->network );
+
         list_add_tail( &mgr->networks, &network->entry );
         list_add_tail( &mgr->connections, &connection->entry );
     }




More information about the wine-cvs mailing list