“and the system did not become unstable”
try writing some data to the disk and then hitting the eject button. You’re pretty much guaranteed to corrupt the media by doing this since the file systems will believe the disk is fixed and will aggressively cache data.
-p
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Michael Kong
Sent: Tuesday, May 11, 2004 4:55 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Can I filter IOCTL_STORAGE_QUERY_PROPERTY below disk.sys?
Dear Maxim,
First of all, thank you for your reply.
I have tried to change Media’s Characteristics, and then I alter the disk.sys to my version. It worked.
The code like this:
NTSTATUS
ClassPnpStartDevice(
IN PDEVICE_OBJECT DeviceObject
)
{
…
/////////////////////////////////////
// Get Media’s Descriptor
status = ClassGetDescriptor(
commonExtension->LowerDeviceObject,
&propertyId,
&fdoExtension->DeviceDescriptor);
// Added by Michael Kong 2004.5.4
// Remove the Removable property of the Device, so system
// can treat it as fixed
if (fdoExtension->DeviceDescriptor->RemovableMedia)
{
fdoExtension->DeviceDescriptor->RemovableMedia = FALSE;
}
// End Adding
…
}
After I removed the property, disk treated it as fixed disk. I could use all of the partitions on Media. And system did not become unstable.
It is a bad way to change class drive or the ClassPnp lib. So I want to add a filter to filter IOCTL_STORAGE_QUERY_PROPERTY, which was used to get media property.
My problem is, I don’t know where to add filter.
Impossible.
Look at Disk/ClassPnP sources - the limit of 1 partition on the removable media is hard-coded.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
I want to mount Removable Media’s sencond partition in Windows 2000.
I just found a post at Microsoft Newsgroup kernal, which said there is a way to add a filter driver below disk, and filter IOCTL_STORAGE_QUERY_PROPERTY. Then I learned from source codes of disk.sys and ClassPnp illustrated by Windows 2000 DDK. And I found that, FDO created by disk.sys use ClassGetDescriptor function to get Media’s characteristics. It generates a new irp according to IoControlCode, then uses IoCallDriver to call portdriver.
I was wondering that, if I add filter driver just below disk, does it work?
Should I add filter driver to usbstor as upper filter ?
I’m really new at this field, please don’t mind.
Thanks in advance
Michael
B栋瞴叜zA?y龎q韬{.n?壏瑉wZnV闅奫h曟痾{]z8卟%娝l⑹