ReactOS 0.4.16-dev-320-g3bd9ddc
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 498 of file iso.c.

499{
501 PPVD Pvd = (PPVD)Buffer;
503 ULONG Count;
505
506 TRACE("Enter IsoMount(%lu)\n", DeviceId);
507
508 /*
509 * Read the Primary Volume Descriptor
510 */
511 Position.HighPart = 0;
512 Position.LowPart = 16 * SECTORSIZE;
513 Status = ArcSeek(DeviceId, &Position, SeekAbsolute);
514 if (Status != ESUCCESS)
515 return NULL;
516 Status = ArcRead(DeviceId, Pvd, SECTORSIZE, &Count);
517 if (Status != ESUCCESS || Count < sizeof(PVD))
518 return NULL;
519
520 /* Check if the PVD is valid */
521 if (!(Pvd->VdType == 1 && RtlEqualMemory(Pvd->StandardId, "CD001", 5) && Pvd->VdVersion == 1))
522 {
523 WARN("Unrecognized CDROM format\n");
524 return NULL;
525 }
526 if (Pvd->LogicalBlockSizeL != SECTORSIZE)
527 {
528 ERR("Unsupported LogicalBlockSize %u\n", Pvd->LogicalBlockSizeL);
529 return NULL;
530 }
531
532 Count = (ULONG)((ULONGLONG)Pvd->VolumeSpaceSizeL * SECTORSIZE / 1024 / 1024);
533 TRACE("Recognized ISO9660 drive, size %lu MB (%lu sectors)\n",
534 Count, Pvd->VolumeSpaceSizeL);
535
536 /* Everything OK, return the ISO9660 function table */
537 return &Iso9660FuncTable;
538}
#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
#define SECTORSIZE
Definition: iso.c:27
const DEVVTBL Iso9660FuncTable
Definition: iso.c:488
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
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
Definition: iso.h:61
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
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
unsigned char UCHAR
Definition: xmlstorage.h:181