Bus Driver : Not getting "new hardware found" pop for the enumerated PDO

Hello everyone

I am writing a WDM bus driver (root enumerated) from scratch for learning
purposes and mainly to see the flow PNP Irps in the whole stack. The bus
driver creates a child PDO in it’s IRP_MN_START_DEVICE handler, calls
IoInvalidateDeviceRelations() and reports it on receiving
IRP_MN_QUERY_DEVICE_RELATIONS (BusRelations). There after I am handling the
subsquent IRPs for the child PDO as per DDK but i still don’t get the
“Found New Hardware” pop up and not asked for installing a function driver.
The pdo doesn’t show up in the Device Manager under “other devices”. To my
knowledge I have handled all the “must handle” IRPs for the PDO in the
correct way as per DDK. I can’t figure out what I could possibly be
missing. Checking through Windbg, the devnode for the PDO is being created
with final state as initialized. The bus driver stops getting IRPs after
sometime.

Here are the DbgPrint logs:

BUS DRIVER: Entering DriverEntry
BUS DRIVER: Exiting DriverEntry
BUS DRIVER: Entering MyBus_AddDevice
BUS DRIVER: MyBus_AddDevice Bus’s Physical Device Object : 0x8A498F10
BUS DRIVER: MyBus_AddDevice Bus FDO’s LowerDeviceObject : 0x8A498F10
BUS DRIVER: MyBus_AddDevice Bus’s FDO : 0x89882EF0
BUS DRIVER: Exiting MyBus_AddDevice
Break instruction exception - code 80000003 (first chance)
bus!MyBus_AddDevice+0x11e:
b49ca63e cc int 3
1: kd> g
BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x18
BUS DRIVER: Entering FdoDispatchPnP
BUS DRIVER: Exiting FdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0xd
BUS DRIVER: Entering FdoDispatchPnP
BUS DRIVER: FdoDispatchPnP: FDO_IRP_MN_FILTER_RESOURCE_REQUIREMENTS
BUS DRIVER: Exiting FdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x0
BUS DRIVER: Entering FdoDispatchPnP
BUS DRIVER: FdoDispatchPnP: FDO_IRP_MN_START_DEVICE
BUS DRIVER: Entering ForwardAndWait
BUS DRIVER: Entering ForwardAndWaitCompletionRoutine
BUS DRIVER: Exiting ForwardAndWaitCompletionRoutine
BUS DRIVER: FdoDispatchPnP: ForwardAndWait ReturnVal 0x0
BUS DRIVER: Entering CreateChildPdo
BUS DRIVER: CreateChildPdo: ChildPdo Address: 0x8993e2d0
BUS DRIVER: Exiting CreateChildPdo
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x13
BUS DRIVER: Entering FdoDispatchPnP
BUS DRIVER: FdoDispatchPnP: FDO_IRP_MN_QUERY_ID
BUS DRIVER: Exiting FdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x13
BUS DRIVER: Entering FdoDispatchPnP
BUS DRIVER: FdoDispatchPnP: FDO_IRP_MN_QUERY_ID
BUS DRIVER: Exiting FdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x9
BUS DRIVER: Entering FdoDispatchPnP
BUS DRIVER: FdoDispatchPnP: FDO_IRP_MN_QUERY_CAPABILITIES
BUS DRIVER: Exiting FdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x14
BUS DRIVER: Entering FdoDispatchPnP
BUS DRIVER: FdoDispatchPnP: FDO_IRP_MN_QUERY_PNP_DEVICE_STATE
BUS DRIVER: Exiting FdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x7
BUS DRIVER: Entering FdoDispatchPnP
BUS DRIVER: FdoDispatchPnP: FDO_IRP_MN_QUERY_DEVICE_RELATIONS
BUS DRIVER: FdoDispatchPnP: ChildPdo Count: 0x1
BUS DRIVER: FdoDispatchPnP: ChildPdo Address: 0x8993e2d0
BUS DRIVER: Exiting FdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x13
BUS DRIVER: Entering PdoDispatchPnP
BUS DRIVER: PdoDispatchPnP: PDO_IRP_MN_QUERY_ID
BUS DRIVER: PdoDispatchPnP: Device ID Sent: Bond\MyDevice_007
BUS DRIVER: Exiting PdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x9
BUS DRIVER: Entering PdoDispatchPnP
BUS DRIVER: PdoDispatchPnP: PDO_IRP_MN_QUERY_CAPABILITIES
BUS DRIVER: Entering BusPdo_QueryCapabilitiesHandler
BUS DRIVER: Exiting BusPdo_QueryCapabilitiesHandler
BUS DRIVER: Exiting PdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0xc
BUS DRIVER: Entering PdoDispatchPnP
BUS DRIVER: PdoDispatchPnP: PDO_IRP_MN_QUERY_DEVICE_TEXT
BUS DRIVER: PdoDispatchPnP: Device Text Sent: My Poor Lil Fake Device
BUS DRIVER: Exiting PdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0xc
BUS DRIVER: Entering PdoDispatchPnP
BUS DRIVER: PdoDispatchPnP: PDO_IRP_MN_QUERY_DEVICE_TEXT
BUS DRIVER: Exiting PdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x13
BUS DRIVER: Entering PdoDispatchPnP
BUS DRIVER: PdoDispatchPnP: PDO_IRP_MN_QUERY_ID
BUS DRIVER: PdoDispatchPnP: Device ID Sent: Bond\MyDevice_007_1
BUS DRIVER: Exiting PdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x13
BUS DRIVER: Entering PdoDispatchPnP
BUS DRIVER: PdoDispatchPnP: PDO_IRP_MN_QUERY_ID
BUS DRIVER: PdoDispatchPnP: Device ID Sent: Bond\MyDevice_007
BUS DRIVER: Exiting PdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x13
BUS DRIVER: Entering PdoDispatchPnP
BUS DRIVER: PdoDispatchPnP: PDO_IRP_MN_QUERY_ID
BUS DRIVER: PdoDispatchPnP: Device ID Sent: Bond\CompMyDevice_007
BUS DRIVER: Exiting PdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0xb
BUS DRIVER: Entering PdoDispatchPnP
BUS DRIVER: PdoDispatchPnP: PDO_IRP_MN_QUERY_RESOURCE_REQUIREMENTS
BUS DRIVER: Exiting PdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x15
BUS DRIVER: Entering PdoDispatchPnP
BUS DRIVER: PdoDispatchPnP: PDO_IRP_MN_QUERY_BUS_INFORMATION
BUS DRIVER: Entering BusPdo_QueryBusInformationHandler
BUS DRIVER: Exiting BusPdo_QueryBusInformationHandler
BUS DRIVER: Exiting PdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0xa
BUS DRIVER: Entering PdoDispatchPnP
BUS DRIVER: PdoDispatchPnP: PDO_IRP_MN_QUERY_RESOURCES
BUS DRIVER: Exiting PdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

BUS DRIVER: Entering DispatchPnP
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x1b
BUS DRIVER: DispatchPnP : IRP MajorFunction = 0x7
BUS DRIVER: Entering FdoDispatchPnP
BUS DRIVER: FdoDispatchPnP: FDO_IRP_MN_QUERY_DEVICE_RELATIONS
BUS DRIVER: FdoDispatchPnP: ChildPdo Count: 0x1
BUS DRIVER: FdoDispatchPnP: ChildPdo Address: 0x8993e2d0
BUS DRIVER: Exiting FdoDispatchPnP
BUS DRIVER: Exiting DispatchPnP

Kindly suggest as to what is not being handled correctly.

P.S. I know many have suggested to write a bus driver using kmdf but I want
to do it in WDM just for learning purposes.

Thanks

The instance ID CANNOT have a backslash in it.

It Worked. Thanks. But DDK doesn’t mention anywhere that backslash
shouldn’t be present in InstanceId

On Wed, Aug 29, 2012 at 8:31 PM, wrote:

> The instance ID CANNOT have a backslash in it.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Though I do get the enumerated device under “other devices” in device
manager now, I still don’t get the “found new hardware” pop up. I have set
SilentInstall member in DEVICE_CAPABILITIES as false.

On Wed, Aug 29, 2012 at 9:40 PM, sanjeev wrote:

> It Worked. Thanks. But DDK doesn’t mention anywhere that backslash
> shouldn’t be present in InstanceId
>
>
> On Wed, Aug 29, 2012 at 8:31 PM, wrote:
>
>> The instance ID CANNOT have a backslash in it.
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
>

sanjeev wrote:

Though I do get the enumerated device under “other devices” in device
manager now, I still don’t get the “found new hardware” pop up. I have
set SilentInstall member in DEVICE_CAPABILITIES as false.

The “Found New Hardware” popup was eliminated in Windows 7. New devices
without drivers merely appear silently in Device Manager with a yellow
bang. Apparently, the dialog was frightening small children.

(Actually, I don’t have a problem with the dialog being removed.
Statistically, I suspect it did more harm than good.)


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

>But DDK doesn’t mention anywhere that backslash shouldn’t be present in InstanceId

See “Instance IDs” chapter in DDK.

Thanks Grigora. Yea it’s mentioned there. I had checked just under
IRP_MN_QUERY_ID before, forgot to check under device identification
strings. There are just too many details, too many things that can go
wrong. But thanks a lot.

On Wed, Aug 29, 2012 at 10:35 PM, wrote:

> >But DDK doesn’t mention anywhere that backslash shouldn’t be present in
> InstanceId
>
> See “Instance IDs” chapter in DDK.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

I am testing it on Windows XP. I don’t have a problem as such either
because I can install my function driver using my device listed under
“other devices”. But pop-ups do come on Windows XP. Just curious as to why
it’s not coming in my case.

On Wed, Aug 29, 2012 at 9:48 PM, Tim Roberts wrote:

> sanjeev wrote:
> > Though I do get the enumerated device under “other devices” in device
> > manager now, I still don’t get the “found new hardware” pop up. I have
> > set SilentInstall member in DEVICE_CAPABILITIES as false.
>
> The “Found New Hardware” popup was eliminated in Windows 7. New devices
> without drivers merely appear silently in Device Manager with a yellow
> bang. Apparently, the dialog was frightening small children.
>
> (Actually, I don’t have a problem with the dialog being removed.
> Statistically, I suspect it did more harm than good.)
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

sanjeev wrote:

I am testing it on Windows XP. I don’t have a problem as such either
because I can install my function driver using my device listed under
“other devices”. But pop-ups do come on Windows XP. Just curious as to
why it’s not coming in my case.

When your PDO appears in Device Manager, does it appear with a yellow
bang, or is it properly loaded?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Sanjeev,

I am also start learning writing bus driver. Could you please provide me pointers where I can get started?

my email id is: xxxxx@yahoo.com, if you are comfortable then you can send me test mail so that I can discuss more about it.

Thanks and Regards,
Anand Choubey

Sanjeev is writing a WDM bus driver, that is a rather foolish thing to
do. Use KMDF wasting time on WDM for this is just an exercise in
futility.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

xxxxx@yahoo.com” wrote in message
news:xxxxx@ntdev:

> Hi Sanjeev,
>
> I am also start learning writing bus driver. Could you please provide me pointers where I can get started?
>
> my email id is: xxxxx@yahoo.com, if you are comfortable then you can send me test mail so that I can discuss more about it.
>
> Thanks and Regards,
> Anand Choubey

Tim Roberts wrote:

The “Found New Hardware” popup was eliminated in Windows 7. New devices
without drivers merely appear silently in Device Manager with a yellow
bang. Apparently, the dialog was frightening small children.

We have a multifunction PCI card with (bus and function) drivers which work on Windows XP. We want to port the drivers to Windows 7.
The installation on Windows XP is as follows:

  1. We change the DevicePath registry key to include the path of the drivers.
  2. We open Device Manager.
  3. We select the unknown device, click Update driver, and let windows find and install the bus driver.
  4. Windows detects the new child devices automatically and prompts to install their drivers.
  5. We install the child drivers.

However on Windows 7 (x86), after the bus driver is installed we do not see the “Found new hardware” wizard. The child devices appear in Device Manager with a yellow bang.

What can we do about it?

Thank you in advance!

Use dpinst to install (and apply) all involved drivers.
http://msdn.microsoft.com/en-us/library/windows/hardware/ff544842(v=vs.85).aspx

–pa

On 20-Sep-2012 14:37, itaih@ wrote:

Tim Roberts wrote:
> The “Found New Hardware” popup was eliminated in Windows 7. New devices
> without drivers merely appear silently in Device Manager with a yellow
> bang. Apparently, the dialog was frightening small children.

We have a multifunction PCI card with (bus and function) drivers which work on Windows XP. We want to port the drivers to Windows 7.
The installation on Windows XP is as follows:

  1. We change the DevicePath registry key to include the path of the drivers.
  2. We open Device Manager.
  3. We select the unknown device, click Update driver, and let windows find and install the bus driver.
  4. Windows detects the new child devices automatically and prompts to install their drivers.
  5. We install the child drivers.

However on Windows 7 (x86), after the bus driver is installed we do not see the “Found new hardware” wizard. The child devices appear in Device Manager with a yellow bang.

What can we do about it?

Thank you in advance!