Jungo WinDriver  
Official Documentation

◆ WDC_PciSriovGetNumVFs()

DWORD DLLCALLCONV WDC_PciSriovGetNumVFs ( _In_ WDC_DEVICE_HANDLE  hDev,
_Outptr_ DWORD *  pdwNumVFs 
)

Gets the number of virtual functions assigned to a supported device.

Parameters
[in]hDevHandle to a PlugandPlay WDC device, returned by WDC_PciDeviceOpen()
[out]pdwNumVFsA pointer to a DWORD to store the number of VFs assigned
Returns
Returns WD_STATUS_SUCCESS (0) on success, or an appropriate error code otherwise
void SriovExample(WDC_DEVICE_HANDLE hDev)
{
DWORD dwStatus, dwNumVFs = 3;
dwStatus = WDC_PciSriovEnable(hDev, dwNumVFs);
if (dwStatus)
{
printf("Error! Could not enable SRIOV\n");
return;
}
dwNumVFs = 0;
dwStatus = WDC_PciSriovGetNumVFs(hDev, &dwNumVFs);
if (dwStatus)
{
printf("Error! Could not get number of virtual functions\n");
goto Error;
}
// Should be 3
printf("Number of virtual functions: %ld\n", dwNumVFs);
/*
More code...
*/
Error:
dwStatus = WDC_PciSriovDisable(hDev);
if (dwStatus)
{
printf("Error! Could not disable SRIOV\n");
}
}
DWORD DLLCALLCONV WDC_PciSriovDisable(_In_ WDC_DEVICE_HANDLE hDev)
Disables SR-IOV for a supported device and removes all the assigned VFs.
DWORD DLLCALLCONV WDC_PciSriovGetNumVFs(_In_ WDC_DEVICE_HANDLE hDev, _Outptr_ DWORD *pdwNumVFs)
Gets the number of virtual functions assigned to a supported device.
DWORD DLLCALLCONV WDC_PciSriovEnable(_In_ WDC_DEVICE_HANDLE hDev, _In_ DWORD dwNumVFs)
SR-IOV API functions are not part of the standard WinDriver API, and not included in the standard ver...
void * WDC_DEVICE_HANDLE
Handle to device information struct.
Definition: wdc_lib.h:33