Re: finding the parent of a device
From: Doron Holan [MS] (doronh_at_nospam.microsoft.com)
Date: 06/23/04
- Next message: tiyayin: "Re: USB 2.0 Streaming Webcam Problems"
- Previous message: shahar: "a device object's type"
- In reply to: shahar: "finding the parent of a device"
- Next in thread: shahar: "Re: finding the parent of a device"
- Reply: shahar: "Re: finding the parent of a device"
- Messages sorted by: [ date ] [ thread ]
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 ?
- Next message: tiyayin: "Re: USB 2.0 Streaming Webcam Problems"
- Previous message: shahar: "a device object's type"
- In reply to: shahar: "finding the parent of a device"
- Next in thread: shahar: "Re: finding the parent of a device"
- Reply: shahar: "Re: finding the parent of a device"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|