From c1c434d11521fd7ed79864c69d235e18624fc502 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Wed, 2 Sep 2015 10:44:34 +0200 Subject: [PATCH] netprofm: Implement INetworkListManager::IsConnectedToInternet and INetworkListManager::IsConnected. --- dlls/netprofm/list.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/dlls/netprofm/list.c b/dlls/netprofm/list.c index e7d826475b4..197ef688a48 100644 --- a/dlls/netprofm/list.c +++ b/dlls/netprofm/list.c @@ -1249,9 +1249,21 @@ static HRESULT WINAPI list_manager_IsConnectedToInternet( INetworkListManager *iface, VARIANT_BOOL *pbIsConnected ) { - FIXME( "%p, %p\n", iface, pbIsConnected ); + struct list_manager *mgr = impl_from_INetworkListManager( iface ); + struct network *network; - *pbIsConnected = VARIANT_TRUE; + TRACE( "%p, %p\n", iface, pbIsConnected ); + + LIST_FOR_EACH_ENTRY( network, &mgr->networks, struct network, entry ) + { + if (network->connected_to_internet) + { + *pbIsConnected = VARIANT_TRUE; + return S_OK; + } + } + + *pbIsConnected = VARIANT_FALSE; return S_OK; } @@ -1259,9 +1271,21 @@ static HRESULT WINAPI list_manager_IsConnected( INetworkListManager *iface, VARIANT_BOOL *pbIsConnected ) { - FIXME( "%p, %p\n", iface, pbIsConnected ); + struct list_manager *mgr = impl_from_INetworkListManager( iface ); + struct network *network; - *pbIsConnected = VARIANT_TRUE; + TRACE( "%p, %p\n", iface, pbIsConnected ); + + LIST_FOR_EACH_ENTRY( network, &mgr->networks, struct network, entry ) + { + if (network->connected) + { + *pbIsConnected = VARIANT_TRUE; + return S_OK; + } + } + + *pbIsConnected = VARIANT_FALSE; return S_OK; }