RE: How to export a read-only disk from a virtual storport

Take a look at sre\storage\class\disk\disk.c for the function
DiskIoctlIsWritable. That will show you how the system queries if the
disk is writable.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

-----Original Message-----
From: xxxxx@unidesk.com [mailto:xxxxx@unidesk.com]
Posted At: Wednesday, March 10, 2010 4:54 PM
Posted To: ntdev
Conversation: How to export a read-only disk from a virtual storport
miniport driver?
Subject: How to export a read-only disk from a virtual storport
miniport driver?

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?

__________ Information from ESET Smart Security, version of virus
signature database 4933 (20100310) __________

The message was checked by ESET Smart Security.

http://www.eset.com