1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

netprofm: Set return pointer to NULL in networks_enum_Next().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56271
This commit is contained in:
Hans Leidekker 2024-02-26 15:23:51 +01:00 committed by Alexandre Julliard
parent 635e0566a3
commit d2df3c2c21
2 changed files with 9 additions and 0 deletions

View file

@ -812,6 +812,8 @@ static HRESULT WINAPI networks_enum_Next(
TRACE( "%p, %lu %p %p\n", iter, count, ret, fetched );
if (!ret) return E_POINTER;
*ret = NULL;
if (fetched) *fetched = 0;
if (!count) return S_OK;

View file

@ -381,14 +381,21 @@ static void test_INetworkListManager( void )
hr = INetworkListManager_GetNetworks( mgr, NLM_ENUM_NETWORK_ALL, &network_iter );
ok( hr == S_OK, "got %08lx\n", hr );
ok(network_iter != NULL, "network_iter not set\n");
hr = IEnumNetworks_Next( network_iter, 0, NULL, NULL );
ok( hr == E_POINTER, "got %08lx\n", hr );
network = (INetwork *)0xdeadbeef;
while ((hr = IEnumNetworks_Next( network_iter, 1, &network, NULL )) == S_OK)
{
ok( network != (INetwork *)0xdeadbeef, "network not set\n" );
connected = 1;
hr = INetwork_get_IsConnected( network, &connected );
ok( hr == S_OK, "got %08lx\n", hr );
ok( connected == -1 || connected == 0, "got %d\n", connected );
INetwork_Release( network );
network = (INetwork *)0xdeadbeef;
}
ok( hr == S_FALSE, "got %08lx\n", hr );
ok( network == NULL, "network not set\n" );
IEnumNetworks_Release( network_iter );
hr = INetworkListManager_GetNetworks( mgr, NLM_ENUM_NETWORK_CONNECTED, &network_iter );