ReactOS 0.4.16-dev-927-g467dec4
iso.h File Reference
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for iso.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _DIR_RECORD
 
struct  _VD_HEADER
 
struct  _PVD
 
struct  _ISO_FILE_INFO
 

Typedefs

typedef struct _DIR_RECORD DIR_RECORD
 
typedef struct _DIR_RECORDPDIR_RECORD
 
typedef struct _VD_HEADER VD_HEADER
 
typedef struct _VD_HEADERPVD_HEADER
 
typedef struct _PVD PVD
 
typedef struct _PVDPPVD
 
typedef struct _ISO_FILE_INFO ISO_FILE_INFO
 
typedef struct _ISO_FILE_INFOPISO_FILE_INFO
 

Functions

const DEVVTBLIsoMount (ULONG DeviceId)
 

Typedef Documentation

◆ DIR_RECORD

◆ ISO_FILE_INFO

◆ PDIR_RECORD

◆ PISO_FILE_INFO

◆ PPVD

typedef struct _PVD * PPVD

◆ PVD

typedef struct _PVD PVD

◆ PVD_HEADER

◆ VD_HEADER

Function Documentation

◆ IsoMount()

const DEVVTBL * IsoMount ( ULONG  DeviceId)

Definition at line 560 of file iso.c.

561{
563 PPVD Pvd = (PPVD)Buffer;
565 ULONG Count;
568
569 TRACE("Enter IsoMount(%lu)\n", DeviceId);
570
571 /*
572 * Read the Primary Volume Descriptor
573 */
574 Position.HighPart = 0;
575 Position.LowPart = 16 * SECTORSIZE;
576 Status = ArcSeek(DeviceId, &Position, SeekAbsolute);
577 if (Status != ESUCCESS)
578 return NULL;
579 Status = ArcRead(DeviceId, Pvd, SECTORSIZE, &Count);
580 if (Status != ESUCCESS || Count < sizeof(PVD))
581 return NULL;
582
583 /* Check if the PVD is valid */
584 if (!(Pvd->VdType == 1 && RtlEqualMemory(Pvd->StandardId, "CD001", 5) && Pvd->VdVersion == 1))
585 {
586 WARN("Unrecognized CDROM format\n");
587 return NULL;
588 }
589 if (Pvd->LogicalBlockSizeL != SECTORSIZE)
590 {
591 ERR("Unsupported LogicalBlockSize %u\n", Pvd->LogicalBlockSizeL);
592 return NULL;
593 }
594
595 Count = (ULONG)((ULONGLONG)Pvd->VolumeSpaceSizeL * SECTORSIZE / 1024 / 1024);
596 TRACE("Recognized ISO9660 drive, size %lu MB (%lu sectors)\n",
597 Count, Pvd->VolumeSpaceSizeL);
598
600 if (!Volume)
601 return NULL;
602 RtlZeroMemory(Volume, sizeof(*Volume));
603
604 /* Cache the PVD information */
605 Volume->PvdDirectorySector = Pvd->RootDirRecord.ExtentLocationL;
606 Volume->PvdDirectoryLength = Pvd->RootDirRecord.DataLengthL;
607
608 IsoVolumes[DeviceId] = Volume;
609
610 /* Everything OK, return the ISO9660 function table */
611 return &Iso9660FuncTable;
612}
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
ARC_STATUS ArcSeek(ULONG FileId, LARGE_INTEGER *Position, SEEKMODE SeekMode)
Definition: fs.c:455
ARC_STATUS ArcRead(ULONG FileId, VOID *Buffer, ULONG N, ULONG *Count)
Definition: fs.c:448
PVOID FrLdrTempAlloc(_In_ SIZE_T Size, _In_ ULONG Tag)
Definition: heap.c:545
static PISO_VOLUME_INFO IsoVolumes[MAX_FDS]
Definition: iso.c:42
#define SECTORSIZE
Definition: iso.c:27
#define TAG_ISO_VOLUME
Definition: iso.c:28
static const DEVVTBL Iso9660FuncTable
Definition: iso.c:550
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
Status
Definition: gdiplustypes.h:25
struct _PVD * PPVD
#define RtlEqualMemory(dst, src, len)
Definition: kdvm.h:18
UNICODE_STRING Volume
Definition: fltkernel.h:1172
int Count
Definition: noreturn.cpp:7
@ ESUCCESS
Definition: arc.h:32
ULONG ARC_STATUS
Definition: arc.h:4
@ SeekAbsolute
Definition: arc.h:59
#define TRACE(s)
Definition: solgame.cpp:4
ULONG ExtentLocationL
Definition: iso.h:27
ULONG DataLengthL
Definition: iso.h:29
Definition: iso.h:61
DIR_RECORD RootDirRecord
Definition: iso.h:84
USHORT LogicalBlockSizeL
Definition: iso.h:76
ULONG VolumeSpaceSizeL
Definition: iso.h:69
UCHAR StandardId[5]
Definition: iso.h:63
UCHAR VdType
Definition: iso.h:62
UCHAR VdVersion
Definition: iso.h:64
static COORD Position
Definition: mouse.c:34
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
unsigned char UCHAR
Definition: xmlstorage.h:181