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
;
32 Offset
.QuadPart
= 16 * SectorSize
;
33 for (i
= 0; i
< 16; i
++)
35 if (!FsRecReadBlock(DeviceObject
,
39 (PVOID
*)&VolumeStructDesc
,
45 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
49 DPRINT("BEA01 found\n");
52 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
56 DPRINT("NSR03 found\n");
60 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
64 DPRINT("NSR02 found\n");
68 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
72 DPRINT("TEA01 found\n");
75 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
79 DPRINT("CD001 found\n");
82 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
86 DPRINT("CDW02 found\n");
89 if (!strncmp((const char*)VolumeStructDesc
->Ident
,
93 DPRINT("BOOT2 found\n");
96 Offset
.QuadPart
+= SectorSize
;
100 ExFreePool(VolumeStructDesc
);
106 FsRecUdfsFsControl(IN PDEVICE_OBJECT DeviceObject
,
109 PIO_STACK_LOCATION Stack
;
111 PDEVICE_OBJECT MountDevice
;
115 /* Get the I/O Stack and check the function type */
116 Stack
= IoGetCurrentIrpStackLocation(Irp
);
117 switch (Stack
->MinorFunction
)
119 case IRP_MN_MOUNT_VOLUME
:
122 Status
= STATUS_UNRECOGNIZED_VOLUME
;
124 /* Get the device object and request the sector size */
125 MountDevice
= Stack
->Parameters
.MountVolume
.DeviceObject
;
126 if (FsRecGetDeviceSectorSize(MountDevice
, &SectorSize
))
128 /* Check if it's an actual FAT volume */
129 if (FsRecIsUdfsVolume(MountDevice
, SectorSize
))
132 Status
= STATUS_FS_DRIVER_REQUIRED
;
138 case IRP_MN_LOAD_FILE_SYSTEM
:
140 /* Load the file system */
141 Status
= FsRecLoadFileSystem(DeviceObject
,
142 L
"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Udfs");
147 /* Invalid request */
148 Status
= STATUS_INVALID_DEVICE_REQUEST
;