在編譯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函式怎么用,錯誤怎么解決?謝謝了
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/17247.html
標籤:驅動開發/核心開發
下一篇:上一個圖片不清晰重發,求大佬解答
