ReactOS  0.4.15-dev-5137-g826bd41
udfs.c File Reference
#include "fs_rec.h"
#include <debug.h>
#include "udfs.h"
Include dependency graph for udfs.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

BOOLEAN NTAPI FsRecIsUdfsVolume (IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize)
 
NTSTATUS NTAPI FsRecUdfsFsControl (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 14 of file udfs.c.

Function Documentation

◆ FsRecIsUdfsVolume()

BOOLEAN NTAPI FsRecIsUdfsVolume ( IN PDEVICE_OBJECT  DeviceObject,
IN ULONG  SectorSize 
)

Definition at line 23 of file udfs.c.

25 {
26  PVOLSTRUCTDESC VolumeStructDesc = NULL;
28  BOOLEAN ret = FALSE;
29  int i;
30  PAGED_CODE();
31 
32  Offset.QuadPart = 16 * SectorSize;
33  for (i = 0; i < 16; i++)
34  {
36  &Offset,
37  SectorSize,
38  SectorSize,
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 }
#define VSD_STD_ID_BEA01
Definition: udfs.h:13
#define TRUE
Definition: types.h:120
#define VSD_STD_ID_NSR03
Definition: udfs.h:17
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define FALSE
Definition: types.h:117
#define VSD_STD_ID_CDW02
Definition: udfs.h:16
unsigned char BOOLEAN
#define VSD_STD_ID_TEA01
Definition: udfs.h:18
#define VSD_STD_ID_CD001
Definition: udfs.h:15
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define VSD_STD_ID_LEN
Definition: udfs.h:21
int ret
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
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define VSD_STD_ID_BOOT2
Definition: udfs.h:14
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
#define NULL
Definition: types.h:112
#define VSD_STD_ID_NSR02
Definition: udfs.h:10
_In_ ULONG SectorSize
Definition: halfuncs.h:291
#define DPRINT
Definition: sndvol32.h:71
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define PAGED_CODE()

Referenced by FsRecUdfsFsControl().

◆ FsRecUdfsFsControl()

NTSTATUS NTAPI FsRecUdfsFsControl ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 106 of file udfs.c.

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  {
119  case IRP_MN_MOUNT_VOLUME:
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 }
BOOLEAN NTAPI FsRecGetDeviceSectorSize(IN PDEVICE_OBJECT DeviceObject, OUT PULONG SectorSize)
Definition: blockdev.c:80
LONG NTSTATUS
Definition: precomp.h:26
#define IRP_MN_LOAD_FILE_SYSTEM
Definition: iotypes.h:4406
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_FS_DRIVER_REQUIRED
Definition: ntstatus.h:645
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:636
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define L(x)
Definition: ntvdm.h:50
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_UNRECOGNIZED_VOLUME
Definition: udferr_usr.h:173
Status
Definition: gdiplustypes.h:24
#define IRP_MN_MOUNT_VOLUME
Definition: iotypes.h:4404
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
NTSTATUS NTAPI FsRecLoadFileSystem(IN PDEVICE_OBJECT DeviceObject, IN PWCHAR DriverServiceName)
Definition: fs_rec.c:23
BOOLEAN NTAPI FsRecIsUdfsVolume(IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize)
Definition: udfs.c:23
unsigned int ULONG
Definition: retypes.h:1
_In_ ULONG SectorSize
Definition: halfuncs.h:291
#define PAGED_CODE()

Referenced by FsRecFsControl().