Re: finding the parent of a device

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Doron Holan [MS] (doronh_at_nospam.microsoft.com)
Date: 06/23/04


Date: Wed, 23 Jun 2004 00:46:24 -0700

you should never *ever* *ever* (did i say ever? i mean it!) send a query
device relations / BusRelations to the driver in question. this irp is
strictly for the pnp subsystem to send.

why?

because if there is a state change based on the relations reported (a new
PDO or the removal of one), you cannot enact that change. You cannot create
a new stack nor invoke a surprise removal on the removed PDO. State get's
lost, the driver who reported the change in its relations gets put into a
weird state and things go south really quickly.

what you want is to ask the DO in question who its enumerator is,
IoGetDeviceProperty(..., DevicePropertyEnumeratorName, ..) will return a
strig of the enumerator. So for a usb device it would be L"USB", for a
parallel device probably L"LPT".

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.
"shahar" <shahar@discussions.microsoft.com> wrote in message
news:4B8B0986-1DA0-4CFB-9AFB-B9DF98046642@microsoft.com...
> When I want to know who are the children of a device I can send an
IRP_MN_QUERY_DEVICE_RELATIONS request to it with "type = BusRelations", but
how to I make the reversed operation ?
> Let's say I have a printer DO, how can I know if it is connected to a
parallel port or to a USB hub ?


Relevant Pages

  • Re: Behaviour of USB Device in low powered state
    ... Please do not send e-mail directly to this alias. ... similarly i want the system wake when the device is disconnected too. ... notification to my driver when a USB device gets disconnected. ...
    (microsoft.public.development.device.drivers)
  • Re: Behaviour of USB Device in low powered state
    ... Please do not send e-mail directly to this alias. ... notification to my driver when a USB device gets disconnected. ... some reason then the user need to be intimated and hence i need to wake ...
    (microsoft.public.development.device.drivers)
  • Re: Behaviour of USB Device in low powered state
    ... similarly i want the system wake when the device is disconnected too. ... Please do not send e-mail directly to this alias. ... notification to my driver when a USB device gets disconnected. ...
    (microsoft.public.development.device.drivers)
  • Re: Behaviour of USB Device in low powered state
    ... notification to my driver when a USB device gets disconnected. ... Please do not send e-mail directly to this alias. ...
    (microsoft.public.development.device.drivers)
  • Re: USB not detected - help
    ... If I connect the device after the OS is loaded, "Unidentified USB device" ... I copied the dll after installing the CAB file from the CE device. ... debugzones in your usb host driver, you should see some information about ... Check for other registry keys besides the one I mentioned. ...
    (microsoft.public.windowsce.platbuilder)