Hi folks,
I’ve probably made a silly error here, but I can’t work out what I’ve
done wrong. I get an error via driver verifier, but clearly WDF is
making my memory for the details of PnP Irp handling rather vague…
WDM DRIVER ERROR: [Wdf01000.sys @ 0xB97BE80D] A driver has returned
STATUS_PENDING but did not mark the IRP pending via a call
to IoMarkIrpPending (Irp = 8937CCF0).
IRP_MJ_PNP.IRP_MN_START_DEVICE
[ DevObj=875BEB80, FileObject=00000000, Parameters=E20F1C68 E12A1C00
00000000 00000000 ]
http://www.microsoft.com/hwdq/bc/default.asp?os=5.2.3790&major=0xc9&minor=0x24c&lang=0x9
Break, Ignore, Zap, Remove, Disable all (bizrd)? b
I’ve done:
status = WdfDeviceInitAssignWdmIrpPreprocessCallback(DeviceInit,
BusDevicePnpIrpFilter,
IRP_MJ_PNP,
NULL,
0);
static NTSTATUS
BusDevicePnpIrpFilter(
IN WDFDEVICE Device,
IN PIRP pIrp
)
{
…
pStack = IoGetCurrentIrpStackLocation(pIrp);
NT_ASSERT(pStack->MajorFunction == IRP_MJ_PNP);
BusDriverPrintPnPIrpDetails(Device, pIrp, pStack, TRUE, FALSE);
…
done:
IoCopyCurrentIrpStackLocationToNext(pIrp);
IoSetCompletionRoutine( pIrp,
BusDriverDevPnPIrpCompletion,
NULL,
TRUE,
TRUE,
TRUE
);
return WdfDeviceWdmDispatchPreprocessedIrp(Device, pIrp);
}
NTSTATUS BusDriverDevPnPIrpCompletion(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PVOID Context) {
PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(Irp);
WDFDEVICE Device = WdfWdmDeviceGetWdfDeviceHandle(DeviceObject);
PBUS_DEVICE_CONTEXT pPhysCtxt = BusDeviceGetContext(Device);
PBUS_SINGLETON_CONTEXT pVirtCtxt = BusSingletonGetContext(Device);
NT_ASSERT((pPhysCtxt != NULL) != (pVirtCtxt != NULL));
BusDriverPrintPnPIrpDetails(Device, Irp, pStack, (pPhysCtxt != NULL),
TRUE);
return STATUS_SUCCESS;
}