Hi all.
I am trying to create a driver for a non-standard floppy disk controller.
THe hardware part works fine, my problem ist mounting it.
I have created a Device driver for a drive on the controller, which is
supposed to make sure, that the mount manager sets up the connection. I can
get the mount manager to set up the links and logically enable the volume,
but the drive cannot be accessed.
What works is this:
- The Device Interface is registered as a ‘mountable’ device.
- The mount manager queries the drivers name and ID of the device.
- the mount manager creates two links and notifies my driver.
(“??\Volume{3c303…” and “\DosDevices\B:”) - mount manager sends IOCTL_VOLUME_ONLINE. Looks good until here.
- Now, there is one more call to IOCTL_MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY,
which my driver fails. (I beleive it must not answer this)
When the system boots, I get a drive in the explorer with a bogus name of 3
unreadable characters. When trying to look into it, Explorer says ‘invalid
function’. Opening the properties dialog of the drive, I get a drive with 0
bytes size. But the system never asked for drive geometry or even, if there
is a disk in the drive.
After the VOLUME_ONLINE Irp, the device gets a whole lot of queries for its
device name and is opened approx. 20 times. Some of accesses, it receives a
IRP_MJ_QUERY_VOLUME_INFORMATION, IRP_MJ_QUERY_INFORMATION and
IRP_MJ_LOCK_CONTROL Irps. According to the docs I have, I don’t need to
answer these as Volume_information is for higher level drivers and
QUERY_INFORMATION is for serial/parallel port drivers.
After this, no more queries reach my drive. I can, however, open my drive
from a user-mode program using CreateFile(‘\.\B:’,…). GetGeometry, read,
write, all works fine.
When trying to format drive B: from the explorer, the driver receives
queries for Disk geometry and partitioning. Nothing more. The driver replies
to the disk Geo request and fails the partitioning Irps (according to
DDK,floppy drivers need not care about Partitioning Irp.)
In the Explorer, no window pops up for formatting…
I compared the behavior to the original floppy drive and found some
differences:
- The original driver does not get the VOLUME_INFORMATION of
QUERY_INFORMATION Irps. But, it gets a IRP_MJ_DIRECTORY_CONTROL Irp, which
it fails. Furthermore, it responds to QUERY_DEVICE_RELATIONS by reporting a
subordinate device. I checked the ID of that and found it has
‘FDC\GENERIC_FLOPPY_DRIVE’, the same ID as the floppy drive FDO my filter is
sitting on top of! (flpydisk.sys) But the device type is diffrent. It’s
FILE_DEVICE_DISK and not FILE_DEVICE_MASS_STORAGE. I tries to create one
myself using that ID, but the system won’t load a driver on it. Thie
subordinate device is reported AFTER the IOCTL_VOLUME_ONLINE Irp is
received.
The original device receives CHECK_VERIFY Irps to check for disk-in-drive
during the boot process. Mine does not.
Can anyone help me and tell me what I need to do to get the drive cleanly
mapped into the system? It is supposed to support disk change, disks of
diffrent size and drive geometry and diffrent file systems. The disks do not
contain partitions or MBRs.
(And, can someone hint me on a good book about storage drivers? I have the
DDK and Walter Oney’s book on WDM drivers.)
Thank you.
Achim.