ReactOS  0.4.13-dev-1148-g9b75b67
udfinit.cpp File Reference
#include "udffs.h"
Include dependency graph for udfinit.cpp:

Go to the source code of this file.

Macros

#define UDF_BUG_CHECK_ID   UDF_FILE_INIT
 
#define KD_PREFIX
 
#define UDF_CHECK_FS_NAME(name)
 

Functions

NTSTATUS UDFCreateFsDeviceObject (PCWSTR FsDeviceName, PDRIVER_OBJECT DriverObject, DEVICE_TYPE DeviceType, PDEVICE_OBJECT *DeviceObject)
 
NTSTATUS UDFDismountDevice (PUNICODE_STRING unicodeCdRomDeviceName)
 
VOID UDFRemountAll (IN PVOID Context)
 
NTSTATUS NTAPI DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
 
VOID NTAPI UDFInitializeFunctionPointers (PDRIVER_OBJECT DriverObject)
 
VOID NTAPI UDFFsNotification (IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN FsActive)
 

Variables

UDFData UDFGlobalData
 
struct UDF_MEDIA_CLASS_NAMES UDFMediaClassName []
 
ULONG FsRegistered = FALSE
 
WORK_QUEUE_ITEM RemountWorkQueueItem
 
HANDLE FsNotification_ThreadId = (HANDLE)(-1)
 

Macro Definition Documentation

◆ KD_PREFIX

#define KD_PREFIX

Definition at line 27 of file udfinit.cpp.

◆ UDF_BUG_CHECK_ID

#define UDF_BUG_CHECK_ID   UDF_FILE_INIT

Definition at line 22 of file udfinit.cpp.

◆ UDF_CHECK_FS_NAME

#define UDF_CHECK_FS_NAME (   name)
Value:
(Buffer->FileSystemNameLength+sizeof(WCHAR) == sizeof(name) && \
DbgCompareMemory(&Buffer->FileSystemName[0],name , sizeof(name)) == sizeof(name))
Definition: bufpool.h:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: name.c:36
GLuint const GLchar * name
Definition: glext.h:6031

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( PDRIVER_OBJECT  DriverObject,
PUNICODE_STRING  RegistryPath 
)

Definition at line 87 of file udfinit.cpp.

91 {
93  UNICODE_STRING DriverDeviceName;
94  UNICODE_STRING unicodeDeviceName;
95 // BOOLEAN RegisteredShutdown = FALSE;
96  BOOLEAN InternalMMInitialized = FALSE;
97 // BOOLEAN DLDetectInitialized = FALSE;
98 // ULONG CdRomNumber;
99 // CCHAR deviceNameBuffer[MAXIMUM_FILENAME_LENGTH];
100 // ANSI_STRING deviceName;
101 // UNICODE_STRING unicodeCdRomDeviceName;
102  PUDFFS_DEV_EXTENSION FSDevExt;
103  HKEY hUdfRootKey;
105 
106 // UDFPrint(("UDF: Entered " VER_STR_PRODUCT_NAME " UDF DriverEntry \n"));
107 // UDFPrint((KD_PREFIX "Build " VER_STR_PRODUCT "\n"));
108 
109  _SEH2_TRY {
110  _SEH2_TRY {
111 
112 /*
113  CrNtInit(DriverObject, RegistryPath);
114 
115  //PsGetVersion(&MajorVersion, &MinorVersion, &BuildNumber, NULL);
116  UDFPrint(("UDF: OS Version Major: %x, Minor: %x, Build number: %d\n",
117  MajorVersion, MinorVersion, BuildNumber));
118 */
119 #ifdef __REACTOS__
120  UDFPrint(("UDF Init: OS should be ReactOS\n"));
121 #endif
122 
123  // initialize the global data structure
125 
126  // initialize some required fields
127  UDFGlobalData.NodeIdentifier.NodeType = UDF_NODE_TYPE_GLOBAL_DATA;
128  UDFGlobalData.NodeIdentifier.NodeSize = sizeof(UDFGlobalData);
129 
130  // initialize the global data resource and remember the fact that
131  // the resource has been initialized
132  RC = UDFInitializeResourceLite(&(UDFGlobalData.GlobalDataResource));
133  ASSERT(NT_SUCCESS(RC));
135 
136  RC = UDFInitializeResourceLite(&(UDFGlobalData.DelayedCloseResource));
137  ASSERT(NT_SUCCESS(RC));
138 // UDFSetFlag(UDFGlobalData.UDFFlags, UDF_DATA_FLAGS_RESOURCE_INITIALIZED);
139 
140  // keep a ptr to the driver object sent to us by the I/O Mgr
141  UDFGlobalData.DriverObject = DriverObject;
142 
143  //SeEnableAccessToExports();
144 
145  // initialize the mounted logical volume list head
146  InitializeListHead(&(UDFGlobalData.VCBQueue));
147 
148  UDFPrint(("UDF: Init memory manager\n"));
149  // Initialize internal memory management
150  if(!MyAllocInit()) {
152  }
153  InternalMMInitialized = TRUE;
154 
155 #ifdef USE_DLD
156  // Initialize Deadlock Detector
157  DLDInit(1280);
158  DLDetectInitialized = TRUE;
159 #endif
160  // before we proceed with any more initialization, read in
161  // user supplied configurable values ...
162 
163  // Save RegistryPath
165 
169 
171 
175 
176  UDFPrint(("UDF: Init delayed close queues\n"));
177 #ifdef UDF_DELAYED_CLOSE
178  InitializeListHead( &UDFGlobalData.DelayedCloseQueue );
179  InitializeListHead( &UDFGlobalData.DirDelayedCloseQueue );
180 
183  NULL );
184 
185  UDFGlobalData.DelayedCloseCount = 0;
186  UDFGlobalData.DirDelayedCloseCount = 0;
187 #endif //UDF_DELAYED_CLOSE
188 
189  // we should have the registry data (if any), allocate zone memory ...
190  // This is an example of when FSD implementations __try to pre-allocate
191  // some fixed amount of memory to avoid internal fragmentation and/or waiting
192  // later during run-time ...
193 
194  UDFGlobalData.DefaultZoneSizeInNumStructs=10;
195 
196  UDFPrint(("UDF: Init zones\n"));
197  if (!NT_SUCCESS(RC = UDFInitializeZones()))
198  try_return(RC);
199 
200  UDFPrint(("UDF: Init pointers\n"));
201  // initialize the IRP major function table, and the fast I/O table
203 
204  UDFGlobalData.CPU_Count = KeNumberProcessors;
205 
206  // create a device object representing the driver itself
207  // so that requests can be targeted to the driver ...
208  // e.g. for a disk-based FSD, "mount" requests will be sent to
209  // this device object by the I/O Manager.
210  // For a redirector/server, you may have applications
211  // send "special" IOCTL's using this device object ...
212 
213  RtlInitUnicodeString(&DriverDeviceName, UDF_FS_NAME);
214 
215  UDFPrint(("UDF: Create Driver dev obj\n"));
216  if (!NT_SUCCESS(RC = IoCreateDevice(
217  DriverObject, // our driver object
218  sizeof(UDFFS_DEV_EXTENSION), // don't need an extension for this object
219  &DriverDeviceName, // name - can be used to "open" the driver
220  // see the book for alternate choices
222  0, // no special characteristics
223  // do not want this as an exclusive device, though you might
224  FALSE,
225  &(UDFGlobalData.UDFDeviceObject)))) {
226  // failed to create a device object, leave ...
227  try_return(RC);
228  }
229 
230  FSDevExt = (PUDFFS_DEV_EXTENSION)((UDFGlobalData.UDFDeviceObject)->DeviceExtension);
231  // Zero it out (typically this has already been done by the I/O
232  // Manager but it does not hurt to do it again)!
233  RtlZeroMemory(FSDevExt, sizeof(UDFFS_DEV_EXTENSION));
234 
235  // Initialize the signature fields
237  FSDevExt->NodeIdentifier.NodeSize = sizeof(UDFFS_DEV_EXTENSION);
238 
239  RtlInitUnicodeString(&unicodeDeviceName, UDF_DOS_FS_NAME);
240  IoCreateSymbolicLink(&unicodeDeviceName, &DriverDeviceName);
241 
242  UDFPrint(("UDF: Create CD dev obj\n"));
244  DriverObject,
246  &(UDFGlobalData.UDFDeviceObject_CD)))) {
247  // failed to create a device object, leave ...
248  try_return(RC);
249  }
250 #ifdef UDF_HDD_SUPPORT
251  UDFPrint(("UDF: Create HDD dev obj\n"));
253  DriverObject,
255  &(UDFGlobalData.UDFDeviceObject_HDD)))) {
256  // failed to create a device object, leave ...
257  try_return(RC);
258  }
259 #endif //UDF_HDD_SUPPORT
260 
261 /* RtlInitUnicodeString(&DriverDeviceName, UDF_FS_NAME_OTHER);
262 
263  if (!NT_SUCCESS(RC = IoCreateDevice(
264  DriverObject, // our driver object
265  0, // don't need an extension for this object
266  &DriverDeviceName, // name - can be used to "open" the driver
267  // see the book for alternate choices
268  FILE_DEVICE_FILE_SYSTEM,
269  0, // no special characteristics
270  // do not want this as an exclusive device, though you might
271  FALSE,
272  &(UDFGlobalData.UDFDeviceObject_OTHER)))) {
273  // failed to create a device object, leave ...
274  try_return(RC);
275  }
276  // register the driver with the I/O Manager, pretend as if this is
277  // a physical disk based FSD (or in order words, this FSD manages
278  // logical volumes residing on physical disk drives)
279  IoRegisterFileSystem(UDFGlobalData.UDFDeviceObject_OTHER);
280 
281  RtlInitUnicodeString(&DriverDeviceName, UDF_FS_NAME_TAPE);
282 
283  if (!NT_SUCCESS(RC = IoCreateDevice(
284  DriverObject, // our driver object
285  0, // don't need an extension for this object
286  &DriverDeviceName, // name - can be used to "open" the driver
287  // see the book for alternate choices
288  FILE_DEVICE_TAPE_FILE_SYSTEM,
289  0, // no special characteristics
290  // do not want this as an exclusive device, though you might
291  FALSE,
292  &(UDFGlobalData.UDFDeviceObject_TAPE)))) {
293  // failed to create a device object, leave ...
294  try_return(RC);
295  }
296  // register the driver with the I/O Manager, pretend as if this is
297  // a physical disk based FSD (or in order words, this FSD manages
298  // logical volumes residing on physical disk drives)
299  IoRegisterFileSystem(UDFGlobalData.UDFDeviceObject_TAPE);
300 */
301 
302  if (UDFGlobalData.UDFDeviceObject_CD) {
303  UDFPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for CD\n"));
304  IoRegisterFileSystem(UDFGlobalData.UDFDeviceObject_CD);
305  }
306 #ifdef UDF_HDD_SUPPORT
307  if (UDFGlobalData.UDFDeviceObject_HDD) {
308  UDFPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem() for HDD\n"));
309  IoRegisterFileSystem(UDFGlobalData.UDFDeviceObject_HDD);
310  }
311 #endif // UDF_HDD_SUPPORT
312  FsRegistered = TRUE;
313 
314  UDFPrint(("UDF: IoRegisterFsRegistrationChange()\n"));
316 
317 // delay.QuadPart = -10000000;
318 // KeDelayExecutionThread(KernelMode, FALSE, &delay); //10 microseconds
319 
320  delay.QuadPart = -10000000; // 1 sec
322 
323 #if 0
324  if(!WinVer_IsNT) {
325  /*ExInitializeWorkItem(&RemountWorkQueueItem, UDFRemountAll, NULL);
326  UDFPrint(("UDFDriverEntry: create remount thread\n"));
327  ExQueueWorkItem(&RemountWorkQueueItem, DelayedWorkQueue);*/
328 
329  for(CdRomNumber = 0;true;CdRomNumber++) {
330  sprintf(deviceNameBuffer, "\\Device\\CdRom%d", CdRomNumber);
331  UDFPrint(( "UDF: DriverEntry : dismount %s\n", deviceNameBuffer));
332  RtlInitString(&deviceName, deviceNameBuffer);
333  RC = RtlAnsiStringToUnicodeString(&unicodeCdRomDeviceName, &deviceName, TRUE);
334 
335  if (!NT_SUCCESS(RC)) {
336  RtlFreeUnicodeString(&unicodeCdRomDeviceName);
337  break;
338  }
339 
340  RC = UDFDismountDevice(&unicodeCdRomDeviceName);
341  RtlFreeUnicodeString(&unicodeCdRomDeviceName);
342 
343  if (!NT_SUCCESS(RC)) break;
344 
345  }
346 
347  PVOID ModuleBase = NULL;
348 
349  // get NTOSKRNL.EXE exports
350  ModuleBase = CrNtGetModuleBase("NTOSKRNL.EXE");
351  if(ModuleBase) {
352  FsRtlNotifyVolumeEvent = (ptrFsRtlNotifyVolumeEvent)CrNtGetProcAddress(ModuleBase, "FsRtlNotifyVolumeEvent");
353  }
354 
355  }
356 #endif
357  RC = STATUS_SUCCESS;
358 
360  // we encountered an exception somewhere, eat it up
361  UDFPrint(("UDF: exception\n"));
362  RC = _SEH2_GetExceptionCode();
363  } _SEH2_END;
364 
365  InternalMMInitialized = FALSE;
366 
367  try_exit: NOTHING;
368  } _SEH2_FINALLY {
369  // start unwinding if we were unsuccessful
370  if (!NT_SUCCESS(RC)) {
371  UDFPrint(("UDF: failed with status %x\n", RC));
372  // Now, delete any device objects, etc. we may have created
373 /* if (UDFGlobalData.UDFDeviceObject) {
374  IoDeleteDevice(UDFGlobalData.UDFDeviceObject);
375  UDFGlobalData.UDFDeviceObject = NULL;
376  }*/
377 #ifdef USE_DLD
378  if (DLDetectInitialized) DLDFree();
379 #endif
380  if (InternalMMInitialized) {
381  MyAllocRelease();
382  }
383  if (UDFGlobalData.UDFDeviceObject_CD) {
384  IoDeleteDevice(UDFGlobalData.UDFDeviceObject_CD);
385  UDFGlobalData.UDFDeviceObject_CD = NULL;
386  }
387 #ifdef UDF_HDD_SUPPORT
388 
389  if (UDFGlobalData.UDFDeviceObject_HDD) {
390  IoDeleteDevice(UDFGlobalData.UDFDeviceObject_HDD);
391  UDFGlobalData.UDFDeviceObject_HDD = NULL;
392  }
393 #endif // UDF_HDD_SUPPORT
394 
395 /*
396  if (UDFGlobalData.UDFDeviceObject_OTHER) {
397  IoDeleteDevice(UDFGlobalData.UDFDeviceObject_CD);
398  UDFGlobalData.UDFDeviceObject_CD = NULL;
399  }
400 
401  if (UDFGlobalData.UDFDeviceObject_TAPE) {
402  IoDeleteDevice(UDFGlobalData.UDFDeviceObject_CD);
403  UDFGlobalData.UDFDeviceObject_CD = NULL;
404  }
405 */
406  // free up any memory we might have reserved for zones/lookaside
407  // lists
409  UDFDestroyZones();
410  }
411 
412  // delete the resource we may have initialized
414  // un-initialize this resource
415  UDFDeleteResource(&(UDFGlobalData.GlobalDataResource));
417  }
418 // } else {
419  }
420  } _SEH2_END;
421 
422  return(RC);
423 } // end DriverEntry()
VOID MyAllocRelease(VOID)
#define WinVer_IsNT
Definition: CrossNt.h:101
UNICODE_STRING UnicodeStrRoot
Definition: udf_common.h:616
#define UDFInitializeResourceLite(Resource)
Definition: env_spec_w32.h:667
#define UDFPrint(Args)
Definition: udffs.h:225
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
UNICODE_STRING AclName
Definition: udf_common.h:618
#define UDFSetFlag(Flag, Value)
Definition: udffs.h:191
uint16_t * PWSTR
Definition: typedefs.h:54
UDFIdentifier NodeIdentifier
Definition: struct.h:354
LONG NTSTATUS
Definition: precomp.h:26
#define UDF_DATA_FLAGS_RESOURCE_INITIALIZED
Definition: udf_common.h:634
VOID NTAPI UDFDelayedClose(PVOID unused)
Definition: close.cpp:690
#define UDFClearFlag(Flag, Value)
Definition: udffs.h:192
#define UDF_FS_NAME_CD
Definition: udf_reg.h:32
_SEH2_TRY
Definition: create.c:4250
NTSTATUS(* ptrFsRtlNotifyVolumeEvent)(IN PFILE_OBJECT FileObject, IN ULONG EventCode)
Definition: ntifs_ex.h:453
#define sprintf(buf, format,...)
Definition: sprintf.c:55
NTSTATUS UDFDismountDevice(PUNICODE_STRING unicodeCdRomDeviceName)
Definition: udfinit.cpp:634
NTSTATUS UDFCreateFsDeviceObject(PCWSTR FsDeviceName, PDRIVER_OBJECT DriverObject, DEVICE_TYPE DeviceType, PDEVICE_OBJECT *DeviceObject)
Definition: udfinit.cpp:588
VOID DLDInit(ULONG MaxThrdCount)
Initialize deadlock detector.
Definition: dldetect.cpp:51
NTSTATUS NTAPI KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Interval OPTIONAL)
Definition: wait.c:283
UDFData UDFGlobalData
Definition: udfinit.cpp:25
#define UDF_NODE_TYPE_UDFFS_DRVOBJ
Definition: struct.h:67
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define UDF_DOS_FS_NAME
Definition: udf_reg.h:38
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
struct _UDFFS_DEV_EXTENSION UDFFS_DEV_EXTENSION
uint32 NodeType
Definition: struct.h:75
#define FILE_DEVICE_DISK_FILE_SYSTEM
Definition: winioctl.h:113
#define MyAllocatePool__(type, size)
Definition: mem_tools.h:149
NTSTATUS UDFInitializeZones(VOID)
Definition: misc.cpp:41
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
NTSTATUS NTAPI FsRtlNotifyVolumeEvent(IN PFILE_OBJECT FileObject, IN ULONG EventCode)
Definition: pnp.c:38
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define try_return(S)
Definition: cdprocs.h:2189
#define UDFDeleteResource(Resource)
Definition: env_spec_w32.h:663
#define UDF_SN_NT_ACL
Definition: osta_misc.h:340
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define UDF_DATA_FLAGS_ZONES_INITIALIZED
Definition: udf_common.h:635
#define UDF_NODE_TYPE_GLOBAL_DATA
Definition: struct.h:63
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static const WCHAR L[]
Definition: oid.c:1250
void delay(unsigned msec)
Definition: i386rtl.c:32
uint32 NodeSize
Definition: struct.h:76
#define NOTHING
Definition: env_spec_w32.h:461
UNICODE_STRING SavedRegPath
Definition: udf_common.h:615
CCHAR KeNumberProcessors
Definition: krnlinit.c:35
NTSYSAPI VOID NTAPI RtlInitString(PSTRING DestinationString, PCSZ SourceString)
struct _UDFFS_DEV_EXTENSION * PUDFFS_DEV_EXTENSION
BOOLEAN MyAllocInit(VOID)
Definition: mem_tools.h:140
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
PVOID CrNtGetModuleBase(IN PCHAR pModuleName)
_SEH2_END
Definition: create.c:4424
uint32 UDFFlags
Definition: udf_common.h:627
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
_SEH2_FINALLY
Definition: create.c:4395
UNICODE_STRING UnicodeStrSDir
Definition: udf_common.h:617
PVOID CrNtGetProcAddress(PVOID ModuleBase, PCHAR pFunctionName)
VOID NTAPI UDFFsNotification(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN FsActive)
Definition: udfinit.cpp:779
VOID NTAPI IoRegisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:992
#define FILE_DEVICE_CD_ROM_FILE_SYSTEM
Definition: winioctl.h:108
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
VOID NTAPI UDFInitializeFunctionPointers(PDRIVER_OBJECT DriverObject)
Definition: udfinit.cpp:444
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
VOID UDFDestroyZones(VOID)
Definition: misc.cpp:177
NTSTATUS RegTGetKeyHandle(IN HKEY hRootKey, IN PWCHAR KeyName, OUT HKEY *hKey)
Definition: regtools.cpp:59
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define UDF_FS_NAME
Definition: udf_reg.h:31
NTSTATUS NTAPI IoRegisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject, IN PDRIVER_FS_NOTIFICATION DriverNotificationRoutine)
Definition: volume.c:1094
ULONG FsRegistered
Definition: udfinit.cpp:45
#define UDF_FS_NAME_HDD
Definition: udf_reg.h:33
VOID DLDFree(VOID)
Definition: dldetect.cpp:64

◆ UDFCreateFsDeviceObject()

NTSTATUS UDFCreateFsDeviceObject ( PCWSTR  FsDeviceName,
PDRIVER_OBJECT  DriverObject,
DEVICE_TYPE  DeviceType,
PDEVICE_OBJECT DeviceObject 
)

Definition at line 588 of file udfinit.cpp.

594 {
596  UNICODE_STRING DriverDeviceName;
597  PUDFFS_DEV_EXTENSION FSDevExt;
598  RtlInitUnicodeString(&DriverDeviceName, FsDeviceName);
599  *DeviceObject = NULL;
600 
601  UDFPrint(("UDFCreateFsDeviceObject: create dev\n"));
602 
603  if (!NT_SUCCESS(RC = IoCreateDevice(
604  DriverObject, // our driver object
605  sizeof(UDFFS_DEV_EXTENSION), // don't need an extension for this object
606  &DriverDeviceName, // name - can be used to "open" the driver
607  // see the book for alternate choices
608  DeviceType,
609  0, // no special characteristics
610  // do not want this as an exclusive device, though you might
611  FALSE,
612  DeviceObject))) {
613  // failed to create a device object, leave ...
614  return(RC);
615  }
616  FSDevExt = (PUDFFS_DEV_EXTENSION)((*DeviceObject)->DeviceExtension);
617  // Zero it out (typically this has already been done by the I/O
618  // Manager but it does not hurt to do it again)!
619  RtlZeroMemory(FSDevExt, sizeof(UDFFS_DEV_EXTENSION));
620 
621  // Initialize the signature fields
623  FSDevExt->NodeIdentifier.NodeSize = sizeof(UDFFS_DEV_EXTENSION);
624  // register the driver with the I/O Manager, pretend as if this is
625  // a physical disk based FSD (or in order words, this FSD manages
626  // logical volumes residing on physical disk drives)
627 /* UDFPrint(("UDFCreateFsDeviceObject: IoRegisterFileSystem()\n"));
628  IoRegisterFileSystem(*DeviceObject);*/
629  return(RC);
630 } // end UDFCreateFsDeviceObject()
#define UDF_NODE_TYPE_UDFFS_DEVOBJ
Definition: struct.h:65
#define UDFPrint(Args)
Definition: udffs.h:225
DeviceType
Definition: mmdrv.h:41
UDFIdentifier NodeIdentifier
Definition: struct.h:354
LONG NTSTATUS
Definition: precomp.h:26
smooth NULL
Definition: ftsmooth.c:416
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
struct _UDFFS_DEV_EXTENSION UDFFS_DEV_EXTENSION
uint32 NodeType
Definition: struct.h:75
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
uint32 NodeSize
Definition: struct.h:76
struct _UDFFS_DEV_EXTENSION * PUDFFS_DEV_EXTENSION
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by DriverEntry().

◆ UDFDismountDevice()

NTSTATUS UDFDismountDevice ( PUNICODE_STRING  unicodeCdRomDeviceName)

Definition at line 634 of file udfinit.cpp.

637 {
638  NTSTATUS RC;
640  HANDLE NtFileHandle = (HANDLE)-1;
644 
645  _SEH2_TRY {
646 
649 
651  unicodeCdRomDeviceName,
653  NULL,
654  NULL );
655 
656  UDFPrint(("\n*** UDFDismountDevice: Create\n"));
657  RC = ZwCreateFile( &NtFileHandle,
658  GENERIC_READ,
660  &IoStatus,
661  NULL,
664  FILE_OPEN,
666  NULL,
667  0 );
668 
669 
670  if (!NT_SUCCESS(RC)) try_return(RC);
671 
672  UDFPrint(("\n*** UDFDismountDevice: QueryVolInfo\n"));
673  RC = ZwQueryVolumeInformationFile( NtFileHandle,
674  &IoStatus,
675  Buffer,
678 
679 #define UDF_CHECK_FS_NAME(name) \
680  (Buffer->FileSystemNameLength+sizeof(WCHAR) == sizeof(name) && \
681  DbgCompareMemory(&Buffer->FileSystemName[0],name , sizeof(name)) == sizeof(name))
682 
683  if (NT_SUCCESS(RC) &&
691 
692  UDFPrint(("\n*** UDFDismountDevice: LockVolume\n"));
693  RC = ZwFsControlFile(NtFileHandle,
694  NULL,
695  NULL,
696  NULL,
697  &IoStatus,
699  NULL,
700  NULL,
701  NULL,
702  NULL);
703 
704  if (!NT_SUCCESS(RC)) try_return(RC);
705 
706  UDFPrint(("\n*** UDFDismountDevice: DismountVolume\n"));
707  RC = ZwFsControlFile(NtFileHandle,
708  NULL,
709  NULL,
710  NULL,
711  &IoStatus,
713  NULL,
714  NULL,
715  NULL,
716  NULL);
717 
718  if (!NT_SUCCESS(RC)) try_return(RC);
719 
720  UDFPrint(("\n*** UDFDismountDevice: NotifyMediaChange\n"));
721  RC = ZwDeviceIoControlFile(NtFileHandle,
722  NULL,
723  NULL,
724  NULL,
725  &IoStatus,
727  &buffer,
728  sizeof(buffer),
729  &buffer,
730  sizeof(buffer));
731 
732  if (!NT_SUCCESS(RC)) try_return(RC);
733 
734 
735  UDFPrint(("\n*** UDFDismountDevice: UnlockVolume\n"));
736  RC = ZwFsControlFile(NtFileHandle,
737  NULL,
738  NULL,
739  NULL,
740  &IoStatus,
742  NULL,
743  NULL,
744  NULL,
745  NULL);
746 
747  UDFPrint(("\n*** UDFDismountDevice: Close\n"));
748  ZwClose( NtFileHandle );
749 
750  NtFileHandle = (HANDLE)-1;
751 
752  UDFPrint(("\n*** UDFDismountDevice: Create 2\n"));
753  RC = ZwCreateFile( &NtFileHandle,
754  GENERIC_READ,
756  &IoStatus,
757  NULL,
760  FILE_OPEN,
762  NULL,
763  0 );
764 
765 try_exit: NOTHING;
766 
767  } _SEH2_FINALLY {
768  if (Buffer) MyFreePool__(Buffer);
769  if (NtFileHandle != (HANDLE)-1) ZwClose( NtFileHandle );
770  } _SEH2_END;
771 
772  UDFPrint(("\n*** UDFDismountDevice: RC=%x\n",RC));
773  return RC;
774 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define UDF_FS_TITLE_DVDRW
Definition: udf_reg.h:55
#define FSCTL_UNLOCK_VOLUME
Definition: nt_native.h:833
#define UDFPrint(Args)
Definition: udffs.h:225
NTSYSAPI NTSTATUS NTAPI ZwDeviceIoControlFile(IN HANDLE DeviceHandle, IN HANDLE Event OPTIONAL, IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, IN PVOID UserApcContext OPTIONAL, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG IoControlCode, IN PVOID InputBuffer, IN ULONG InputBufferSize, OUT PVOID OutputBuffer, IN ULONG OutputBufferSize)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define UDF_FS_TITLE_CDRW
Definition: udf_reg.h:58
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define IOCTL_CDRW_NOTIFY_MEDIA_CHANGE
Definition: cdrw_usr.h:108
LONG NTSTATUS
Definition: precomp.h:26
GLuint buffer
Definition: glext.h:5915
#define UDF_FS_TITLE_CDR
Definition: udf_reg.h:59
#define UDF_FS_TITLE_DVDR
Definition: udf_reg.h:56
#define FILE_SHARE_READ
Definition: compat.h:125
_SEH2_TRY
Definition: create.c:4250
NTSYSAPI NTSTATUS NTAPI ZwFsControlFile(IN HANDLE DeviceHandle, IN HANDLE Event OPTIONAL, IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, IN PVOID ApcContext OPTIONAL, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG IoControlCode, IN PVOID InputBuffer, IN ULONG InputBufferSize, OUT PVOID OutputBuffer, IN ULONG OutputBufferSize)
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define UDF_FS_TITLE_DVDpR
Definition: udf_reg.h:54
#define MyAllocatePool__(type, size)
Definition: mem_tools.h:149
#define FSCTL_DISMOUNT_VOLUME
Definition: nt_native.h:834
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define try_return(S)
Definition: cdprocs.h:2189
#define MyFreePool__(addr)
Definition: mem_tools.h:152
PVOID HANDLE
Definition: typedefs.h:71
struct _FILE_FS_ATTRIBUTE_INFORMATION * PFILE_FS_ATTRIBUTE_INFORMATION
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
NTSYSAPI NTSTATUS NTAPI ZwQueryVolumeInformationFile(IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, OUT PVOID FsInformation, IN ULONG Length, IN FS_INFORMATION_CLASS FsInformationClass)
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define FILE_NON_DIRECTORY_FILE
Definition: constants.h:492
#define NOTHING
Definition: env_spec_w32.h:461
#define GENERIC_READ
Definition: compat.h:124
#define FILE_OPEN
Definition: from_kernel.h:54
_SEH2_END
Definition: create.c:4424
_SEH2_FINALLY
Definition: create.c:4395
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
#define FSCTL_LOCK_VOLUME
Definition: nt_native.h:832
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define UDF_FS_TITLE_DVDRAM
Definition: udf_reg.h:52
#define UDF_CHECK_FS_NAME(name)
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define UDF_FS_TITLE_DVDpRW
Definition: udf_reg.h:53

Referenced by DriverEntry().

◆ UDFFsNotification()

VOID NTAPI UDFFsNotification ( IN PDEVICE_OBJECT  DeviceObject,
IN BOOLEAN  FsActive 
)

Definition at line 779 of file udfinit.cpp.

812 {
813  // Begin by determine whether or not the file system is a cdrom-based file
814  // system. If not, then this driver is not concerned with it.
815  if (!FsRegistered ||
817  return;
818  }
819 
820  // Begin by determining whether this file system is registering or
821  // unregistering as an active file system.
822  if (FsActive
823  && UDFGlobalData.UDFDeviceObject_CD != DeviceObject
824 #ifdef UDF_HDD_SUPPORT
825  && UDFGlobalData.UDFDeviceObject_HDD != DeviceObject
826 #endif // UDF_HDD_SUPPORT
827  ) {
828  UDFPrint(("\n*** UDFFSNotification \n\n"));
829 
830  // Acquire GlobalDataResource
831  UDFAcquireResourceExclusive(&(UDFGlobalData.GlobalDataResource), TRUE);
832 
834 
836 
837  IoUnregisterFileSystem(UDFGlobalData.UDFDeviceObject_CD);
838  IoRegisterFileSystem(UDFGlobalData.UDFDeviceObject_CD);
839 
840 #ifdef UDF_HDD_SUPPORT
841  IoUnregisterFileSystem(UDFGlobalData.UDFDeviceObject_HDD);
842  IoRegisterFileSystem(UDFGlobalData.UDFDeviceObject_HDD);
843 #endif // UDF_HDD_SUPPORT
844 
846 
847  } else {
848  UDFPrint(("\n*** recursive UDFFSNotification call,\n can't become top-level UDF FSD \n\n"));
849  }
850 
851  // Release the global resource.
852  UDFReleaseResource( &(UDFGlobalData.GlobalDataResource) );
853 
854 
855  }
856 }
#define UDFAcquireResourceExclusive(Resource, CanWait)
Definition: env_spec_w32.h:656
#define UDFPrint(Args)
Definition: udffs.h:225
#define TRUE
Definition: types.h:120
#define UDF_HDD_SUPPORT
Definition: udffs.h:45
#define UDFReleaseResource(Resource)
Definition: env_spec_w32.h:661
VOID NTAPI IoUnregisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:1061
UDFData UDFGlobalData
Definition: udfinit.cpp:25
PsGetCurrentThreadId
Definition: CrNtStubs.h:7
_In_ BOOLEAN FsActive
Definition: iotypes.h:7004
PVOID HANDLE
Definition: typedefs.h:71
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
HANDLE FsNotification_ThreadId
Definition: udfinit.cpp:51
VOID NTAPI IoRegisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:992
#define FILE_DEVICE_CD_ROM_FILE_SYSTEM
Definition: winioctl.h:108
ULONG FsRegistered
Definition: udfinit.cpp:45

Referenced by DriverEntry().

◆ UDFInitializeFunctionPointers()

VOID NTAPI UDFInitializeFunctionPointers ( PDRIVER_OBJECT  DriverObject)

Definition at line 444 of file udfinit.cpp.

447 {
448  PFAST_IO_DISPATCH PtrFastIoDispatch = NULL;
449 
450  // initialize the function pointers for the IRP major
451  // functions that this FSD is prepared to handle ...
452  // NT Version 4.0 has 28 possible functions that a
453  // kernel mode driver can handle.
454  // NT Version 3.51 and before has only 22 such functions,
455  // of which 18 are typically interesting to most FSD's.
456 
457  // The only interesting new functions that a FSD might
458  // want to respond to beginning with Version 4.0 are the
459  // IRP_MJ_QUERY_QUOTA and the IRP_MJ_SET_QUOTA requests.
460 
461  // The code below does not handle quota manipulation, neither
462  // does the NT Version 4.0 operating system (or I/O Manager).
463  // However, you should be on the lookout for any such new
464  // functionality that the FSD might have to implement in
465  // the near future.
466 
470 #ifndef UDF_READ_ONLY_BUILD
472 #endif //UDF_READ_ONLY_BUILD
473 
475 #ifndef UDF_READ_ONLY_BUILD
477 #endif //UDF_READ_ONLY_BUILD
478 
479 #ifndef UDF_READ_ONLY_BUILD
481 #endif //UDF_READ_ONLY_BUILD
482  // To implement support for querying and modifying volume attributes
483  // (volume information query/set operations), enable initialization
484  // of the following two function pointers and then implement the supporting
485  // functions.
487 #ifndef UDF_READ_ONLY_BUILD
489 #endif //UDF_READ_ONLY_BUILD
491  // To implement support for file system IOCTL calls, enable initialization
492  // of the following function pointer and implement appropriate support.
496  // For byte-range lock support, enable initialization of the following
497  // function pointer and implement appropriate support.
500 #ifdef UDF_HANDLE_EAS
502 #ifndef UDF_READ_ONLY_BUILD
504 #endif //UDF_READ_ONLY_BUILD
505 #endif //UDF_HANDLE_EAS
506  // If the FSD supports security attributes, we should provide appropriate
507  // dispatch entry points and initialize the function pointers as given below.
508 
509 #ifdef UDF_ENABLE_SECURITY
511 #ifndef UDF_READ_ONLY_BUILD
513 #endif //UDF_READ_ONLY_BUILD
514 #endif //UDF_ENABLE_SECURITY
515 
516 // if(MajorVersion >= 0x05) {
517  // w2k and higher
518 // DriverObject->MajorFunction[IRP_MJ_PNP] = UDFPnp;
519 // }
520 
521  // Now, it is time to initialize the fast-io stuff ...
522  PtrFastIoDispatch = DriverObject->FastIoDispatch = &(UDFGlobalData.UDFFastIoDispatch);
523 
524  // initialize the global fast-io structure
525  // NOTE: The fast-io structure has undergone a substantial revision
526  // in Windows NT Version 4.0. The structure has been extensively expanded.
527  // Therefore, if the driver needs to work on both V3.51 and V4.0+,
528  // we will have to be able to distinguish between the two versions at compile time.
529 
530  RtlZeroMemory(PtrFastIoDispatch, sizeof(FAST_IO_DISPATCH));
531 
532  PtrFastIoDispatch->SizeOfFastIoDispatch = sizeof(FAST_IO_DISPATCH);
533  PtrFastIoDispatch->FastIoCheckIfPossible = UDFFastIoCheckIfPossible;
534  PtrFastIoDispatch->FastIoRead = FsRtlCopyRead;
535 #ifndef UDF_READ_ONLY_BUILD
536  PtrFastIoDispatch->FastIoWrite = UDFFastIoCopyWrite /*FsRtlCopyWrite*/;
537 #endif //UDF_READ_ONLY_BUILD
538  PtrFastIoDispatch->FastIoQueryBasicInfo = UDFFastIoQueryBasicInfo;
539  PtrFastIoDispatch->FastIoQueryStandardInfo = UDFFastIoQueryStdInfo;
540  PtrFastIoDispatch->FastIoLock = UDFFastLock; // Lock
541  PtrFastIoDispatch->FastIoUnlockSingle = UDFFastUnlockSingle; // UnlockSingle
542  PtrFastIoDispatch->FastIoUnlockAll = UDFFastUnlockAll; // UnlockAll
543  PtrFastIoDispatch->FastIoUnlockAllByKey = (unsigned char (__stdcall *)(struct _FILE_OBJECT *,
544  PVOID ,unsigned long,struct _IO_STATUS_BLOCK *,struct _DEVICE_OBJECT *))UDFFastUnlockAllByKey; // UnlockAllByKey
545 
548 
549 // PtrFastIoDispatch->FastIoDeviceControl = UDFFastIoDeviceControl;
550 
551  // the remaining are only valid under NT Version 4.0 and later
552 #if(_WIN32_WINNT >= 0x0400)
553 
554  PtrFastIoDispatch->FastIoQueryNetworkOpenInfo = UDFFastIoQueryNetInfo;
555 
556  PtrFastIoDispatch->AcquireForModWrite = UDFFastIoAcqModWrite;
557  PtrFastIoDispatch->ReleaseForModWrite = UDFFastIoRelModWrite;
558  PtrFastIoDispatch->AcquireForCcFlush = UDFFastIoAcqCcFlush;
559  PtrFastIoDispatch->ReleaseForCcFlush = UDFFastIoRelCcFlush;
560 
561 /* // MDL functionality
562 
563  PtrFastIoDispatch->MdlRead = UDFFastIoMdlRead;
564  PtrFastIoDispatch->MdlReadComplete = UDFFastIoMdlReadComplete;
565  PtrFastIoDispatch->PrepareMdlWrite = UDFFastIoPrepareMdlWrite;
566  PtrFastIoDispatch->MdlWriteComplete = UDFFastIoMdlWriteComplete;*/
567 
568  // this FSD does not support compressed read/write functionality,
569  // NTFS does, and if we design a FSD that can provide such functionality,
570  // we should consider initializing the fast io entry points for reading
571  // and/or writing compressed data ...
572 #endif // (_WIN32_WINNT >= 0x0400)
573 
574  // last but not least, initialize the Cache Manager callback functions
575  // which are used in CcInitializeCacheMap()
576 
577  UDFGlobalData.CacheMgrCallBacks.AcquireForLazyWrite = UDFAcqLazyWrite;
578  UDFGlobalData.CacheMgrCallBacks.ReleaseFromLazyWrite = UDFRelLazyWrite;
579  UDFGlobalData.CacheMgrCallBacks.AcquireForReadAhead = UDFAcqReadAhead;
580  UDFGlobalData.CacheMgrCallBacks.ReleaseFromReadAhead = UDFRelReadAhead;
581 
583 
584  return;
585 } // end UDFInitializeFunctionPointers()
VOID NTAPI UDFRelReadAhead(IN PVOID Context)
Definition: fastio.cpp:558
PFAST_IO_UNLOCK_SINGLE FastIoUnlockSingle
Definition: iotypes.h:1697
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
NTSTATUS NTAPI UDFDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: devcntrl.cpp:81
#define IRP_MJ_QUERY_SECURITY
#define IRP_MJ_FLUSH_BUFFERS
VOID NTAPI UDFFastIoAcqCreateSec(IN PFILE_OBJECT FileObject)
Definition: fastio.cpp:342
NTSTATUS NTAPI UDFDirControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: dircntrl.cpp:57
BOOLEAN NTAPI UDFFastUnlockSingle(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: lockctrl.cpp:309
#define IRP_MJ_SHUTDOWN
NTSTATUS NTAPI UDFCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: cleanup.cpp:43
#define IRP_MJ_SET_SECURITY
#define IRP_MJ_SET_VOLUME_INFORMATION
NTSTATUS UDFSetSecurity(PDEVICE_OBJECT DeviceObject, PIRP Irp)
PFAST_IO_UNLOCK_ALL FastIoUnlockAll
Definition: iotypes.h:1698
PFAST_IO_RELEASE_FILE ReleaseFileForNtCreateSection
Definition: iotypes.h:1702
NTSTATUS NTAPI UDFCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: create.cpp:48
PFAST_IO_QUERY_NETWORK_OPEN_INFO FastIoQueryNetworkOpenInfo
Definition: iotypes.h:1704
PFAST_IO_RELEASE_FOR_MOD_WRITE ReleaseForModWrite
Definition: iotypes.h:1715
VOID NTAPI UDFFastIoRelCreateSec(IN PFILE_OBJECT FileObject)
Definition: fastio.cpp:387
BOOLEAN NTAPI UDFAcqReadAhead(IN PVOID Context, IN BOOLEAN Wait)
Definition: fastio.cpp:514
PFAST_IO_QUERY_BASIC_INFO FastIoQueryBasicInfo
Definition: iotypes.h:1694
OSSTATUS NTAPI UDFRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: read.cpp:53
#define IRP_MJ_SET_EA
struct _FAST_IO_DISPATCH FAST_IO_DISPATCH
UDFData UDFGlobalData
Definition: udfinit.cpp:25
BOOLEAN NTAPI UDFFastUnlockAll(IN PFILE_OBJECT FileObject, PEPROCESS ProcessId, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: lockctrl.cpp:404
BOOLEAN NTAPI UDFFastIoQueryBasicInfo(IN PFILE_OBJECT FileObject, IN BOOLEAN Wait, OUT PFILE_BASIC_INFORMATION Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.cpp:159
smooth NULL
Definition: ftsmooth.c:416
unsigned char
Definition: typeof.h:29
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void * PVOID
Definition: retypes.h:9
#define IRP_MJ_QUERY_VOLUME_INFORMATION
Definition: rdpdr.c:50
#define IRP_MJ_DIRECTORY_CONTROL
Definition: rdpdr.c:51
#define IRP_MJ_QUERY_EA
NTSTATUS UDFGetSecurity(PDEVICE_OBJECT DeviceObject, PIRP Irp)
BOOLEAN NTAPI UDFFastIoCopyWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, IN PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.cpp:1160
NTSTATUS NTAPI UDFFSControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fscntrl.cpp:39
#define IRP_MJ_FILE_SYSTEM_CONTROL
VOID NTAPI UDFRelLazyWrite(IN PVOID Context)
Definition: fastio.cpp:472
PFAST_IO_UNLOCK_ALL_BY_KEY FastIoUnlockAllByKey
Definition: iotypes.h:1699
NTSTATUS NTAPI UDFQueryVolInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: volinfo.cpp:86
#define __stdcall
Definition: typedefs.h:25
NTSTATUS NTAPI UDFLockControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: lockctrl.cpp:38
PFAST_IO_ACQUIRE_FOR_CCFLUSH AcquireForCcFlush
Definition: iotypes.h:1716
PFAST_IO_LOCK FastIoLock
Definition: iotypes.h:1696
BOOLEAN NTAPI UDFFastIoCheckIfPossible(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, IN BOOLEAN CheckForReadOperation, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.cpp:42
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
NTSTATUS NTAPI UDFClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: close.cpp:62
NTSTATUS NTAPI UDFShutdown(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: shutdown.cpp:47
PDRIVER_UNLOAD DriverUnload
Definition: iotypes.h:2180
BOOLEAN NTAPI UDFAcqLazyWrite(IN PVOID Context, IN BOOLEAN Wait)
Definition: fastio.cpp:423
BOOLEAN NTAPI UDFFastUnlockAllByKey(IN PFILE_OBJECT FileObject, PEPROCESS ProcessId, ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: lockctrl.cpp:494
PFAST_IO_ACQUIRE_FOR_MOD_WRITE AcquireForModWrite
Definition: iotypes.h:1705
NTSTATUS NTAPI UDFSetVolInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: volinfo.cpp:614
PFAST_IO_READ FastIoRead
Definition: iotypes.h:1692
PFAST_IO_WRITE FastIoWrite
Definition: iotypes.h:1693
#define long
Definition: qsort.c:33
NTSTATUS NTAPI UDFFileInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fileinfo.cpp:46
PFAST_IO_QUERY_STANDARD_INFO FastIoQueryStandardInfo
Definition: iotypes.h:1695
#define IRP_MJ_LOCK_CONTROL
Definition: rdpdr.c:53
#define IRP_MJ_READ
Definition: rdpdr.c:46
BOOLEAN NTAPI FsRtlCopyRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:64
VOID NTAPI UDFDriverUnload(IN PDRIVER_OBJECT DriverObject)
Definition: unload.cpp:10
struct _FAST_IO_DISPATCH * FastIoDispatch
Definition: iotypes.h:2177
#define IRP_MJ_CLEANUP
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2181
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
PFAST_IO_CHECK_IF_POSSIBLE FastIoCheckIfPossible
Definition: iotypes.h:1691
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
NTSTATUS NTAPI UDFFlush(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: flush.cpp:42
BOOLEAN NTAPI UDFFastIoQueryStdInfo(IN PFILE_OBJECT FileObject, IN BOOLEAN Wait, OUT PFILE_STANDARD_INFORMATION Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.cpp:250
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_QUERY_INFORMATION
Definition: rdpdr.c:48
NTSTATUS NTAPI UDFWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: write.cpp:42
PFAST_IO_ACQUIRE_FILE AcquireFileForNtCreateSection
Definition: iotypes.h:1701
NTSTATUS NTAPI UDFQuerySetEA(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: misc.cpp:2484
PFAST_IO_RELEASE_FOR_CCFLUSH ReleaseForCcFlush
Definition: iotypes.h:1717
BOOLEAN NTAPI UDFFastLock(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, PEPROCESS ProcessId, ULONG Key, BOOLEAN FailImmediately, BOOLEAN ExclusiveLock, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: lockctrl.cpp:205
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
ULONG SizeOfFastIoDispatch
Definition: iotypes.h:1690

Referenced by DriverEntry().

◆ UDFRemountAll()

VOID UDFRemountAll ( IN PVOID  Context)

Variable Documentation

◆ FsNotification_ThreadId

HANDLE FsNotification_ThreadId = (HANDLE)(-1)

Definition at line 51 of file udfinit.cpp.

Referenced by UDFFsNotification().

◆ FsRegistered

ULONG FsRegistered = FALSE

Definition at line 45 of file udfinit.cpp.

Referenced by DriverEntry(), and UDFFsNotification().

◆ RemountWorkQueueItem

WORK_QUEUE_ITEM RemountWorkQueueItem

Definition at line 47 of file udfinit.cpp.

◆ UDFGlobalData

◆ UDFMediaClassName

struct UDF_MEDIA_CLASS_NAMES UDFMediaClassName[]
Initial value:
= {
}
#define REG_DEFAULT_CDRW
Definition: udf_reg.h:78
#define REG_DEFAULT_CDR
Definition: udf_reg.h:77
#define REG_DEFAULT_FLOPPY
Definition: udf_reg.h:81
#define REG_DEFAULT_ZIP
Definition: udf_reg.h:80
#define REG_DEFAULT_DVDRW
Definition: udf_reg.h:83
#define REG_DEFAULT_UNKNOWN
Definition: udf_reg.h:75
#define REG_DEFAULT_CDROM
Definition: udf_reg.h:79
#define REG_DEFAULT_DVDR
Definition: udf_reg.h:82
#define REG_DEFAULT_HDD
Definition: udf_reg.h:76

Definition at line 29 of file udfinit.cpp.

Referenced by UDFReadRegKeys().