From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed by Just Cause 4. --- .../network_information.c | 12 ++++++++++-- .../tests/connectivity.c | 7 ------- 2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/dlls/windows.networking.connectivity/network_information.c b/dlls/windows.networking.connectivity/network_information.c index 868271fe37d..62b2a5f0fce 100644 --- a/dlls/windows.networking.connectivity/network_information.c +++ b/dlls/windows.networking.connectivity/network_information.c @@ -219,8 +219,16 @@ static HRESULT WINAPI connection_profile_get_ProfileName( IConnectionProfile *if
static HRESULT WINAPI connection_profile_GetNetworkConnectivityLevel( IConnectionProfile *iface, NetworkConnectivityLevel *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + struct connection_profile *impl = impl_from_IConnectionProfile( iface ); + HRESULT hr; + + TRACE( "iface %p, value %p\n", iface, value ); + + if (!value) return E_POINTER; + if (FAILED(hr = get_connectivity_level( &impl->network_connectivity_level ))) return hr; + + *value = impl->network_connectivity_level; + return S_OK; }
static HRESULT WINAPI connection_profile_GetNetworkNames( IConnectionProfile *iface, IVectorView_HSTRING **value ) diff --git a/dlls/windows.networking.connectivity/tests/connectivity.c b/dlls/windows.networking.connectivity/tests/connectivity.c index a557d18cc8f..264fdf883d6 100644 --- a/dlls/windows.networking.connectivity/tests/connectivity.c +++ b/dlls/windows.networking.connectivity/tests/connectivity.c @@ -103,13 +103,10 @@ static void test_NetworkInformationStatics(void) }
hr = IConnectionProfile_GetNetworkConnectivityLevel( connection_profile, NULL ); - todo_wine ok( hr == E_POINTER, "got hr %#lx.\n", hr ); network_connectivity_level = 0xdeadbeef; hr = IConnectionProfile_GetNetworkConnectivityLevel( connection_profile, &network_connectivity_level ); - todo_wine ok( hr == S_OK || hr == 0x8007023e /* Internet disconnect after GetInternetConnectionProfile */, "got hr %#lx.\n", hr ); - todo_wine ok( network_connectivity_level != 0xdeadbeef, "got network_connectivity_level %d.\n", network_connectivity_level );
connectivity = 0xdeadbeef; @@ -119,16 +116,12 @@ static void test_NetworkInformationStatics(void) trace( "GetConnectivity: %08x\n", connectivity );
if (connectivity == NLM_CONNECTIVITY_DISCONNECTED) - todo_wine ok( network_connectivity_level == NetworkConnectivityLevel_None, "got network_connectivity_level %d.\n", network_connectivity_level ); else if (connectivity & ( NLM_CONNECTIVITY_IPV4_INTERNET | NLM_CONNECTIVITY_IPV6_INTERNET )) - todo_wine ok( network_connectivity_level == NetworkConnectivityLevel_InternetAccess, "got network_connectivity_level %d.\n", network_connectivity_level ); else if (connectivity & ( NLM_CONNECTIVITY_IPV4_LOCALNETWORK | NLM_CONNECTIVITY_IPV6_LOCALNETWORK | NLM_CONNECTIVITY_IPV4_NOTRAFFIC | NLM_CONNECTIVITY_IPV6_NOTRAFFIC )) - todo_wine ok( network_connectivity_level == NetworkConnectivityLevel_LocalAccess, "got network_connectivity_level %d.\n", network_connectivity_level ); else - todo_wine ok( network_connectivity_level == NetworkConnectivityLevel_ConstrainedInternetAccess, "got network_connectivity_level %d.\n", network_connectivity_level );
ref = IConnectionProfile_Release( connection_profile );