2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS File System Recognizer
4 * FILE: drivers/filesystems/fs_rec/udfs.c
5 * PURPOSE: USFS Recognizer
6 * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
10 /* INCLUDES *****************************************************************/
19 /* FUNCTIONS ****************************************************************/
23 FsRecIsUdfsVolume(IN PDEVICE_OBJECT DeviceObject
,
26 PVOLSTRUCTDESC VolumeStructDesc
= NULL
;
31 Offset
.QuadPart
= UDFS_VRS_START_OFFSET
;
34 if (!FsRecReadBlock(DeviceObject
,
38 (PVOID
)&VolumeStructDesc
,
48 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
56 ExFreePool(VolumeStructDesc
);
63 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
66 !strncmp((const char*)VolumeStructDesc
->Ident
,
76 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
80 ExFreePool(VolumeStructDesc
);
86 Offset
.QuadPart
+= SectorSize
;
87 if (Offset
.QuadPart
== UDFS_AVDP_SECTOR
)
89 ExFreePool(VolumeStructDesc
);
94 ExFreePool(VolumeStructDesc
);
100 FsRecUdfsFsControl(IN PDEVICE_OBJECT DeviceObject
,
103 PIO_STACK_LOCATION Stack
;
105 PDEVICE_OBJECT MountDevice
;
109 /* Get the I/O Stack and check the function type */
110 Stack
= IoGetCurrentIrpStackLocation(Irp
);
111 switch (Stack
->MinorFunction
)
113 case IRP_MN_MOUNT_VOLUME
:
116 Status
= STATUS_UNRECOGNIZED_VOLUME
;
118 /* Get the device object and request the sector size */
119 MountDevice
= Stack
->Parameters
.MountVolume
.DeviceObject
;
120 if (FsRecGetDeviceSectorSize(MountDevice
, &SectorSize
))
122 /* Check if it's an actual FAT volume */
123 if (FsRecIsUdfsVolume(MountDevice
, SectorSize
))
126 Status
= STATUS_FS_DRIVER_REQUIRED
;
132 case IRP_MN_LOAD_FILE_SYSTEM
:
134 /* Load the file system */
135 Status
= FsRecLoadFileSystem(DeviceObject
,
136 L
"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Udfs");
141 /* Invalid request */
142 Status
= STATUS_INVALID_DEVICE_REQUEST
;