[PARTMGR] Implement IOCTL_VOLUME_QUERY_VOLUME_NUMBER and IOCTL_VOLUME_IS_PARTITION #6911
+40
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Used by some 3rd-party software (see example link below). Also,
IOCTL_VOLUME_IS_PARTITION
is an easy way to know whether a\Device\HarddiskVolumeN
(or whatever other volume) device corresponds to one single disk partition.Proposed changes
Implement
IOCTL_VOLUME_QUERY_VOLUME_NUMBER
: See usage example in: https://github.com/dansdrivers/ndas4windows/blob/7241cebfa2a2076de546b8841c2ccda8ca599a8d/mayfield/branches/spr/src/umapps/ndassvc/service/drivematch.cpp#L627Stubplement
IOCTL_VOLUME_IS_PARTITION
: The only type of volume we support right now is disk partition so we just return success. A more robust algorithm would be to check whether the volume has only one single extent, that covers the whole partition on which it lies upon. If this is not the case, return STATUS_UNSUCCESSFUL instead.