Commit 805e30ee authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

iphlpapi: Implement GetNumberOfInterfaces() on top of nsi.

parent 0b5a6c70
......@@ -2376,21 +2376,18 @@ DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
* RETURNS
* NO_ERROR on success, ERROR_INVALID_PARAMETER if pdwNumIf is NULL.
*/
DWORD WINAPI GetNumberOfInterfaces(PDWORD pdwNumIf)
DWORD WINAPI GetNumberOfInterfaces( DWORD *count )
{
DWORD ret;
DWORD err, num;
TRACE("pdwNumIf %p\n", pdwNumIf);
if (!pdwNumIf)
ret = ERROR_INVALID_PARAMETER;
else {
*pdwNumIf = get_interface_indices( FALSE, NULL );
ret = NO_ERROR;
}
TRACE("returning %d\n", ret);
return ret;
}
TRACE( "count %p\n", count );
if (!count) return ERROR_INVALID_PARAMETER;
err = NsiEnumerateObjectsAllParameters( 1, 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, NULL, 0,
NULL, 0, NULL, 0, NULL, 0, &num );
*count = err ? 0 : num;
return err;
}
/******************************************************************
* GetPerAdapterInfo (IPHLPAPI.@)
......
......@@ -138,10 +138,6 @@ static void testGetNumberOfInterfaces(void)
}
apiReturn = GetNumberOfInterfaces(&numInterfaces);
if (apiReturn == ERROR_NOT_SUPPORTED) {
skip("GetNumberOfInterfaces is not supported\n");
return;
}
ok(apiReturn == NO_ERROR,
"GetNumberOfInterfaces returned %d, expected 0\n", apiReturn);
}
......
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