Changeset 75772 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Nov 27, 2018 1:13:16 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r75075 r75772 3345 3345 iATAPILBA = scsiBE2H_U32(pbPacket + 2); 3346 3346 3347 /* Check that the sector size is valid. */3348 VDREGIONDATAFORM enmDataForm = VDREGIONDATAFORM_INVALID;3349 int rc = s->pDrvMedia->pfnQueryRegionPropertiesForLba(s->pDrvMedia, iATAPILBA,3350 NULL, NULL, NULL, &enmDataForm);3351 AssertRC(rc);3352 if ( enmDataForm != VDREGIONDATAFORM_MODE1_20483353 && enmDataForm != VDREGIONDATAFORM_MODE1_23523354 && enmDataForm != VDREGIONDATAFORM_MODE2_23363355 && enmDataForm != VDREGIONDATAFORM_MODE2_23523356 && enmDataForm != VDREGIONDATAFORM_RAW)3357 {3358 uint8_t abATAPISense[ATAPI_SENSE_SIZE];3359 RT_ZERO(abATAPISense);3360 3361 abATAPISense[0] = 0x70 | (1 << 7);3362 abATAPISense[2] = (SCSI_SENSE_ILLEGAL_REQUEST & 0x0f) | SCSI_SENSE_FLAG_ILI;3363 scsiH2BE_U32(&abATAPISense[3], iATAPILBA);3364 abATAPISense[7] = 10;3365 abATAPISense[12] = SCSI_ASC_ILLEGAL_MODE_FOR_THIS_TRACK;3366 atapiR3CmdError(s, &abATAPISense[0], sizeof(abATAPISense));3367 break;3368 }3369 3370 3347 if (cSectors == 0) 3371 3348 { … … 3373 3350 break; 3374 3351 } 3375 if ((uint64_t)iATAPILBA + cSectors > s->cTotalSectors) 3352 3353 /* Check that the sector size is valid. */ 3354 VDREGIONDATAFORM enmDataForm = VDREGIONDATAFORM_INVALID; 3355 int rc = s->pDrvMedia->pfnQueryRegionPropertiesForLba(s->pDrvMedia, iATAPILBA, 3356 NULL, NULL, NULL, &enmDataForm); 3357 if (RT_UNLIKELY( rc == VERR_NOT_FOUND 3358 || ((uint64_t)iATAPILBA + cSectors > s->cTotalSectors))) 3376 3359 { 3377 3360 /* Rate limited logging, one log line per second. For … … 3386 3369 } 3387 3370 atapiR3CmdErrorSimple(s, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_LOGICAL_BLOCK_OOR); 3371 break; 3372 } 3373 else if ( enmDataForm != VDREGIONDATAFORM_MODE1_2048 3374 && enmDataForm != VDREGIONDATAFORM_MODE1_2352 3375 && enmDataForm != VDREGIONDATAFORM_MODE2_2336 3376 && enmDataForm != VDREGIONDATAFORM_MODE2_2352 3377 && enmDataForm != VDREGIONDATAFORM_RAW) 3378 { 3379 uint8_t abATAPISense[ATAPI_SENSE_SIZE]; 3380 RT_ZERO(abATAPISense); 3381 3382 abATAPISense[0] = 0x70 | (1 << 7); 3383 abATAPISense[2] = (SCSI_SENSE_ILLEGAL_REQUEST & 0x0f) | SCSI_SENSE_FLAG_ILI; 3384 scsiH2BE_U32(&abATAPISense[3], iATAPILBA); 3385 abATAPISense[7] = 10; 3386 abATAPISense[12] = SCSI_ASC_ILLEGAL_MODE_FOR_THIS_TRACK; 3387 atapiR3CmdError(s, &abATAPISense[0], sizeof(abATAPISense)); 3388 3388 break; 3389 3389 }
Note:
See TracChangeset
for help on using the changeset viewer.