阅读:958回复:0
奇怪的问题,在CHECKED OS下有问题
我的驱动在RELEASE的WIN2K下没有问题,但是在CHECKED BUILD的WINXP下却会出现问题,并提示
Assertion Failed :busInfo != NULL source file xxx..\pnpirp.c LINE 2210 全我看了下WIN2K的代码,位于IopQueryLegacyBusInformation的函数中 NTSTATUS IopQueryLegacyBusInformation ( IN PDEVICE_OBJECT DeviceObject, OUT LPGUID InterfaceGuid, OPTIONAL OUT INTERFACE_TYPE *InterfaceType, OPTIONAL OUT ULONG *BusNumber OPTIONAL ) /*++ Routine Description: This routine queries the specified DeviceObject for its legacy bus information. Parameters: DeviceObject - The device object to be queried. InterfaceGuid = Supplies a pointer to receive the device's interface type GUID. Interface = Supplies a pointer to receive the device's interface type. BusNumber = Supplies a pointer to receive the device's bus number. Return Value: Returns NTSTATUS. --*/ { IO_STACK_LOCATION irpSp; NTSTATUS status; PLEGACY_BUS_INFORMATION busInfo; PAGED_CODE(); // // Initialize the stack location to pass to IopSynchronousCall() // RtlZeroMemory(&irpSp, sizeof(IO_STACK_LOCATION)); // // Set the function codes. // irpSp.MajorFunction = IRP_MJ_PNP; irpSp.MinorFunction = IRP_MN_QUERY_LEGACY_BUS_INFORMATION; // // Make the call and return. // status = IopSynchronousCall(DeviceObject, &irpSp, &busInfo); if (NT_SUCCESS(status)) { if (busInfo == NULL) { // // The device driver LIED to us. Bad, bad, bad device driver. // PDEVICE_NODE deviceNode; deviceNode = DeviceObject->DeviceObjectExtension->DeviceNode; if (deviceNode && deviceNode->ServiceName.Buffer) { DbgPrint("*** IopQueryLegacyBusInformation - Driver %wZ returned STATUS_SUCCESS\n", &deviceNode->ServiceName); DbgPrint(" for IRP_MN_QUERY_LEGACY_BUS_INFORMATION, and a NULL POINTER.\n"); } ASSERT(busInfo != NULL); } else { if (ARGUMENT_PRESENT(InterfaceGuid)) { *InterfaceGuid = busInfo->BusTypeGuid; } if (ARGUMENT_PRESENT(InterfaceType)) { *InterfaceType = busInfo->LegacyBusType; } if (ARGUMENT_PRESENT(BusNumber)) { *BusNumber = busInfo->BusNumber; } ExFreePool(busInfo); } } return status; } 也就是说在调用IopSynchronousCall(DeviceObject, &irpSp, &busInfo); 后busInfo==NULL,想知道有哪些原因导致这个问题呢?? |
|
|