Changeset 87048 in vbox for trunk/src/VBox/Devices/Storage/DevATA.cpp
- Timestamp:
- Dec 7, 2020 2:44:34 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r86481 r87048 2003 2003 int rc; 2004 2004 uint64_t cbBlockRegion = 0; 2005 VDREGIONDATAFORM enmDataForm; 2005 2006 2006 2007 Assert(s->uTxDir == PDMMEDIATXDIR_FROM_DEVICE); … … 2016 2017 2017 2018 rc = pDevR3->pDrvMedia->pfnQueryRegionPropertiesForLba(pDevR3->pDrvMedia, iATAPILBA, NULL, NULL, 2018 &cbBlockRegion, NULL);2019 &cbBlockRegion, &enmDataForm); 2019 2020 if (RT_SUCCESS(rc)) 2020 2021 { … … 2069 2070 { 2070 2071 uint8_t abTmp[2352]; 2072 uint8_t cbSkip; 2073 2071 2074 rc = pDevR3->pDrvMedia->pfnRead(pDevR3->pDrvMedia, (uint64_t)i * 2352, &abTmp[0], 2352); 2072 2075 if (RT_FAILURE(rc)) 2073 2076 break; 2074 2077 2075 memcpy(pbBuf, &abTmp[16], 2048); 2078 /* Mode 2 has an additional subheader before user data; we need to 2079 * skip 16 bytes for Mode 1 (sync + header) and 20 bytes for Mode 2 + 2080 * (sync + header + subheader). 2081 */ 2082 switch (enmDataForm) { 2083 case VDREGIONDATAFORM_MODE2_2352: 2084 case VDREGIONDATAFORM_XA_2352: 2085 cbSkip = 24; 2086 break; 2087 case VDREGIONDATAFORM_MODE1_2352: 2088 cbSkip = 16; 2089 break; 2090 default: 2091 AssertMsgFailed(("Unexpected region form (%#u), using default skip value\n", enmDataForm)); 2092 cbSkip = 16; 2093 } 2094 memcpy(pbBuf, &abTmp[cbSkip], 2048); 2076 2095 pbBuf += 2048; 2077 2096 }
Note:
See TracChangeset
for help on using the changeset viewer.