@@ -168,7 +168,7 @@ static ARC_STATUS IsoLookupFile(PCSTR FileName, ULONG DeviceId, PISO_FILE_INFO I
168
168
RtlZeroMemory (& IsoFileInfo , sizeof (ISO_FILE_INFO ));
169
169
170
170
//
171
- // Read The Primary Volume Descriptor
171
+ // Read the Primary Volume Descriptor
172
172
//
173
173
Position .HighPart = 0 ;
174
174
Position .LowPart = 16 * SECTORSIZE ;
@@ -502,9 +502,9 @@ const DEVVTBL* IsoMount(ULONG DeviceId)
502
502
503
503
TRACE ("Enter IsoMount(%lu)\n" , DeviceId );
504
504
505
- //
506
- // Read The Primary Volume Descriptor
507
- / /
505
+ /*
506
+ * Read the Primary Volume Descriptor
507
+ * /
508
508
Position .HighPart = 0 ;
509
509
Position .LowPart = 16 * SECTORSIZE ;
510
510
Status = ArcSeek (DeviceId , & Position , SeekAbsolute );
@@ -514,16 +514,24 @@ const DEVVTBL* IsoMount(ULONG DeviceId)
514
514
if (Status != ESUCCESS || Count < sizeof (PVD ))
515
515
return NULL ;
516
516
517
- //
518
- // Check if PVD is valid. If yes, return ISO9660 function table
519
- //
520
- if (Pvd -> VdType == 1 && RtlEqualMemory (Pvd -> StandardId , "CD001" , 5 ))
517
+ /* Check if the PVD is valid */
518
+ if (!(Pvd -> VdType == 1 && RtlEqualMemory (Pvd -> StandardId , "CD001" , 5 ) && Pvd -> VdVersion == 1 ))
521
519
{
522
- TRACE ( "IsoMount(%lu) success \n", DeviceId );
523
- return & Iso9660FuncTable ;
520
+ WARN ( "Unrecognized CDROM format \n" );
521
+ return NULL ;
524
522
}
523
+ if (Pvd -> LogicalBlockSizeL != SECTORSIZE )
524
+ {
525
+ ERR ("Unsupported LogicalBlockSize %u\n" , Pvd -> LogicalBlockSizeL );
526
+ return NULL ;
527
+ }
528
+
529
+ Count = (ULONG )((ULONGLONG )Pvd -> VolumeSpaceSizeL * SECTORSIZE / 1024 / 1024 );
530
+ TRACE ("Recognized ISO9660 drive, size %lu MB (%lu sectors)\n" ,
531
+ Count , Pvd -> VolumeSpaceSizeL );
525
532
526
- return NULL ;
533
+ /* Everything OK, return the ISO9660 function table */
534
+ return & Iso9660FuncTable ;
527
535
}
528
536
529
537
#endif
0 commit comments