Hi,
i have obtained a trace.
Understanding it isn't all that easy.
Thus this is a post of some length.
But here is the first part and my attempts at interpretation.
This seems to be USB lowlevel stuff.
Not that hot to us.
[\\GHANIMA]
00000139 49.48165440 UsbSnoop - IRP_MJ_PNP (IRP_MN_REMOVE_DEVICE)
00000140 49.48205440 UsbSnoop - Entering DriverUnload: DriverObject C14C59E8
00000141 53.44573040 UsbSnoop - Entering DriverEntry: DriverObject C14C59E8
00000142 53.44575440 UsbSnoop - Running under Windows 98
00000143 53.44580800 UsbSnoop - Entering AddDevice: DriverObject C14C59E8, pdo
C1445E88
00000144 53.45008880 UsbSnoop - IRP_MJ_PNP (IRP_MN_FILTER_RESOURCE_REQUIREMENTS)
00000145 53.45027200 UsbSnoop - IRP_MJ_PNP (IRP_MN_START_DEVICE)
00000146 53.45031600 UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL,
IOCTL_INTERNAL_USB_SUBMIT_URB
00000147 53.45033760
00000148 53.45034560 >>>>>>> URB 1 going down...
00000149 53.45037040 -- URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE:
00000150 53.45039200 TransferBufferLength = 00000012
00000151 53.45041120 TransferBuffer = c14c4f80
00000152 53.45043520 TransferBufferMDL = 00000000
00000153 53.45045360 Index = 00
00000154 53.45047840 DescriptorType = 01 (USB_DEVICE_DESCRIPTOR_TYPE)
00000155 53.45049600 LanguageId = 0000
00000156 53.45422080
00000157 53.45422640 <<<<<<< URB 1 coming back...
00000158 53.45425040 -- URB_FUNCTION_CONTROL_TRANSFER:
00000159 53.45427120 PipeHandle = c15c7fac
00000160 53.45430400 TransferFlags = 00000003 (USBD_TRANSFER_DIRECTION_IN,
USBD_SHORT_TRANSFER_OK)
00000161 53.45432400 TransferBufferLength = 00000012
00000162 53.45434240 TransferBuffer = c14c4f80
00000163 53.45436880 TransferBufferMDL = c15ea3d0
00000164 53.45437360 0000:
00000165 53.45447840 12 01 00 01 ff 03 00 40 da 05 99 00 00 00 00 00
^ The scanner identifies itself.
00000166 53.45448400 0010:
00000167 53.45450240 00 01
00000168 53.45452080 UrbLink = 00000000
00000169 53.45458720 SetupPacket : 80 06 00 01 00 00 12 00
00000170 53.45475680 UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL,
IOCTL_INTERNAL_USB_SUBMIT_URB
00000171 53.45477600
00000172 53.45478160 >>>>>>> URB 2 going down...
00000173 53.45480480 -- URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE:
00000174 53.45482400 TransferBufferLength = 00000009
00000175 53.45484320 TransferBuffer = c14c5c90
00000176 53.45486480 TransferBufferMDL = 00000000
00000177 53.45488320 Index = 00
00000178 53.45490640 DescriptorType = 02 (USB_CONFIGURATION_DESCRIPTOR_TYPE)
00000179 53.45492480 LanguageId = 0000
00000180 53.45800720
00000181 53.45801360 <<<<<<< URB 2 coming back...
00000182 53.45803360 -- URB_FUNCTION_CONTROL_TRANSFER:
00000183 53.45805360 PipeHandle = c15c7fac
00000184 53.45808560 TransferFlags = 00000003 (USBD_TRANSFER_DIRECTION_IN,
USBD_SHORT_TRANSFER_OK)
00000185 53.45810400 TransferBufferLength = 00000009
00000186 53.45812400 TransferBuffer = c14c5c90
00000187 53.45814960 TransferBufferMDL = c14c4f80
00000188 53.45815520 0000:
00000189 53.45820800 09 02 27 00 01 01 00 40 00
00000190 53.45822640 UrbLink = 00000000
00000191 53.45829200 SetupPacket : 80 06 00 02 00 00 09 00
00000192 53.45834960 UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL,
IOCTL_INTERNAL_USB_SUBMIT_URB
00000193 53.45836880
00000194 53.45837440 >>>>>>> URB 3 going down...
00000195 53.45839680 -- URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE:
00000196 53.45841520 TransferBufferLength = 00000027
00000197 53.45843360 TransferBuffer = c15f1240
00000198 53.45845520 TransferBufferMDL = 00000000
00000199 53.45847280 Index = 00
00000200 53.45849680 DescriptorType = 02 (USB_CONFIGURATION_DESCRIPTOR_TYPE)
00000201 53.45851440 LanguageId = 0000
00000202 53.46278080
00000203 53.46278800 <<<<<<< URB 3 coming back...
00000204 53.46281040 -- URB_FUNCTION_CONTROL_TRANSFER:
00000205 53.46282960 PipeHandle = c15c7fac
00000206 53.46286160 TransferFlags = 00000003 (USBD_TRANSFER_DIRECTION_IN,
USBD_SHORT_TRANSFER_OK)
00000207 53.46288000 TransferBufferLength = 00000027
00000208 53.46289920 TransferBuffer = c15f1240
00000209 53.46292480 TransferBufferMDL = c14c4f80
00000210 53.46292960 0000:
00000211 53.46302320 09 02 27 00 01 01 00 40 00 09 04 00 00 03 00 00
00000212 53.46302800 0010:
00000213 53.46312080 00 00 07 05 01 02 20 00 00 07 05 82 02 20 00 00
00000214 53.46312640 0020:
00000215 53.46316880 07 05 83 02 40 00 00
00000216 53.46318720 UrbLink = 00000000
00000217 53.46325360 SetupPacket : 80 06 00 02 00 00 27 00
00000218 53.46331200 UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL,
IOCTL_INTERNAL_USB_SUBMIT_URB
00000219 53.46333040
00000220 53.46333600 >>>>>>> URB 4 going down...
00000221 53.46335760 -- URB_FUNCTION_SELECT_CONFIGURATION:
00000222 53.46338160 ConfigurationDescriptor = 0xc15f1240 (configure)
00000223 53.46340800 ConfigurationDescriptor : bLength = 0x09
00000224 53.46343520 ConfigurationDescriptor : bDescriptorType = 0x02
00000225 53.46346240 ConfigurationDescriptor : wTotalLength = 0x0027
00000226 53.46348880 ConfigurationDescriptor : bNumInterfaces = 0x01
00000227 53.46351600 ConfigurationDescriptor : bConfigurationValue = 0x01
00000228 53.46354320 ConfigurationDescriptor : iConfiguration = 0x00
00000229 53.46357040 ConfigurationDescriptor : bmAttributes = 0x40
00000230 53.46359680 ConfigurationDescriptor : MaxPower = 0x00
00000231 53.46361760 ConfigurationHandle = 0x0000000b
00000232 53.46364080 Interface[0]: Length = 0x0000004c
00000233 53.46366400 Interface[0]: InterfaceNumber = 0x00
00000234 53.46368800 Interface[0]: AlternateSetting = 0x00
00000235 53.46682800
00000236 53.46683360 <<<<<<< URB 4 coming back...
00000237 53.46685520 -- URB_FUNCTION_SELECT_CONFIGURATION:
00000238 53.46687920 ConfigurationDescriptor = 0xc15f1240 (configure)
00000239 53.46690560 ConfigurationDescriptor : bLength = 0x09
00000240 53.46693280 ConfigurationDescriptor : bDescriptorType = 0x02
00000241 53.46696080 ConfigurationDescriptor : wTotalLength = 0x0027
00000242 53.46698720 ConfigurationDescriptor : bNumInterfaces = 0x01
00000243 53.46701360 ConfigurationDescriptor : bConfigurationValue = 0x01
00000244 53.46704000 ConfigurationDescriptor : iConfiguration = 0x00
00000245 53.46706640 ConfigurationDescriptor : bmAttributes = 0x40
00000246 53.46709280 ConfigurationDescriptor : MaxPower = 0x00
00000247 53.46711360 ConfigurationHandle = 0xc29b4550
00000248 53.46713680 Interface[0]: Length = 0x0000004c
00000249 53.46716000 Interface[0]: InterfaceNumber = 0x00
00000250 53.46718240 Interface[0]: AlternateSetting = 0x00
00000251 53.46720560 Interface[0]: Class = 0x00
00000252 53.46722880 Interface[0]: SubClass = 0x00
00000253 53.46725200 Interface[0]: Protocol = 0x00
00000254 53.46727600 Interface[0]: InterfaceHandle = 0xc14c5920
00000255 53.46729920 Interface[0]: NumberOfPipes = 0x00000003
00000256 53.46732720 Interface[0]: Pipes[0] : MaximumPacketSize = 0x0020
00000257 53.46735440 Interface[0]: Pipes[0] : EndpointAddress = 0x01
00000258 53.46738240 Interface[0]: Pipes[0] : Interval = 0x00
00000259 53.46741440 Interface[0]: Pipes[0] : PipeType = 0x02
(UsbdPipeTypeBulk)
00000260 53.46744320 Interface[0]: Pipes[0] : PipeHandle = 0xc14c5938
00000261 53.46747200 Interface[0]: Pipes[0] : MaxTransferSize = 0x00010000
00000262 53.46749920 Interface[0]: Pipes[0] : PipeFlags = 0x00
00000263 53.46753520 Interface[0]: Pipes[1] : MaximumPacketSize = 0x0020
00000264 53.46757920 Interface[0]: Pipes[1] : EndpointAddress = 0x82
00000265 53.46762480 Interface[0]: Pipes[1] : Interval = 0x00
00000266 53.46767520 Interface[0]: Pipes[1] : PipeType = 0x02
(UsbdPipeTypeBulk)
00000267 53.46772000 Interface[0]: Pipes[1] : PipeHandle = 0xc14c594c
00000268 53.46776560 Interface[0]: Pipes[1] : MaxTransferSize = 0x00010000
00000269 53.46780960 Interface[0]: Pipes[1] : PipeFlags = 0x00
00000270 53.46785520 Interface[0]: Pipes[2] : MaximumPacketSize = 0x0040
00000271 53.46790000 Interface[0]: Pipes[2] : EndpointAddress = 0x83
00000272 53.46794560 Interface[0]: Pipes[2] : Interval = 0x00
00000273 53.46799680 Interface[0]: Pipes[2] : PipeType = 0x02
(UsbdPipeTypeBulk)
00000274 53.46804400 Interface[0]: Pipes[2] : PipeHandle = 0xc14c5960
00000275 53.46808880 Interface[0]: Pipes[2] : MaxTransferSize = 0x00010000
00000276 53.46813440 Interface[0]: Pipes[2] : PipeFlags = 0x00
^ This is consistent with what we know.
I conclude that we can use PipeHandle
to tell apart the endpoints.
Here it is becoming relevant.
Looks like a SCSI command written to pipe 0.
Seems like INQUIRY with 96 bytes requested.
00000282 79.85785440 >>>>>>> URB 5 going down...
00000283 79.85788160 -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
00000284 79.85790240 PipeHandle = c14c5938
00000285 79.85793600 TransferFlags = 00000002 (USBD_TRANSFER_DIRECTION_OUT,
USBD_SHORT_TRANSFER_OK)
00000286 79.85796960 TransferBufferLength = 00000006
00000287 79.85798800 TransferBuffer = ce5b6318
00000288 79.85801600 TransferBufferMDL = 00000000
00000289 79.85802160 0000:
00000290 79.85806080 12 00 00 00 60 00
00000291 79.85808000 UrbLink = 00000000
00000292 79.85925760
00000293 79.85926640 <<<<<<< URB 5 coming back...
00000294 79.85931840 -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
00000295 79.85934880 PipeHandle = c14c5938
00000296 79.85940080 TransferFlags = 00000002 (USBD_TRANSFER_DIRECTION_OUT,
USBD_SHORT_TRANSFER_OK)
00000297 79.85943200 TransferBufferLength = 00000006
00000298 79.85946320 TransferBuffer = ce5b6318
00000299 79.85950000 TransferBufferMDL = c15f79e0
00000300 79.85952960 UrbLink = 00000000
00000301 79.86015920 UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL,
IOCTL_INTERNAL_USB_SUBMIT_URB
This is were the trouble starts.
00000303 79.86020480 >>>>>>> URB 6 going down...
00000304 79.86024640 -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
00000305 79.86027680 PipeHandle = c14c594c
00000306 79.86032800 TransferFlags = 00000000 (USBD_TRANSFER_DIRECTION_OUT,
~USBD_SHORT_TRANSFER_OK)
00000307 79.86035760 TransferBufferLength = 00000020
00000308 79.86038640 TransferBuffer = ce5b6730
00000309 79.86042640 TransferBufferMDL = 00000000
00000310 79.86043520 0000:
00000311 79.86057280 55 53 42 00 32 20 33 20 34 20 35 20 36 00 00 00
00000312 79.86058080 0010:
00000313 79.86071440 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^ What is that ???
00000314 79.86074400 UrbLink = 00000000
00000315 79.86212000
00000316 79.86212800 <<<<<<< URB 6 coming back...
00000317 79.86217440 -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
00000318 79.86220560 PipeHandle = c14c594c
00000319 79.86225680 TransferFlags = 00000001 (USBD_TRANSFER_DIRECTION_IN,
~USBD_SHORT_TRANSFER_OK)
00000320 79.86228800 TransferBufferLength = 00000020
00000321 79.86231680 TransferBuffer = ce5b6730
00000322 79.86236080 TransferBufferMDL = c15f79e0
00000323 79.86236880 0000:
00000324 79.86250880 06 00 02 02 5b 00 00 00 20 20 20 20 20 20 20 20
00000325 79.86251680 0010:
00000326 79.86264880 53 63 61 6e 6e 65 72 20 36 33 36 41 34 20 20 20
^ This seems to be the answer to the command from
URB 5. Again it is regular SCSI.
00000327 79.86268000 UrbLink = 00000000
00000328 79.86303440 UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL,
IOCTL_INTERNAL_USB_SUBMIT_URB
It seems commands are written to Pipe 0 and answers are read from Pipe 1.
URB 7 and URB 8 are basically continuing URB 6.
This is most strange.
00000384 79.86680240 >>>>>>> URB 9 going down...
00000385 79.86684640 -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
00000386 79.86687680 PipeHandle = c14c594c
00000387 79.86692880 TransferFlags = 00000000 (USBD_TRANSFER_DIRECTION_OUT,
~USBD_SHORT_TRANSFER_OK)
00000388 79.86695920 TransferBufferLength = 00000001
00000389 79.86698800 TransferBuffer = ce5b6422
00000390 79.86702720 TransferBufferMDL = 00000000
00000391 79.86703600 0000:
00000392 79.86705760 6a
00000393 79.86708720 UrbLink = 00000000
00000394 79.86781760
00000395 79.86782640 <<<<<<< URB 9 coming back...
00000396 79.86786960 -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
00000397 79.86790000 PipeHandle = c14c594c
00000398 79.86795040 TransferFlags = 00000001 (USBD_TRANSFER_DIRECTION_IN,
~USBD_SHORT_TRANSFER_OK)
00000399 79.86798000 TransferBufferLength = 00000001
00000400 79.86800960 TransferBuffer = ce5b6422
00000401 79.86804960 TransferBufferMDL = c15f79e0
00000402 79.86805680 0000:
00000403 79.86807840 00
00000404 79.86810720 UrbLink = 00000000
00000405 79.86850560 UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL,
IOCTL_INTERNAL_USB_SUBMIT_URB
A SCSI read, reading scanner attributes (31 bytes).
Again going to Pipe 0.
00000407 79.86855200 >>>>>>> URB 10 going down...
00000408 79.86859520 -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
00000409 79.86862560 PipeHandle = c14c5938
00000410 79.86866000 TransferFlags = 00000002 (USBD_TRANSFER_DIRECTION_OUT,
USBD_SHORT_TRANSFER_OK)
00000411 79.86867840 TransferBufferLength = 0000000a
00000412 79.86869840 TransferBuffer = ce5b6348
00000413 79.86873840 TransferBufferMDL = 00000000
00000414 79.86874640 0000:
00000415 79.86883520 28 00 82 00 00 00 00 00 1f 00
00000416 79.86886480 UrbLink = 00000000
00000417 79.86973200
00000418 79.86974080 <<<<<<< URB 10 coming back...
00000419 79.86978480 -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
00000420 79.86981600 PipeHandle = c14c5938
00000421 79.86986720 TransferFlags = 00000002 (USBD_TRANSFER_DIRECTION_OUT,
USBD_SHORT_TRANSFER_OK)
00000422 79.86989680 TransferBufferLength = 0000000a
00000423 79.86992560 TransferBuffer = ce5b6348
00000424 79.86996160 TransferBufferMDL = c15f79e0
00000425 79.86999040 UrbLink = 00000000
00000426 79.87034480 UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL,
IOCTL_INTERNAL_USB_SUBMIT_URB
URB 11 reads 31 bytes from Pipe 1 as expected.
Again strange. TEST_UNIT_READY ?
But why Pipe 1 ?
00000455 79.87389120 >>>>>>> URB 12 going down...
00000456 79.87393520 -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
00000457 79.87396640 PipeHandle = c14c594c
00000458 79.87401680 TransferFlags = 00000000 (USBD_TRANSFER_DIRECTION_OUT,
~USBD_SHORT_TRANSFER_OK)
00000459 79.87404720 TransferBufferLength = 00000001
00000460 79.87407760 TransferBuffer = ce5b6422
00000461 79.87411920 TransferBufferMDL = 00000000
00000462 79.87412720 0000:
00000463 79.87414960 00
00000464 79.87418000 UrbLink = 00000000
00000465 79.87450720
00000466 79.87451600 <<<<<<< URB 12 coming back...
00000467 79.87456320 -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
00000468 79.87459440 PipeHandle = c14c594c
00000469 79.87464640 TransferFlags = 00000001 (USBD_TRANSFER_DIRECTION_IN,
~USBD_SHORT_TRANSFER_OK)
00000470 79.87467680 TransferBufferLength = 00000001
00000471 79.87470720 TransferBuffer = ce5b6422
00000472 79.87474880 TransferBufferMDL = c15f79e0
00000473 79.87475600 0000:
00000474 79.87477760 00
00000475 79.87480640 UrbLink = 00000000
00000476 79.87520560 UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL,
IOCTL_INTERNAL_USB_SUBMIT_URB
I might be missing something fundamental about the way Windows uses USB.
Regards
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]