Re: disk type (Unsigned Mail)

Hallo,

if you just want to find out, if it is NOT IDE/SCSI, you can use
IOCTL_STORAGE_GET_HOTPLUG_INFO (XP),
else use IOCTL_STORAGE_QUERY_PROPERTY =>
PSTORAGE_ADAPTER_DESCRIPTOR->BusType.

(BTW I myself would like to know how I can find out if it’s a PCMCIA - they
always come as ATA?)

Regards
Else

“george”
To: “Windows System Software Devs Interest List”
Sent by: cc:
xxxxx@lis Subject: [ntdev] disk type (Unsigned Mail)
ts.osr.com

30.09.2003 05:16
Please respond to
“Windows System
Software Devs Interest
List”

hi!
could anyone tell me how to distinguish the usb harddisk type on filter
driver from normal harddisk?

thank u in advance!


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@utimaco.de
To unsubscribe send a blank email to xxxxx@lists.osr.com

Else Kluger,???ã?

I wanna know whether it is a remoble usb mass storge device or a harddisk.
I cannot distinguish it from a harddisk.

======= 2003-09-30 08:58:00 ???д???=======

Hallo,

if you just want to find out, if it is NOT IDE/SCSI, you can use
IOCTL_STORAGE_GET_HOTPLUG_INFO (XP),
else use IOCTL_STORAGE_QUERY_PROPERTY =>
PSTORAGE_ADAPTER_DESCRIPTOR->BusType.

(BTW I myself would like to know how I can find out if it’s a PCMCIA - they
always come as ATA?)

Regards
Else

“george”
To: “Windows System Software Devs Interest List”
> Sent by: cc:
> xxxxx@lis Subject: [ntdev] disk type (Unsigned Mail)
> ts.osr.com
>
>
> 30.09.2003 05:16
> Please respond to
> “Windows System
> Software Devs Interest
> List”
>
>
>
>
>
>
>hi!
> could anyone tell me how to distinguish the usb harddisk type on filter
>driver from normal harddisk?
>
>
> thank u in advance!
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@utimaco.de
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>.

= = = = = = = = = = = = = = = = = = = =

???
???

???george
???xxxxx@hotmail.com
???2003-09-30

Hi,

I can’t find out if it is hotswappable hard drives too.
It give me ATA too.
How to determine if it is a removable hard drive be it a PCMCIA hard drive,
USB hard drive or hotswappable hard drive (laptops) and fixed hard drive?

I would like to find out in file filter driver.
Is that possible?

thank you!

cheers,
vincent

From: “Else Kluger”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Re: disk type (Unsigned Mail)
>Date: Tue, 30 Sep 2003 08:58:09 +0200
>
>
>Hallo,
>
>if you just want to find out, if it is NOT IDE/SCSI, you can use
>IOCTL_STORAGE_GET_HOTPLUG_INFO (XP),
>else use IOCTL_STORAGE_QUERY_PROPERTY =>
>PSTORAGE_ADAPTER_DESCRIPTOR->BusType.
>
>(BTW I myself would like to know how I can find out if it’s a PCMCIA - they
>always come as ATA?)
>
>Regards
>Else
>
>
>
>
> “george”
> To: “Windows System
>Software Devs Interest List”
> Sent by: cc:
> xxxxx@lis Subject: [ntdev] disk
>type (Unsigned Mail)
> ts.osr.com
>
>
> 30.09.2003 05:16
> Please respond to
> “Windows System
> Software Devs Interest
> List”
>
>
>
>
>
>
>hi!
> could anyone tell me how to distinguish the usb harddisk type on filter
>driver from normal harddisk?
>
>
> thank u in advance!
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@utimaco.de
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_________________________________________________________________
Get MSN Hotmail alerts on your mobile. http://en-asiasms.mobile.msn.com/

IoGetDeviceProperty/DevicePropertyEnumeratorName.

It is “USBSTOR” for USB disks.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “vincent gambit”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, October 07, 2003 6:42 AM
Subject: [ntdev] Re: disk type (Unsigned Mail)

> Hi,
>
> I can’t find out if it is hotswappable hard drives too.
> It give me ATA too.
> How to determine if it is a removable hard drive be it a PCMCIA hard drive,
> USB hard drive or hotswappable hard drive (laptops) and fixed hard drive?
>
> I would like to find out in file filter driver.
> Is that possible?
>
> thank you!
>
> cheers,
> vincent
>
>
> >From: “Else Kluger”
> >Reply-To: “Windows System Software Devs Interest List”
> >
> >To: “Windows System Software Devs Interest List”
> >Subject: [ntdev] Re: disk type (Unsigned Mail)
> >Date: Tue, 30 Sep 2003 08:58:09 +0200
> >
> >
> >Hallo,
> >
> >if you just want to find out, if it is NOT IDE/SCSI, you can use
> >IOCTL_STORAGE_GET_HOTPLUG_INFO (XP),
> >else use IOCTL_STORAGE_QUERY_PROPERTY =>
> >PSTORAGE_ADAPTER_DESCRIPTOR->BusType.
> >
> >(BTW I myself would like to know how I can find out if it’s a PCMCIA - they
> >always come as ATA?)
> >
> >Regards
> >Else
> >
> >
> >
> >
> > “george”
> > To: “Windows System
> >Software Devs Interest List”
> > Sent by: cc:
> > xxxxx@lis Subject: [ntdev] disk
> >type (Unsigned Mail)
> > ts.osr.com
> >
> >
> > 30.09.2003 05:16
> > Please respond to
> > “Windows System
> > Software Devs Interest
> > List”
> >
> >
> >
> >
> >
> >
> >hi!
> > could anyone tell me how to distinguish the usb harddisk type on filter
> >driver from normal harddisk?
> >
> >
> > thank u in advance!
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at
> >http://www.osronline.com/article.cfm?id=256
> >
> >You are currently subscribed to ntdev as: xxxxx@utimaco.de
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at
> >http://www.osronline.com/article.cfm?id=256
> >
> >You are currently subscribed to ntdev as: xxxxx@hotmail.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> _________________________________________________________________
> Get MSN Hotmail alerts on your mobile. http://en-asiasms.mobile.msn.com/
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi,

How about PCMCIA disk and hotswappable disk?
They gave me IDE.
Which is the same as fixed IDE hard disks.

Is there other ways?

Thank You!

cheers,
vincent

From: “Maxim S. Shatskih”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Re: disk type (Unsigned Mail)
>Date: Wed, 8 Oct 2003 01:02:13 +0400
>
>IoGetDeviceProperty/DevicePropertyEnumeratorName.
>
>It is “USBSTOR” for USB disks.
>
>Maxim Shatskih, Windows DDK MVP
>StorageCraft Corporation
>xxxxx@storagecraft.com
>http://www.storagecraft.com
>
>
>----- Original Message -----
>From: “vincent gambit”
>To: “Windows System Software Devs Interest List”
>Sent: Tuesday, October 07, 2003 6:42 AM
>Subject: [ntdev] Re: disk type (Unsigned Mail)
>
>
> > Hi,
> >
> > I can’t find out if it is hotswappable hard drives too.
> > It give me ATA too.
> > How to determine if it is a removable hard drive be it a PCMCIA hard
>drive,
> > USB hard drive or hotswappable hard drive (laptops) and fixed hard
>drive?
> >
> > I would like to find out in file filter driver.
> > Is that possible?
> >
> > thank you!
> >
> > cheers,
> > vincent
> >
> >
> > >From: “Else Kluger”
> > >Reply-To: “Windows System Software Devs Interest List”
> > >
> > >To: “Windows System Software Devs Interest List”
> > >Subject: [ntdev] Re: disk type (Unsigned Mail)
> > >Date: Tue, 30 Sep 2003 08:58:09 +0200
> > >
> > >
> > >Hallo,
> > >
> > >if you just want to find out, if it is NOT IDE/SCSI, you can use
> > >IOCTL_STORAGE_GET_HOTPLUG_INFO (XP),
> > >else use IOCTL_STORAGE_QUERY_PROPERTY =>
> > >PSTORAGE_ADAPTER_DESCRIPTOR->BusType.
> > >
> > >(BTW I myself would like to know how I can find out if it’s a PCMCIA -
>they
> > >always come as ATA?)
> > >
> > >Regards
> > >Else
> > >
> > >
> > >
> > >
> > > “george”
> > > To: “Windows
>System
> > >Software Devs Interest List”
> > > Sent by: cc:
> > > xxxxx@lis Subject: [ntdev]
>disk
> > >type (Unsigned Mail)
> > > ts.osr.com
> > >
> > >
> > > 30.09.2003 05:16
> > > Please respond to
> > > “Windows System
> > > Software Devs Interest
> > > List”
> > >
> > >
> > >
> > >
> > >
> > >
> > >hi!
> > > could anyone tell me how to distinguish the usb harddisk type on
>filter
> > >driver from normal harddisk?
> > >
> > >
> > > thank u in advance!
> > >
> > >
> > >—
> > >Questions? First check the Kernel Driver FAQ at
> > >http://www.osronline.com/article.cfm?id=256
> > >
> > >You are currently subscribed to ntdev as: xxxxx@utimaco.de
> > >To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> > >
> > >
> > >
> > >—
> > >Questions? First check the Kernel Driver FAQ at
> > >http://www.osronline.com/article.cfm?id=256
> > >
> > >You are currently subscribed to ntdev as: xxxxx@hotmail.com
> > >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> > Get MSN Hotmail alerts on your mobile. http://en-asiasms.mobile.msn.com/
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


Get MSN Hotmail alerts on your mobile. http://en-asiasms.mobile.msn.com/

Try IoGetDeviceProperty/DevicePropertyBusTypeGuid also to distinguish IDE and
non-IDE.

Note that this query fails for USBSTOR. To detect USBSTOR, use the query for
enumerator name.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “vincent gambit”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, October 08, 2003 5:31 AM
Subject: [ntdev] Re: disk type (Unsigned Mail)

> Hi,
>
> How about PCMCIA disk and hotswappable disk?
> They gave me IDE.
> Which is the same as fixed IDE hard disks.
>
> Is there other ways?
>
> Thank You!
>
> cheers,
> vincent
>
>
> >From: “Maxim S. Shatskih”
> >Reply-To: “Windows System Software Devs Interest List”
> >
> >To: “Windows System Software Devs Interest List”
> >Subject: [ntdev] Re: disk type (Unsigned Mail)
> >Date: Wed, 8 Oct 2003 01:02:13 +0400
> >
> >IoGetDeviceProperty/DevicePropertyEnumeratorName.
> >
> >It is “USBSTOR” for USB disks.
> >
> >Maxim Shatskih, Windows DDK MVP
> >StorageCraft Corporation
> >xxxxx@storagecraft.com
> >http://www.storagecraft.com
> >
> >
> >----- Original Message -----
> >From: “vincent gambit”
> >To: “Windows System Software Devs Interest List”
> >Sent: Tuesday, October 07, 2003 6:42 AM
> >Subject: [ntdev] Re: disk type (Unsigned Mail)
> >
> >
> > > Hi,
> > >
> > > I can’t find out if it is hotswappable hard drives too.
> > > It give me ATA too.
> > > How to determine if it is a removable hard drive be it a PCMCIA hard
> >drive,
> > > USB hard drive or hotswappable hard drive (laptops) and fixed hard
> >drive?
> > >
> > > I would like to find out in file filter driver.
> > > Is that possible?
> > >
> > > thank you!
> > >
> > > cheers,
> > > vincent
> > >
> > >
> > > >From: “Else Kluger”
> > > >Reply-To: “Windows System Software Devs Interest List”
> > > >
> > > >To: “Windows System Software Devs Interest List”
> > > >Subject: [ntdev] Re: disk type (Unsigned Mail)
> > > >Date: Tue, 30 Sep 2003 08:58:09 +0200
> > > >
> > > >
> > > >Hallo,
> > > >
> > > >if you just want to find out, if it is NOT IDE/SCSI, you can use
> > > >IOCTL_STORAGE_GET_HOTPLUG_INFO (XP),
> > > >else use IOCTL_STORAGE_QUERY_PROPERTY =>
> > > >PSTORAGE_ADAPTER_DESCRIPTOR->BusType.
> > > >
> > > >(BTW I myself would like to know how I can find out if it’s a PCMCIA -
> >they
> > > >always come as ATA?)
> > > >
> > > >Regards
> > > >Else
> > > >
> > > >
> > > >
> > > >
> > > > “george”
> > > > To: “Windows
> >System
> > > >Software Devs Interest List”
> > > > Sent by: cc:
> > > > xxxxx@lis Subject: [ntdev]
> >disk
> > > >type (Unsigned Mail)
> > > > ts.osr.com
> > > >
> > > >
> > > > 30.09.2003 05:16
> > > > Please respond to
> > > > “Windows System
> > > > Software Devs Interest
> > > > List”
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >hi!
> > > > could anyone tell me how to distinguish the usb harddisk type on
> >filter
> > > >driver from normal harddisk?
> > > >
> > > >
> > > > thank u in advance!
> > > >
> > > >
> > > >—
> > > >Questions? First check the Kernel Driver FAQ at
> > > >http://www.osronline.com/article.cfm?id=256
> > > >
> > > >You are currently subscribed to ntdev as: xxxxx@utimaco.de
> > > >To unsubscribe send a blank email to xxxxx@lists.osr.com
> > > >
> > > >
> > > >
> > > >
> > > >—
> > > >Questions? First check the Kernel Driver FAQ at
> > > >http://www.osronline.com/article.cfm?id=256
> > > >
> > > >You are currently subscribed to ntdev as: xxxxx@hotmail.com
> > > >To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> > >
> > > Get MSN Hotmail alerts on your mobile. http://en-asiasms.mobile.msn.com/
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> >http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at
> >http://www.osronline.com/article.cfm?id=256
> >
> >You are currently subscribed to ntdev as: xxxxx@hotmail.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>

> Get MSN Hotmail alerts on your mobile. http://en-asiasms.mobile.msn.com/
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi,

Do you mean I check for GUID_BUS_TYPE_PCMCIA for PCMCIA hard drives?
How about hotswappable hard drives?

I tried it.
But I didn’t get any valid GUID that is defined in wdmguid.h

What deviceobject should i use to query?
vpb->realdevice?
vpb->deviceobject?
or irp->parameters.mountvolume.deviceobject?
can i called it in mountcompletion routine in a file filter driver?

and does iogetdeviceproperty works in win 2k?

thank you!

cheers,
vincent

From: “Maxim S. Shatskih”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Re: disk type (Unsigned Mail)
>Date: Wed, 8 Oct 2003 16:17:15 +0400
>
>Try IoGetDeviceProperty/DevicePropertyBusTypeGuid also to distinguish IDE
>and
>non-IDE.
>
>Note that this query fails for USBSTOR. To detect USBSTOR, use the query
>for
>enumerator name.
>
>Maxim Shatskih, Windows DDK MVP
>StorageCraft Corporation
>xxxxx@storagecraft.com
>http://www.storagecraft.com
>
>----- Original Message -----
>From: “vincent gambit”
>To: “Windows System Software Devs Interest List”
>Sent: Wednesday, October 08, 2003 5:31 AM
>Subject: [ntdev] Re: disk type (Unsigned Mail)
>
>
> > Hi,
> >
> > How about PCMCIA disk and hotswappable disk?
> > They gave me IDE.
> > Which is the same as fixed IDE hard disks.
> >
> > Is there other ways?
> >
> > Thank You!
> >
> > cheers,
> > vincent
> >
> >
> > >From: “Maxim S. Shatskih”
> > >Reply-To: “Windows System Software Devs Interest List”
> > >
> > >To: “Windows System Software Devs Interest List”
> > >Subject: [ntdev] Re: disk type (Unsigned Mail)
> > >Date: Wed, 8 Oct 2003 01:02:13 +0400
> > >
> > >IoGetDeviceProperty/DevicePropertyEnumeratorName.
> > >
> > >It is “USBSTOR” for USB disks.
> > >
> > >Maxim Shatskih, Windows DDK MVP
> > >StorageCraft Corporation
> > >xxxxx@storagecraft.com
> > >http://www.storagecraft.com
> > >
> > >
> > >----- Original Message -----
> > >From: “vincent gambit”
> > >To: “Windows System Software Devs Interest List”
> > >Sent: Tuesday, October 07, 2003 6:42 AM
> > >Subject: [ntdev] Re: disk type (Unsigned Mail)
> > >
> > >
> > > > Hi,
> > > >
> > > > I can’t find out if it is hotswappable hard drives too.
> > > > It give me ATA too.
> > > > How to determine if it is a removable hard drive be it a PCMCIA hard
> > >drive,
> > > > USB hard drive or hotswappable hard drive (laptops) and fixed hard
> > >drive?
> > > >
> > > > I would like to find out in file filter driver.
> > > > Is that possible?
> > > >
> > > > thank you!
> > > >
> > > > cheers,
> > > > vincent
> > > >
> > > >
> > > > >From: “Else Kluger”
> > > > >Reply-To: “Windows System Software Devs Interest List”
> > > > >
> > > > >To: “Windows System Software Devs Interest List”
>
> > > > >Subject: [ntdev] Re: disk type (Unsigned Mail)
> > > > >Date: Tue, 30 Sep 2003 08:58:09 +0200
> > > > >
> > > > >
> > > > >Hallo,
> > > > >
> > > > >if you just want to find out, if it is NOT IDE/SCSI, you can use
> > > > >IOCTL_STORAGE_GET_HOTPLUG_INFO (XP),
> > > > >else use IOCTL_STORAGE_QUERY_PROPERTY =>
> > > > >PSTORAGE_ADAPTER_DESCRIPTOR->BusType.
> > > > >
> > > > >(BTW I myself would like to know how I can find out if it’s a
>PCMCIA -
> > >they
> > > > >always come as ATA?)
> > > > >
> > > > >Regards
> > > > >Else
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > “george”
> > > > > To: “Windows
> > >System
> > > > >Software Devs Interest List”
> > > > > Sent by: cc:
> > > > > xxxxx@lis Subject:
>[ntdev]
> > >disk
> > > > >type (Unsigned Mail)
> > > > > ts.osr.com
> > > > >
> > > > >
> > > > > 30.09.2003 05:16
> > > > > Please respond to
> > > > > “Windows System
> > > > > Software Devs Interest
> > > > > List”
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >hi!
> > > > > could anyone tell me how to distinguish the usb harddisk type on
> > >filter
> > > > >driver from normal harddisk?
> > > > >
> > > > >
> > > > > thank u in advance!
> > > > >
> > > > >
> > > > >—
> > > > >Questions? First check the Kernel Driver FAQ at
> > > > >http://www.osronline.com/article.cfm?id=256
> > > > >
> > > > >You are currently subscribed to ntdev as: xxxxx@utimaco.de
> > > > >To unsubscribe send a blank email to
>xxxxx@lists.osr.com
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >—
> > > > >Questions? First check the Kernel Driver FAQ at
> > > > >http://www.osronline.com/article.cfm?id=256
> > > > >
> > > > >You are currently subscribed to ntdev as: xxxxx@hotmail.com
> > > > >To unsubscribe send a blank email to
>xxxxx@lists.osr.com
> > > >
> > > >
> > > > Get MSN Hotmail alerts on your mobile.
>http://en-asiasms.mobile.msn.com/
> > > >
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > >http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > > > To unsubscribe send a blank email to
>xxxxx@lists.osr.com
> > >
> > >
> > >—
> > >Questions? First check the Kernel Driver FAQ at
> > >http://www.osronline.com/article.cfm?id=256
> > >
> > >You are currently subscribed to ntdev as: xxxxx@hotmail.com
> > >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >

> > Get MSN Hotmail alerts on your mobile. http://en-asiasms.mobile.msn.com/
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_________________________________________________________________
Find it on the web with MSN Search. http://search.msn.com.sg/

> What deviceobject should i use to query?

vpb->realdevice?

Send MN_QUERY_RELATIONS/TargetDeviceRelation to Vpb->RealDevice and then
IoGetDeviceProperty to this returned PDO.

and does iogetdeviceproperty works in win 2k?

Surely.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Hi,

how about the fileobject?
i should use current fileobject?

thank you!

cheers,
vincent

From: “Maxim S. Shatskih”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Re: disk type (Unsigned Mail)
>Date: Thu, 9 Oct 2003 06:41:59 +0400
>
> > What deviceobject should i use to query?
> > vpb->realdevice?
>
>Send MN_QUERY_RELATIONS/TargetDeviceRelation to Vpb->RealDevice and then
>IoGetDeviceProperty to this returned PDO.
>
> > and does iogetdeviceproperty works in win 2k?
>
>Surely.
>
>Maxim Shatskih, Windows DDK MVP
>StorageCraft Corporation
>xxxxx@storagecraft.com
>http://www.storagecraft.com
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_________________________________________________________________
Get 10mb of inbox space with MSN Hotmail Extra Storage
http://join.msn.com/?pgmarket=en-sg

Hi,

Thanks for your reply.
I have tried it.
I not sure whether I got the Physical DeviceObject successfully because the
IoGetDeviceProperty failed for DevicePropertyBusTypeGuid!!!
However it was successful for DevicePropertyDeviceDescription and
DevicePropertyEnumeratorName
First one return me Generic Volume
2nd one Storage
So I guess I did it wronly?
I issue the IRP and call IoGetDeviceObject in MountCompletion routine in
sfilter driver
Hope you can help

thank you very much.

Below is a cut of my code:

BOOLEAN
sfQueryRelations(
PDEVICE_OBJECT pDeviceObject,
PFILE_OBJECT pFileObject,
PVOID *pPhysicalDeviceObject
)
{
PIRP pIrp;
KEVENT event;
IO_STATUS_BLOCK IoStatusBlock;
PIO_STACK_LOCATION pIoStackLocation;
PDEVICE_RELATIONS pDevice_Relations;
PDEVICE_OBJECT pDevObj;

// Initialize the event
KeInitializeEvent (&event, SynchronizationEvent, FALSE);

// Allocate an irp for this request. This could also come from a
// private pool, for instance.
pIrp = IoAllocateIrp (pDeviceObject->StackSize, FALSE);
if(!pIrp)
{
// Failure!
KdPrint((“[sfQueryRelations] IoAllocateIrp Failed…\n”));
return FALSE;
}

// Build the IRP’s main body
pIrp->UserEvent = &event;
pIrp->UserIosb = &IoStatusBlock;
pIrp->Tail.Overlay.Thread = PsGetCurrentThread();
pIrp->RequestorMode = KernelMode;
pIrp->Flags = 0;

// Set up the I/O stack location.
pIoStackLocation = IoGetNextIrpStackLocation (pIrp);
pIoStackLocation->MajorFunction = IRP_MJ_PNP;
pIoStackLocation->MinorFunction = IRP_MN_QUERY_DEVICE_RELATIONS;
pIoStackLocation->DeviceObject = pDeviceObject;
pIoStackLocation->FileObject = pFileObject;
pIoStackLocation->Parameters.QueryDeviceRelations.Type =
TargetDeviceRelation;
IoStatusBlock.Status = STATUS_NOT_SUPPORTED;

// Set the completion routine.
IoSetCompletionRoutine (pIrp, sfQueryRelationsComplete, 0, TRUE, TRUE,
TRUE);

// Send it to the FSD
(void) IoCallDriver (pDeviceObject, pIrp);

// Wait for the I/O
KeWaitForSingleObject (&event, Executive, KernelMode, TRUE, 0);

pDevice_Relations = (PDEVICE_RELATIONS )IoStatusBlock.Information;
KdPrint ((“count %d\n”, pDevice_Relations->Count));
pDevObj = (PDEVICE_OBJECT)pDevice_Relations->Objects[0];
KdPrint ((“pDevjObj devtype: %x flags %x\n”, pDevObj->DeviceType,
pDevObj->Flags));
(PDEVICE_OBJECT) *pPhysicalDeviceObject =
(PDEVICE_OBJECT)pDevice_Relations->Objects[0];

// Done! Note that since our completion routine frees the IRP we cannot
// touch the IRP now.
return NT_SUCCESS (IoStatusBlock.Status);
}

NTSTATUS
sfQueryRelationsComplete(
PDEVICE_OBJECT pDeviceObject,
PIRP pIrp,
PVOID pContext)
{
// Copy the status information back into the “user” IOSB.
*pIrp->UserIosb = pIrp->IoStatus;
if( !NT_SUCCESS(pIrp->IoStatus.Status) )
KdPrint((“ERROR ON IRP!!!: %x\n”, pIrp->IoStatus.Status ));

// Set the user event - wakes up the mainline code doing this.
KeSetEvent(pIrp->UserEvent, 0, FALSE);

// Free the IRP now that we are done with it.
IoFreeIrp(pIrp);

// We return STATUS_MORE_PROCESSING_REQUIRED because this “magic” return
value
// tells the I/O Manager that additional processing will be done by this
driver
// to the IRP - in fact, it might (as it is in this case) already BE
done - and
// the IRP cannot be completed.
return STATUS_MORE_PROCESSING_REQUIRED;
}

In sfMountCompletion routine

if (NT_SUCCESS (sfQueryRelations (RealDeviceObject, pIrpSp->FileObject,
&PhyDevObj)))
{
KdPrint ((“Success! DevType %x Flags %x\n”, PhyDevObj->DeviceType,
PhyDevObj->Flags));
}

regprop = DevicePropertyBusTypeGuid;
ntstatus = IoGetDeviceProperty (PhyDevObj, regprop, sizeof(guid), &guid,
&ulSize);

if (NT_SUCCESS (ntstatus))
{
KdPrint ((“Guid : data 4: %x data 1: %x\n”, guid.Data4, guid.Data1));
}
else
{
KdPrint ((“IoGetDeviceProperty failed\n”));
if (ntstatus == STATUS_BUFFER_TOO_SMALL)
KdPrint ((“STATUS_BUFFER_TOO_SMALL\n”));
else if (ntstatus == STATUS_INVALID_PARAMETER_2)
KdPrint ((“STATUS_INVALID_PARAMETER_2\n”));
else if (ntstatus == STATUS_INVALID_DEVICE_REQUEST)
KdPrint ((“STATUS_INVALID_DEVICE_REQUEST\n”));
}

From: “Maxim S. Shatskih”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Re: disk type (Unsigned Mail)
>Date: Thu, 9 Oct 2003 06:41:59 +0400
>
> > What deviceobject should i use to query?
> > vpb->realdevice?
>
>Send MN_QUERY_RELATIONS/TargetDeviceRelation to Vpb->RealDevice and then
>IoGetDeviceProperty to this returned PDO.
>
> > and does iogetdeviceproperty works in win 2k?
>
>Surely.
>
>Maxim Shatskih, Windows DDK MVP
>StorageCraft Corporation
>xxxxx@storagecraft.com
>http://www.storagecraft.com
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_________________________________________________________________
Find love on MSN Personals http://personals.msn.com.sg/