566{
571
573
575 {
579 }
580
582 {
583
585 {
587 {
589 break;
590 }
591
593
594
596 {
599 break;
600 }
601
603
608 .HiddenSectors = partExt->
Mbr.HiddenSectors,
610 .BootIndicator = partExt->
Mbr.BootIndicator,
611 .RecognizedPartition = partExt->
Mbr.RecognizedPartition,
612 .RewritePartition =
FALSE,
613 };
614
616
617 Irp->IoStatus.Information =
sizeof(*partInfo);
619 break;
620 }
622 {
624 {
626 break;
627 }
628
630
632
637 .PartitionStyle = fdoExtension->
DiskData.PartitionStyle,
638 .RewritePartition =
FALSE,
639 };
640
642 {
645 .HiddenSectors = partExt->
Mbr.HiddenSectors,
646 .BootIndicator = partExt->
Mbr.BootIndicator,
647 .RecognizedPartition = partExt->
Mbr.RecognizedPartition,
648 };
649 }
650 else
651 {
654 .PartitionId = partExt->
Gpt.PartitionId,
655 .Attributes = partExt->
Gpt.Attributes,
656 };
657
661 }
662
664
665 Irp->IoStatus.Information =
sizeof(*partInfoEx);
667 break;
668 }
670 {
673 {
675 break;
676 }
677
679
680
682 fdoExtension->
DiskData.BytesPerSector,
685
687 {
689 }
690
692
693 Irp->IoStatus.Information = 0;
694 break;
695 }
697 {
698 PSET_PARTITION_INFORMATION_EX inputBuffer =
Irp->AssociatedIrp.SystemBuffer;
700 {
702 break;
703 }
704
706
707
710 inputBuffer);
711
713 {
715 {
716 partExt->
Mbr.PartitionType = inputBuffer->Mbr.PartitionType;
717 }
718 else
719 {
720 partExt->
Gpt.PartitionType = inputBuffer->Gpt.PartitionType;
721 partExt->
Gpt.PartitionId = inputBuffer->Gpt.PartitionId;
722 partExt->
Gpt.Attributes = inputBuffer->Gpt.Attributes;
723
725 inputBuffer->Gpt.Name,
726 sizeof(partExt->
Gpt.Name));
727 }
728 }
729
731
732 Irp->IoStatus.Information = 0;
733 break;
734 }
736 {
739 {
741 break;
742 }
743
745
747
749
751 Irp->IoStatus.Information =
sizeof(*lengthInfo);
752 break;
753 }
755 {
758 {
760 break;
761 }
762
763
766 }
768 {
771
773 break;
774 }
776 {
778 }
779
781 {
783
784
786 {
788 break;
789 }
790
792
793
794
795
798 .Extents = {{
799 .DiskNumber = fdoExtension->
DiskData.DeviceNumber,
802 }}
803 };
804
806
808 Irp->IoStatus.Information =
sizeof(*volExts);
809 break;
810 }
812 {
815 {
817 break;
818 }
819
821
826
828
830 Irp->IoStatus.Information =
sizeof(*volNum);
831 break;
832 }
834 {
835
836
837
838
839
841 break;
842 }
844 {
846 break;
847 }
849 {
852 {
854 break;
855 }
856
857
859 {
861 break;
862 }
863
865
867 Irp->IoStatus.Information =
sizeof(*gptAttrs);
868 break;
869 }
870
872 {
874
876 {
878 break;
879 }
880
882
883
885 {
886 Irp->IoStatus.Information =
sizeof(
USHORT);
888 break;
889 }
890
892
894 Irp->IoStatus.Information =
sizeof(
USHORT) +
name->NameLength;
895 break;
896 }
898 {
903
904
906 {
908 break;
909 }
910
912
916
917
920 {
922 }
924 {
926 }
927 else
928 {
929 if (!InterfaceName->Buffer || !InterfaceName->Length)
930 {
933 break;
934 }
936 }
937
938
940 {
942 Irp->IoStatus.Information = headerSize;
944 break;
945 }
946
947
948
949
950
951
952
953
954
955
956
957
958
961 {
962 basicVolId->
Mbr.Signature = fdoExtension->
DiskData.Mbr.Signature;
964 }
966 {
968 basicVolId->
Gpt.PartitionGuid = partExt->
Gpt.PartitionId;
969 }
970 else
971 {
973 InterfaceName->Buffer,
975 }
976
978
981 break;
982 }
986#if (NTDDI_VERSION >= NTDDI_WS03)
987
988
991#endif
994 {
995 WARN(
"Ignored MountMgr notification: 0x%lX\n",
998 break;
999 }
1000 default:
1002 }
1003
1007}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
NTSTATUS FASTCALL IoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize, IN ULONG PartitionNumber, IN ULONG PartitionType)
#define IOCTL_DISK_VERIFY
#define IOCTL_DISK_GET_PARTITION_INFO_EX
NTSTATUS NTAPI IoSetPartitionInformationEx(IN PDEVICE_OBJECT DeviceObject, IN ULONG PartitionNumber, IN PSET_PARTITION_INFORMATION_EX PartitionInfo)
DRIVER_DISPATCH ForwardIrpAndForget
#define IOCTL_MOUNTDEV_LINK_CREATED
#define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME
#define IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME
#define IOCTL_MOUNTDEV_QUERY_STABLE_GUID
struct _PARTITION_INFORMATION_EX PARTITION_INFORMATION_EX
#define IOCTL_DISK_GET_LENGTH_INFO
#define MOUNTDEVCONTROLTYPE
#define IOCTL_MOUNTDEV_QUERY_UNIQUE_ID
#define IOCTL_MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY
struct _PARTITION_INFORMATION_MBR PARTITION_INFORMATION_MBR
#define IOCTL_MOUNTDEV_LINK_DELETED
struct _PARTITION_INFORMATION_GPT PARTITION_INFORMATION_GPT
#define CTL_CODE(DeviceType, Function, Method, Access)
#define IOCTL_DISK_SET_PARTITION_INFO
#define IOCTL_DISK_SET_PARTITION_INFO_EX
struct _PARTITION_INFORMATION PARTITION_INFORMATION
#define IOCTL_DISK_GET_PARTITION_INFO
#define IOCTL_DISK_UPDATE_PROPERTIES
#define IOCTL_STORAGE_MEDIA_REMOVAL
#define IOCTL_VOLUME_QUERY_VOLUME_NUMBER
#define IOCTL_VOLUME_GET_GPT_ATTRIBUTES
struct _VOLUME_DISK_EXTENTS VOLUME_DISK_EXTENTS
#define IOCTL_VOLUME_ONLINE
#define IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS
#define IOCTL_VOLUME_IS_PARTITION
#define IoCompleteRequest
#define STATUS_NOT_IMPLEMENTED
#define STATUS_DEVICE_DOES_NOT_EXIST
union _BASIC_VOLUME_UNIQUE_ID * PBASIC_VOLUME_UNIQUE_ID
FORCEINLINE VOID PartMgrReleaseLayoutLock(_In_ PFDO_EXTENSION FDOExtension)
FORCEINLINE VOID PartMgrAcquireLayoutLock(_In_ PFDO_EXTENSION FDOExtension)
FORCEINLINE BOOLEAN VerifyIrpInBufferSize(_In_ PIRP Irp, _In_ SIZE_T Size)
#define DMIO_ID_SIGNATURE
FORCEINLINE BOOLEAN VerifyIrpOutBufferSize(_In_ PIRP Irp, _In_ SIZE_T Size)
VOID NTAPI IoInvalidateDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE Type)
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_BUFFER_OVERFLOW
PDEVICE_OBJECT PhysicalDiskDO
struct _FDO_EXTENSION::@1325 DiskData
PDEVICE_OBJECT LowerDevice
UNICODE_STRING DiskInterfaceName
struct _IO_STACK_LOCATION::@1575::@1576 DeviceIoControl
union _IO_STACK_LOCATION::@1575 Parameters
UNICODE_STRING VolumeInterfaceName
ULONG NumberOfDiskExtents
WCHAR VolumeManagerName[8]
#define FIELD_OFFSET(t, f)
#define RtlMoveMemory(Destination, Source, Length)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define STATUS_INFO_LENGTH_MISMATCH
struct _BASIC_VOLUME_UNIQUE_ID::@1324 Gpt
struct _BASIC_VOLUME_UNIQUE_ID::@1323 Mbr
_In_ PDEVICE_OBJECT DeviceObject