I am writing a volume upper filter where separate logic has to be put for
internal hard disk volumes and removable device volumes.
I have tried two ways
IoGetDeviceProperty
I call this function in AddDevice of the driver to retrieve
DevicePropertyBusTypeGuid, but I always get error
STATUS_OBJECT_NAME_NOT_FOUND. The device object passed to the function is
the physical device object received in AddDevice
IOCTL_STORAGE_QUERY_PROPERTY
I send this device IO control request in driver’s start device
completion routine.The device object used to send IOCTL is the one returned
by IoAttachDeviceToDeviceStack while attaching the volume device to stack.
In this case I am getting error STATUS_NO_SUCH_DEVICE
I don’t understand where I am going wrong. Can you please help me to find
correct way?
for a removable device you can always check DevObj->Characteristics &
FILE_REMOVABLE_MEDIA in your AddDeviceRoutine.
If your definition of “external” storage device includes hot pluggable hard
disks (like USB disks), you can help
yourself with IOCTL_STORAGE_GET_HOTPLUG_INFO (starting with XP).
IOCTL_STORAGE_QUERY_PROPERTY is another option to find out about the bus
type.
(I’m sending this to the physical DiskObject, not sure about the
VolumeObject.)
I am writing a volume upper filter where separate logic has to be put for internal hard disk volumes and removable device volumes.
I have tried two ways 1. IoGetDeviceProperty I call this function in AddDevice of the driver to retrieve DevicePropertyBusTypeGuid, but I always get error STATUS_OBJECT_NAME_NOT_FOUND. The device object passed to the function is the physical device object received in AddDevice
2. IOCTL_STORAGE_QUERY_PROPERTY
I send this device IO control request in driver’s start device completion routine.The device object used to send IOCTL is the one returned by IoAttachDeviceToDeviceStack while attaching the volume device to stack. In this case I am getting error STATUS_NO_SUCH_DEVICE
I don’t understand where I am going wrong. Can you please help me to find correct way?
Hi
Else thanks for your reply. Its not working in my case may be because I am using VolumeObject. Is there any way to get physical DiskObject using Volume object?
The problem is I am always getting STATUS_NO_SUCH_DEVICE when I am passing IOCTL_STORAGE_xxx to volume object. I am not sure why this error is happening. The reason may be volume object doesn’t support the IRP and returing the error without passing it lower device objects.