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 *****************************************************************/
18 /* FUNCTIONS ****************************************************************/
22 FsRecIsUdfsVolume(IN PDEVICE_OBJECT DeviceObject
,
25 PVOLSTRUCTDESC VolumeStructDesc
= NULL
;
30 Offset
.QuadPart
= UDFS_VRS_START_OFFSET
;
33 if (!FsRecReadBlock(DeviceObject
,
37 (PVOID
)&VolumeStructDesc
,
47 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
55 ExFreePool(VolumeStructDesc
);
62 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
65 !strncmp((const char*)VolumeStructDesc
->Ident
,
75 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
79 ExFreePool(VolumeStructDesc
);
85 Offset
.QuadPart
+= SectorSize
;
86 if (Offset
.QuadPart
== UDFS_AVDP_SECTOR
)
88 ExFreePool(VolumeStructDesc
);
93 ExFreePool(VolumeStructDesc
);
99 FsRecUdfsFsControl(IN PDEVICE_OBJECT DeviceObject
,
102 PIO_STACK_LOCATION Stack
;
104 PDEVICE_OBJECT MountDevice
;
108 /* Get the I/O Stack and check the function type */
109 Stack
= IoGetCurrentIrpStackLocation(Irp
);
110 switch (Stack
->MinorFunction
)
112 case IRP_MN_MOUNT_VOLUME
:
115 Status
= STATUS_UNRECOGNIZED_VOLUME
;
117 /* Get the device object and request the sector size */
118 MountDevice
= Stack
->Parameters
.MountVolume
.DeviceObject
;
119 if (FsRecGetDeviceSectorSize(MountDevice
, &SectorSize
))
121 /* Check if it's an actual FAT volume */
122 if (FsRecIsUdfsVolume(MountDevice
, SectorSize
))
125 Status
= STATUS_FS_DRIVER_REQUIRED
;
131 case IRP_MN_LOAD_FILE_SYSTEM
:
133 /* Load the file system */
134 Status
= FsRecLoadFileSystem(DeviceObject
,
135 L
"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Udfs");
140 /* Invalid request */
141 Status
= STATUS_INVALID_DEVICE_REQUEST
;