[libhid-discuss] libhid USB error: error sending control message: Protocol error

Charles Lepple clepple at ghz.cc
Mon Mar 12 02:33:16 CET 2007


On Mar 11, 2007, at 9:42 PM, hatmakers wrote:

> [2 ms] UsbSnoop - MyInternalIOCTLCompletion(f0b91db0) : fido=00000000,
> Irp=859623d8, Context=855aa678, IRQL=2
> [2 ms]  <<<  URB 2 coming back  <<<
> -- URB_FUNCTION_CONTROL_TRANSFER:
>   PipeHandle           = 86234218
>   TransferFlags        = 0000000b (USBD_TRANSFER_DIRECTION_IN,
> USBD_SHORT_TRANSFER_OK)
>   TransferBufferLength = 00000009
>   TransferBuffer       = 85709418
>   TransferBufferMDL    = 862b92c8
>     00000000: 09 02 29 00 01 01 00 a0 32
>   UrbLink              = 00000000
>   SetupPacket          =
>     00000000: 80 06 00 02 00 00 09 00

Here's where Windows requests the first 9 bytes (well, technically,  
it's the return packet from that).

> [2 ms] UsbSnoop - DispatchAny(f0b90610) :  
> IRP_MJ_INTERNAL_DEVICE_CONTROL
> [2 ms] UsbSnoop - MyDispatchInternalIOCTL(f0b91e80) : fdo=8558fde8,  
> Irp=859623d8,
> IRQL=0
> 2 ms]  >>>  URB 3 going down  >>>
> -- URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE:
>   TransferBufferLength = 00000029
>   TransferBuffer       = 8557f060
>   TransferBufferMDL    = 00000000
>   Index                = 00000000
>   DescriptorType       = 00000002 (USB_CONFIGURATION_DESCRIPTOR_TYPE)
>   LanguageId           = 00000000
> [3 ms] UsbSnoop - MyInternalIOCTLCompletion(f0b91db0) : fido=00000000,
> Irp=859623d8, Context=86085978, IRQL=2
> [3 ms]  <<<  URB 3 coming back  <<<
> -- URB_FUNCTION_CONTROL_TRANSFER:
>   PipeHandle           = 86234218
>   TransferFlags        = 0000000b (USBD_TRANSFER_DIRECTION_IN,
> USBD_SHORT_TRANSFER_OK)
>   TransferBufferLength = 00000029
>   TransferBuffer       = 8557f060
>   TransferBufferMDL    = 862b92c8
>     00000000: 09 02 29 00 01 01 00 a0 32 09 04 00 00 02 03 00
>     00000010: 00 00 09 21 01 01 00 01 22 2f 00 07 05 81 03 10
>     00000020: 00 0a 07 05 01 03 10 00 0a
>   UrbLink              = 00000000
>   SetupPacket          =
>     00000000: 80 06 00 02 00 00 29 00

And here it fetches the full 0x29 bytes.

>> Did you change the code to use 24 instead for the length? (I'm
>> looking at the parameters to usb_control_msg() above.)
>
> Oh yes, sorry.. I was testing something... forgot to change it back.
> Here I put the value back and re-compiled...

You might try 0x29. I still don't know what the difference is, but  
maybe looking at the trace in wireshark will help.

I have been working on a script to convert a usbsnoop log into a  
wireshark-compatible dump, but while I was working on it, they  
changed the format, and I haven't finished converting to the new format.

-- 
Charles Lepple
clepple at ghz.cc





More information about the libhid-discuss mailing list