reactos/drivers/storage
Hermès Bélusca-Maïto 9e07d0cc74
[PARTMGR] Trigger mount points removal when a partition/volume is deleted (#7034)
CORE-18139

When a partition is created, PartMgr notifies the volume manager
(FTDisk on Windows <= 2003, VolMgr on Vista+) of its presence.
(Note that currently in ReactOS, our partmgr does the job of both
PartMgr *AND* VolMgr.)
The VolMgr then sends a `GUID_DEVINTERFACE_VOLUME` PnP notification,
which is handled by the mount manager (MountMgr) as part of a
`GUID_DEVICE_INTERFACE_ARRIVAL` notification:
```
MountMgr!MountMgrMountedDeviceNotification -> MountMgrMountedDeviceArrival
followed by
MountMgr!MountMgrTargetDeviceNotification
```

When a partition is deleted, via e.g. Disk Management or DiskPart,
it can be observed, on Windows, that the PartMgr gets notified by
the PnP manager, as part of QueryDeviceRelations. Before actually
removing the partition, it notifies the VolMgr. The latter invalidates
any volume mounted on that partition (`*PartitionRemoved*` functions
for basic volumes), then requests (`*DeleteMountPoints` function)
the MountMgr to delete all the mount points associated to the volume:
```
VolMgr!*DeleteMountPoints
-> MountMgr!MountMgrDeviceControl -> MountMgrDeletePoints
```
**** THIS is the new functionality that is implemented for ReactOS ****
**** in the present commit.                                        ****

Following this, a subsequent PnP notification is sent, which calls
```
MountMgr!MountMgrTargetDeviceNotification
-> MountMgr!MountMgrMountedDeviceRemoval
```
(Note that this observation somewhat invalidates the modification
made in ReactOS commit 62a4f9d42b : our MountMgr placed in Windows
*WOULD* receive a `GUID_TARGET_DEVICE_REMOVE_COMPLETE` target-device
notification...)

Finally, a `GUID_DEVICE_INTERFACE_REMOVAL` PnP notification is sent
to the MountMgr:
```
MountMgr!MountMgrMountedDeviceNotification
-> MountMgr!MountMgrMountedDeviceRemoval
```
2024-07-11 13:46:52 +02:00
..
class [INF] Set manufacturer as ReactOS Project for consistency 2022-06-27 17:00:18 +03:00
floppy [FLOPPY] "zero" parameters in IoQueryDeviceDescription() call are NULL pointers. 2023-06-14 11:24:47 +02:00
ide [PCIIDEX] Improve and fix the driver 2023-07-16 13:20:30 +03:00
mountmgr [MOUNTMGR] Fix initial sending of device online notification (#7030) 2024-06-25 22:51:08 +02:00
partmgr [PARTMGR] Trigger mount points removal when a partition/volume is deleted (#7034) 2024-07-11 13:46:52 +02:00
port [DRIVERS][INF] Update Romanian (ro-RO) translation (#6088) 2023-12-09 20:19:54 +01:00
CMakeLists.txt [PARTMGR] Add the Partition Manager driver 2020-11-13 03:04:15 +03:00