WdfFdoQueryForInterface函数返回错误
在编译Intel的DPDK驱动时,发现驱动编译完后安装不上,调试发现WdfFdoQueryForInterface函数返回错误,返回的status值为c00000bb。部分代码如下:
get_pci_device_info(_In_ WDFOBJECT device)
{
NTSTATUS status = STATUS_UNSUCCESSFUL;
PNETUIO_CONTEXT_DATA netuio_contextdata;
netuio_contextdata = netuio_get_context_data(device);
if (!netuio_contextdata)
return status;
netuio_contextdata->wdf_device = device; // Store for later use
// Obtain the BUS_INTERFACE_STANDARD interface from the Bus Driver
DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_NETUIO_INFO_LEVEL, "get_pci_device_info 111\n");
status = WdfFdoQueryForInterface(device, &GUID_BUS_INTERFACE_STANDARD,
(PINTERFACE)&netuio_contextdata->bus_interface,
sizeof(BUS_INTERFACE_STANDARD), 1, NULL);
if (!NT_SUCCESS(status))
{
DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_NETUIO_INFO_LEVEL, "get_pci_device_info status %08x\n",status);
return status;
}
// Retrieve the B:D:F details of our device
PDEVICE_OBJECT pdo = NULL;
pdo = WdfDeviceWdmGetPhysicalDevice(device);
if (pdo) {
ULONG prop = 0, length = 0;
status = IoGetDeviceProperty(pdo, DevicePropertyBusNumber, sizeof(ULONG), (PVOID)&netuio_contextdata->addr.bus_num, &length);
status = IoGetDeviceProperty(pdo, DevicePropertyAddress, sizeof(ULONG), (PVOID)&prop, &length);
if (NT_SUCCESS(status)) {
netuio_contextdata->addr.func_num = prop & 0x0000FFFF;
netuio_contextdata->addr.dev_num = ((prop >> 16) & 0x0000FFFF);
}
// Also, retrieve the NUMA node of the device
USHORT numaNode;
status = IoGetDeviceNumaNode(pdo, &numaNode);
if (NT_SUCCESS(status)) {
netuio_contextdata->dev_numa_node = numaNode;
}
}
return status;
}
请问WdfFdoQueryForInterface函数怎么用,错误怎么解决?谢谢了