Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 13 November 2017

Kernel Debugging & Crash Analysis for Windows, Nashua (Amherst) NH, 4 December 2017

Writing WDF Drivers I: Core Concepts, Nashua (Amherst) NH, 8 January 2018

WDF Drivers II: Advanced Implementation Techniques, Nashua (Amherst) NH, 15 January 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 8  
10 Sep 17 14:49
Martin Dráb
xxxxxx@email.cz
Join Date: 12 Aug 2013
Posts To This List: 21
Getting device identification information in AddDevice or earlier

Hello, I have a filter driver that, based on the device identification information, decides whether to attach to device stack of a newly reported device or not. Since the decision policy may change dynamically, I cannot configure it via registry (as a filter driver for only some device IDs). My question: is there a reliable way of getting device ID/instance ID during the AddDevice routine (or possibly earlier; when I see the PDO appearing in the IRP_MN_QUERY_DEVICE_RELATIONS:BusRelations request)? Or, is it possible to base the device identification on something else than these IDs? I was relying on the hardware and compatible IDs and that worked quite well but I am also inserted in the device ID case. My experiments show that it is not possible to query this ID via IRP_MN_QUERY_ID, since some devices (namely, WPDs) may then behave incorrectly. I know that I may query device descriptors by a way specific to the bus the device is connected to, however, I would like to know about a generic way first. Thank you in advance for any replies/suggestions. Martin
  Message 2 of 8  
10 Sep 17 16:18
Alex Grig
xxxxxx@broadcom.com
Join Date: 14 Apr 2008
Posts To This List: 3218
Getting device identification information in AddDevice or earlier

IoGetDeviceProperty
  Message 3 of 8  
10 Sep 17 18:59
Martin Dráb
xxxxxx@email.cz
Join Date: 12 Aug 2013
Posts To This List: 21
Getting device identification information in AddDevice or earlier

My experience with this function is that it may return empty results for devices seen for the first time (the system apparently needs to gather necessary information itself). Also, it does not help in terms of the device ID (it does with HW/compatible ID but I can get those without using this function). Dne 10. 9. 2017 v 22:16 xxxxx@broadcom.com ntdev"@lists.osr.com napsal(a): > IoGetDeviceProperty > > --- > NTDEV is sponsored by OSR > > Visit the list online at: <http://www.osronline.com/showlists.cfm?list=ntdev> > > MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! > Details at <http://www.osr.com/seminars> > <...excess quoted lines suppressed...>
  Message 4 of 8  
10 Sep 17 21:49
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 10099
Getting device identification information in AddDevice or earlier

What you can do in AddDevice depends on the bus. USB will let you send queries for descriptors, others like pci may not be fully powered on yet Bent from my phone ________________________________ From: xxxxx@lists.osr.com <xxxxx@lists.osr.com> on behalf of Martin Dr?b <xxxxx@email.cz> Sent: Sunday, September 10, 2017 3:57:52 PM To: Windows System Software Devs Interest List Subject: Re: [ntdev] Getting device identification information in AddDevice or earlier My experience with this function is that it may return empty results for devices seen for the first time (the system apparently needs to gather necessary information itself). Also, it does not help in terms of the device ID (it does with HW/compatible ID but I can get those without using this function). Dne 10. 9. 2017 v 22:16 xxxxx@broadcom.com ntdev"@lists.osr.com napsal(a): > IoGetDeviceProperty > > --- > NTDEV is sponsored by OSR > > Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&data=3D02%7C01%7CDoron.Holan%40microsoft.com%7C4 069b78b354d465b459608d4f89f6547%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6364 06810879555099&sdata=Oodj7Di1pFf%2FgFNkz0AgoGfDM8zdbHN6bpP%2FlOYqUl0%3D&reserved= 0> > > MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! > Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&data=02%7C01%7CDoron.Holan%40microsoft.com%7C4069b78b354d465b459608d4f89f6 547%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636406810879555099&sdata=7mDtD%2 BQtcpedRlxZSfy74R5mhPncEcUOhGjg4pkh6SI%3D&reserved=0> > <...excess quoted lines suppressed...> --- NTDEV is sponsored by OSR Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&data=02%7C01%7CDoron.Holan%40microsoft.com%7C406 9b78b354d465b459608d4f89f6547%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636406 810879555099&sdata=Oodj7Di1pFf%2FgFNkz0AgoGfDM8zdbHN6bpP%2FlOYqUl0%3D&reserved=0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&data=02%7C01%7CDoron.Holan%40microsoft.com%7C4069b78b354d465b459608d4f89f6 547%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636406810879555099&sdata=7mDtD%2 BQtcpedRlxZSfy74R5mhPncEcUOhGjg4pkh6SI%3D&reserved=0> To unsubscribe, visit the List Server section of OSR Online at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fpage.cfm%3Fname%3DListServer&data=02%7C01%7CDoron.Holan%40microsoft.com%7C406 9b78b354d465b459608d4f89f6547%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636406 810879555099&sdata=aFXtfd3Y8b%2FL4Z45PQ8Lv0bmUL5R1esGtb78I9JsBVY%3D&reserved=0> --
  Message 5 of 8  
10 Sep 17 22:33
Alex Grig
xxxxxx@broadcom.com
Join Date: 14 Apr 2008
Posts To This List: 3218
Getting device identification information in AddDevice or earlier

During AddDevice, HW ID and instance ID must be fully available.
  Message 6 of 8  
11 Sep 17 11:49
Mark Roddy
xxxxxx@gmail.com
Join Date: 25 Feb 2000
Posts To This List: 4019
Getting device identification information in AddDevice or earlier

If all the information you need is not present in add device the other option is to switch between "active" and "passive" filtering later when the information is available. Passive filter mode is just pass through and should add negligible performance cost and almost no additional complexity. Mark Roddy On Sun, Sep 10, 2017 at 10:31 PM, xxxxx@broadcom.com <xxxxx@lists.osr.com> wrote: > During AddDevice, HW ID and instance ID must be fully available. > > --- > NTDEV is sponsored by OSR > > Visit the list online at: <http://www.osronline.com/ > showlists.cfm?list=ntdev> > > MONTHLY seminars on crash dump analysis, WDF, Windows internals and > software drivers! <...excess quoted lines suppressed...> --
  Message 7 of 8  
11 Sep 17 13:15
Martin Dráb
xxxxxx@email.cz
Join Date: 12 Aug 2013
Posts To This List: 21
Getting device identification information in AddDevice or earlier

Hello Mark, my current implementation does exactly that. I was asked whether it would be possible to achieve the same thing even without passive filtering. And since I did not come with any reasonable idea, I decided to ask more skilled audience (means: these mailing lists). Martin Dne 11. 9. 2017 v 17:47 xxxxx@lists.osr.com napsal(a): > If all the information you need is not present in add device the other > option is to switch between "active" and "passive" filtering later when the > information is available. Passive filter mode is just pass through and > should add negligible performance cost and almost no additional complexity. > > Mark Roddy > > On Sun, Sep 10, 2017 at 10:31 PM, xxxxx@broadcom.com <xxxxx@lists.osr.com> > wrote: > <...excess quoted lines suppressed...>
  Message 8 of 8  
11 Sep 17 16:35
W. D.
xxxxxx@gmail.com
Join Date: 12 Oct 2017
Posts To This List: 40
Getting device identification information in AddDevice or earlier

You can send an IRP_MN_QUERY_ID PNP IRP with an IdType of BusQueryHardwareIDs to the lower drivers. On success, the bus driver sets the Information member of the IoStatusBlock to the address of a MULTI_SZ string containing the hardware IDs of the device.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 08:13.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license