ReactOS 0.4.15-dev-7924-g5949c20
udfs.c
Go to the documentation of this file.
1/*
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)
7 * Eric Kohl
8 */
9
10/* INCLUDES *****************************************************************/
11
12#include "fs_rec.h"
13
14#define NDEBUG
15#include <debug.h>
16
17#include "udfs.h"
18
19/* FUNCTIONS ****************************************************************/
20
25{
26 PVOLSTRUCTDESC VolumeStructDesc = NULL;
29 int i;
30 PAGED_CODE();
31
32 Offset.QuadPart = 16 * SectorSize;
33 for (i = 0; i < 16; i++)
34 {
36 &Offset,
39 (PVOID *)&VolumeStructDesc,
40 NULL))
41 {
42 break;
43 }
44
45 if (!strncmp((const char*)VolumeStructDesc->Ident,
48 {
49 DPRINT("BEA01 found\n");
50 }
51
52 if (!strncmp((const char*)VolumeStructDesc->Ident,
55 {
56 DPRINT("NSR03 found\n");
57 ret = TRUE;
58 }
59
60 if (!strncmp((const char*)VolumeStructDesc->Ident,
63 {
64 DPRINT("NSR02 found\n");
65 ret = TRUE;
66 }
67
68 if (!strncmp((const char*)VolumeStructDesc->Ident,
71 {
72 DPRINT("TEA01 found\n");
73 }
74
75 if (!strncmp((const char*)VolumeStructDesc->Ident,
78 {
79 DPRINT("CD001 found\n");
80 }
81
82 if (!strncmp((const char*)VolumeStructDesc->Ident,
85 {
86 DPRINT("CDW02 found\n");
87 }
88
89 if (!strncmp((const char*)VolumeStructDesc->Ident,
92 {
93 DPRINT("BOOT2 found\n");
94 }
95
96 Offset.QuadPart += SectorSize;
97 }
98
99 if (VolumeStructDesc)
100 ExFreePool(VolumeStructDesc);
101 return ret;
102}
103
105NTAPI
107 IN PIRP Irp)
108{
111 PDEVICE_OBJECT MountDevice;
113 PAGED_CODE();
114
115 /* Get the I/O Stack and check the function type */
117 switch (Stack->MinorFunction)
118 {
120
121 /* Assume failure */
123
124 /* Get the device object and request the sector size */
125 MountDevice = Stack->Parameters.MountVolume.DeviceObject;
126 if (FsRecGetDeviceSectorSize(MountDevice, &SectorSize))
127 {
128 /* Check if it's an actual UDF volume */
129 if (FsRecIsUdfsVolume(MountDevice, SectorSize))
130 {
131 /* It is! */
133 }
134 }
135
136 break;
137
139
140 /* Load the file system */
142 L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Udfs");
143 break;
144
145 default:
146
147 /* Invalid request */
149 }
150
151 /* Return Status */
152 return Status;
153}
154
155/* EOF */
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define PAGED_CODE()
unsigned char BOOLEAN
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
BOOLEAN NTAPI FsRecReadBlock(IN PDEVICE_OBJECT DeviceObject, IN PLARGE_INTEGER Offset, IN ULONG Length, IN ULONG SectorSize, IN OUT PVOID *Buffer, OUT PBOOLEAN DeviceError OPTIONAL)
Definition: blockdev.c:152
BOOLEAN NTAPI FsRecGetDeviceSectorSize(IN PDEVICE_OBJECT DeviceObject, OUT PULONG SectorSize)
Definition: blockdev.c:80
NTSTATUS NTAPI FsRecLoadFileSystem(IN PDEVICE_OBJECT DeviceObject, IN PWCHAR DriverServiceName)
Definition: fs_rec.c:23
Status
Definition: gdiplustypes.h:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define STATUS_FS_DRIVER_REQUIRED
Definition: ntstatus.h:645
#define L(x)
Definition: ntvdm.h:50
#define DPRINT
Definition: sndvol32.h:71
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_UNRECOGNIZED_VOLUME
Definition: udferr_usr.h:173
BOOLEAN NTAPI FsRecIsUdfsVolume(IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize)
Definition: udfs.c:23
NTSTATUS NTAPI FsRecUdfsFsControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: udfs.c:106
#define VSD_STD_ID_NSR03
Definition: udfs.h:17
#define VSD_STD_ID_NSR02
Definition: udfs.h:10
#define VSD_STD_ID_CDW02
Definition: udfs.h:16
#define VSD_STD_ID_BOOT2
Definition: udfs.h:14
#define VSD_STD_ID_LEN
Definition: udfs.h:21
#define VSD_STD_ID_TEA01
Definition: udfs.h:18
#define VSD_STD_ID_CD001
Definition: udfs.h:15
#define VSD_STD_ID_BEA01
Definition: udfs.h:13
int ret
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
_In_ ULONG SectorSize
Definition: halfuncs.h:291
#define IRP_MN_LOAD_FILE_SYSTEM
Definition: iotypes.h:4406
#define IRP_MN_MOUNT_VOLUME
Definition: iotypes.h:4404