I have a virtual storport miniport driver and am trying to use to export a read-only disk device on which is installed an NTFS partition. If this were a full disk device driver I could return STATUS_MEDIA_WRITE_PROTECTED from the IOCTL_DISK_IS_WRITABLE IOCTL, but this is only a miniport and therefore doesn’t handle this IOCTL directly.
I’ve tried setting the DeviceType to READ_ONLY_DIRECT_ACCESS_DEVICE instead of DIRECT_ACCESS_DEVICE in the INQUIRYDATA, but this make Windows think the device is a CDROM rather than a normal disk.
I’ve considered just failing write requests, but this seems a bit heavy handed – and then NTFS still wouldn’t know the device itself is read-only.
Is this possible?