Get the device name of a specific device object

Hi, how can I get the device name of a specific device
object? In my bus filter driver I hooked the
IRP_MN_QUERY_DEVICE_RELATIONS. Then I got the list of
all the child devices on a port. How can I get the
device name of the child device? Is there any native
API doing this?

Thanks

Michael


Post your free ad now! http://personals.yahoo.ca

Not sure if this works for device objects, but try
NtQueryObject/ZwQueryObject using ObjectNameInformation. This is
documented in “Windows NT/2000: Native API Reference”, by Gary Nebbett.
(It’s a good book, overall, too.)

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Zhu
Sent: Saturday, September 20, 2003 6:34 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Get the device name of a specific device object

Hi, how can I get the device name of a specific device
object? In my bus filter driver I hooked the
IRP_MN_QUERY_DEVICE_RELATIONS. Then I got the list of all the child
devices on a port. How can I get the device name of the child device? Is
there any native API doing this?

Thanks

Michael


Post your free ad now! http://personals.yahoo.ca


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

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

Thanks for the reply. I read some documentation about
the ZwQueryObject(). The first parameter of this
native API is “IN HANDLE ObjectHandle”. How can I get
a handle of a specific device object?

Thanks.

— Arlie Davis wrote: > Not
sure if this works for device objects, but try
> NtQueryObject/ZwQueryObject using
> ObjectNameInformation. This is
> documented in “Windows NT/2000: Native API
> Reference”, by Gary Nebbett.
> (It’s a good book, overall, too.)
>
> – arlie
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf
> Of Michael Zhu
> Sent: Saturday, September 20, 2003 6:34 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Get the device name of a specific
> device object
>
>
> Hi, how can I get the device name of a specific
> device
> object? In my bus filter driver I hooked the
> IRP_MN_QUERY_DEVICE_RELATIONS. Then I got the list
> of all the child
> devices on a port. How can I get the device name of
> the child device? Is
> there any native API doing this?
>
> Thanks
>
> Michael
>
>

>
> Post your free ad now! http://personals.yahoo.ca
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@sublinear.org 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@yahoo.ca
> To unsubscribe send a blank email to
xxxxx@lists.osr.com


Post your free ad now! http://personals.yahoo.ca

ObQueryNameString can also help.

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

----- Original Message -----
From: “Arlie Davis”
To: “Windows System Software Devs Interest List”
Sent: Sunday, September 21, 2003 11:26 PM
Subject: [ntdev] RE: Get the device name of a specific device object

> Not sure if this works for device objects, but try
> NtQueryObject/ZwQueryObject using ObjectNameInformation. This is
> documented in “Windows NT/2000: Native API Reference”, by Gary Nebbett.
> (It’s a good book, overall, too.)
>
> – arlie
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Michael Zhu
> Sent: Saturday, September 20, 2003 6:34 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Get the device name of a specific device object
>
>
> Hi, how can I get the device name of a specific device
> object? In my bus filter driver I hooked the
> IRP_MN_QUERY_DEVICE_RELATIONS. Then I got the list of all the child
> devices on a port. How can I get the device name of the child device? Is
> there any native API doing this?
>
> Thanks
>
> Michael
>
> ______________________________________________________________________
> Post your free ad now! http://personals.yahoo.ca
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@sublinear.org 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@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com