In case it helps, here is the basic code:
ULONG frameNumber;
ntStatus =
WdfUsbTargetDeviceRetrieveCurrentFrameNumber(context->WdfUsbTargetDevice,
&frameNumber);
frameNumber += 5;
if (!NT_SUCCESS(ntStatus))
{
…
}
struct _URB_ISOCH_TRANSFER *urb =
&request->urbBuffer->UrbIsochronousTransfer;
urb->Hdr.Function = URB_FUNCTION_ISOCH_TRANSFER;
urb->Hdr.Length = GET_ISO_URB_SIZE(1);
urb->Hdr.Status = 0;
urb->PipeHandle =
WdfUsbTargetPipeWdmGetPipeHandle(context->writePipe);
urb->TransferFlags = USBD_TRANSFER_DIRECTION_OUT |
USBD_START_ISO_TRANSFER_ASAP;
urb->TransferBufferMDL = 0;
urb->ErrorCount = 0;
urb->StartFrame = frameNumber;
urb->NumberOfPackets = 1;
urb->TransferBuffer = pBuffer;
urb->TransferBufferLength = 176;
urb->UrbLink = NULL;
urb->IsoPacket[0].Offset = 0;
urb->IsoPacket[0].Length = 176;
urb->IsoPacket[0].Status = 0;
ntStatus =
WdfUsbTargetPipeFormatRequestForUrb(context->writePipe, Request,
request->urbMemory, NULL);
if (!NT_SUCCESS(ntStatus))
{
…
}
USBRequestSetCompletionRoutine(Request);
if (WdfRequestSend(Request, context->ioTarget,
WDF_NO_SEND_OPTIONS) == FALSE)
{
…
}
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Tuesday, September 08, 2009 2:27 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] WdfRequestSend completion routine gives
status=0xC000000D urb USBD_STATUS=0x80000600
pgruebele wrote:
So I think I understand generally how things are supposed to be done.
However I am still getting no errors and TransferBufferLength==0 in the
completion routine. To keep things simple I now only send a single frame.
The completion routine sees packet.Status==0 and packet.Length==176 (the
original length that I set).I assume if there were something wrong with my frame numbers I would get a
frame related error.Any ideas why no error but no data sent?
This is an output request, right? For an input request, the packet
sizes must all equal the max packet size for the pipe. Are you
specifying USBD_SHORT_REQUEST_OK? Are you giving a frame number, or
specifying ASAP? Are you setting TransferBufferLength=176 when you
build the request?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer