Hi,
When you say “NO Interrupt”, do you mean that your completion routine
is
not called? The IRP just hangs forever?
That’s exactly what happens. The bigger question is: Why does the IRP
comes
back if the receive buffer is small and hangs when I provide a much
bigger buffer.
I am using am USB-sniffer, which acts as filter driver, and
analyzes the IRPs passed between my device driver and the lower layer.
But after the
Host-controller received the last package of the INT-IN transfer it does
not return
the IRP to my driver.
Can you post the code that prepares and submits the URB…
I am working on an USB-library so I try to copy&paste the most relevante
parts.
Here you go:
=========== SNIP ============
NTSTATUS OnInterrupt(PDEVICE_OBJECT junk,
PIRP irp,
PVOID pdx);
NTSTATUS StartInterrupt(PDEVICE_OBJECT fdo)
{
PDEVICE_EXTENSION pdx = (PDEVICE_EXTENSION) fdo->DeviceExtension;
/*
This stuff was done sometime before:
pdx->irp = IoAllocateIrp(pdx->nextFdo->StackSize, FALSE);
pdx->urb = (PURB)ExAllocatePool( NonPagedPool,
sizeof(struct
_URB_BULK_OR_INTERRUPT_TRANSFER));
pdx->inBuffer = ExAllocatePool(…) // sufficient space
*/
UsbBuildInterruptOrBulkTransferRequest(
pdx->urb,
sizeof(struct _URB_BULK_OR_INTERRUPT_TRANSFER),
pdx->handle,
pdx->inBuffer,
NULL,
pdx->inBufLen,
USBD_TRANSFER_DIRECTION_IN | USBD_SHORT_TRANSFER_OK,
NULL);
IoSetCompletionRoutine( pdx->irp,
(PIO_COMPLETION_ROUTINE) OnInterrupt,
pdx,
TRUE,
TRUE,
TRUE);
PIO_STACK_LOCATION nextStack = IoGetNextIrpStackLocation(irp);
nextStack->MajorFunction =
IRP_MJ_INTERNAL_DEVICE_CONTROL;
nextStack->Parameters.DeviceIoControl.IoControlCode =
IOCTL_INTERNAL_USB_SUBMIT_URB;
nextStack->Parameters.Others.Argument1 = (PVOID)urb;
return IoCallDriver(pdx->nextFdo, irp);
}
=========== SNAP ============
if you need further information please let me know.
Best regards
Emanuel Eick