62 Vcb->VCBFlags &= ~UDF_VCB_LAST_WRITE;
119#define Vcb ((PVCB)_Vcb)
151 if(!
Vcb->SparingCount ||
152 !
Vcb->SparingCountFree ||
160 UDFPrint((
"Write failed, try relocation\n"));
163 UDFPrint((
"Read failed, try relocation\n"));
165 UDFPrint((
"no remap on not modified volume\n"));
176 Flags &= ~PH_KEEP_VERIFY_CACHE;
180 mask =
Vcb->SparingBlockSize-1;
185 single_packet =
TRUE;
198 if(!
Vcb->SparingCountFree) {
199 UDFPrint((
" no more free spare blocks, abort verification\n"));
211 UDFPrint((
" remap single write\n"));
212 UDFPrint((
" try del from verify cache @ %x, %x\n", lba0,
len));
216 UDFPrint((
" recover and remap single read\n"));
220 p = tmp_buff+(
j<<
Vcb->BlockSizeBits);
226 if(
Vcb->BSBM_Bitmap) {
233 if(
Vcb->FSBM_Bitmap) {
239 if(!
zero &&
Vcb->ZSBM_Bitmap) {
241 UDFPrint((
" unused @ %x (Z)\n", lba0+
i));
252 RC =
UDFTRead(_Vcb,
p,
Vcb->SparingBlockSize <<
Vcb->BlockSizeBits, lba0+
i, &tmp_wb,
262 i +=
Vcb->SparingBlockSize-1;
314 UDFPrint((
" try get from verify cache @ %x\n", lba0+
i));
324 UDFPrint((
" try del from verify cache @ %x\n", lba0+
i));
328 if(!packet_ok || need_remap) {
329 UDFPrint((
" block in bad packet @ %x\n", lba0+
i));
330 if(
Vcb->BSBM_Bitmap) {
333 if(
Vcb->FSBM_Bitmap) {
339 if(
j >=
Vcb->SparingBlockSize) {
344 UDFPrint((
" forget Z packet @ %x\n", lba1));
350 UDFPrint((
" remap packet @ %x\n", lba1));
363 UDFPrint((
" remap status %x\n", RC));
367 RC =
UDFTWrite(_Vcb, tmp_buff,
Vcb->SparingBlockSize <<
Vcb->BlockSizeBits, lba1, &tmp_wb,
369 UDFPrint((
" write status %x\n", RC));
402 UDFPrint((
"IO-Write-Verify (2)\n"));
462#ifndef UDF_READ_ONLY_BUILD
463#define Vcb ((PVCB)_Vcb)
484 UDFPrint((
"TWrite %x (%x)\n", LBA, BCount));
544 RelocExtent_saved = RelocExtent;
545 for(
i=0; RelocExtent->
extLength;
i++, RelocExtent++) {
567 (*WrittenBytes) += _WrittenBytes;
578 if(RelocExtent_saved) {
637 if(rLba >= (
Vcb->CDR_Mode ?
Vcb->NWA :
Vcb->LastLBA + 1)) {
645 rLba = UDFFixFPAddress(
Vcb, rLba);
658 Vcb->VCBFlags &= ~UDF_VCB_LAST_WRITE;
675 RelocExtent_saved = RelocExtent;
676 for(
i=0; RelocExtent->
extLength;
i++, RelocExtent++) {
679 if(rLba >= (
Vcb->CDR_Mode ?
Vcb->NWA :
Vcb->LastLBA + 1)) {
689 rLba = UDFFixFPAddress(
Vcb, rLba);
695 Vcb->VCBFlags &= ~UDF_VCB_LAST_WRITE;
707 (*ReadBytes) += _ReadBytes;
716 if(RelocExtent_saved) {
757 if(rLba >= (
Vcb->CDR_Mode ?
Vcb->NWA :
Vcb->LastLBA + 1)) {
764 rLba = UDFFixFPAddress(
Vcb, rLba);
767 Vcb->VCBFlags &= ~UDF_VCB_LAST_WRITE;
775 RelocExtent_saved = RelocExtent;
779 if(rLba >= (
Vcb->CDR_Mode ?
Vcb->NWA :
Vcb->LastLBA + 1)) {
788 rLba = UDFFixFPAddress(
Vcb, rLba);
790 ((
uint64)rLba) <<
Vcb->BlockSizeBits, &_ReadBytes, 0);
791 Vcb->VCBFlags &= ~UDF_VCB_LAST_WRITE;
797 (*ReadBytes) += _ReadBytes;
825 if(!
Vcb->MRWStatus) {
826 UDFPrint((
"Non-MRW disk. Skip setting MRW_MODE\n"));
832 (
PVOID)&MRWPage,
sizeof(MRWPage),
841 (
PVOID)&MRWPage,
sizeof(MRWPage),
844 UDFPrint((
"SET_MRW_MODE status %x\n", RC));
855 if(
Vcb->OPCNum && !
Vcb->OPCDone) {
865 Vcb->OPCh->OpcBlocksNumber = 0;
899#ifndef UDF_READ_ONLY_BUILD
900#ifdef UDF_FORMAT_MEDIA
901 PUDFFmtState
fms =
Vcb->fms;
906#ifdef _UDF_STRUCTURES_H_
907 if(
Vcb->BSBM_Bitmap) {
909 for(
i=0;
i<BCount;
i++) {
911 UDFPrint((
"W: Known BB @ %#x\n", Lba));
930#ifdef UDF_FORMAT_MEDIA
931 (
fms &&
fms->SkipPrepareW) ||
935 UDFPrint((
"Skip prepare for Write @%x\n", Lba));
947 if(
Vcb->LastModifiedTrack &&
948 (
Vcb->TrackMap[
Vcb->LastModifiedTrack].FirstLba <= Lba) &&
949 (
Vcb->TrackMap[
Vcb->LastModifiedTrack].LastLba >= Lba) &&
959 UDFPrint((
"Skip prepare for Write (2) @%x\n", Lba));
966#ifdef UDF_FORMAT_MEDIA
973 for(
uint32 i=
Vcb->FirstTrackNum; i<=Vcb->LastTrackNum;
i++) {
974 if((
Vcb->TrackMap[
i].FirstLba > Lba) ||
975 (
Vcb->TrackMap[
i].LastLba < Lba)) {
984 goto check_dvd_bg_format;
991 if(!(WParams =
Vcb->WParams)) {
1001#ifdef UDF_FORMAT_MEDIA
1003 fms->SkipPrepareW = 1;
1040 if(!
Vcb->CDR_Mode) {
1048 WParams->
Byte3.
Flags &= ~WParam_MultiSes_Mask;
1052 if(
Vcb->LastSession > 1) {
1058 WParams->
Byte4.
Flags &= ~WParam_BlkType_Mask;
1068#ifdef UDF_FORMAT_MEDIA
1070 fms->SkipPrepareW = 1;
1094#ifdef UDF_FORMAT_MEDIA
1097 fms->SkipPrepareW = 1;
1111 if(
fms->opt_partition == PT_VAT15 ||
1112 fms->opt_blank_vat15) {
1118 if(!(WParams->Byte3.Flags &
WParam_FP)) {
1136 if(!
Vcb->CDR_Mode) {
1138 Vcb->LastModifiedTrack =
i;
1148 Vcb->LastModifiedTrack = 0;
1157 && (Lba >
Vcb->LastLBA)) {
1161 ULONG PSz = BCount <<
Vcb->BlockSizeBits;
1169 if(Lba+BCount <= (
Vcb->LastLBA+1) ) {
1170 UDFPrint((
"DVD cont. fmt, LBA+BCount<=NWA, exiting\n"));
1174 (Lba <= (
Vcb->LastLBA+1)) ) {
1175 UDFPrint((
"!PausedBGF + DVD cont. fmt, LBA<=NWA, exiting\n"));
1181 UDFPrint((
"DVD cont. fmt, LastLBA %x, Lba %x\n",
Vcb->LastLBA, Lba));
1194 UDFPrint((
"BGFormat restarted Interrupted->InProgress\n"));
1208 UDFPrint((
"SK=%x ASC=%x, ASCQ=%x, IE=%x\n",
1209 Error->SenseKey,
Error->AdditionalSenseCode,
Error->AdditionalSenseCodeQualifier,
Error->LastError));
1216 UDFPrint((
"Seems, BGFormat already restarted\n"));
1226 UDFPrint((
"DVD cont. write, LastLBA %x, Lba %x\n",
Vcb->LastLBA, Lba));
1229 if(!
Vcb->fZBuffer) {
1232 Vcb->fZBufferSize = PSz;
1234 if(
Vcb->fZBufferSize < PSz) {
1235 PSz =
Vcb->fZBufferSize;
1237 if(!
Vcb->fZBuffer) {
1241 for(fLba =
Vcb->NWA; fLba < Lba; fLba+=BCount) {
1249 UDFPrint((
"Fmt status: %x\n", RC));
1259 UDFPrint((
"Fmt break on ERROR\n"));
1266 UDFPrint((
" no special processing\n"));
1272 UDFPrint((
" no suitable track!\n"));
1311 UDFPrint((
"Error recovery: STATUS_NO_SUCH_DEVICE, die.....\n"));
1316#ifdef _UDF_STRUCTURES_H_
1318 UDFPrint((
"Error recovery: STATUS_NO_MEDIA_IN_DEVICE, prevent further remount.....\n"));
1322 Vcb->SerialNumber--;
1332 UDFPrint((
"SK=%x ASC=%x, ASCQ=%x, IE=%x\n",
1333 Error->SenseKey,
Error->AdditionalSenseCode,
Error->AdditionalSenseCodeQualifier,
Error->LastError));
1341 UDFPrint((
"Error recovery: reserve retry count for write retries\n"));
1345 UDFPrint((
"Error recovery: jump over UDF_WRITE_MAX_RETRY\n"));
1351 UDFPrint((
"Error recovery: simple write retry with delay\n"));
1358 UDFPrint((
"Error recovery: retry read after small delay\n"));
1362 UDFPrint((
"Error recovery: sync cache\n"));
1368#ifdef _UDF_STRUCTURES_H_
1369 if(
Vcb->BGWriters) (*retry)++;
1380 UDFPrint((
"Error recovery: op. in progress, waiting 0.3 sec\n"));
1383#ifdef _UDF_STRUCTURES_H_
1384 if(
Vcb->BGWriters) (*retry)++;
1394 UDFPrint((
"Error recovery: invalid command sequence on read\n"));
1397 UDFPrint((
"Error recovery: sync cache\n"));
1403#ifdef _UDF_STRUCTURES_H_
1404 if(
Vcb->BGWriters) (*retry)++;
1408 goto reinit_sector_mode;
1414 UDFPrint((
"Error recovery: bus reset...\n"));
1415 Vcb->MediaChangeCount =
Error->MediaChangeCount;
1438 Vcb->LastModifiedTrack = 0;
1450bad_rw_seek_recovery:
1455 for(
i=
Vcb->FirstTrackNum; i<=Vcb->LastTrackNum;
i++) {
1456 if((
Vcb->TrackMap[
i].FirstLba > Lba) ||
1457 (
Vcb->TrackMap[
i].LastLba < Lba))
1468 Vcb->TrackMap[
i].Flags &= ~TrackMap_Try_variation;
1483 Vcb->TrackMap[
i].Flags &= ~TrackMap_Try_variation;
1486 Vcb->LastModifiedTrack = 0;
1497 goto reinit_sector_mode;
1507 UDFPrint((
"Using incremental seek workaround...\n"));
1511 UDFPrint((
"Seems to be BB @ %x\n", Lba));
1519 Lba+BCount <= Vcb->LastLBA+1) {
1520 UDFPrint((
"bad Session in streaming mode. Lba %x, try fix-up\n", Lba));
1532 UDFPrint((
"CDRW_ERR_WRITE_IN_PROGRESS_BUSY || STATUS_DEVICE_BUSY\n"));
1534#ifdef _UDF_STRUCTURES_H_
1535 if(
Vcb->BGWriters) (*retry)++;
1544 Vcb->LastModifiedTrack = 0;
1559 goto bad_rw_seek_recovery;
1561 UDFPrint((
"map error to STATUS_NONEXISTENT_SECTOR\n"));
1564 UDFPrint((
"Seems to be BB @ %x (read 2)\n", Lba));
1572 Lba+BCount <= Vcb->LastLBA+1) {
1573 UDFPrint((
"bad LBA %x in streaming mode, try fix-up\n", Lba));
1579 if((Lba+BCount >=
Vcb->LastLBA) &&
1581 UDFPrint((
"stupid drive, cannot read beyond formatted area on DiscInfo_BGF_Interrupted\n"));
1598 if((
Vcb->MountPhErrorCount != (
ULONG)-1) &&
1599 (
Vcb->MountPhErrorCount < 0x7fffffff)) {
1600 Vcb->MountPhErrorCount++;
1603 if(UpdateBB && (BCount == 1)) {
1605 if(!(bm = (
uint32*)(
Vcb->BSBM_Bitmap))) {
1610 UDFPrint((
"Can't alloc BSBM for %x blocks\n",
Vcb->LastPossibleLBA));
1621 UDFPrint((
"Set BB @ %#x as used\n", Lba));
1651#ifdef UDF_FORMAT_MEDIA
1652 PUDFFmtState
fms =
Vcb->fms;
1656 if(!DiscInfo || !TrackInfoOut)
1665 UDFPrint((
"ReadDiskInfo failed. Use default.\n"));
1678#ifdef UDF_FORMAT_MEDIA
1679 if(
fms &&
fms->opt_disk_info) {
1688 UDFPrint((
"ReadCapacity failed.\n"));
1701#ifdef UDF_FORMAT_MEDIA
1702 if(
fms &&
fms->opt_disk_info) {
1718 UDFPrint((
"DiskInfo: SN %x, OPCn %x(%x), Stat %x, Flg: %x\n",
1720#ifdef UDF_FORMAT_MEDIA
1721 if(
fms &&
fms->opt_disk_info) {
1723 switch(
Vcb->MediaClassEx) {
1743 default:
UserPrint((
"Unknown\n"));
break;
1804 UDFPrint((
"+RW returns bad value\n"));
1820 goto MRWRetry_label;
1838 UDFPrint((
"force Rewritable (2)\n"));
1848 Vcb->LastTrackNum =
max(
Vcb->LastTrackNum,
Vcb->FirstTrackNum);
1849 if(!
Vcb->LastTrackNum) {
1850 UDFPrint((
"Try read 1st track...\n"));
1851 Vcb->LastTrackNum = 1;
1853 UDFPrint((
"DiskInfo: 1st trk %x, last trk %x\n",
Vcb->FirstTrackNum,
Vcb->LastTrackNum));
1854#ifdef UDF_FORMAT_MEDIA
1855 if(
fms &&
fms->opt_disk_info) {
1857 "Last track: %d\n",
Vcb->FirstTrackNum,
Vcb->LastTrackNum));
1858 UserPrint((
"------------------------------------------\n"));
1876 if((
Vcb->LastTrackNum < TrackInfoOut->
TrackNum) &&
1883 Vcb->LastPossibleLBA =
1885 UDFPrint((
" set LastPossibleLBA=%x\n",
Vcb->LastPossibleLBA));
1889 UDFPrint((
"Ses %d, Track %d (%x, len %x) PckSize %x: \n"
1890 " NWA: %x (%s) DatType:%x, %s %s %s %s TrkType:%x %s %s\n"
1891 " LRA: %x (%s) RC_LBA:%x\n",
1915#ifdef UDF_FORMAT_MEDIA
1916 if(
fms &&
fms->opt_disk_info) {
1918 UserPrint((
" Ses %d, Track %d (%x, len %x) PckSize %x: \n"
1919 " NWA: %x (%s) DatType:%x, %s %s %s %s TrkType:%x %s %s\n"
1920 " LRA: %x (%s) RC_LBA:%x\n",
1961 Vcb->TrackMap[TrackNumber].FirstLba = 0;
1967 Vcb->LastPossibleLBA -
Vcb->TrackMap[TrackNumber].FirstLba + 1));
1968 TrackInfoOut->
TrackLength =
Vcb->LastPossibleLBA -
Vcb->TrackMap[TrackNumber].FirstLba + 1;
1976 Vcb->TrackMap[TrackNumber].NWA_V = TrackInfoOut->
NWA_V;
1979 if(!(
Vcb->TrackMap[TrackNumber].LastLba & 0x8000000)) {
1980 UDFPrint((
"TrkInfo: set NWA to LastLba (%x)\n",
Vcb->TrackMap[TrackNumber].LastLba));
1981 Vcb->TrackMap[TrackNumber].NWA =
1982 Vcb->TrackMap[TrackNumber].LastLba;
1984 UDFPrint((
"TrkInfo: set NWA to INV (1)\n"));
1985 Vcb->TrackMap[TrackNumber].NWA = 0;
1986 Vcb->TrackMap[TrackNumber].NWA_V = 0;
1991 Vcb->TrackMap[TrackNumber].NWA =
1994 UDFPrint((
"TrkInfo: set NWA to INV (2)\n"));
1995 Vcb->TrackMap[TrackNumber].NWA = 0;
1996 Vcb->TrackMap[TrackNumber].NWA_V = 0;
1999 Vcb->TrackMap[TrackNumber].Session = TrackInfoOut->
SesNum;
2004 Vcb->TrackMap[TrackNumber].DataParam &= ~TrkInfo_FP;
2026 UDFPrint((
"TrkInfo_Damage, Try RAW_MOUNT\n"));
2032 UDFPrint((
"Unknown DatType, Try RAW_MOUNT\n"));
2038 UDFPrint((
"Ses %d, Track %d (%x - %x) PckSize %x: \n"
2039 " NWA: %x (%s) DatType:%x, %s %s %s %s TrkType:%x %s %s\n"
2040 " LRA: %x (%s) RC_LBA:%x\n",
2043 Vcb->TrackMap[TrackNumber].FirstLba,
2044 Vcb->TrackMap[TrackNumber].LastLba,
2064#ifdef UDF_FORMAT_MEDIA
2065 if(
fms &&
fms->opt_disk_info) {
2066 UserPrint((
"Track %d: \n", TrackNumber));
2067 UserPrint((
" Ses %d, Track %d (%x, len %x) PckSize %x: \n"
2068 " NWA: %x (%s) DatType:%x, %s %s %s %s TrkType:%x %s %s\n"
2069 " LRA: %x (%s) RC_LBA:%x\n",
2097 if(!(
Vcb->TrackMap[TrackNumber].FirstLba & 0x80000000)) {
2098 UDFPrint((
"TrkInfo: Update FirstLBA (%x)\n",
Vcb->TrackMap[TrackNumber].FirstLba));
2099 Vcb->FirstLBA =
Vcb->TrackMap[TrackNumber].FirstLba;
2102 if((TrackInfoOut->
SesNum ==
Vcb->LastSession) && !
Vcb->FirstTrackNumLastSes) {
2103 if(!(
Vcb->TrackMap[TrackNumber].FirstLba & 0x80000000)) {
2104 UDFPrint((
"TrkInfo: Update FirstLBALastSes (%x)\n",
Vcb->TrackMap[TrackNumber].FirstLba));
2105 Vcb->FirstLBALastSes =
Vcb->TrackMap[TrackNumber].FirstLba;
2107 Vcb->FirstTrackNumLastSes = TrackNumber;
2126 Vcb->LastPossibleLBA =
2128 UDFPrint((
" set LastPossibleLBA=%x\n",
Vcb->LastPossibleLBA));
2130 TrackNumber =
Vcb->LastTrackNum;
2133 UDFPrint((
" check quick formatted +RW\n"));
2134 if(
Vcb->TrackMap[TrackNumber].LastLba &&
2135 !(
Vcb->TrackMap[TrackNumber].LastLba & 0x80000000) &&
2136 Vcb->TrackMap[TrackNumber].LastLba <
Vcb->LastPossibleLBA
2139 UDFPrint((
" track LastLBA %x != LastPossibleLBA %x, verify\n",
2140 Vcb->TrackMap[TrackNumber].LastLba,
Vcb->LastPossibleLBA));
2143 UDFPrint((
" complete MRW state\n"));
2145 Vcb->LastPossibleLBA =
2148 Vcb->TrackMap[TrackNumber].LastLba;
2149 goto valid_track_length;
2152 if(
Vcb->MRWStatus) {
2162 Vcb->WriteBlockSize,
2163 Vcb->TrackMap[TrackNumber].LastLba+1,
2168 UDFPrint((
" Can't read beyond track LastLBA (%x)\n",
Vcb->TrackMap[TrackNumber].LastLba+1));
2169 Vcb->LastLBA =
Vcb->TrackMap[TrackNumber].LastLba;
2170 Vcb->NWA =
Vcb->LastLBA+1;
2171 Vcb->TrackMap[TrackNumber].NWA_V = 1;
2172 Vcb->TrackMap[TrackNumber].NWA =
Vcb->NWA;
2173 Vcb->TrackMap[TrackNumber].LastLba =
Vcb->LastPossibleLBA;
2175 goto valid_track_length;
2180 UDFPrint((
" set track LastLBA %x\n",
Vcb->LastPossibleLBA));
2183 Vcb->TrackMap[TrackNumber].LastLba =
2184 Vcb->LastPossibleLBA;
2188 if((
Vcb->TrackMap[TrackNumber].Session !=
2189 Vcb->TrackMap[TrackNumber-1].Session) &&
2190 (
Vcb->LastSession > 1)) {
2192 if((
Vcb->TrackMap[TrackNumber].LastLba <=
2193 Vcb->TrackMap[TrackNumber].FirstLba) ||
2194 (
Vcb->TrackMap[TrackNumber].FirstLba ==
2195 Vcb->TrackMap[TrackNumber].NWA)) {
2197 Vcb->LastTrackNum--;
2204 Vcb->LastSession =
Vcb->TrackMap[TrackNumber-1].Session;
2208 TrackNumber =
Vcb->LastTrackNum;
2210 Vcb->LastLBA =
min(
Vcb->TrackMap[TrackNumber].LastLba,
Vcb->TrackMap[TrackNumber].NWA);
2214 UDFPrint((
" NWA ok, set LastLBA to min(Last %x, NWA %x\n",
2215 Vcb->TrackMap[TrackNumber].LastLba,
2216 Vcb->TrackMap[TrackNumber].NWA));
2217 Vcb->LastLBA =
min(
Vcb->TrackMap[TrackNumber].LastLba,
Vcb->TrackMap[TrackNumber].NWA);
2219 UDFPrint((
" no NWA, set LastLBA to Last %x\n",
Vcb->TrackMap[TrackNumber].LastLba));
2220 Vcb->LastLBA =
Vcb->TrackMap[TrackNumber].LastLba;
2225 UDFPrint((
" disable Raw mount\n"));
2226 Vcb->VCBFlags &= ~UDF_VCB_FLAGS_RAW_DISK;
2256 UDFPrint((
"UDFReadAndProcessFullToc\n"));
2259 Vcb->FirstTrackNum = 0xFF;
2301 CurTrack = (
uint8)(
Vcb->FirstTrackNum);
2306 if(CurTrack < Vcb->LastTrackNum)
2307 CurTrack = (
uint8)(
Vcb->FirstTrackNum);
2311#define TempMSF toc->SessionData[index].Params.StartPositionOfLeadOut.MSF
2313 LastLeadOut =
max(LastLeadOut,
Vcb->TrackMap[CurTrack].LastLba);
2318 if( (
Vcb->FirstTrackNum != 0x0FF) &&
2320#define TempMSF toc->SessionData[index].Params.StartPositionOfTrack.MSF
2322 if(
Vcb->FirstLBA & 0x80000000) {
2332#define TempMSF toc->SessionData[index].Params.StartPositionOfTrack.MSF
2334 if(
Vcb->TrackMap[
POINT].FirstLba & 0x80000000) {
2338 if(
Vcb->TrackMap[
POINT-1].LastLba) {
2353#define TempMSF toc->SessionData[index].Params.StartPositionOfNextProgramArea.MaxLeadOut_MSF
2372 Vcb->LastTrackNum =
max(
Vcb->LastTrackNum,
Vcb->FirstTrackNum);
2373 Vcb->TrackMap[
Vcb->LastTrackNum].LastLba =
max(LastLeadOut,
Vcb->TrackMap[
Vcb->LastTrackNum].LastLba);
2375 Vcb->LastLBA =
Vcb->TrackMap[
Vcb->LastTrackNum].LastLba;
2402#ifdef UDF_FORMAT_MEDIA
2403 PUDFFmtState
fms =
Vcb->fms;
2412 if(!toc || !LastSes) {
2427#ifdef UDF_FORMAT_MEDIA
2428 if(
fms->opt_media == MT_none) {
2442 Vcb->FirstTrackNum=1;
2444 Vcb->LastTrackNum=1;
2445 Vcb->TrackMap[1].FirstLba =
Vcb->FirstLBA;
2446 Vcb->TrackMap[1].LastLba =
Vcb->LastLBA;
2448#ifdef UDF_FORMAT_MEDIA
2453#ifdef UDF_HDD_SUPPORT
2460#ifdef UDF_FORMAT_MEDIA
2463 if(
fms->opt_media == MT_HD) {
2464 Vcb->LastPossibleLBA =
Vcb->LastLBA;
2472 Vcb->TrackMap[1].NWA = 0xffffffff;
2493 Vcb->LastTrackNum =
max(
Vcb->LastTrackNum,
Vcb->FirstTrackNum);
2521 for(TocEntry=0;TocEntry<LocalTrackCount + 1;TocEntry++) {
2523 Vcb->TrackMap[TrkNum].Session =
Vcb->LastSession;
2530 for(TocEntry=0;TocEntry<LocalTrackCount + 1;TocEntry++) {
2531#define TempMSF toc->TrackData[TocEntry].LBA
2536 UDFPrint((
"UDFUseStandard: Array out of bounds\n"));
2540 UDFPrint((
"Track N %d (0x%x) first LBA %ld (%lx) \n",TrkNum,TrkNum,
2544 if(
Vcb->FirstTrackNum == TrkNum) {
2546 if(
Vcb->FirstLBA & 0x80000000) {
2552 Vcb->TrackMap[OldTrkNum].LastLba =
Vcb->LastLBA-1;
2553 UDFPrint((
"UDFUseStandard: Last track entry, break TOC scan\n"));
2558 if(
Vcb->TrackMap[TrkNum].FirstLba & 0x80000000)
2559 Vcb->TrackMap[TrkNum].FirstLba = 0;
2562 UDFPrint((
"UDFUseStandard: Wrong previous track number\n"));
2565 Vcb->TrackMap[OldTrkNum].LastLba =
Vcb->TrackMap[TrkNum].FirstLba-1;
2584 TrkNum =
Vcb->LastTrackNum;
2587 for(;TrkNum;TrkNum--) {
2591 Vcb->LastTrackNum = TrkNum;
2597 UDFPrint((
"UDFUseStandard: no valid tracks...\n"));
2611 Vcb->LastLBA =
Vcb->TrackMap[TrkNum].LastLba-
i+1;
2623 len =
Vcb->TrackMap[TrkNum].LastLba -
Vcb->TrackMap[TrkNum].FirstLba + 1;
2633 Vcb->TrackMap[TrkNum].LastLba =
Vcb->TrackMap[TrkNum].FirstLba-
i+
len+1;
2643#ifdef UDF_CDRW_EMULATION_ON_ROM
2644 Vcb->LastPossibleLBA =
Vcb->LastLBA+7+1+1024;
2645 Vcb->NWA =
Vcb->LastLBA+7+1;
2647 Vcb->LastPossibleLBA =
2648 Vcb->NWA =
Vcb->LastLBA+7+1;
2657 for(TocEntry=0;TocEntry<LocalTrackCount + 1;TocEntry++) {
2658#define TempMSF toc->TrackData[TocEntry].LBA
2661 if(
Vcb->FirstLBA & 0x80000000) {
2695#ifdef UDF_FORMAT_MEDIA
2696 PUDFFmtState
fms =
Vcb->fms;
2706#ifdef UDF_HDD_SUPPORT
2709 UDFPrint((
"UDFGetBlockSize: HDD\n"));
2722 UDFPrint((
"UDFGetBlockSize: IOCTL_DISK_GET_PARTITION_INFO failed\n"));
2728 UDFPrint((
"UDFGetBlockSize: PartitionInfo->PartitionType != PARTITION_IFS\n"));
2752#ifdef UDF_FORMAT_MEDIA
2765 fms->opt_media = MT_HD;
2788 switch (
Vcb->BlockSize) {
2789 case 2048:
Vcb->BlockSizeBits = 11;
break;
2790#ifdef UDF_HDD_SUPPORT
2791 case 512:
Vcb->BlockSizeBits = 9;
break;
2792 case 1024:
Vcb->BlockSizeBits = 10;
break;
2793 case 4096:
Vcb->BlockSizeBits = 12;
break;
2794 case 8192:
Vcb->BlockSizeBits = 13;
break;
2798 UserPrint((
"UDF: Bad block size (%ld)\n",
Vcb->BlockSize));
2803#ifdef UDF_HDD_SUPPORT
2809#ifdef UDF_FORMAT_MEDIA
2810 (
fms &&
fms->opt_media == MT_HD)
2815#ifdef UDF_FORMAT_MEDIA
2821 Vcb->LastPossibleLBA =
2830 if(
Vcb->LastLBA == 0x7fffffff) {
2836 Vcb->LastPossibleLBA =
Vcb->LastLBA;
2837#ifdef UDF_HDD_SUPPORT
2848 if(
fms->opt_media == MT_HD) {
2849 Vcb->WriteBlockSize =
Vcb->BlockSize;
2859 UDFPrint((
"UDFGetBlockSize:\nBlock size is %x, Block size bits %x, Last LBA is %x\n",
2860 Vcb->BlockSize,
Vcb->BlockSizeBits,
Vcb->LastLBA));
2871UDFCheckTrackFPAddressing(
2886 ULONG FirstChunkLen = 0;
2888 ULONG NextChunkLen = 0;
2889 ULONG NextChunkLenCount = 0;
2891 ULONG NextChunkLenOth = 0;
2892 ULONG NextChunkLenOthCount = 0;
2901 if(!
Vcb->TrackMap) {
2902 Vcb->CompatFlags &= ~UDF_VCB_IC_FP_ADDR_PROBLEM;
2918 for(
i=0;
i<=0x200;
i++) {
2939 UDFPrint((
" Read error at lba %x\n",
i));
2963 if(!FirstChunkLen) {
2964 FirstChunkLen =
i-
lba;
2967 NextChunkLen =
i-
lba;
2968 NextChunkLenCount++;
2970 if(NextChunkLen ==
i-
lba) {
2971 NextChunkLenCount++;
2973 if((NextChunkLenOth+1) % (NextChunkLen+1)) {
2974 NextChunkLenOth =
i-
lba;
2975 NextChunkLenOthCount++;
2977 NextChunkLenCount++;
2989 if(!NextChunkLenCount && !NextChunkLenOthCount) {
2990 Vcb->CompatFlags &= ~UDF_VCB_IC_FP_ADDR_PROBLEM;
2993 if(NextChunkLenOthCount > NextChunkLenCount) {
2994 NextChunkLen = NextChunkLenOth;
2997 Vcb->CompatFlags &= ~UDF_VCB_IC_FP_ADDR_PROBLEM;
3000 Vcb->TrackMap[TrackNum].DataParam &= ~TrkInfo_Dat_Mask;
3003 Vcb->TrackMap[TrackNum].PacketSize = 1;
3004 while(NextChunkLen >>
Vcb->TrackMap[TrackNum].PacketSize) {
3005 Vcb->TrackMap[TrackNum].PacketSize++;
3007 Vcb->TrackMap[TrackNum].PacketSize = 1 << (
Vcb->TrackMap[TrackNum].PacketSize-1);
3008 Vcb->TrackMap[TrackNum].TrackFPOffset = NextChunkLen - FirstChunkLen;
3009 Vcb->TrackMap[TrackNum].PacketFPOffset =
Vcb->TrackMap[TrackNum].TrackFPOffset;
3010 Vcb->TrackMap[TrackNum].LastLba = (
Vcb->TrackMap[TrackNum].LastLba*
Vcb->TrackMap[TrackNum].PacketSize) /
3011 (
Vcb->TrackMap[TrackNum].PacketSize + 7);
3036 pk = Lba /
Vcb->TrackMap[
i].PacketSize;
3037 rel = Lba %
Vcb->TrackMap[
i].PacketSize;
3038 UDFPrint((
"FixFPAddr: %x -> %x\n", Lba, pk*(
Vcb->TrackMap[
i].PacketSize+7) + rel));
3039 return pk*(
Vcb->TrackMap[
i].PacketSize+7) + rel ;
3061 uint32 SavedFeatures = 0;
3062#ifdef UDF_FORMAT_MEDIA
3063 PUDFFmtState
fms =
Vcb->fms;
3093 goto GetSignatureFailed;
3097 UDFPrint((
"UDF: Signature of low driver is : %s \n",
3102 UDFPrint((
"UDF: *****************************************\n"));
3103 UDFPrint((
"UDF: ********* Our Device Driver Found ******\n"));
3104 UDFPrint((
"UDF: *****************************************\n"));
3109#ifdef UDF_FORMAT_MEDIA
3110 if(!
fms->opt_probe) {
3120#ifdef UDF_FORMAT_MEDIA
3132 Vcb->SavedFeatures =
3135 UDFPrint((
"UDFGetDiskInfo: UDF_VCB_IC_NO_SYNCCACHE_AFTER_WRITE\n"));
3139 UDFPrint((
"UDFGetDiskInfo: UDF_VCB_IC_SYNCCACHE_BEFORE_READ\n"));
3143 UDFPrint((
"UDFGetDiskInfo: CDRW_FEATURE_BAD_RW_SEEK\n"));
3149 UDFPrint((
"UDFGetDiskInfo: CDRW_FEATURE_FP_ADDRESSING_PROBLEM ?\n"));
3153 UDFPrint((
"UDFGetDiskInfo: CDRW_FEATURE_MRW_ADDRESSING_PROBLEM ?\n"));
3156 UDFPrint((
"UDFGetDiskInfo: CDRW_FEATURE_FORCE_SYNC_ON_WRITE\n"));
3160 UDFPrint((
"UDFGetDiskInfo: CDRW_FEATURE_BAD_DVD_LAST_LBA\n"));
3164 UDFPrint((
"UDFGetDiskInfo: CDRW_FEATURE_STREAMING\n"));
3167 UDFPrint((
"UDFGetDiskInfo: CDRW_FEATURE_OPC -> assume OPCNum=1\n"));
3170#ifdef UDF_FORMAT_MEDIA
3172 UDFPrint((
"UDFGetDiskInfo: CDRW_FEATURE_FULL_BLANK_ON_FORMAT\n"));
3173 if((
fms->opt_probe ||
fms->opt_smart_f)
3175 UDFPrint((
"UDFGetDiskInfo: force Full Erase\n"));
3190 Vcb->CdrwBufferSize = 0;
3192 UDFPrint((
"UDFGetDiskInfo: CdrwBufferSize = %dKb\n",
Vcb->CdrwBufferSize / 1024));
3193 Vcb->CdrwBufferSizeCounter = 0;
3202 UDFPrint((
"UDFGetDiskInfo: MediaType %x\n", MediaType));
3204#ifndef UDF_FORMAT_MEDIA
3214 UDFPrint((
"UDFGetDiskInfo: we shall ignore audio-disks...\n"));
3219 UDFPrint((
"UDFGetDiskInfo: Check DVD-disks...\n"));
3226 UDFPrint((
"UDFGetDiskInfo: MediaClassEx %x\n", MediaType));
3238 UDFPrint((
"UDFGetDiskInfo: MediaClass R\n"));
3244 UDFPrint((
"UDFGetDiskInfo: CDRW_FEATURE_MRW_ADDRESSING_PROBLEM on CD-RW\n"));
3254 UDFPrint((
"UDFGetDiskInfo: MediaClass RW\n"));
3261 UDFPrint((
"UDFGetDiskInfo: MediaClass ROM\n"));
3266 UDFPrint((
"UDFGetDiskInfo: MediaClass Unknown\n"));
3270 MediaType =
Vcb->MediaType;
3275#ifdef UDF_FORMAT_MEDIA
3283 if(
fms->opt_media == MT_AUTO)
3284 fms->opt_media = MT_CDR;
3287 UDFPrint((
"CdMediaClass_DVDR -> MediaType_UnknownSize_CDR\n"));
3289 if(
fms->opt_media == MT_AUTO)
3290 fms->opt_media = MT_DVDR;
3293 UDFPrint((
"CdMediaClass_DVDpR -> MediaType_UnknownSize_CDR\n"));
3295 if(
fms->opt_media == MT_AUTO)
3296 fms->opt_media = MT_DVDpR;
3299 UDFPrint((
"CdMediaClass_HD_DVDR -> MediaType_UnknownSize_CDR\n"));
3301 if(
fms->opt_media == MT_AUTO)
3302 fms->opt_media = MT_DVDR;
3305 UDFPrint((
"CdMediaClass_BDR -> MediaType_UnknownSize_CDR\n"));
3307 if(
fms->opt_media == MT_AUTO)
3308 fms->opt_media = MT_DVDR;
3313 if(
fms->opt_media == MT_AUTO)
3314 fms->opt_media = MT_CDRW;
3316 UDFPrint((
"UDFGetDiskInfo: CDRW_FEATURE_MRW_ADDRESSING_PROBLEM on CD-RW\n"));
3321 UDFPrint((
" CdMediaClass_DVDRW -> MediaType_UnknownSize_CDRW\n"));
3322 if(
fms->opt_media == MT_AUTO)
3323 fms->opt_media = MT_DVDRW;
3327 UDFPrint((
" CdMediaClass_DVDpRW -> MediaType_UnknownSize_CDRW\n"));
3328 if(
fms->opt_media == MT_AUTO)
3329 fms->opt_media = MT_DVDpRW;
3333 UDFPrint((
" CdMediaClass_DVDRAM -> MediaType_UnknownSize_CDRW\n"));
3334 if(
fms->opt_media == MT_AUTO)
3335 fms->opt_media = MT_DVDRAM;
3339 UDFPrint((
" CdMediaClass_HD_DVDRW -> MediaType_UnknownSize_CDRW\n"));
3340 if(
fms->opt_media == MT_AUTO)
3341 fms->opt_media = MT_DVDRW;
3345 UDFPrint((
" CdMediaClass_HD_DVDRAM -> MediaType_UnknownSize_CDRW\n"));
3346 if(
fms->opt_media == MT_AUTO)
3347 fms->opt_media = MT_DVDRAM;
3351 UDFPrint((
" CdMediaClass_BDRE -> MediaType_UnknownSize_CDRW\n"));
3352 if(
fms->opt_media == MT_AUTO)
3353 fms->opt_media = MT_DVDRW;
3357 UDFPrint((
" CdMediaClass_NoDiscPresent -> MediaType_NoDiscPresent\n"));
3359 fms->opt_media = MT_none;
3362 UDFPrint((
" CdMediaClass_DoorOpen -> MediaType_DoorOpen\n"));
3364 fms->opt_media = MT_none;
3367 UDFPrint((
" MediaType_Unknown\n"));
3371 if(!apply_force_r(
fms)) {
3383 UDFPrint((
"UDFGetDiskInfo: DVD && !CdCapFlags_RandomWritable\n"));
3386#ifndef UDF_CDRW_EMULATION_ON_ROM
3390#ifdef UDF_FORMAT_MEDIA
3399 if(!
Vcb->WriteParamsReq) {
3400 UDFPrint((
"UDFGetDiskInfo: do not use WriteParams\n"));
3403 UDFPrint((
"UDFGetDiskInfo: Use CAV (1)\n"));
3412 UDFPrint((
"UDFGetDiskInfo: update defaulted LastLBA\n"));
3418 UDFPrint((
"UDFGetDiskInfo: CDRW_FEATURE_MRW_ADDRESSING_PROBLEM on old CD-ROM\n"));
3434#define cap ((PGET_CAPABILITIES_3_USER_OUT)ioBuf)
3445 UDFPrint((
"IS_WRITABLE - false, doing additional check...\n"));
3449 UserPrint((
"Hardware Read-only volume\n"));
3450#ifndef UDF_CDRW_EMULATION_ON_ROM
3453#ifdef UDF_FORMAT_MEDIA
3454 if(
fms && !
fms->opt_read_iso)
3461 Vcb->MaxWriteSpeed =
cap->MaximumWriteSpeedSupported;
3462 Vcb->MaxReadSpeed =
cap->MaximumSpeedSupported;
3464 Vcb->CurSpeed =
max(
cap->CurrentSpeed,
cap->CurrentWriteSpeed3);
3465 if(
cap->LunWPerfDescriptorCount &&
cap->LunWPerfDescriptorCount != 0xffff) {
3467 UDFPrint((
"Write performance descriptor(s) found: %x\n",
cap->LunWPerfDescriptorCount));
3469 n =
min(
n,
cap->LunWPerfDescriptorCount);
3478 for(
i = 0;
i<
n;
i++) {
3486 Vcb->CurSpeed =
max(WPerfDesc[
i].WriteSpeedSupported,
Vcb->CurSpeed);
3488 UDFPrint((
"supports speed %dX\n",
Vcb->CurSpeed/176));
3493 UDFPrint((
"Set r/w speeds to %dX\n",
Vcb->CurSpeed/176));
3494 Vcb->MaxWriteSpeed =
3495 Vcb->MaxReadSpeed =
Vcb->CurSpeed;
3500 Vcb->CurSpeed =
max(
cap->CurrentSpeed,
cap->CurrentWriteSpeed);
3502 UDFPrint((
" Speeds r/w %dX/%dX\n",
Vcb->CurSpeed/176,
cap->CurrentWriteSpeed/176));
3513#ifdef UDF_FORMAT_MEDIA
3515 if( (
fms->auto_media || (
fms->opt_media == MT_AUTO)) &&
3516 (
fms->opt_media < MT_DVDR) ) {
3518 fms->opt_media = MT_CDR;
3520 fms->opt_media = MT_CDRW;
3523 if(!apply_force_r(
fms)) {
3533 UDFPrint((
"Hardware Read-only volume (2)\n"));
3535#ifndef UDF_CDRW_EMULATION_ON_ROM
3566 UDFPrint((
"UDF: Bad DVD last LBA %x, fixup!\n",
Vcb->LastLBA));
3573 UDFPrint((
"UDF: Empty DVD. Use bogus values for now\n"));
3578 if((
Vcb->LastPossibleLBA & 0x80000000) || (
Vcb->LastPossibleLBA <
Vcb->LastLBA)) {
3579 UDFPrint((
"UDF: bad LastPossibleLBA %x -> %x\n",
Vcb->LastPossibleLBA,
Vcb->LastLBA));
3580 Vcb->LastPossibleLBA =
Vcb->LastLBA;
3582 if(!
Vcb->WriteBlockSize)
3587 if(
Vcb->TrackMap[
Vcb->LastTrackNum].LastLba >
Vcb->NWA) {
3590 Vcb->LastLBA =
Vcb->NWA-1;
3592 Vcb->LastLBA =
Vcb->NWA-7-1;
3596 if((
Vcb->LastTrackNum > 1) &&
3597 (
Vcb->TrackMap[
Vcb->LastTrackNum-1].FirstLba >=
Vcb->TrackMap[
Vcb->LastTrackNum-1].LastLba)) {
3598 Vcb->LastLBA =
Vcb->TrackMap[
Vcb->LastTrackNum-1].LastLba;
3603 for(
i=0;
i<32;
i++) {
3604 if(!(
Vcb->LastPossibleLBA >>
i))
3608 Vcb->WCacheBlocksPerFrameSh =
max(
Vcb->WCacheBlocksPerFrameSh, (2*
i)/5+2);
3609 Vcb->WCacheBlocksPerFrameSh =
min(
Vcb->WCacheBlocksPerFrameSh, 16);
3614 UDFCheckTrackFPAddressing(
Vcb,
Vcb->FirstTrackNum);
3617 UDFPrint((
"UDF: Fix LastLBA: %x -> %x\n",
Vcb->LastLBA, (
Vcb->LastLBA*32) / 39));
3618 Vcb->LastLBA = (
Vcb->LastLBA*32) / 39;
3625 UDFPrint((
"UDFGetDiskInfo: R/O+!Blank+!RW -> !RAW\n"));
3626 Vcb->VCBFlags &= ~UDF_VCB_FLAGS_RAW_DISK;
3628 UDFPrint((
"UDFGetDiskInfo: Blank or RW\n"));
3632 UDFPrint((
"UDF: ------------------------------------------\n"));
3633 UDFPrint((
"UDF: Media characteristics\n"));
3634 UDFPrint((
"UDF: Last session: %d\n",
Vcb->LastSession));
3635 UDFPrint((
"UDF: First track in first session: %d\n",
Vcb->FirstTrackNum));
3636 UDFPrint((
"UDF: First track in last session: %d\n",
Vcb->FirstTrackNumLastSes));
3637 UDFPrint((
"UDF: Last track in last session: %d\n",
Vcb->LastTrackNum));
3638 UDFPrint((
"UDF: First LBA in first session: %x\n",
Vcb->FirstLBA));
3639 UDFPrint((
"UDF: First LBA in last session: %x\n",
Vcb->FirstLBALastSes));
3640 UDFPrint((
"UDF: Last LBA in last session: %x\n",
Vcb->LastLBA));
3641 UDFPrint((
"UDF: First writable LBA (NWA) in last session: %x\n",
Vcb->NWA));
3642 UDFPrint((
"UDF: Last available LBA beyond end of last session: %x\n",
Vcb->LastPossibleLBA));
3643 UDFPrint((
"UDF: blocks per frame: %x\n",1 <<
Vcb->WCacheBlocksPerFrameSh));
3648 UDFPrint((
"UDF: ------------------------------------------\n"));
3650#ifdef UDF_FORMAT_MEDIA
3651 if(
fms &&
fms->opt_disk_info) {
3652 UserPrint((
"------------------------------------------\n"));
3653 UserPrint((
"Media characteristics:\n"));
3654 UserPrint((
" First writable LBA (NWA) in last session: %x\n",
Vcb->NWA));
3655 UserPrint((
" Last available LBA beyond end of last session: %x\n",
Vcb->LastPossibleLBA));
3656 UserPrint((
"------------------------------------------\n"));
3662 UDFPrint((
"UDFGetDiskInfo: %x\n", RC));
3677 Vcb->VCBFlags &= ~UDF_VCB_LAST_WRITE;
3688#ifdef _UDF_STRUCTURES_H_
3689 if(
Vcb->BSBM_Bitmap) {
3691 for(
i=0;
i<BCount;
i++) {
3693 UDFPrint((
"R: Known BB @ %#x\n", Lba));
3713#ifndef UDF_FORMAT_MEDIA
3731 if(
Vcb->CurSpeed !=
Vcb->MaxWriteSpeed ||
3732 Vcb->CurSpeed !=
Vcb->MaxReadSpeed) {
3733 Vcb->CurSpeed =
Vcb->MaxWriteSpeed;
3734 speed_changed =
TRUE;
3739 if(
Vcb->CurSpeed >
Vcb->MaxWriteSpeed) {
3740 Vcb->CurSpeed =
Vcb->MaxWriteSpeed;
3741 speed_changed =
TRUE;
3744 if(
Vcb->CurSpeed <
Vcb->MaxReadSpeed ) {
3746 Vcb->CurSpeed += 176/1;
3747 speed_changed =
TRUE;
3750 if(
Vcb->CurSpeed >
Vcb->MaxReadSpeed) {
3751 Vcb->CurSpeed =
Vcb->MaxReadSpeed;
3756 Vcb->SpeedBuf.ReadSpeed =
Vcb->CurSpeed;
3757 Vcb->SpeedBuf.WriteSpeed =
Vcb->MaxWriteSpeed;
3761 UDFPrint((
" UDFPrepareForReadOperation: set speed to %s %dX/%dX\n",
3763 Vcb->SpeedBuf.ReadSpeed,
3764 Vcb->SpeedBuf.WriteSpeed));
3766 Vcb->TargetDeviceObject,
3775 if(
Vcb->LastReadTrack &&
3776 ((
Vcb->TrackMap[
i].FirstLba <= Lba) || (
Vcb->TrackMap[
i].FirstLba & 0x80000000)) &&
3777 (
Vcb->TrackMap[
i].LastLba >= Lba)) {
3778check_for_data_track:
3791 for(
i=
Vcb->FirstTrackNum; i<=Vcb->LastTrackNum;
i++) {
3792 if(((
Vcb->TrackMap[
i].FirstLba > Lba) && !(
Vcb->TrackMap[
i].FirstLba & 0x80000000)) ||
3793 (
Vcb->TrackMap[
i].LastLba < Lba))
3795 Vcb->LastReadTrack =
i;
3796 goto check_for_data_track;
3798 Vcb->LastReadTrack = 0;
3804 UDFPrint((
" UDFPrepareForReadOperation: seek workaround...\n"));
3812 for(
i=0x1000;
i<=Lba;
i+=0x1000) {
3815 UDFPrint((
" seek workaround, LBA %x, status %x\n",
i, RC));
3833#ifndef UDF_READ_ONLY_BUILD
3838 if(!
Vcb->CDR_Mode) {
3845 && (LBA+BCount-1) >
Vcb->LastLBA) {
3847 Vcb->NWA = LBA+BCount;
3848 Vcb->LastLBA =
Vcb->NWA-1;
3866 if(
Vcb->LastLBA < (LBA+BCount))
3867 Vcb->LastLBA = LBA+BCount;
3872 UDFPrint((
" UDFUpdateNWA: syncing...\n"));
3987 (*ReadBytes) += _ReadBytes;
3999 (*ReadBytes) += _ReadBytes;
4006#ifndef UDF_READ_ONLY_BUILD
4027 if(
Vcb->LVid && !Direct) {
4033 if(
Vcb->LastLBA < Lba+BCount-1)
4034 Vcb->LastLBA = Lba+BCount-1;