ReactOS  0.4.14-dev-556-g4c5b21f
udfinit.cpp
Go to the documentation of this file.
1 // Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine
3 // All rights reserved
4 // This file was released under the GPLv2 on June 2015.
6 /*************************************************************************
7 *
8 * File: UDFinit.cpp
9 *
10 * Module: UDF File System Driver (Kernel mode execution only)
11 *
12 * Description:
13 * This file contains the initialization code for the kernel mode
14 * UDF FSD module. The DriverEntry() routine is called by the I/O
15 * sub-system to initialize the FSD.
16 *
17 *************************************************************************/
18 
19 #include "udffs.h"
20 
21 // define the file specific bug-check id
22 #define UDF_BUG_CHECK_ID UDF_FILE_INIT
23 
24 // global variables are declared here
26 
27 #define KD_PREFIX
28 
39 };
40 /*
41 ULONG MajorVersion = 0;
42 ULONG MinorVersion = 0;
43 ULONG BuildNumber = 0;
44 */
46 
48 
49 //ptrFsRtlNotifyVolumeEvent FsRtlNotifyVolumeEvent = NULL;
50 
52 
55  PCWSTR FsDeviceName,
59 
62  PUNICODE_STRING unicodeCdRomDeviceName);
63 
64 VOID
66  IN PVOID Context);
67 
68 /*************************************************************************
69 *
70 * Function: DriverEntry()
71 *
72 * Description:
73 * This routine is the standard entry point for all kernel mode drivers.
74 * The routine is invoked at IRQL PASSIVE_LEVEL in the context of a
75 * system worker thread.
76 * All FSD specific data structures etc. are initialized here.
77 *
78 * Expected Interrupt Level (for execution) :
79 *
80 * IRQL_PASSIVE_LEVEL
81 *
82 * Return Value: STATUS_SUCCESS/Error (will cause driver to be unloaded).
83 *
84 *************************************************************************/
86 NTAPI
88  PDRIVER_OBJECT DriverObject, // created by the I/O sub-system
89  PUNICODE_STRING RegistryPath // path to the registry key
90  )
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()
424 
425 
426 
427 /*************************************************************************
428 *
429 * Function: UDFInitializeFunctionPointers()
430 *
431 * Description:
432 * Initialize the IRP... function pointer array in the driver object
433 * structure. Also initialize the fast-io function ptr array ...
434 *
435 * Expected Interrupt Level (for execution) :
436 *
437 * IRQL_PASSIVE_LEVEL
438 *
439 * Return Value: None
440 *
441 *************************************************************************/
442 VOID
443 NTAPI
445  PDRIVER_OBJECT DriverObject // created by the I/O sub-system
446  )
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()
586 
587 NTSTATUS
589  PCWSTR FsDeviceName,
593  )
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()
631 
632 
633 NTSTATUS
635  PUNICODE_STRING unicodeCdRomDeviceName
636  )
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 }
775 
776 
777 VOID
778 NTAPI
782  )
783 
784 /*
785 
786 Routine Description:
787 
788  This routine is invoked whenever a file system has either registered or
789  unregistered itself as an active file system.
790 
791  For the former case, this routine creates a device object and attaches it
792  to the specified file system's device object. This allows this driver
793  to filter all requests to that file system.
794 
795  For the latter case, this file system's device object is located,
796  detached, and deleted. This removes this file system as a filter for
797  the specified file system.
798 
799 Arguments:
800 
801  DeviceObject - Pointer to the file system's device object.
802 
803  FsActive - bolean indicating whether the file system has registered
804  (TRUE) or unregistered (FALSE) itself as an active file system.
805 
806 Return Value:
807 
808  None.
809 
810 */
811 
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 }
857 /*VOID
858 UDFRemountAll(
859  IN PVOID Context
860  )
861 {
862  NTSTATUS RC = STATUS_SUCCESS;
863  ULONG CdRomNumber;
864  CCHAR deviceNameBuffer[MAXIMUM_FILENAME_LENGTH];
865  ANSI_STRING deviceName;
866  UNICODE_STRING unicodeCdRomDeviceName;
867  LARGE_INTEGER delay;
868 
869 */
870 /* delay.QuadPart = -80*10000000;
871  KeDelayExecutionThread(KernelMode, FALSE, &delay); //10 seconds*/
872 
873 /* for(CdRomNumber = 0;true;CdRomNumber++) {
874  sprintf(deviceNameBuffer, "\\Device\\CdRom%d", CdRomNumber);
875  UDFPrint(( "UDF: UDFRemountAll : dismount %s\n", deviceNameBuffer));
876  RtlInitString(&deviceName, deviceNameBuffer);
877  RC = RtlAnsiStringToUnicodeString(&unicodeCdRomDeviceName, &deviceName, TRUE);
878 
879  if (!NT_SUCCESS(RC)) {
880  RtlFreeUnicodeString(&unicodeCdRomDeviceName);
881  break;
882  }
883 
884  RC = UDFDismountDevice(&unicodeCdRomDeviceName);
885  RtlFreeUnicodeString(&unicodeCdRomDeviceName);
886 
887  if (!NT_SUCCESS(RC)) break;
888  }
889 }*/
#define UDFAcquireResourceExclusive(Resource, CanWait)
Definition: env_spec_w32.h:656
VOID MyAllocRelease(VOID)
#define WinVer_IsNT
Definition: CrossNt.h:101
VOID NTAPI UDFRelReadAhead(IN PVOID Context)
Definition: fastio.cpp:558
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
struct UDF_MEDIA_CLASS_NAMES UDFMediaClassName[]
Definition: udfinit.cpp:29
UNICODE_STRING UnicodeStrRoot
Definition: udf_common.h:616
#define UDF_FS_TITLE_DVDRW
Definition: udf_reg.h:55
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define IN
Definition: typedefs.h:38
#define UDF_NODE_TYPE_UDFFS_DEVOBJ
Definition: struct.h:65
#define UDFInitializeResourceLite(Resource)
Definition: env_spec_w32.h:667
PFAST_IO_UNLOCK_SINGLE FastIoUnlockSingle
Definition: iotypes.h:1697
#define FSCTL_UNLOCK_VOLUME
Definition: nt_native.h:833
#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)
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 IRP_MJ_CREATE
Definition: rdpdr.c:44
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define UDF_FS_TITLE_CDRW
Definition: udf_reg.h:58
#define UDF_HDD_SUPPORT
Definition: udffs.h:45
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
UNICODE_STRING AclName
Definition: udf_common.h:618
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
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define IRP_MJ_SHUTDOWN
#define UDFSetFlag(Flag, Value)
Definition: udffs.h:191
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
uint16_t * PWSTR
Definition: typedefs.h:54
DeviceType
Definition: mmdrv.h:41
UDFIdentifier NodeIdentifier
Definition: struct.h:354
NTSTATUS NTAPI UDFCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: cleanup.cpp:43
#define IOCTL_CDRW_NOTIFY_MEDIA_CHANGE
Definition: cdrw_usr.h:108
#define IRP_MJ_SET_SECURITY
#define UDFReleaseResource(Resource)
Definition: env_spec_w32.h:661
VOID NTAPI IoUnregisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:1061
LONG NTSTATUS
Definition: precomp.h:26
#define IRP_MJ_SET_VOLUME_INFORMATION
#define REG_DEFAULT_CDRW
Definition: udf_reg.h:78
NTSTATUS UDFSetSecurity(PDEVICE_OBJECT DeviceObject, PIRP Irp)
PFAST_IO_UNLOCK_ALL FastIoUnlockAll
Definition: iotypes.h:1698
GLuint buffer
Definition: glext.h:5915
PFAST_IO_RELEASE_FILE ReleaseFileForNtCreateSection
Definition: iotypes.h:1702
NTSTATUS NTAPI UDFCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: create.cpp:48
#define UDF_DATA_FLAGS_RESOURCE_INITIALIZED
Definition: udf_common.h:634
#define UDF_FS_TITLE_CDR
Definition: udf_reg.h:59
PFAST_IO_QUERY_NETWORK_OPEN_INFO FastIoQueryNetworkOpenInfo
Definition: iotypes.h:1704
VOID UDFRemountAll(IN PVOID Context)
VOID NTAPI UDFDelayedClose(PVOID unused)
Definition: close.cpp:690
PFAST_IO_RELEASE_FOR_MOD_WRITE ReleaseForModWrite
Definition: iotypes.h:1715
#define UDF_FS_TITLE_DVDR
Definition: udf_reg.h:56
#define FILE_SHARE_READ
Definition: compat.h:125
#define UDFClearFlag(Flag, Value)
Definition: udffs.h:192
#define UDF_FS_NAME_CD
Definition: udf_reg.h:32
VOID NTAPI UDFFastIoRelCreateSec(IN PFILE_OBJECT FileObject)
Definition: fastio.cpp:387
_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
BOOLEAN NTAPI UDFAcqReadAhead(IN PVOID Context, IN BOOLEAN Wait)
Definition: fastio.cpp:514
NTSTATUS UDFDismountDevice(PUNICODE_STRING unicodeCdRomDeviceName)
Definition: udfinit.cpp:634
#define REG_DEFAULT_CDR
Definition: udf_reg.h:77
NTSTATUS UDFCreateFsDeviceObject(PCWSTR FsDeviceName, PDRIVER_OBJECT DriverObject, DEVICE_TYPE DeviceType, PDEVICE_OBJECT *DeviceObject)
Definition: udfinit.cpp:588
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID DLDInit(ULONG MaxThrdCount)
Initialize deadlock detector.
Definition: dldetect.cpp:51
PFAST_IO_QUERY_BASIC_INFO FastIoQueryBasicInfo
Definition: iotypes.h:1694
#define REG_DEFAULT_FLOPPY
Definition: udf_reg.h:81
NTSTATUS NTAPI KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Interval OPTIONAL)
Definition: wait.c:283
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
#define UDF_NODE_TYPE_UDFFS_DRVOBJ
Definition: struct.h:67
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
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
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)
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
unsigned char
Definition: typeof.h:29
#define UDF_DOS_FS_NAME
Definition: udf_reg.h:38
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
PsGetCurrentThreadId
Definition: CrNtStubs.h:7
Definition: bufpool.h:45
struct _UDFFS_DEV_EXTENSION UDFFS_DEV_EXTENSION
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
uint32 NodeType
Definition: struct.h:75
#define UDF_FS_TITLE_DVDpR
Definition: udf_reg.h:54
#define REG_DEFAULT_ZIP
Definition: udf_reg.h:80
#define FILE_DEVICE_DISK_FILE_SYSTEM
Definition: winioctl.h:113
#define MyAllocatePool__(type, size)
Definition: mem_tools.h:149
#define FSCTL_DISMOUNT_VOLUME
Definition: nt_native.h:834
NTSTATUS UDFInitializeZones(VOID)
Definition: misc.cpp:41
#define IRP_MJ_QUERY_EA
NTSTATUS UDFGetSecurity(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
Definition: udfinit.cpp:87
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
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
WORK_QUEUE_ITEM RemountWorkQueueItem
Definition: udfinit.cpp:47
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
NTSTATUS NTAPI UDFFSControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fscntrl.cpp:39
#define IRP_MJ_FILE_SYSTEM_CONTROL
#define UDFDeleteResource(Resource)
Definition: env_spec_w32.h:663
#define UDF_SN_NT_ACL
Definition: osta_misc.h:340
VOID NTAPI UDFRelLazyWrite(IN PVOID Context)
Definition: fastio.cpp:472
#define MyFreePool__(addr)
Definition: mem_tools.h:152
PFAST_IO_UNLOCK_ALL_BY_KEY FastIoUnlockAllByKey
Definition: iotypes.h:1699
_In_ BOOLEAN FsActive
Definition: iotypes.h:7004
PVOID HANDLE
Definition: typedefs.h:71
NTSTATUS NTAPI UDFQueryVolInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: volinfo.cpp:86
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
struct _FILE_FS_ATTRIBUTE_INFORMATION * PFILE_FS_ATTRIBUTE_INFORMATION
#define __stdcall
Definition: typedefs.h:25
NTSTATUS NTAPI UDFLockControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: lockctrl.cpp:38
#define REG_DEFAULT_DVDRW
Definition: udf_reg.h:83
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#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)
NTSYSAPI NTSTATUS NTAPI ZwQueryVolumeInformationFile(IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, OUT PVOID FsInformation, IN ULONG Length, IN FS_INFORMATION_CLASS FsInformationClass)
PFAST_IO_ACQUIRE_FOR_CCFLUSH AcquireForCcFlush
Definition: iotypes.h:1716
#define REG_DEFAULT_UNKNOWN
Definition: udf_reg.h:75
PFAST_IO_LOCK FastIoLock
Definition: iotypes.h:1696
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
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
static const WCHAR L[]
Definition: oid.c:1250
void delay(unsigned msec)
Definition: i386rtl.c:32
NTSTATUS NTAPI UDFShutdown(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: shutdown.cpp:47
PDRIVER_UNLOAD DriverUnload
Definition: iotypes.h:2180
#define FILE_NON_DIRECTORY_FILE
Definition: constants.h:492
BOOLEAN NTAPI UDFAcqLazyWrite(IN PVOID Context, IN BOOLEAN Wait)
Definition: fastio.cpp:423
uint32 NodeSize
Definition: struct.h:76
#define NOTHING
Definition: env_spec_w32.h:461
#define GENERIC_READ
Definition: compat.h:124
UNICODE_STRING SavedRegPath
Definition: udf_common.h:615
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
CCHAR KeNumberProcessors
Definition: krnlinit.c:35
NTSYSAPI VOID NTAPI RtlInitString(PSTRING DestinationString, PCSZ SourceString)
struct _UDFFS_DEV_EXTENSION * PUDFFS_DEV_EXTENSION
NTSTATUS NTAPI UDFSetVolInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: volinfo.cpp:614
#define FILE_OPEN
Definition: from_kernel.h:54
BOOLEAN MyAllocInit(VOID)
Definition: mem_tools.h:140
PFAST_IO_READ FastIoRead
Definition: iotypes.h:1692
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
PVOID CrNtGetModuleBase(IN PCHAR pModuleName)
_SEH2_END
Definition: create.c:4424
PFAST_IO_WRITE FastIoWrite
Definition: iotypes.h:1693
uint32 UDFFlags
Definition: udf_common.h:627
HANDLE FsNotification_ThreadId
Definition: udfinit.cpp:51
#define REG_DEFAULT_CDROM
Definition: udf_reg.h:79
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define long
Definition: qsort.c:33
#define DEVICE_TYPE
Definition: guid.c:10
NTSTATUS NTAPI UDFFileInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fileinfo.cpp:46
_SEH2_FINALLY
Definition: create.c:4395
UNICODE_STRING UnicodeStrSDir
Definition: udf_common.h:617
PVOID CrNtGetProcAddress(PVOID ModuleBase, PCHAR pFunctionName)
PFAST_IO_QUERY_STANDARD_INFO FastIoQueryStandardInfo
Definition: iotypes.h:1695
VOID NTAPI UDFFsNotification(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN FsActive)
Definition: udfinit.cpp:779
#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
VOID NTAPI IoRegisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:992
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
#define IRP_MJ_CLEANUP
#define FILE_DEVICE_CD_ROM_FILE_SYSTEM
Definition: winioctl.h:108
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2181
#define FSCTL_LOCK_VOLUME
Definition: nt_native.h:832
#define REG_DEFAULT_DVDR
Definition: udf_reg.h:82
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
unsigned int ULONG
Definition: retypes.h:1
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
PFAST_IO_CHECK_IF_POSSIBLE FastIoCheckIfPossible
Definition: iotypes.h:1691
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
NTSTATUS NTAPI UDFFlush(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: flush.cpp:42
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
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
#define UDF_FS_TITLE_DVDRAM
Definition: udf_reg.h:52
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
#define UDF_CHECK_FS_NAME(name)
NTSTATUS NTAPI UDFWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: write.cpp:42
VOID UDFDestroyZones(VOID)
Definition: misc.cpp:177
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
PFAST_IO_ACQUIRE_FILE AcquireFileForNtCreateSection
Definition: iotypes.h:1701
NTSTATUS NTAPI UDFQuerySetEA(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: misc.cpp:2484
NTSTATUS RegTGetKeyHandle(IN HKEY hRootKey, IN PWCHAR KeyName, OUT HKEY *hKey)
Definition: regtools.cpp:59
return STATUS_SUCCESS
Definition: btrfs.c:2938
PFAST_IO_RELEASE_FOR_CCFLUSH ReleaseForCcFlush
Definition: iotypes.h:1717
#define UDF_FS_NAME
Definition: udf_reg.h:31
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
NTSTATUS NTAPI IoRegisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject, IN PDRIVER_FS_NOTIFICATION DriverNotificationRoutine)
Definition: volume.c:1094
ULONG FsRegistered
Definition: udfinit.cpp:45
#define REG_DEFAULT_HDD
Definition: udf_reg.h:76
#define UDF_FS_TITLE_DVDpRW
Definition: udf_reg.h:53
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
ULONG SizeOfFastIoDispatch
Definition: iotypes.h:1690
#define UDF_FS_NAME_HDD
Definition: udf_reg.h:33
VOID DLDFree(VOID)
Definition: dldetect.cpp:64