File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -240,14 +240,30 @@ USBSTOR_CSWCompletionRoutine(
240240
241241NTSTATUS
242242USBSTOR_SendCSWRequest (
243- PFDO_DEVICE_EXTENSION FDODeviceExtension ,
244- PIRP Irp )
243+ _In_ PFDO_DEVICE_EXTENSION FDODeviceExtension ,
244+ _In_ PIRP Irp )
245245{
246+ ULONG TransferBufferLength ;
247+ ULONG TransferFlags ;
248+
249+ DPRINT ("USBSTOR_SendCSWRequest: %p, %p\n" , FDODeviceExtension , Irp );
250+
251+ if (FDODeviceExtension -> InterfaceInformation -> Pipes [FDODeviceExtension -> BulkInPipeIndex ].MaximumPacketSize == 0x200 )
252+ {
253+ TransferBufferLength = 0x200 ;
254+ TransferFlags = USBD_SHORT_TRANSFER_OK ;
255+ }
256+ else
257+ {
258+ TransferBufferLength = sizeof (CSW );
259+ TransferFlags = 0 ;
260+ }
261+
246262 return USBSTOR_IssueBulkOrInterruptRequest (FDODeviceExtension ,
247263 Irp ,
248264 FDODeviceExtension -> InterfaceInformation -> Pipes [FDODeviceExtension -> BulkInPipeIndex ].PipeHandle ,
249- USBD_TRANSFER_DIRECTION_IN ,
250- sizeof ( CSW ) ,
265+ TransferFlags ,
266+ TransferBufferLength ,
251267 & FDODeviceExtension -> CurrentIrpContext .csw ,
252268 NULL ,
253269 USBSTOR_CSWCompletionRoutine );
Original file line number Diff line number Diff line change @@ -345,8 +345,8 @@ USBSTOR_HandleExecuteSCSI(
345345
346346NTSTATUS
347347USBSTOR_SendCSWRequest (
348- PFDO_DEVICE_EXTENSION FDODeviceExtension ,
349- PIRP Irp );
348+ _In_ PFDO_DEVICE_EXTENSION FDODeviceExtension ,
349+ _In_ PIRP Irp );
350350
351351NTSTATUS
352352NTAPI
You can’t perform that action at this time.
0 commit comments