Hello,

I would like to retrieve the PID and VID of a mass storage device from
its symbolic name.
Symbolic name comes from the IoRegisterPlugPlayNotification API
indicating the GUID of a disk interface.
I guess that there is som eway to find this, but I did not find one.
Thanks,
Roger

Re: Get PID/VID from symbolic name? by Eliyas

Eliyas
Tue Aug 28 09:02:58 CDT 2007

What are you? Are you an app or driver?

--
- This posting is provided "AS IS" with no warranties, and confers no
rights.

"Roger" <roger.maps@tiscali.fr> wrote in message
news:1188225187.750181.24780@22g2000hsm.googlegroups.com...
> Hello,
>
> I would like to retrieve the PID and VID of a mass storage device from
> its symbolic name.
> Symbolic name comes from the IoRegisterPlugPlayNotification API
> indicating the GUID of a disk interface.
> I guess that there is som eway to find this, but I did not find one.
> Thanks,
> Roger
>



Re: Get PID/VID from symbolic name? by Roger

Roger
Tue Aug 28 09:27:01 CDT 2007

On 28 ao=FBt, 16:02, "Eliyas Yakub [MSFT]"
<eliy...@online.discussion.microsoft.com> wrote:
> What are you? Are you an app or driver?
>
> --
> - This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Roger" <roger.m...@tiscali.fr> wrote in message
>
> news:1188225187.750181.24780@22g2000hsm.googlegroups.com...
>
> > Hello,
>
> > I would like to retrieve the PID and VID of a mass storage device from
> > its symbolic name.
> > Symbolic name comes from the IoRegisterPlugPlayNotification API
> > indicating the GUID of a disk interface.
> > I guess that there is som eway to find this, but I did not find one.
> > Thanks,
> > Roger

Hi Eliyas,

I am in a driver.


Re: Get PID/VID from symbolic name? by Eliyas

Eliyas
Tue Aug 28 10:57:16 CDT 2007

In kernel-mode, you will need a PDO to get the hardware-id information. Look
at the toastmon (src\general\toaster\toastmon) sample. This sample registers
for notification on an interface. When it gets notified, it opens the device
to get the fileobject, from the fileobject it gets the deviceobject, with
the deviceobject it sends a QDR-target-relations to get the PDO, and with
the PDO you can call IoGetDeviceProperty to get the hardware-id information.
There is a KMDF version of this sample. If you use remote I/O target to open
the device, it will do most of this work for you.

--
- This posting is provided "AS IS" with no warranties, and confers no
rights.



Re: Get PID/VID from symbolic name? by Doron

Doron
Tue Aug 28 11:41:19 CDT 2007

also, remember to ObDerefenceObject the PDO you get back from the QDR target
relations when you are done with it

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Eliyas Yakub [MSFT]" <eliyasy@online.discussion.microsoft.com> wrote in
message news:OjViUwY6HHA.3528@TK2MSFTNGP04.phx.gbl...
> In kernel-mode, you will need a PDO to get the hardware-id information.
> Look at the toastmon (src\general\toaster\toastmon) sample. This sample
> registers for notification on an interface. When it gets notified, it
> opens the device to get the fileobject, from the fileobject it gets the
> deviceobject, with the deviceobject it sends a QDR-target-relations to get
> the PDO, and with the PDO you can call IoGetDeviceProperty to get the
> hardware-id information. There is a KMDF version of this sample. If you
> use remote I/O target to open the device, it will do most of this work for
> you.
>
> --
> - This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>


Re: Get PID/VID from symbolic name? by Roger

Roger
Wed Aug 29 03:09:34 CDT 2007

On 28 ao=FBt, 18:41, "Doron Holan [MSFT]" <dor...@online.microsoft.com>
wrote:
> also, remember to ObDerefenceObject the PDO you get back from the QDR tar=
get
> relations when you are done with it
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no right=
s=2E
>
> "Eliyas Yakub [MSFT]" <eliy...@online.discussion.microsoft.com> wrote in
> messagenews:OjViUwY6HHA.3528@TK2MSFTNGP04.phx.gbl...
>
> > In kernel-mode, you will need a PDO to get the hardware-id information.
> > Look at the toastmon (src\general\toaster\toastmon) sample. This sample
> > registers for notification on an interface. When it gets notified, it
> > opens the device to get the fileobject, from the fileobject it gets the
> > deviceobject, with the deviceobject it sends a QDR-target-relations to =
get
> > the PDO, and with the PDO you can call IoGetDeviceProperty to get the
> > hardware-id information. There is a KMDF version of this sample. If you
> > use remote I/O target to open the device, it will do most of this work =
for
> > you.
>
> > --
> > - This posting is provided "AS IS" with no warranties, and confers no
> > rights.

Thanks you all! I will look at toaster sample, THE driver reference as
always...

Thanks,
Roger


Re: Get PID/VID from symbolic name? by Roger

Roger
Thu Aug 30 07:52:31 PDT 2007

On 29 ao=FBt, 10:09, Roger <roger.m...@tiscali.fr> wrote:
> On 28 ao=FBt, 18:41, "Doron Holan [MSFT]" <dor...@online.microsoft.com>
> wrote:
>
>
>
> > also, remember to ObDerefenceObject the PDO you get back from the QDR t=
arget
> > relations when you are done with it
>
> > d
>
> > --
> > Please do not send e-mail directly to this alias. this alias is for
> > newsgroup purposes only.
> > This posting is provided "AS IS" with no warranties, and confers no rig=
hts.
>
> > "Eliyas Yakub [MSFT]" <eliy...@online.discussion.microsoft.com> wrote in
> > messagenews:OjViUwY6HHA.3528@TK2MSFTNGP04.phx.gbl...
>
> > > In kernel-mode, you will need a PDO to get the hardware-id informatio=
n=2E
> > > Look at the toastmon (src\general\toaster\toastmon) sample. This samp=
le
> > > registers for notification on an interface. When it gets notified, it
> > > opens the device to get the fileobject, from the fileobject it gets t=
he
> > > deviceobject, with the deviceobject it sends a QDR-target-relations t=
o get
> > > the PDO, and with the PDO you can call IoGetDeviceProperty to get the
> > > hardware-id information. There is a KMDF version of this sample. If y=
ou
> > > use remote I/O target to open the device, it will do most of this wor=
k for
> > > you.
>
> > > --
> > > - This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
>
> Thanks you all! I will look at toaster sample, THE driver reference as
> always...
>
> Thanks,
> Roger
Well, it's not that simple...
What I would like is the PID and VID of the USB device. As
symbolicName refers to a CDROM unit, what I get from the PDO and
PropertyHardwareId is "USBSTOR\<something>".
And I want "USB\Vid_xxxx&Pid_yyyy".
I have to go deeper in the stack, like device manager, view by
connections does.
I tried to request again a pdo on the pdo returned, as expected it
returns the same pdo...
In DEVICE_RELATIONS structure, there is only one DEVICE_OBJECT
returned.

Any idea ?
Thanks,
Roger


Re: Get PID/VID from symbolic name? by Doron

Doron
Thu Aug 30 10:49:15 PDT 2007

there is no defined way to ask a PDO for its parent (by design).

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Roger" <roger.maps@tiscali.fr> wrote in message
news:1188485551.053888.288250@50g2000hsm.googlegroups.com...
On 29 août, 10:09, Roger <roger.m...@tiscali.fr> wrote:
> On 28 août, 18:41, "Doron Holan [MSFT]" <dor...@online.microsoft.com>
> wrote:
>
>
>
> > also, remember to ObDerefenceObject the PDO you get back from the QDR
> > target
> > relations when you are done with it
>
> > d
>
> > --
> > Please do not send e-mail directly to this alias. this alias is for
> > newsgroup purposes only.
> > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
>
> > "Eliyas Yakub [MSFT]" <eliy...@online.discussion.microsoft.com> wrote in
> > messagenews:OjViUwY6HHA.3528@TK2MSFTNGP04.phx.gbl...
>
> > > In kernel-mode, you will need a PDO to get the hardware-id
> > > information.
> > > Look at the toastmon (src\general\toaster\toastmon) sample. This
> > > sample
> > > registers for notification on an interface. When it gets notified, it
> > > opens the device to get the fileobject, from the fileobject it gets
> > > the
> > > deviceobject, with the deviceobject it sends a QDR-target-relations to
> > > get
> > > the PDO, and with the PDO you can call IoGetDeviceProperty to get the
> > > hardware-id information. There is a KMDF version of this sample. If
> > > you
> > > use remote I/O target to open the device, it will do most of this work
> > > for
> > > you.
>
> > > --
> > > - This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
>
> Thanks you all! I will look at toaster sample, THE driver reference as
> always...
>
> Thanks,
> Roger
Well, it's not that simple...
What I would like is the PID and VID of the USB device. As
symbolicName refers to a CDROM unit, what I get from the PDO and
PropertyHardwareId is "USBSTOR\<something>".
And I want "USB\Vid_xxxx&Pid_yyyy".
I have to go deeper in the stack, like device manager, view by
connections does.
I tried to request again a pdo on the pdo returned, as expected it
returns the same pdo...
In DEVICE_RELATIONS structure, there is only one DEVICE_OBJECT
returned.

Any idea ?
Thanks,
Roger


Re: Get PID/VID from symbolic name? by Roger

Roger
Fri Aug 31 00:57:56 PDT 2007

On 30 ao=FBt, 19:49, "Doron Holan [MSFT]" <dor...@online.microsoft.com>
wrote:
> there is no defined way to ask a PDO for its parent (by design).
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no right=
s=2E
>
> "Roger" <roger.m...@tiscali.fr> wrote in message
>
> news:1188485551.053888.288250@50g2000hsm.googlegroups.com...
> On 29 ao=FBt, 10:09, Roger <roger.m...@tiscali.fr> wrote:
>
> > On 28 ao=FBt, 18:41, "Doron Holan [MSFT]" <dor...@online.microsoft.com>
> > wrote:
>
> > > also, remember to ObDerefenceObject the PDO you get back from the QDR
> > > target
> > > relations when you are done with it
>
> > > d
>
> > > --
> > > Please do not send e-mail directly to this alias. this alias is for
> > > newsgroup purposes only.
> > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
>
> > > "Eliyas Yakub [MSFT]" <eliy...@online.discussion.microsoft.com> wrote=
in
> > > messagenews:OjViUwY6HHA.3528@TK2MSFTNGP04.phx.gbl...
>
> > > > In kernel-mode, you will need a PDO to get the hardware-id
> > > > information.
> > > > Look at the toastmon (src\general\toaster\toastmon) sample. This
> > > > sample
> > > > registers for notification on an interface. When it gets notified, =
it
> > > > opens the device to get the fileobject, from the fileobject it gets
> > > > the
> > > > deviceobject, with the deviceobject it sends a QDR-target-relations=
to
> > > > get
> > > > the PDO, and with the PDO you can call IoGetDeviceProperty to get t=
he
> > > > hardware-id information. There is a KMDF version of this sample. If
> > > > you
> > > > use remote I/O target to open the device, it will do most of this w=
ork
> > > > for
> > > > you.
>
> > > > --
> > > > - This posting is provided "AS IS" with no warranties, and confers =
no
> > > > rights.
>
> > Thanks you all! I will look at toaster sample, THE driver reference as
> > always...
>
> > Thanks,
> > Roger
>
> Well, it's not that simple...
> What I would like is the PID and VID of the USB device. As
> symbolicName refers to a CDROM unit, what I get from the PDO and
> PropertyHardwareId is "USBSTOR\<something>".
> And I want "USB\Vid_xxxx&Pid_yyyy".
> I have to go deeper in the stack, like device manager, view by
> connections does.
> I tried to request again a pdo on the pdo returned, as expected it
> returns the same pdo...
> In DEVICE_RELATIONS structure, there is only one DEVICE_OBJECT
> returned.
>
> Any idea ?
> Thanks,
> Roger

But then how does device manager can do that ? Is it possible that
some user mode application can access information a kernel mode module
cannot ?
May registry search be an alternative ?


Re: Get PID/VID from symbolic name? by Doron

Doron
Fri Aug 31 10:47:41 PDT 2007

device manager does it in reverse. it traverses the root nood and finds all
children. it can also find the parent devnode. these are available in the
CM_ apis. The parent lookup is not available in KM. Searching the registry
directly will not yield this information for you either.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Roger" <roger.maps@tiscali.fr> wrote in message
news:1188547076.574496.254450@l22g2000prc.googlegroups.com...
On 30 août, 19:49, "Doron Holan [MSFT]" <dor...@online.microsoft.com>
wrote:
> there is no defined way to ask a PDO for its parent (by design).
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Roger" <roger.m...@tiscali.fr> wrote in message
>
> news:1188485551.053888.288250@50g2000hsm.googlegroups.com...
> On 29 août, 10:09, Roger <roger.m...@tiscali.fr> wrote:
>
> > On 28 août, 18:41, "Doron Holan [MSFT]" <dor...@online.microsoft.com>
> > wrote:
>
> > > also, remember to ObDerefenceObject the PDO you get back from the QDR
> > > target
> > > relations when you are done with it
>
> > > d
>
> > > --
> > > Please do not send e-mail directly to this alias. this alias is for
> > > newsgroup purposes only.
> > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
>
> > > "Eliyas Yakub [MSFT]" <eliy...@online.discussion.microsoft.com> wrote
> > > in
> > > messagenews:OjViUwY6HHA.3528@TK2MSFTNGP04.phx.gbl...
>
> > > > In kernel-mode, you will need a PDO to get the hardware-id
> > > > information.
> > > > Look at the toastmon (src\general\toaster\toastmon) sample. This
> > > > sample
> > > > registers for notification on an interface. When it gets notified,
> > > > it
> > > > opens the device to get the fileobject, from the fileobject it gets
> > > > the
> > > > deviceobject, with the deviceobject it sends a QDR-target-relations
> > > > to
> > > > get
> > > > the PDO, and with the PDO you can call IoGetDeviceProperty to get
> > > > the
> > > > hardware-id information. There is a KMDF version of this sample. If
> > > > you
> > > > use remote I/O target to open the device, it will do most of this
> > > > work
> > > > for
> > > > you.
>
> > > > --
> > > > - This posting is provided "AS IS" with no warranties, and confers
> > > > no
> > > > rights.
>
> > Thanks you all! I will look at toaster sample, THE driver reference as
> > always...
>
> > Thanks,
> > Roger
>
> Well, it's not that simple...
> What I would like is the PID and VID of the USB device. As
> symbolicName refers to a CDROM unit, what I get from the PDO and
> PropertyHardwareId is "USBSTOR\<something>".
> And I want "USB\Vid_xxxx&Pid_yyyy".
> I have to go deeper in the stack, like device manager, view by
> connections does.
> I tried to request again a pdo on the pdo returned, as expected it
> returns the same pdo...
> In DEVICE_RELATIONS structure, there is only one DEVICE_OBJECT
> returned.
>
> Any idea ?
> Thanks,
> Roger

But then how does device manager can do that ? Is it possible that
some user mode application can access information a kernel mode module
cannot ?
May registry search be an alternative ?