Hello NG,
I am currently testing our self-developed USB device driver. It works fine
on most machines. However on a few machines it seems as if a reading
operation which has been passed down the stack does not return. Meaning the
completion routine is never called and therefore the IRP is never completed.
As my application is performing synchronous IO-operation on the device my
application hangs up and can be ended only by killing it through the task
manager. I found this strange driver behaviour by implementing several debug
traces in a checked version of the driver and watching that traces with
debug view. Debugging the driver with WinDBG also did not bring anything
new. Here a short code snippet how I pass down the IRP to the lower driver:
//***************************************************************************************************************************************
pNextStack=IoGetNextIrpStackLocation(pIrp);
pNextStack->MajorFunction=IRP_MJ_INTERNAL_DEVICE_CONTROL;
pNextStack->Parameters.Others.Argument1=(PVOID)pUrb;
pNextStack->Parameters.DeviceIoControl.IoControlCode=IOCTL_INTERNAL_USB_SUBMIT_URB;
IoSetCompletionRoutine(pIrp, ReadCompletion, pReadContext, TRUE, TRUE,
TRUE);
IoMarkIrpPending(pIrp);
ntStatus=IoCallDriver(pDeviceInfo->pNextDeviceObject, pIrp);
return STATUS_PENDING;
//***************************************************************************************************************************************
What can be the reason for not getting the IRP completed? Any ideas?
Thanks in advance
Benji