- Endpoint_Read_Stream_LE(&MSInterfaceInfo->CommandBlock,\r
- (sizeof(CommandBlockWrapper_t) - MAX_SCSI_COMMAND_LENGTH),\r
- StreamCallback_AbortOnMassStoreReset);\r
-\r
- if ((MSInterfaceInfo->CommandBlock.Signature != CBW_SIGNATURE) ||\r
- (MSInterfaceInfo->CommandBlock.LUN >= MSInterfaceInfo->TotalLUNs) ||\r
- (MSInterfaceInfo->CommandBlock.SCSICommandLength > MAX_SCSI_COMMAND_LENGTH))\r
+ Endpoint_Read_Stream_LE(&MSInterfaceInfo->State.CommandBlock,\r
+ (sizeof(MS_CommandBlockWrapper_t) - 16),\r
+ StreamCallback_MS_Device_AbortOnMassStoreReset);\r
+\r
+ if ((MSInterfaceInfo->State.CommandBlock.Signature != MS_CBW_SIGNATURE) ||\r
+ (MSInterfaceInfo->State.CommandBlock.LUN >= MSInterfaceInfo->Config.TotalLUNs) ||\r
+ (MSInterfaceInfo->State.CommandBlock.Flags & 0x1F) ||\r
+ (MSInterfaceInfo->State.CommandBlock.SCSICommandLength == 0) ||\r
+ (MSInterfaceInfo->State.CommandBlock.SCSICommandLength > 16))\r