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 ?