Commit be41201c authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

netprofm: Initialize ret value in IEnumNetworkConnections_Next().

parent e51ae869
......@@ -1001,6 +1001,8 @@ static HRESULT WINAPI connections_enum_Next(
TRACE( "%p, %u %p %p\n", iter, count, ret, fetched );
if (!ret) return E_POINTER;
*ret = NULL;
if (fetched) *fetched = 0;
if (!count) return S_OK;
......
......@@ -229,7 +229,7 @@ static void test_INetworkListManager( void )
INetworkConnection *conn;
DWORD cookie;
HRESULT hr;
ULONG ref1, ref2;
ULONG ref1, ref2, fetched;
IID iid;
hr = CoCreateInstance( &CLSID_NetworkListManager, NULL, CLSCTX_INPROC_SERVER,
......@@ -355,11 +355,22 @@ static void test_INetworkListManager( void )
ok( hr == S_OK, "got %08x\n", hr );
if (conn_iter)
{
fetched = 256;
hr = IEnumNetworkConnections_Next( conn_iter, 1, NULL, &fetched );
ok( hr == E_POINTER, "got hr %#x.\n", hr );
ok( fetched == 256, "got wrong feteched: %d.\n", fetched );
hr = IEnumNetworkConnections_Next( conn_iter, 0, NULL, &fetched );
ok( hr == E_POINTER, "got hr %#x.\n", hr );
ok( fetched == 256, "got wrong feteched: %d.\n", fetched );
while ((hr = IEnumNetworkConnections_Next( conn_iter, 1, &conn, NULL )) == S_OK)
{
test_INetworkConnection( conn );
INetworkConnection_Release( conn );
conn = (void *)0xdeadbeef;
}
ok( !conn, "got wrong pointer: %p.\n", conn );
IEnumNetworkConnections_Release( conn_iter );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment