ReactOS 0.4.15-dev-7897-g78dc504
udfinit.cpp
Go to the documentation of this file.
1
2// 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/*
41ULONG MajorVersion = 0;
42ULONG MinorVersion = 0;
43ULONG BuildNumber = 0;
44*/
46
48
49//ptrFsRtlNotifyVolumeEvent FsRtlNotifyVolumeEvent = NULL;
50
52
55 PCWSTR FsDeviceName,
59
62 PUNICODE_STRING unicodeCdRomDeviceName);
63
64VOID
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*************************************************************************/
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;
104 LARGE_INTEGER delay;
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
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
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"));
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"));
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
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"));
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) {
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
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*************************************************************************/
442VOID
443NTAPI
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
467 DriverObject->MajorFunction[IRP_MJ_CREATE] = UDFCreate;
468 DriverObject->MajorFunction[IRP_MJ_CLOSE] = UDFClose;
469 DriverObject->MajorFunction[IRP_MJ_READ] = UDFRead;
470#ifndef UDF_READ_ONLY_BUILD
471 DriverObject->MajorFunction[IRP_MJ_WRITE] = UDFWrite;
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.
495 DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = UDFShutdown;
496 // For byte-range lock support, enable initialization of the following
497 // function pointer and implement appropriate support.
499 DriverObject->MajorFunction[IRP_MJ_CLEANUP] = UDFCleanup;
500#ifdef UDF_HANDLE_EAS
502#ifndef UDF_READ_ONLY_BUILD
503 DriverObject->MajorFunction[IRP_MJ_SET_EA] = UDFQuerySetEA;
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);
534 PtrFastIoDispatch->FastIoRead = FsRtlCopyRead;
535#ifndef UDF_READ_ONLY_BUILD
536 PtrFastIoDispatch->FastIoWrite = UDFFastIoCopyWrite /*FsRtlCopyWrite*/;
537#endif //UDF_READ_ONLY_BUILD
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
582 DriverObject->DriverUnload = UDFDriverUnload;
583
584 return;
585} // end UDFInitializeFunctionPointers()
586
589 PCWSTR FsDeviceName,
593 )
594{
596 UNICODE_STRING DriverDeviceName;
597 PUDFFS_DEV_EXTENSION FSDevExt;
598 RtlInitUnicodeString(&DriverDeviceName, FsDeviceName);
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
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
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,
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,
756 &IoStatus,
757 NULL,
760 FILE_OPEN,
762 NULL,
763 0 );
764
765try_exit: NOTHING;
766
767 } _SEH2_FINALLY {
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
777VOID
778NTAPI
782 )
783
784/*
785
786Routine 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
799Arguments:
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
806Return 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
858UDFRemountAll(
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}*/
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define FILE_NON_DIRECTORY_FILE
Definition: constants.h:492
#define try_return(S)
Definition: cdprocs.h:2179
#define IOCTL_CDRW_NOTIFY_MEDIA_CHANGE
Definition: cdrw_usr.h:108
Definition: bufpool.h:45
NTSTATUS NTAPI UDFCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: cleanup.cpp:43
VOID NTAPI UDFDelayedClose(PVOID unused)
Definition: close.cpp:690
NTSTATUS NTAPI UDFClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: close.cpp:62
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
NTSTATUS NTAPI UDFDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: devcntrl.cpp:81
NTSTATUS NTAPI UDFDirControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: dircntrl.cpp:57
VOID DLDFree(VOID)
Definition: dldetect.cpp:64
VOID DLDInit(ULONG MaxThrdCount)
Initialize deadlock detector.
Definition: dldetect.cpp:51
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define DEVICE_TYPE
Definition: guid.c:10
#define GENERIC_READ
Definition: compat.h:135
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
unsigned char
Definition: typeof.h:29
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
NTSTATUS NTAPI UDFCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: create.cpp:48
VOID UDFDestroyZones(VOID)
Definition: misc.cpp:177
NTSTATUS UDFInitializeZones(VOID)
Definition: misc.cpp:41
NTSTATUS NTAPI UDFQuerySetEA(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: misc.cpp:2484
#define UDFReleaseResource(Resource)
Definition: env_spec_w32.h:661
#define UDFDeleteResource(Resource)
Definition: env_spec_w32.h:663
#define UDFAcquireResourceExclusive(Resource, CanWait)
Definition: env_spec_w32.h:656
#define UDFInitializeResourceLite(Resource)
Definition: env_spec_w32.h:667
#define NonPagedPool
Definition: env_spec_w32.h:307
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define KeDelayExecutionThread(mode, foo, t)
Definition: env_spec_w32.h:484
BOOLEAN NTAPI UDFAcqReadAhead(IN PVOID Context, IN BOOLEAN Wait)
Definition: fastio.cpp:514
VOID NTAPI UDFFastIoRelCreateSec(IN PFILE_OBJECT FileObject)
Definition: fastio.cpp:387
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
VOID NTAPI UDFRelReadAhead(IN PVOID Context)
Definition: fastio.cpp:558
BOOLEAN NTAPI UDFAcqLazyWrite(IN PVOID Context, IN BOOLEAN Wait)
Definition: fastio.cpp:423
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
VOID NTAPI UDFRelLazyWrite(IN PVOID Context)
Definition: fastio.cpp:472
VOID NTAPI UDFFastIoAcqCreateSec(IN PFILE_OBJECT FileObject)
Definition: fastio.cpp:342
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
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
NTSTATUS NTAPI UDFFileInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fileinfo.cpp:46
#define _SEH2_FINALLY
Definition: filesup.c:21
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
PsGetCurrentThreadId
Definition: CrNtStubs.h:8
PVOID CrNtGetProcAddress(PVOID ModuleBase, PCHAR pFunctionName)
#define WinVer_IsNT
Definition: CrossNt.h:101
PVOID CrNtGetModuleBase(IN PCHAR pModuleName)
NTSTATUS NTAPI UDFFlush(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: flush.cpp:42
#define FILE_OPEN
Definition: from_kernel.h:54
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
@ FileFsAttributeInformation
Definition: from_kernel.h:223
struct _FILE_FS_ATTRIBUTE_INFORMATION * PFILE_FS_ATTRIBUTE_INFORMATION
NTSTATUS NTAPI UDFFSControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fscntrl.cpp:39
GLuint buffer
Definition: glext.h:5915
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define NOTHING
Definition: input_list.c:10
CCHAR KeNumberProcessors
Definition: krnlinit.c:35
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
NTSTATUS NTAPI UDFLockControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: lockctrl.cpp:38
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
BOOLEAN NTAPI UDFFastUnlockAllByKey(IN PFILE_OBJECT FileObject, PEPROCESS ProcessId, ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: lockctrl.cpp:494
BOOLEAN NTAPI UDFFastUnlockAll(IN PFILE_OBJECT FileObject, PEPROCESS ProcessId, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: lockctrl.cpp:404
#define MyAllocatePool__(type, size)
Definition: mem_tools.h:149
BOOLEAN MyAllocInit(VOID)
Definition: mem_tools.h:140
#define MyAllocRelease()
Definition: mem_tools.h:141
#define MyFreePool__(addr)
Definition: mem_tools.h:152
DeviceType
Definition: mmdrv.h:42
#define ASSERT(a)
Definition: mode.c:44
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:159
#define KernelMode
Definition: asm.h:34
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define FSCTL_LOCK_VOLUME
Definition: nt_native.h:832
NTSYSAPI VOID NTAPI RtlInitString(PSTRING DestinationString, PCSZ SourceString)
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define FSCTL_UNLOCK_VOLUME
Definition: nt_native.h:833
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define FSCTL_DISMOUNT_VOLUME
Definition: nt_native.h:834
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)
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)
NTSTATUS(* ptrFsRtlNotifyVolumeEvent)(IN PFILE_OBJECT FileObject, IN ULONG EventCode)
Definition: ntifs_ex.h:453
NTSYSAPI NTSTATUS NTAPI ZwQueryVolumeInformationFile(IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, OUT PVOID FsInformation, IN ULONG Length, IN FS_INFORMATION_CLASS FsInformationClass)
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
NTSTATUS NTAPI FsRtlNotifyVolumeEvent(IN PFILE_OBJECT FileObject, IN ULONG EventCode)
Definition: pnp.c:38
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 IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
VOID NTAPI IoUnregisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:1056
VOID NTAPI IoRegisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:987
NTSTATUS NTAPI IoRegisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject, IN PDRIVER_FS_NOTIFICATION DriverNotificationRoutine)
Definition: volume.c:1089
#define L(x)
Definition: ntvdm.h:50
#define UDF_SN_NT_ACL
Definition: osta_misc.h:340
NTSTATUS NTAPI UDFQueryVolInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: volinfo.cpp:86
OSSTATUS NTAPI UDFRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: read.cpp:53
NTSTATUS NTAPI UDFWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: write.cpp:42
VOID NTAPI UDFDriverUnload(IN PDRIVER_OBJECT DriverObject)
Definition: unload.cpp:10
NTSTATUS UDFSetSecurity(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS UDFGetSecurity(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS NTAPI UDFShutdown(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: shutdown.cpp:47
NTSTATUS NTAPI UDFSetVolInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: volinfo.cpp:617
#define FILE_DEVICE_DISK_FILE_SYSTEM
Definition: winioctl.h:114
#define FILE_DEVICE_CD_ROM_FILE_SYSTEM
Definition: winioctl.h:109
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define long
Definition: qsort.c:33
#define IRP_MJ_DIRECTORY_CONTROL
Definition: rdpdr.c:51
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_QUERY_VOLUME_INFORMATION
Definition: rdpdr.c:50
#define IRP_MJ_LOCK_CONTROL
Definition: rdpdr.c:53
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define IRP_MJ_QUERY_INFORMATION
Definition: rdpdr.c:48
NTSTATUS RegTGetKeyHandle(IN HKEY hRootKey, IN PWCHAR KeyName, OUT HKEY *hKey)
Definition: regtools.cpp:59
#define STATUS_SUCCESS
Definition: shellext.h:65
#define UDF_NODE_TYPE_GLOBAL_DATA
Definition: struct.h:63
struct _UDFFS_DEV_EXTENSION UDFFS_DEV_EXTENSION
#define UDF_NODE_TYPE_UDFFS_DRVOBJ
Definition: struct.h:67
struct _UDFFS_DEV_EXTENSION * PUDFFS_DEV_EXTENSION
#define UDF_NODE_TYPE_UDFFS_DEVOBJ
Definition: struct.h:65
PFAST_IO_ACQUIRE_FOR_MOD_WRITE AcquireForModWrite
Definition: iotypes.h:1748
PFAST_IO_QUERY_STANDARD_INFO FastIoQueryStandardInfo
Definition: iotypes.h:1738
PFAST_IO_UNLOCK_ALL_BY_KEY FastIoUnlockAllByKey
Definition: iotypes.h:1742
PFAST_IO_RELEASE_FOR_CCFLUSH ReleaseForCcFlush
Definition: iotypes.h:1760
PFAST_IO_WRITE FastIoWrite
Definition: iotypes.h:1736
PFAST_IO_UNLOCK_ALL FastIoUnlockAll
Definition: iotypes.h:1741
PFAST_IO_QUERY_NETWORK_OPEN_INFO FastIoQueryNetworkOpenInfo
Definition: iotypes.h:1747
PFAST_IO_ACQUIRE_FOR_CCFLUSH AcquireForCcFlush
Definition: iotypes.h:1759
ULONG SizeOfFastIoDispatch
Definition: iotypes.h:1733
PFAST_IO_ACQUIRE_FILE AcquireFileForNtCreateSection
Definition: iotypes.h:1744
PFAST_IO_READ FastIoRead
Definition: iotypes.h:1735
PFAST_IO_QUERY_BASIC_INFO FastIoQueryBasicInfo
Definition: iotypes.h:1737
PFAST_IO_LOCK FastIoLock
Definition: iotypes.h:1739
PFAST_IO_UNLOCK_SINGLE FastIoUnlockSingle
Definition: iotypes.h:1740
PFAST_IO_RELEASE_FILE ReleaseFileForNtCreateSection
Definition: iotypes.h:1745
PFAST_IO_RELEASE_FOR_MOD_WRITE ReleaseForModWrite
Definition: iotypes.h:1758
PFAST_IO_CHECK_IF_POSSIBLE FastIoCheckIfPossible
Definition: iotypes.h:1734
UNICODE_STRING SavedRegPath
Definition: udf_common.h:615
UNICODE_STRING AclName
Definition: udf_common.h:618
UNICODE_STRING UnicodeStrSDir
Definition: udf_common.h:617
UNICODE_STRING UnicodeStrRoot
Definition: udf_common.h:616
uint32 UDFFlags
Definition: udf_common.h:627
UDFIdentifier NodeIdentifier
Definition: struct.h:354
uint32 NodeType
Definition: struct.h:75
uint32 NodeSize
Definition: struct.h:76
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
PVOID HANDLE
Definition: typedefs.h:73
#define __stdcall
Definition: typedefs.h:25
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define UDF_DATA_FLAGS_RESOURCE_INITIALIZED
Definition: udf_common.h:634
#define UDF_DATA_FLAGS_ZONES_INITIALIZED
Definition: udf_common.h:635
@ MediaHdd
Definition: udf_common.h:11
@ MediaCdr
Definition: udf_common.h:12
@ MediaUnknown
Definition: udf_common.h:10
@ MediaCdrw
Definition: udf_common.h:13
@ MediaZip
Definition: udf_common.h:15
@ MediaCdrom
Definition: udf_common.h:14
@ MediaDvdrw
Definition: udf_common.h:18
@ MediaFloppy
Definition: udf_common.h:16
@ MediaDvdr
Definition: udf_common.h:17
#define UDF_FS_TITLE_DVDRAM
Definition: udf_reg.h:52
#define REG_DEFAULT_DVDRW
Definition: udf_reg.h:83
#define REG_DEFAULT_HDD
Definition: udf_reg.h:76
#define UDF_FS_TITLE_CDR
Definition: udf_reg.h:59
#define REG_DEFAULT_CDR
Definition: udf_reg.h:77
#define REG_DEFAULT_CDRW
Definition: udf_reg.h:78
#define REG_DEFAULT_FLOPPY
Definition: udf_reg.h:81
#define UDF_FS_NAME_CD
Definition: udf_reg.h:32
#define REG_DEFAULT_CDROM
Definition: udf_reg.h:79
#define REG_DEFAULT_DVDR
Definition: udf_reg.h:82
#define UDF_FS_TITLE_CDRW
Definition: udf_reg.h:58
#define REG_DEFAULT_ZIP
Definition: udf_reg.h:80
#define UDF_FS_TITLE_DVDpRW
Definition: udf_reg.h:53
#define REG_DEFAULT_UNKNOWN
Definition: udf_reg.h:75
#define UDF_FS_TITLE_DVDpR
Definition: udf_reg.h:54
#define UDF_FS_NAME_HDD
Definition: udf_reg.h:33
#define UDF_FS_TITLE_DVDRW
Definition: udf_reg.h:55
#define UDF_FS_NAME
Definition: udf_reg.h:31
#define UDF_FS_TITLE_DVDR
Definition: udf_reg.h:56
#define UDF_DOS_FS_NAME
Definition: udf_reg.h:38
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define UDFSetFlag(Flag, Value)
Definition: udffs.h:189
#define UDFClearFlag(Flag, Value)
Definition: udffs.h:190
#define UDF_HDD_SUPPORT
Definition: udffs.h:45
#define UDFPrint(Args)
Definition: udffs.h:223
NTSTATUS UDFDismountDevice(PUNICODE_STRING unicodeCdRomDeviceName)
Definition: udfinit.cpp:634
#define UDF_CHECK_FS_NAME(name)
NTSTATUS UDFCreateFsDeviceObject(PCWSTR FsDeviceName, PDRIVER_OBJECT DriverObject, DEVICE_TYPE DeviceType, PDEVICE_OBJECT *DeviceObject)
Definition: udfinit.cpp:588
HANDLE FsNotification_ThreadId
Definition: udfinit.cpp:51
VOID UDFRemountAll(IN PVOID Context)
UDFData UDFGlobalData
Definition: udfinit.cpp:25
WORK_QUEUE_ITEM RemountWorkQueueItem
Definition: udfinit.cpp:47
VOID NTAPI UDFFsNotification(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN FsActive)
Definition: udfinit.cpp:779
struct UDF_MEDIA_CLASS_NAMES UDFMediaClassName[]
Definition: udfinit.cpp:29
ULONG FsRegistered
Definition: udfinit.cpp:45
VOID NTAPI UDFInitializeFunctionPointers(PDRIVER_OBJECT DriverObject)
Definition: udfinit.cpp:444
LONGLONG QuadPart
Definition: typedefs.h:114
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
_In_ BOOLEAN FsActive
Definition: iotypes.h:7360
#define IRP_MJ_QUERY_EA
#define IRP_MJ_FILE_SYSTEM_CONTROL
#define IRP_MJ_SET_VOLUME_INFORMATION
#define IRP_MJ_QUERY_SECURITY
#define IRP_MJ_SET_EA
struct _FAST_IO_DISPATCH FAST_IO_DISPATCH
#define IRP_MJ_FLUSH_BUFFERS
#define IRP_MJ_SHUTDOWN
#define IRP_MJ_SET_SECURITY
#define IRP_MJ_CLEANUP