/* Returns the expected transfer length and direction (IN, OUT or don't care) from the host point-of-view.  */
static void MSDD_GetCommandInformation(MSCbw *cbw, unsigned int *length, unsigned char *type)
/* Returns the expected transfer length and direction (IN, OUT or don't care) from the host point-of-view.  */
static void MSDD_GetCommandInformation(MSCbw *cbw, unsigned int *length, unsigned char *type)
{
    (*length) = cbw->dCBWDataTransferLength;
    if (*length == 0) {
        (*type) = MSDD_NO_TRANSFER;
    }
    else if ((cbw->bmCBWFlags & MSD_CBW_DEVICE_TO_HOST) != 0) {
        (*type) = MSDD_DEVICE_TO_HOST;
    }
    else {
        (*type) = MSDD_HOST_TO_DEVICE;
    }
}