ReactOS 0.4.15-dev-5884-gab5aff5
rawfs.c
Go to the documentation of this file.
1/*
2* PROJECT: ReactOS Kernel
3* LICENSE: GPL - See COPYING in the top level directory
4* FILE: ntoskrnl/io/iomgr/rawfs.c
5* PURPOSE: Raw File System Driver
6* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7*/
8
9/* INCLUDES *****************************************************************/
10
11#include <ntoskrnl.h>
12#define NDEBUG
13#include <debug.h>
14
15/* TYPES *******************************************************************/
16
17typedef struct _VCB
18{
22 PVPB Vpb;
31
32typedef struct _VOLUME_DEVICE_OBJECT
33{
35 VCB Vcb;
37
38#define VCB_STATE_LOCKED 0x00000001
39#define VCB_STATE_DISMOUNTED 0x00000002
40
41/* GLOBALS *******************************************************************/
42
44
45/* FUNCTIONS *****************************************************************/
46
51 IN PVPB Vpb)
52{
54
55 PAGED_CODE();
56
57 DPRINT("RawInitializeVcb(%p, %p, %p)\n", Vcb, TargetDeviceObject, Vpb);
58
59 /* Clear it */
60 RtlZeroMemory(Vcb, sizeof(VCB));
61
62 /* Associate to system objects */
63 Vcb->TargetDeviceObject = TargetDeviceObject;
64 Vcb->Vpb = Vpb;
65
66 /* Initialize the lock */
67 KeInitializeMutex(&Vcb->Mutex, 0);
68
69 Vcb->LocalVpb = ExAllocatePoolWithTag(NonPagedPool, sizeof(VPB), ' waR');
70 if (Vcb->LocalVpb == NULL)
71 {
73 }
74
75 return Status;
76}
77
82{
84 PVPB Vpb;
86
87 DPRINT("RawCheckForDismount(%p, %lu)\n", Vcb, CreateOperation);
88
89 ASSERT(KeReadStateMutant(&Vcb->Mutex) == 0);
90
91 /* Lock VPB */
93
94 /* Reference it and check if a create is being done */
95 Vpb = Vcb->Vpb;
96 if (Vcb->Vpb->ReferenceCount != CreateOperation)
97 {
98 /* Copy the VPB to our local own to prepare later dismount */
99 if (Vcb->LocalVpb != NULL)
100 {
101 RtlZeroMemory(Vcb->LocalVpb, sizeof(VPB));
102 Vcb->LocalVpb->Type = IO_TYPE_VPB;
103 Vcb->LocalVpb->Size = sizeof(VPB);
104 Vcb->LocalVpb->RealDevice = Vcb->Vpb->RealDevice;
105 Vcb->LocalVpb->DeviceObject = NULL;
106 Vcb->LocalVpb->Flags = Vcb->Vpb->Flags & VPB_REMOVE_PENDING;
107 Vcb->Vpb->RealDevice->Vpb = Vcb->LocalVpb;
108 Vcb->LocalVpb = NULL;
109 Vcb->Vpb->Flags |= VPB_PERSISTENT;
110 }
111
112 /* Don't do anything */
113 Delete = FALSE;
114 }
115 else
116 {
117 /* Otherwise, delete the volume */
118 Delete = TRUE;
119
120 /* Check if it has a VPB and unmount it */
121 if (Vpb->RealDevice->Vpb == Vpb)
122 {
123 Vpb->DeviceObject = NULL;
124 Vpb->Flags &= ~VPB_MOUNTED;
125 }
126 }
127
128 /* Release the VPB lock */
130
131 /* If we were to delete, delete the volume */
132 if (Delete)
133 {
134 /* Release our Vcb lock to be able delete us */
135 KeReleaseMutex(&Vcb->Mutex, FALSE);
136
137 /* If we have a local VPB, we'll have to delete it
138 * but we won't dismount us - something went bad before
139 */
140 if (Vcb->LocalVpb)
141 {
142 ExFreePool(Vcb->LocalVpb);
143 }
144 /* Otherwise, delete any of the available VPB if its reference count is zero */
145 else if (Vcb->Vpb->ReferenceCount == 0)
146 {
147 ExFreePool(Vcb->Vpb);
148 }
149
150 /* Dismount our device if possible */
151 ObDereferenceObject(Vcb->TargetDeviceObject);
154 Vcb));
155 }
156
157 return Delete;
158}
159
161NTAPI
163 IN PIRP Irp,
165{
167
168 DPRINT("RawCompletionRoutine(%p, %p, %p)\n", DeviceObject, Irp, Context);
169
170 /* Check if this was a valid sync R/W request */
171 if (((IoStackLocation->MajorFunction == IRP_MJ_READ) ||
172 (IoStackLocation->MajorFunction == IRP_MJ_WRITE)) &&
173 ((IoStackLocation->FileObject)) &&
174 (FlagOn(IoStackLocation->FileObject->Flags, FO_SYNCHRONOUS_IO)) &&
175 (NT_SUCCESS(Irp->IoStatus.Status)))
176 {
177 /* Update byte offset */
178 IoStackLocation->FileObject->CurrentByteOffset.QuadPart +=
179 Irp->IoStatus.Information;
180 }
181
182 /* Mark the IRP Pending if it was */
183 if (Irp->PendingReturned) IoMarkIrpPending(Irp);
184 return STATUS_SUCCESS;
185}
186
188NTAPI
190 IN PIRP Irp,
191 IN PIO_STACK_LOCATION IoStackLocation)
192{
194 PAGED_CODE();
195
196 DPRINT("RawClose(%p, %p, %p)\n", Vcb, Irp, IoStackLocation);
197
198 /* If its a stream, not much to do */
199 if (IoStackLocation->FileObject->Flags & FO_STREAM_FILE)
200 {
201 Irp->IoStatus.Status = STATUS_SUCCESS;
203 return STATUS_SUCCESS;
204 }
205
206 /* Make sure we can clean up */
208 Executive,
210 FALSE,
211 NULL);
213
214 /* Decrease the open count and check if this is a dismount */
215 Vcb->OpenCount--;
216 if (Vcb->OpenCount != 0 || !RawCheckForDismount(Vcb, FALSE))
217 {
218 KeReleaseMutex(&Vcb->Mutex, FALSE);
219 }
220
221 /* Complete the request */
222 Irp->IoStatus.Status = STATUS_SUCCESS;
224 return STATUS_SUCCESS;
225}
226
228NTAPI
230 IN PIRP Irp,
231 IN PIO_STACK_LOCATION IoStackLocation)
232{
237 PAGED_CODE();
238
239 DPRINT("RawCreate(%p, %p, %p)\n", Vcb, Irp, IoStackLocation);
240
241 /* Make sure we can clean up */
243 Executive,
245 FALSE,
246 NULL);
248
249 /* Check if this is a valid non-directory file open */
250 if ((!(IoStackLocation->FileObject) ||
251 !(IoStackLocation->FileObject->FileName.Length)) &&
252 ((IoStackLocation->Parameters.Create.Options >> 24) == FILE_OPEN) &&
253 (!(IoStackLocation->Parameters.Create.Options & FILE_DIRECTORY_FILE)))
254 {
255 /* Make sure the VCB isn't locked */
256 if (Vcb->VcbState & VCB_STATE_LOCKED)
257 {
258 /* Refuse the operation */
260 Irp->IoStatus.Information = 0;
261 }
262 else if (Vcb->VcbState & VCB_STATE_DISMOUNTED)
263 {
264 /* Refuse the operation */
266 Irp->IoStatus.Information = 0;
267 }
268 else
269 {
270 /* Setup share access */
271 ShareAccess = IoStackLocation->Parameters.Create.ShareAccess;
272 DesiredAccess = IoStackLocation->Parameters.Create.
273 SecurityContext->DesiredAccess;
274
275 /* Check if this VCB was already opened */
276 if (Vcb->OpenCount > 0)
277 {
278 /* Try to see if we have access to it */
281 IoStackLocation->FileObject,
282 &Vcb->ShareAccess,
283 TRUE);
284 if (!NT_SUCCESS(Status)) Irp->IoStatus.Information = 0;
285 }
286
287 /* Make sure we have access */
288 if (NT_SUCCESS(Status))
289 {
290 /* Check if this is the first open */
291 if (!Vcb->OpenCount)
292 {
293 /* Set the share access */
296 IoStackLocation->FileObject,
297 &Vcb->ShareAccess);
298 }
299
300 /* Increase the open count and set the VPB */
301 Vcb->OpenCount++;
302 IoStackLocation->FileObject->Vpb = Vcb->Vpb;
303
304 /* Set IRP status and disable intermediate buffering */
306 Irp->IoStatus.Information = FILE_OPENED;
307 IoStackLocation->FileObject->Flags |=
309 }
310 }
311 }
312 else
313 {
314 /* Invalid create request */
316 Irp->IoStatus.Information = 0;
317 }
318
319 /* Check if the request failed */
320 if (!NT_SUCCESS(Status) && !Vcb->OpenCount)
321 {
322 /* Check if we can dismount the device */
324 }
325
326 /* In case of deletion, the mutex is already released */
327 if (!Deleted)
328 {
329 KeReleaseMutex(&Vcb->Mutex, FALSE);
330 }
331
332 /* Complete the request */
333 Irp->IoStatus.Status = Status;
335 return Status;
336}
337
339NTAPI
341 IN PIRP Irp,
342 IN PIO_STACK_LOCATION IoStackLocation)
343{
345 PAGED_CODE();
346
347 DPRINT("RawReadWriteDeviceControl(%p, %p, %p)\n", Vcb, Irp, IoStackLocation);
348
349 /* Don't do anything if the request was 0 bytes */
350 if (((IoStackLocation->MajorFunction == IRP_MJ_READ) ||
351 (IoStackLocation->MajorFunction == IRP_MJ_WRITE)) &&
352 !(IoStackLocation->Parameters.Read.Length))
353 {
354 /* Complete it */
355 Irp->IoStatus.Status = STATUS_SUCCESS;
357 return STATUS_SUCCESS;
358 }
359
360 /* Copy the IRP stack location */
362
363 /* Disable verifies */
365
366 /* Setup a completion routine */
369 NULL,
370 TRUE,
371 TRUE,
372 TRUE);
373
374 /* Call the next driver and exit */
375 Status = IoCallDriver(Vcb->TargetDeviceObject, Irp);
376 return Status;
377}
378
380NTAPI
382{
387 PAGED_CODE();
388
389 DPRINT("RawMountVolume(%p)\n", IoStackLocation);
390
391 /* Remember our owner */
392 DeviceObject = IoStackLocation->Parameters.MountVolume.DeviceObject;
393
394 /* Create the volume */
396 sizeof(VOLUME_DEVICE_OBJECT) -
397 sizeof(DEVICE_OBJECT),
398 NULL,
400 0,
401 FALSE,
403 if (!NT_SUCCESS(Status)) return Status;
404
405 /* Use highest alignment requirement */
406 Volume->DeviceObject.AlignmentRequirement = max(DeviceObject->
408 Volume->DeviceObject.
410
411 /* Setup the VCB */
413 IoStackLocation->Parameters.MountVolume.DeviceObject,
414 IoStackLocation->Parameters.MountVolume.Vpb);
415 if (!NT_SUCCESS(Status))
416 {
418 return Status;
419 }
420
421 /* Set dummy label and serial number */
422 Volume->Vcb.Vpb->SerialNumber = 0xFFFFFFFF;
423 Volume->Vcb.Vpb->VolumeLabelLength = 0;
424
425 /* Setup the DO */
426 Volume->Vcb.Vpb->DeviceObject = &Volume->DeviceObject;
427 Volume->DeviceObject.StackSize = DeviceObject->StackSize + 1;
428 Volume->DeviceObject.SectorSize = DeviceObject->SectorSize;
429 Volume->DeviceObject.Flags |= DO_DIRECT_IO;
430 Volume->DeviceObject.Flags &= ~DO_DEVICE_INITIALIZING;
431
432 /* Try to get associated FO (for notification) */
434 {
436 &(Volume->DeviceObject));
437 }
439 {
440 /* Get the exception code */
442 }
443 _SEH2_END;
444
445 /* If failed, delete devive */
446 if (!NT_SUCCESS(Status))
447 {
449 return Status;
450 }
451
452 /* Increment OpenCount by two to avoid dismount when RawClose() will be called on ObDereferenceObject() */
453 Volume->Vcb.OpenCount += 2;
454 /* Notify for successful mount */
456 /* It's not opened anymore, decrease the reference count to 0 to make FileObject being released */
458 Volume->Vcb.OpenCount -= 2;
459
460 return Status;
461}
462
464NTAPI
466 IN PVCB Vcb)
467{
469 PAGED_CODE();
470
471 DPRINT("RawUserFsCtrl(%p, %p)\n", IoStackLocation, Vcb);
472
473 /* Lock the device */
475 Executive,
477 FALSE,
478 NULL);
480
481 /* Check what kind of request this is */
482 switch (IoStackLocation->Parameters.FileSystemControl.FsControlCode)
483 {
484 /* Oplock requests */
489
490 /* We don't handle them */
492 break;
493
494 /* Lock request */
496
497 /* Make sure we're not locked, and that we're alone */
498 if (!(Vcb->VcbState & VCB_STATE_LOCKED) && (Vcb->OpenCount == 1))
499 {
500 /* Lock the VCB */
501 Vcb->VcbState |= VCB_STATE_LOCKED;
503 }
504 else
505 {
506 /* Otherwise, we can't do this */
508 }
509 break;
510
511 /* Unlock request */
513
514 /* Make sure we're locked */
515 if (!(Vcb->VcbState & VCB_STATE_LOCKED))
516 {
517 /* Let caller know we're not */
519 }
520 else
521 {
522 /* Unlock the VCB */
523 Vcb->VcbState &= ~VCB_STATE_LOCKED;
525 }
526 break;
527
528 /* Dismount request */
530
531 /* Make sure we're locked */
532 if (Vcb->VcbState & VCB_STATE_LOCKED)
533 {
534 /* Do nothing, just return success */
536 }
537 else
538 {
539 /* We can't dismount, device not locked */
541 }
542 break;
543
544 /* Unknown request */
545 default:
546
547 /* Fail */
549 break;
550 }
551
552 /* Unlock device */
553 KeReleaseMutex(&Vcb->Mutex, FALSE);
554
555 /* In case of status change, notify */
556 switch (IoStackLocation->Parameters.FileSystemControl.FsControlCode)
557 {
560 break;
562 if (NT_SUCCESS(Status))
563 {
564 FsRtlNotifyVolumeEvent(IoStackLocation->FileObject, FSRTL_VOLUME_UNLOCK);
565 }
566 break;
569 break;
570 }
571
572 return Status;
573}
574
576NTAPI
578 IN PIRP Irp,
579 IN PIO_STACK_LOCATION IoStackLocation)
580{
582 PAGED_CODE();
583
584 DPRINT("RawFileSystemControl(%p, %p, %p)\n", Vcb, Irp, IoStackLocation);
585
586 /* Check the kinds of FSCTLs that we support */
587 switch (IoStackLocation->MinorFunction)
588 {
589 /* User-mode request */
591
592 /* Handle it */
593 Status = RawUserFsCtrl(IoStackLocation, Vcb);
594 break;
595
596 /* Mount request */
598
599 /* Mount the volume */
600 Status = RawMountVolume(IoStackLocation);
601 break;
602
604
605 /* Lock the device */
607 Executive,
609 FALSE,
610 NULL);
612
613 /* We don't do verifies */
615 Vcb->Vpb->RealDevice->Flags &= ~DO_VERIFY_VOLUME;
616
617 /* Check if we should delete the device */
618 if (Vcb->OpenCount != 0 || !RawCheckForDismount(Vcb, FALSE))
619 {
620 /* In case of deletion, the mutex is already released */
621 KeReleaseMutex(&Vcb->Mutex, FALSE);
622 }
623
624 /* We're done */
625 break;
626
627 /* Invalid request */
628 default:
629
630 /* Fail it */
632 break;
633 }
634
635 /* Complete the request */
636 Irp->IoStatus.Status = Status;
638 return Status;
639}
640
642NTAPI
644 IN PIRP Irp,
645 IN PIO_STACK_LOCATION IoStackLocation)
646{
650 PAGED_CODE();
651
652 DPRINT("RawQueryInformation(%p, %p, %p)\n", Vcb, Irp, IoStackLocation);
653
654 /* Get information from the IRP */
655 Length = &IoStackLocation->Parameters.QueryFile.Length;
656 Buffer = Irp->AssociatedIrp.SystemBuffer;
657
658 /* We only handle this request */
659 if (IoStackLocation->Parameters.QueryFile.FileInformationClass ==
661 {
662 /* Validate buffer size */
663 if (*Length < sizeof(FILE_POSITION_INFORMATION))
664 {
665 /* Invalid, fail */
666 Irp->IoStatus.Information = 0;
668 }
669 else
670 {
671 /* Get offset and update length */
672 Buffer->CurrentByteOffset = IoStackLocation->FileObject->
673 CurrentByteOffset;
675
676 /* Set IRP Status information */
677 Irp->IoStatus.Information = sizeof(FILE_POSITION_INFORMATION);
679 }
680 }
681
682 /* Complete it */
683 Irp->IoStatus.Status = Status;
685 return Status;
686}
687
689NTAPI
691 IN PIRP Irp,
692 IN PIO_STACK_LOCATION IoStackLocation)
693{
697 PAGED_CODE();
698
699 DPRINT("RawSetInformation(%p, %p, %p)\n", Vcb, Irp, IoStackLocation);
700
701 /* Get information from the IRP */
702 Buffer = Irp->AssociatedIrp.SystemBuffer;
703
704 /* We only handle this request */
705 if (IoStackLocation->Parameters.QueryFile.FileInformationClass ==
707 {
708 /* Get the DO */
709 DeviceObject = IoGetRelatedDeviceObject(IoStackLocation->FileObject);
710
711 /* Make sure the offset is aligned */
712 if ((Buffer->CurrentByteOffset.LowPart &
713 DeviceObject->AlignmentRequirement))
714 {
715 /* It's not, fail */
717 }
718 else
719 {
720 /* Otherwise, set offset */
721 IoStackLocation->FileObject->CurrentByteOffset = Buffer->
722 CurrentByteOffset;
723
724 /* Set IRP Status information */
726 }
727 }
728
729 /* Complete it */
730 Irp->IoStatus.Status = Status;
732 return Status;
733}
734
736NTAPI
740{
741 PAGED_CODE();
742
743 DPRINT("RawQueryFsVolumeInfo(%p, %p, %p)\n", Vcb, Buffer, Length);
744
745 /* Clear the buffer and stub it out */
747 Buffer->VolumeSerialNumber = Vcb->Vpb->SerialNumber;
748 Buffer->SupportsObjects = FALSE;
749 Buffer->VolumeLabelLength = 0;
750
751 /* Return length and success */
753 return STATUS_SUCCESS;
754}
755
757NTAPI
761{
762 PIRP Irp;
766 PDEVICE_OBJECT RealDevice;
767 DISK_GEOMETRY DiskGeometry;
768 PARTITION_INFORMATION PartitionInformation;
769 BOOLEAN DiskHasPartitions;
770 PAGED_CODE();
771
772 DPRINT("RawQueryFsSizeInfo(%p, %p, %p)\n", Vcb, Buffer, Length);
773
774 /* Validate the buffer */
775 if (*Length < sizeof(FILE_FS_SIZE_INFORMATION))
776 {
777 /* Fail */
779 }
780
781 /* Clear the buffer, initialize the event and set the DO */
784 RealDevice = Vcb->Vpb->RealDevice;
785
786 /* Build query IRP */
788 RealDevice,
789 NULL,
790 0,
791 &DiskGeometry,
792 sizeof(DISK_GEOMETRY),
793 FALSE,
794 &Event,
797
798 /* Call driver and check if we're pending */
799 Status = IoCallDriver(RealDevice, Irp);
800 if (Status == STATUS_PENDING)
801 {
802 /* Wait on driver to finish */
804 Executive,
806 FALSE,
807 NULL);
809 }
810
811 /* Fail if we couldn't get CHS data */
812 if (!NT_SUCCESS(Status))
813 {
814 *Length = 0;
815 return Status;
816 }
817
818 /* Check if this is a floppy */
819 if (FlagOn(RealDevice->Characteristics, FILE_FLOPPY_DISKETTE))
820 {
821 /* Floppies don't have partitions */
822 DiskHasPartitions = FALSE;
823 }
824 else
825 {
826 /* Setup query IRP */
829 RealDevice,
830 NULL,
831 0,
832 &PartitionInformation,
833 sizeof(PARTITION_INFORMATION),
834 FALSE,
835 &Event,
838
839 /* Call driver and check if we're pending */
840 Status = IoCallDriver(RealDevice, Irp);
841 if (Status == STATUS_PENDING)
842 {
843 /* Wait on driver to finish */
845 Executive,
847 FALSE,
848 NULL);
850 }
851
852 /* If this was an invalid request, then the disk is not partitioned */
854 {
855 DiskHasPartitions = FALSE;
856 }
857 else
858 {
859 /* Otherwise, it must be */
861 DiskHasPartitions = TRUE;
862 }
863 }
864
865 /* Set sector data */
866 Buffer->BytesPerSector = DiskGeometry.BytesPerSector;
867 Buffer->SectorsPerAllocationUnit = 1;
868
869 /* Calculate allocation units */
870 if (DiskHasPartitions)
871 {
872 /* Use partition data */
873 Buffer->TotalAllocationUnits =
875 DiskGeometry.BytesPerSector,
876 NULL);
877 }
878 else
879 {
880 /* Use CHS */
881 Buffer->TotalAllocationUnits =
883 DiskGeometry.TracksPerCylinder *
884 DiskGeometry.SectorsPerTrack);
885 }
886
887 /* Set available units */
888 Buffer->AvailableAllocationUnits = Buffer->TotalAllocationUnits;
889
890 /* Return length and success */
892 return STATUS_SUCCESS;
893}
894
896NTAPI
900{
901 PAGED_CODE();
902
903 DPRINT("RawQueryFsDeviceInfo(%p, %p, %p)\n", Vcb, Buffer, Length);
904
905 /* Validate buffer */
906 if (*Length < sizeof(FILE_FS_DEVICE_INFORMATION))
907 {
908 /* Fail */
910 }
911
912 /* Clear buffer and write information */
914 Buffer->DeviceType = FILE_DEVICE_DISK;
915 Buffer->Characteristics = Vcb->TargetDeviceObject->Characteristics;
916
917 /* Return length and success */
919 return STATUS_SUCCESS;
920}
921
923NTAPI
927{
928 const WCHAR szRawFSName[] = L"RAW";
930 PAGED_CODE();
931
932 DPRINT("RawQueryFsAttributeInfo(%p, %p, %p)\n", Vcb, Buffer, Length);
933
934 /* Check if the buffer is large enough for our name ("RAW") */
936 FileSystemName[sizeof(szRawFSName) / sizeof(szRawFSName[0])]);
938
939 /* Output the data */
940 Buffer->FileSystemAttributes = 0;
941 Buffer->MaximumComponentNameLength = 0;
942 Buffer->FileSystemNameLength = 6;
943 RtlCopyMemory(&Buffer->FileSystemName[0], szRawFSName, sizeof(szRawFSName));
944
945 /* Return length and success */
947 return STATUS_SUCCESS;
948}
949
951NTAPI
953 IN PIRP Irp,
954 IN PIO_STACK_LOCATION IoStackLocation)
955{
959 PAGED_CODE();
960
961 DPRINT("RawQueryVolumeInformation(%p, %p, %p)\n", Vcb, Irp, IoStackLocation);
962
963 /* Get IRP Data */
964 Length = IoStackLocation->Parameters.QueryVolume.Length;
965 Buffer = Irp->AssociatedIrp.SystemBuffer;
966
967 /* Check the kind of request */
968 switch (IoStackLocation->Parameters.QueryVolume.FsInformationClass)
969 {
970 /* Volume information request */
972
974 break;
975
976 /* File system size invormation */
978
980 break;
981
982 /* Device information */
984
986 break;
987
988 /* Attribute information */
990
992 break;
993
994 /* Invalid request */
995 default:
996
997 /* Fail it */
999 break;
1000 }
1001
1002 /* Set status and complete the request */
1003 Irp->IoStatus.Information = IoStackLocation->
1004 Parameters.QueryVolume.Length - Length;
1005 Irp->IoStatus.Status = Status;
1007 return Status;
1008}
1009
1011NTAPI
1013 IN PIRP Irp,
1014 IN PIO_STACK_LOCATION IoStackLocation)
1015{
1017 PAGED_CODE();
1018
1019 DPRINT("RawCleanup(%p, %p, %p)\n", Vcb, Irp, IoStackLocation);
1020
1021 /* Make sure we can clean up */
1023 Executive,
1024 KernelMode,
1025 FALSE,
1026 NULL);
1028
1029 /* Remove shared access */
1030 IoRemoveShareAccess(IoStackLocation->FileObject, &Vcb->ShareAccess);
1031
1032 /* Check if we're to dismount */
1033 if (Vcb->VcbState & VCB_STATE_DISMOUNTED)
1034 {
1035 ASSERT(Vcb->OpenCount == 1);
1037 }
1038
1039 KeReleaseMutex(&Vcb->Mutex, FALSE);
1040 Irp->IoStatus.Status = STATUS_SUCCESS;
1042 return STATUS_SUCCESS;
1043}
1044
1046NTAPI
1048 IN PIRP Irp)
1049{
1052 PIO_STACK_LOCATION IoStackLocation;
1053 PVCB Vcb;
1054 PAGED_CODE();
1055
1056 DPRINT("RawDispatch(%p, %p)\n", DeviceObject, Irp);
1057
1058 /* Get the stack location */
1059 IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
1060
1061 /* Differentiate between Volume DO and FS DO */
1062 if ((DeviceObject->Size == sizeof(DEVICE_OBJECT)) &&
1063 !((IoStackLocation->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL) &&
1064 (IoStackLocation->MinorFunction == IRP_MN_MOUNT_VOLUME)))
1065 {
1066 /* This is an FS DO. Stub out the common calls */
1067 if ((IoStackLocation->MajorFunction == IRP_MJ_CREATE) ||
1068 (IoStackLocation->MajorFunction == IRP_MJ_CLEANUP) ||
1069 (IoStackLocation->MajorFunction == IRP_MJ_CLOSE))
1070 {
1071 /* Return success for them */
1073 }
1074 else
1075 {
1076 /* Anything else, we don't support */
1078 }
1079
1080 /* Complete the request */
1081 Irp->IoStatus.Status = Status;
1083 return Status;
1084 }
1085
1086 /* Otherwise, get our VCB and start handling the IRP */
1088 Vcb = &VolumeDeviceObject->Vcb;
1089
1090 /* Check what kind of IRP this is */
1091 switch (IoStackLocation->MajorFunction)
1092 {
1093 /* Cleanup request */
1094 case IRP_MJ_CLEANUP:
1095
1096 Status = RawCleanup(Vcb, Irp, IoStackLocation);
1097 break;
1098
1099 /* Close request */
1100 case IRP_MJ_CLOSE:
1101
1102 Status = RawClose(Vcb, Irp, IoStackLocation);
1103 break;
1104
1105 /* Create request */
1106 case IRP_MJ_CREATE:
1107
1108 Status = RawCreate(Vcb, Irp, IoStackLocation);
1109 break;
1110
1111 /* FSCTL request */
1113
1114 Status = RawFileSystemControl(Vcb, Irp, IoStackLocation);
1115 break;
1116
1117 /* R/W or IOCTL request */
1118 case IRP_MJ_READ:
1119 case IRP_MJ_WRITE:
1121
1122 Status = RawReadWriteDeviceControl(Vcb, Irp, IoStackLocation);
1123 break;
1124
1125 /* Information query request */
1127
1128 Status = RawQueryInformation(Vcb, Irp, IoStackLocation);
1129 break;
1130
1131 /* Information set request */
1133
1134 Status = RawSetInformation(Vcb, Irp, IoStackLocation);
1135 break;
1136
1137 /* Volume information request */
1139
1140 Status = RawQueryVolumeInformation(Vcb, Irp, IoStackLocation);
1141 break;
1142
1143 /* Unexpected request */
1144 default:
1145
1146 /* Anything else is pretty bad */
1148 }
1149
1150 /* Return the status */
1152 return Status;
1153}
1154
1156NTAPI
1158 IN PIRP Irp)
1159{
1160 /* Unregister file systems */
1161#if 0 // FIXME: This freezes ROS at shutdown. PnP Problem?
1165
1166 /* Delete the devices */
1170#endif
1171
1172 /* Complete the request */
1173 Irp->IoStatus.Status = STATUS_SUCCESS;
1175 return STATUS_SUCCESS;
1176}
1177
1178VOID
1179NTAPI
1181{
1182#if 0 // FIXME: DriverUnload is never called
1183 /* Dereference device objects */
1187#endif
1188}
1189
1190CODE_SEG("INIT")
1192NTAPI
1195{
1198
1200
1201 /* Create the raw disk device */
1202 RtlInitUnicodeString(&DeviceName, L"\\Device\\RawDisk");
1204 0,
1205 &DeviceName,
1207 0,
1208 FALSE,
1210 if (!NT_SUCCESS(Status))
1211 {
1212 return Status;
1213 }
1214
1215 /* Create the raw CDROM device */
1216 RtlInitUnicodeString(&DeviceName, L"\\Device\\RawCdRom");
1218 0,
1219 &DeviceName,
1221 0,
1222 FALSE,
1224 if (!NT_SUCCESS(Status))
1225 {
1227 return Status;
1228 }
1229
1230 /* Create the raw tape device */
1231 RtlInitUnicodeString(&DeviceName, L"\\Device\\RawTape");
1233 0,
1234 &DeviceName,
1236 0,
1237 FALSE,
1239 if (!NT_SUCCESS(Status))
1240 {
1243 return Status;
1244 }
1245
1246 /* Set Direct I/O for all devices */
1250
1251 /* Set generic stubs */
1252 DriverObject->MajorFunction[IRP_MJ_CREATE] =
1253 DriverObject->MajorFunction[IRP_MJ_CLEANUP] =
1254 DriverObject->MajorFunction[IRP_MJ_CLOSE] =
1255 DriverObject->MajorFunction[IRP_MJ_READ] =
1256 DriverObject->MajorFunction[IRP_MJ_WRITE] =
1257 DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] =
1258 DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] =
1262
1263 /* Shutdown and unload */
1264 DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = RawShutdown;
1265 DriverObject->DriverUnload = RawUnload;
1266
1267 /* Register the file systems */
1271
1272#if 0 // FIXME: DriverUnload is never called
1273 /* Reference device objects */
1277#endif
1278 return STATUS_SUCCESS;
1279}
1280
1281/* EOF */
#define PAGED_CODE()
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
BOOL Delete(LPCTSTR ServiceName)
Definition: delete.c:12
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
Definition: bug.c:1427
#define IOCTL_DISK_GET_DRIVE_GEOMETRY
Definition: cdrw_usr.h:169
Definition: bufpool.h:45
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT ShareAccess
Definition: create.c:4147
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:43
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define NonPagedPool
Definition: env_spec_w32.h:307
VOID NTAPI KeClearEvent(IN PKEVENT Event)
Definition: eventobj.c:22
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
IN OUT PVCB IN PDEVICE_OBJECT TargetDeviceObject
Definition: fatprocs.h:1674
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
Definition: fatprocs.h:1675
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
@ FilePositionInformation
Definition: from_kernel.h:75
#define FILE_OPEN
Definition: from_kernel.h:54
@ FileFsDeviceInformation
Definition: from_kernel.h:222
@ FileFsAttributeInformation
Definition: from_kernel.h:223
@ FileFsVolumeInformation
Definition: from_kernel.h:219
@ FileFsSizeInformation
Definition: from_kernel.h:221
struct _FILE_FS_SIZE_INFORMATION FILE_FS_SIZE_INFORMATION
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
Status
Definition: gdiplustypes.h:25
static void CreateOperation(FILE *Out, unsigned Bpp, PROPINFO RopInfo, unsigned SourceBpp, unsigned Bits)
Definition: gendib.c:247
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSYSAPI LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG, INT)
NTSYSAPI LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG, INT, INT *)
HRESULT Create([out]ITransactionReceiver **ppReceiver)
IoMarkIrpPending(Irp)
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:498
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
@ Deleted
Definition: kstypes.h:187
UNICODE_STRING Volume
Definition: fltkernel.h:1172
#define ASSERT(a)
Definition: mode.c:44
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
#define KernelMode
Definition: asm.h:34
#define FSCTL_OPLOCK_BREAK_NOTIFY
Definition: nt_native.h:831
#define FSCTL_LOCK_VOLUME
Definition: nt_native.h:832
#define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE
Definition: nt_native.h:829
#define FSCTL_REQUEST_OPLOCK_LEVEL_1
Definition: nt_native.h:826
ULONG ACCESS_MASK
Definition: nt_native.h:40
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
struct _FILE_FS_DEVICE_INFORMATION FILE_FS_DEVICE_INFORMATION
struct _FILE_POSITION_INFORMATION FILE_POSITION_INFORMATION
#define FSCTL_UNLOCK_VOLUME
Definition: nt_native.h:833
#define FILE_FLOPPY_DISKETTE
Definition: nt_native.h:809
#define FILE_OPENED
Definition: nt_native.h:769
#define FSCTL_REQUEST_OPLOCK_LEVEL_2
Definition: nt_native.h:827
#define FSCTL_DISMOUNT_VOLUME
Definition: nt_native.h:834
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define IOCTL_DISK_GET_PARTITION_INFO
Definition: ntdddisk.h:106
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
@ NotificationEvent
#define FSRTL_VOLUME_UNLOCK
Definition: ntifs_ex.h:443
#define FSRTL_VOLUME_LOCK
Definition: ntifs_ex.h:441
#define FSRTL_VOLUME_DISMOUNT_FAILED
Definition: ntifs_ex.h:440
#define FSRTL_VOLUME_DISMOUNT
Definition: ntifs_ex.h:439
#define FSRTL_VOLUME_MOUNT
Definition: ntifs_ex.h:444
#define VPB_REMOVE_PENDING
Definition: ntifs_ex.h:428
#define FSRTL_VOLUME_LOCK_FAILED
Definition: ntifs_ex.h:442
#define IoCopyCurrentIrpStackLocationToNext(Irp)
Definition: ntifs_ex.h:413
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
PDEVICE_OBJECT NTAPI IoGetRelatedDeviceObject(IN PFILE_OBJECT FileObject)
Definition: device.c:1539
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
VOID NTAPI IoSetShareAccess(IN ACCESS_MASK DesiredAccess, IN ULONG DesiredShareAccess, IN PFILE_OBJECT FileObject, OUT PSHARE_ACCESS ShareAccess)
Definition: file.c:3517
NTSTATUS NTAPI IoCheckShareAccess(IN ACCESS_MASK DesiredAccess, IN ULONG DesiredShareAccess, IN PFILE_OBJECT FileObject, IN PSHARE_ACCESS ShareAccess, IN BOOLEAN Update)
Definition: file.c:3390
VOID NTAPI IoRemoveShareAccess(IN PFILE_OBJECT FileObject, IN PSHARE_ACCESS ShareAccess)
Definition: file.c:3478
PFILE_OBJECT NTAPI IoCreateStreamFileObjectLite(IN PFILE_OBJECT FileObject OPTIONAL, IN PDEVICE_OBJECT DeviceObject OPTIONAL)
Definition: file.c:3199
#define IoCompleteRequest
Definition: irp.c:1240
PIRP NTAPI IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, IN PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN InternalDeviceIoControl, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
Definition: irp.c:881
#define IoCallDriver
Definition: irp.c:1225
VOID NTAPI IoUnregisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:1056
VOID NTAPI IoRegisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:987
VOID NTAPI IoReleaseVpbSpinLock(IN KIRQL Irql)
Definition: volume.c:1215
VOID NTAPI IoAcquireVpbSpinLock(OUT PKIRQL Irql)
Definition: volume.c:1204
LONG NTAPI KeReadStateMutant(IN PKMUTANT Mutant)
Definition: mutex.c:87
VOID NTAPI KeInitializeMutex(IN PKMUTEX Mutex, IN ULONG Level)
Definition: mutex.c:67
LONG NTAPI KeReleaseMutex(IN PKMUTEX Mutex, IN BOOLEAN Wait)
Definition: mutex.c:189
#define STATUS_VOLUME_DISMOUNTED
Definition: ntstatus.h:747
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define STATUS_NOT_LOCKED
Definition: ntstatus.h:279
#define L(x)
Definition: ntvdm.h:50
unsigned short USHORT
Definition: pedump.c:61
#define Vcb
Definition: cdprocs.h:1415
#define FILE_DEVICE_DISK_FILE_SYSTEM
Definition: winioctl.h:114
#define FILE_DEVICE_TAPE_FILE_SYSTEM
Definition: winioctl.h:138
#define FILE_DEVICE_CD_ROM_FILE_SYSTEM
Definition: winioctl.h:109
#define FILE_DEVICE_DISK
Definition: winioctl.h:113
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
NTSTATUS NTAPI RawShutdown(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: rawfs.c:1157
NTSTATUS NTAPI RawReadWriteDeviceControl(IN PVCB Vcb, IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation)
Definition: rawfs.c:340
NTSTATUS NTAPI RawQueryFsDeviceInfo(IN PVCB Vcb, IN PFILE_FS_DEVICE_INFORMATION Buffer, IN OUT PULONG Length)
Definition: rawfs.c:897
NTSTATUS NTAPI RawQueryVolumeInformation(IN PVCB Vcb, IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation)
Definition: rawfs.c:952
NTSTATUS NTAPI RawFsDriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: rawfs.c:1193
NTSTATUS NTAPI RawCleanup(IN PVCB Vcb, IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation)
Definition: rawfs.c:1012
PDEVICE_OBJECT RawCdromDeviceObject
Definition: rawfs.c:43
NTSTATUS NTAPI RawQueryFsVolumeInfo(IN PVCB Vcb, IN PFILE_FS_VOLUME_INFORMATION Buffer, IN OUT PULONG Length)
Definition: rawfs.c:737
PDEVICE_OBJECT RawTapeDeviceObject
Definition: rawfs.c:43
NTSTATUS NTAPI RawCompletionRoutine(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
Definition: rawfs.c:162
NTSTATUS NTAPI RawQueryFsSizeInfo(IN PVCB Vcb, IN PFILE_FS_SIZE_INFORMATION Buffer, IN OUT PULONG Length)
Definition: rawfs.c:758
NTSTATUS NTAPI RawMountVolume(IN PIO_STACK_LOCATION IoStackLocation)
Definition: rawfs.c:381
BOOLEAN NTAPI RawCheckForDismount(IN PVCB Vcb, IN BOOLEAN CreateOperation)
Definition: rawfs.c:80
NTSTATUS NTAPI RawQueryInformation(IN PVCB Vcb, IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation)
Definition: rawfs.c:643
NTSTATUS NTAPI RawUserFsCtrl(IN PIO_STACK_LOCATION IoStackLocation, IN PVCB Vcb)
Definition: rawfs.c:465
struct _VCB VCB
PDEVICE_OBJECT RawDiskDeviceObject
Definition: rawfs.c:43
NTSTATUS NTAPI RawQueryFsAttributeInfo(IN PVCB Vcb, IN PFILE_FS_ATTRIBUTE_INFORMATION Buffer, IN OUT PULONG Length)
Definition: rawfs.c:924
#define VCB_STATE_DISMOUNTED
Definition: rawfs.c:39
VOID NTAPI RawUnload(IN PDRIVER_OBJECT DriverObject)
Definition: rawfs.c:1180
#define VCB_STATE_LOCKED
Definition: rawfs.c:38
struct _VCB * PVCB
NTSTATUS NTAPI RawInitializeVcb(IN OUT PVCB Vcb, IN PDEVICE_OBJECT TargetDeviceObject, IN PVPB Vpb)
Definition: rawfs.c:49
struct _VOLUME_DEVICE_OBJECT VOLUME_DEVICE_OBJECT
NTSTATUS NTAPI RawFileSystemControl(IN PVCB Vcb, IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation)
Definition: rawfs.c:577
NTSTATUS NTAPI RawSetInformation(IN PVCB Vcb, IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation)
Definition: rawfs.c:690
NTSTATUS NTAPI RawCreate(IN PVCB Vcb, IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation)
Definition: rawfs.c:229
NTSTATUS NTAPI RawClose(IN PVCB Vcb, IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation)
Definition: rawfs.c:189
struct _VOLUME_DEVICE_OBJECT * PVOLUME_DEVICE_OBJECT
NTSTATUS NTAPI RawDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: rawfs.c:1047
#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_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
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
#define DPRINT
Definition: sndvol32.h:71
LARGE_INTEGER Cylinders
Definition: ntdddisk.h:405
ULONG TracksPerCylinder
Definition: ntdddisk.h:407
ULONG SectorsPerTrack
Definition: ntdddisk.h:408
ULONG BytesPerSector
Definition: ntdddisk.h:409
PFILE_OBJECT FileObject
Definition: iotypes.h:3169
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
LARGE_INTEGER PartitionLength
Definition: ntdddisk.h:414
Definition: cdstruc.h:498
CLONG OpenCount
Definition: rawfs.c:26
PVPB Vpb
Definition: cdstruc.h:511
USHORT NodeByteSize
Definition: rawfs.c:20
SHARE_ACCESS ShareAccess
Definition: fatstruc.h:303
PVPB LocalVpb
Definition: rawfs.c:23
ULONG BytesPerSector
Definition: rawfs.c:28
USHORT NodeTypeCode
Definition: rawfs.c:19
ULONG VcbState
Definition: cdstruc.h:540
KMUTEX Mutex
Definition: rawfs.c:25
PDEVICE_OBJECT TargetDeviceObject
Definition: cdstruc.h:517
LARGE_INTEGER SectorsOnDisk
Definition: rawfs.c:29
DEVICE_OBJECT DeviceObject
Definition: cdstruc.h:729
Definition: iotypes.h:189
#define max(a, b)
Definition: svc.c:63
uint32_t * PULONG
Definition: typedefs.h:59
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_WRONG_VOLUME
Definition: udferr_usr.h:140
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
ULONG CLONG
Definition: umtypes.h:126
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_In_ WDFDEVICE _In_ ULONG AlignmentRequirement
Definition: wdfdevice.h:2854
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_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
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:869
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2695
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
#define SL_OVERRIDE_VERIFY_VOLUME
Definition: iotypes.h:1823
#define IO_TYPE_VPB
#define IRP_MJ_FILE_SYSTEM_CONTROL
#define IRP_MN_VERIFY_VOLUME
Definition: iotypes.h:4405
#define VPB_PERSISTENT
Definition: iotypes.h:1809
#define IRP_MN_USER_FS_REQUEST
Definition: iotypes.h:4403
struct _VPB VPB
* PFILE_OBJECT
Definition: iotypes.h:1998
#define FO_STREAM_FILE
Definition: iotypes.h:1783
#define IO_DISK_INCREMENT
Definition: iotypes.h:600
#define FO_NO_INTERMEDIATE_BUFFERING
Definition: iotypes.h:1778
#define FO_SYNCHRONOUS_IO
Definition: iotypes.h:1776
#define IRP_MJ_SHUTDOWN
#define IRP_MN_MOUNT_VOLUME
Definition: iotypes.h:4404
#define IRP_MJ_CLEANUP
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:792
@ Executive
Definition: ketypes.h:403
#define ObDereferenceObject
Definition: obfuncs.h:203
#define ObReferenceObject
Definition: obfuncs.h:204
__wchar_t WCHAR
Definition: xmlstorage.h:180