A question on pnpdtest

I am trying to run pnpdtest on a driver I’ve written and get some very
weird behavior. When I run the test for rebalance, the following happens:

  1. Driver receives an IRP_MN_QUERY_DEVICE_RELATIONS
  2. Driver receives an IRP_MN_QUERY_REMOVE_DEVICE
  3. Driver receives an IRP_MN_REMOVE_DEVICE
  4. Driver is reloaded
  5. Debugger displays:
    PipCallDriverAddDevice: Unable to reference driver \Driver\clan
    (c000025e)
  6. Device is left in an inoperable state till I unloand the driver and
    reload it.

Note, DriverEntry works successfully on the driver reload (step 4) and the
add device routine entry is present. Has anyone seen something similar
and
can hopefully give me a hint as what the heck is going on?

Don Burn
Egenera, Inc

I actually send same kind of question to this same forum a week ago. Haven’t been able to figure this out yet. One guy from Microsoft responded to me and everything seems to be working in his test computer with XPSP1.

Here is the whole conversation again. Maybe someone else can carry on where Moe left the thread. I too get this:

PipCallDriverAddDevice: Unable to
reference driver \Driver\Xxxx
(c000025e)

  • Mikko

– snip –

Hmm. I haven’t had that problem on my test machines. I checked a newer
version in awhile ago. The DDK for XPSP1 should have it.

-----Original Message-----
From: xxxxx@nokia.com [mailto:xxxxx@nokia.com]
Sent: Monday, August 12, 2002 9:56 PM
To: James Moe
Subject: RE: [ntdev] Problems running PnP Driver Test Tool

Also with test rebalance.

  • Mikko

-----Original Message-----
From: ext James Moe [mailto:xxxxx@windows.microsoft.com]
Sent: 12. elokuuta 2002 23:34
To: Jaakkola Mikko (NMP/Tampere)
Subject: RE: [ntdev] Problems running PnP Driver Test Tool

Does this happen only with test remove, or also with test rebalance?

-----Original Message-----
From: xxxxx@nokia.com [mailto:xxxxx@nokia.com]
Sent: Sunday, August 11, 2002 3:58 AM
To: NT Developers Interest List
Subject: [ntdev] Problems running PnP Driver Test Tool

Hello,

I’m developing a driver for Windows 2000 and Windows XP. At the moment
I’m doing most of my development in Windows XP. The driver that I’m
developing is a bus driver with a couple of child devices. The bus
driver HW is attached to PCMCIA bus. I have tried using PnP
Driver test
tool to check my device driver using both “Test Removal” and “Test
Rebalance” tests from the testkit.

What happens, for example in the first test, is that device
gets removed
OK (first child devices and then bus driver gets unload) but Windows
fails to reload the bus driver, even if I physical remove the card and
reinsert it. The error I’m getting in Device Manager is "Windows
successfully loaded the device driver for this hardware but
cannot find
the hardware device. (Code 41). The status from system’s debug tracing
gives me error STATUS_PLUGPLAY_NO_DEVICE (0xC000025EL). Only
way to get
my device operational after this is to reinstall it using
update driver
and pointing to the original inf-files.

Would anyone happen to know what’s going on here and what would be a
good place to start looking for fix to this problem? Any
ideas about the
issue are very much appreciated.

BR, Mikko

– snip –

-----Original Message-----
From: ext xxxxx@acm.org [mailto:xxxxx@acm.org]
Sent: 19. elokuuta 2002 20:32
To: NT Developers Interest List
Subject: [ntdev] A question on pnpdtest

I am trying to run pnpdtest on a driver I’ve written and get some very
weird behavior. When I run the test for rebalance, the
following happens:

  1. Driver receives an IRP_MN_QUERY_DEVICE_RELATIONS
  2. Driver receives an IRP_MN_QUERY_REMOVE_DEVICE
  3. Driver receives an IRP_MN_REMOVE_DEVICE
  4. Driver is reloaded
  5. Debugger displays:
    PipCallDriverAddDevice: Unable to
    reference driver \Driver\clan
    (c000025e)
  6. Device is left in an inoperable state till I unloand the driver and
    reload it.

Note, DriverEntry works successfully on the driver reload
(step 4) and the
add device routine entry is present. Has anyone seen
something similar
and
can hopefully give me a hint as what the heck is going on?

Don Burn
Egenera, Inc


You are currently subscribed to ntdev as: xxxxx@nokia.com
To unsubscribe send a blank email to %%email.unsub%%

I have found that when AddDevice fails after a “successful” unload, the
unload was actually not successful in that someone left a dangling
reference on either the driver object itself or the device object being
removed (the latter being more likely). This can be from an unmatched
ObReferenceObject call, or the result of not unregistering from a
certain kernel API.

!object and !object will give you the Pointer counts
(ignore the handle counts, those are for open file handles).

d

-----Original Message-----
From: xxxxx@nokia.com [mailto:xxxxx@nokia.com]
Sent: Monday, August 19, 2002 10:52 AM
To: NT Developers Interest List
Subject: [ntdev] RE: A question on pnpdtest

I actually send same kind of question to this same forum a week ago.
Haven’t been able to figure this out yet. One guy from Microsoft
responded to me and everything seems to be working in his test computer
with XPSP1.

Here is the whole conversation again. Maybe someone else can carry on
where Moe left the thread. I too get this:
> PipCallDriverAddDevice: Unable to
> reference driver \Driver\Xxxx
> (c000025e)

- Mikko

– snip –

Hmm. I haven’t had that problem on my test machines. I checked a newer
version in awhile ago. The DDK for XPSP1 should have it.

-----Original Message-----
From: xxxxx@nokia.com [mailto:xxxxx@nokia.com]
Sent: Monday, August 12, 2002 9:56 PM
To: James Moe
Subject: RE: [ntdev] Problems running PnP Driver Test Tool

Also with test rebalance.

- Mikko

> -----Original Message-----
> From: ext James Moe [mailto:xxxxx@windows.microsoft.com]
> Sent: 12. elokuuta 2002 23:34
> To: Jaakkola Mikko (NMP/Tampere)
> Subject: RE: [ntdev] Problems running PnP Driver Test Tool
>
>
> Does this happen only with test remove, or also with test rebalance?
>
> -----Original Message-----
> From: xxxxx@nokia.com [mailto:xxxxx@nokia.com]
> Sent: Sunday, August 11, 2002 3:58 AM
> To: NT Developers Interest List
> Subject: [ntdev] Problems running PnP Driver Test Tool
>
> Hello,
>
> I’m developing a driver for Windows 2000 and Windows XP. At the moment
> I’m doing most of my development in Windows XP. The driver that I’m
> developing is a bus driver with a couple of child devices. The bus
> driver HW is attached to PCMCIA bus. I have tried using PnP
> Driver test
> tool to check my device driver using both “Test Removal” and “Test
> Rebalance” tests from the testkit.
>
> What happens, for example in the first test, is that device
> gets removed
> OK (first child devices and then bus driver gets unload) but Windows
> fails to reload the bus driver, even if I physical remove the card and
> reinsert it. The error I’m getting in Device Manager is "Windows
> successfully loaded the device driver for this hardware but
> cannot find
> the hardware device. (Code 41). The status from system’s debug tracing
> gives me error STATUS_PLUGPLAY_NO_DEVICE (0xC000025EL). Only
> way to get
> my device operational after this is to reinstall it using
> update driver
> and pointing to the original inf-files.
>
> Would anyone happen to know what’s going on here and what would be a
> good place to start looking for fix to this problem? Any
> ideas about the
> issue are very much appreciated.
>
> BR, Mikko
>

– snip –

> -----Original Message-----
> From: ext xxxxx@acm.org [mailto:xxxxx@acm.org]
> Sent: 19. elokuuta 2002 20:32
> To: NT Developers Interest List
> Subject: [ntdev] A question on pnpdtest
>
>
> I am trying to run pnpdtest on a driver I’ve written and get some very
> weird behavior. When I run the test for rebalance, the
> following happens:
>
> 1. Driver receives an IRP_MN_QUERY_DEVICE_RELATIONS
> 2. Driver receives an IRP_MN_QUERY_REMOVE_DEVICE
> 3. Driver receives an IRP_MN_REMOVE_DEVICE
> 4. Driver is reloaded
> 5. Debugger displays:
> PipCallDriverAddDevice: Unable to
> reference driver \Driver\clan
> (c000025e)
> 6. Device is left in an inoperable state till I unloand the driver and
> reload it.
>
> Note, DriverEntry works successfully on the driver reload
> (step 4) and the
> add device routine entry is present. Has anyone seen
> something similar
> and
> can hopefully give me a hint as what the heck is going on?
>
> Don Burn
> Egenera, Inc
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@nokia.com
> To unsubscribe send a blank email to %%email.unsub%%
>


You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

I have no idea why you would get a remove on a rebalance test. I would
highly suspect that you are not handling a PnP IRP as expected somewhere
somehow. As device relations is the last IRP you get before the remove, I
would look there. One of our engineers here tried this with one of our
sample drivers, and we go through the stop path as expected and do not get a
remove.


Bill McKenzie
Windows DDK MVP
OSR - Windows System Software Development, Training, and Consulting

wrote in message news:xxxxx@ntdev…
>
> I am trying to run pnpdtest on a driver I’ve written and get some very
> weird behavior. When I run the test for rebalance, the following happens:
>
> 1. Driver receives an IRP_MN_QUERY_DEVICE_RELATIONS
> 2. Driver receives an IRP_MN_QUERY_REMOVE_DEVICE
> 3. Driver receives an IRP_MN_REMOVE_DEVICE
> 4. Driver is reloaded
> 5. Debugger displays:
> PipCallDriverAddDevice: Unable to reference driver \Driver\clan
> (c000025e)
> 6. Device is left in an inoperable state till I unloand the driver and
> reload it.
>
> Note, DriverEntry works successfully on the driver reload (step 4) and the
> add device routine entry is present. Has anyone seen something similar
> and
> can hopefully give me a hint as what the heck is going on?
>
> Don Burn
> Egenera, Inc
>
>
>

To comment further, the theory of device relations being messed up, well I
don’t handle device relations in my driver, I let the PCI bus driver do
the
dirty work. To the gentleman who suggests a dangling reference, nope
after
running the rebalance the device object does not exist, and the driver
object
has its typed changed to (bad0b0b0) which I assume means something bad,
and
the reference counts are zero.

Note, when I manually remove the device from device manager then scan for
new
hardware the add device routine is found ok, but something about the
pnpdtest
environment and my driver is causing this weird set of interactions.

Don Burn
Egenera, Inc.

I have no idea why you would get a remove on a rebalance test. I would
highly suspect that you are not handling a PnP IRP as expected somewhere
somehow. As device relations is the last IRP you get before the remove, I
would look there. One of our engineers here tried this with one of our
sample drivers, and we go through the stop path as expected and do not get a
remove.


Bill McKenzie
Windows DDK MVP
OSR - Windows System Software Development, Training, and Consulting

wrote in message news:xxxxx@ntdev…
> >
> > I am trying to run pnpdtest on a driver I’ve written and get some very
> > weird behavior. When I run the test for rebalance, the following happens:
> >
> > 1. Driver receives an IRP_MN_QUERY_DEVICE_RELATIONS
> > 2. Driver receives an IRP_MN_QUERY_REMOVE_DEVICE
> > 3. Driver receives an IRP_MN_REMOVE_DEVICE
> > 4. Driver is reloaded
> > 5. Debugger displays:
> > PipCallDriverAddDevice: Unable to reference driver \Driver\clan
> > (c000025e)
> > 6. Device is left in an inoperable state till I unloand the driver and
> > reload it.
> >
> > Note, DriverEntry works successfully on the driver reload (step 4) and the
> > add device routine entry is present. Has anyone seen something similar
> > and
> > can hopefully give me a hint as what the heck is going on?
> >
> > Don Burn
> > Egenera, Inc
> >
> >
> >

wrote in message news:xxxxx@ntdev…
>
>
> Note, when I manually remove the device from device manager then scan for
> new
> hardware the add device routine is found ok, but something about the
> pnpdtest
> environment and my driver is causing this weird set of interactions.
>

It is possible that it just doesn’t like you.

“bad0b0b0”, eh? It’s been my experience that this value appears in the
object type field after an object has been freed.

As far as:

PipCallDriverAddDevice: Unable to reference driver \Driver\clan (c000025e)

I see in NTSTATUS.H that error 0xC000025e is STATUS_PLUGPLAY_NO_DEVICE (“You
have attempted to load a legacy device driver while its device instance had
been disabled.”) – Does that make any sense to you?

If you reboot, does everything “just work”? Is the PnPDTest’s filter
installed above you?

You might want to turn on full PnP tracing for the checked build and see if
that helps you – One of my favorite Eliyas KB articles, Q314743, talks
about enabling tracing… You’ll want to turn on tracing for
DbgPrintEx(…) for the module(s) you’re interested in (perhaps PnP). The
KB arcitle says that you can find all the enabling masks by doing:

x NT!Kd_*_Mask

in WinDbg. Follow the directions in the debugger for how to enable tracing
with a DbgPrintEx mask, if you’ve never done it before (it’s trivial).

Let us all know how it goes,

Peter
OSR

Okay, stupid question time: Are you messing with the status of the
IRP_MN_QUERY_DEVICE_RELATIONS IRP in anyway? If the status gets set to
success, the PnP manager is going to expect DEVICE_RELATIONS info in the IRP
as well. If the bus didn’t handle this, but you somehow set the status to
success, that could be a problem. Aside from that, I have no idea what the
problem could be aside from maybe some other PnP mishandling somewhere else
in the driver??


Bill McKenzie
Windows DDK MVP
OSR - Windows System Software Development, Training, and Consulting

wrote in message news:xxxxx@ntdev…
>
> To comment further, the theory of device relations being messed up, well I
> don’t handle device relations in my driver, I let the PCI bus driver do
> the
> dirty work. To the gentleman who suggests a dangling reference, nope
> after
> running the rebalance the device object does not exist, and the driver
> object
> has its typed changed to (bad0b0b0) which I assume means something bad,
> and
> the reference counts are zero.
>
> Note, when I manually remove the device from device manager then scan for
> new
> hardware the add device routine is found ok, but something about the
> pnpdtest
> environment and my driver is causing this weird set of interactions.
>
> Don Burn
> Egenera, Inc.
>
> > I have no idea why you would get a remove on a rebalance test. I would
> > highly suspect that you are not handling a PnP IRP as expected somewhere
> > somehow. As device relations is the last IRP you get before the remove,
I
> > would look there. One of our engineers here tried this with one of our
> > sample drivers, and we go through the stop path as expected and do not
get a
> > remove.
> >
> > –
> > Bill McKenzie
> > Windows DDK MVP
> > OSR - Windows System Software Development, Training, and Consulting
> >
> >
> > wrote in message news:xxxxx@ntdev…
> > >
> > > I am trying to run pnpdtest on a driver I’ve written and get some very
> > > weird behavior. When I run the test for rebalance, the following
happens:
> > >
> > > 1. Driver receives an IRP_MN_QUERY_DEVICE_RELATIONS
> > > 2. Driver receives an IRP_MN_QUERY_REMOVE_DEVICE
> > > 3. Driver receives an IRP_MN_REMOVE_DEVICE
> > > 4. Driver is reloaded
> > > 5. Debugger displays:
> > > PipCallDriverAddDevice: Unable to reference driver \Driver\clan
> > > (c000025e)
> > > 6. Device is left in an inoperable state till I unloand the driver and
> > > reload it.
> > >
> > > Note, DriverEntry works successfully on the driver reload (step 4) and
the
> > > add device routine entry is present. Has anyone seen something
similar
> > > and
> > > can hopefully give me a hint as what the heck is going on?
> > >
> > > Don Burn
> > > Egenera, Inc
> > >
> > >
> > >
>
>

The test removes and re-enumerates the device in order to add the test
filter driver as an upper filter. If the driver is already added as an
upper filter, you won’t see an initial remove sequence.

-----Original Message-----
From: Bill McKenzie [mailto:xxxxx@osr.com]
Sent: Monday, August 19, 2002 11:57 AM
To: NT Developers Interest List
Subject: [ntdev] Re: A question on pnpdtest

I have no idea why you would get a remove on a rebalance test. I would
highly suspect that you are not handling a PnP IRP as expected somewhere
somehow. As device relations is the last IRP you get before the remove,
I
would look there. One of our engineers here tried this with one of our
sample drivers, and we go through the stop path as expected and do not
get a
remove.


Bill McKenzie
Windows DDK MVP
OSR - Windows System Software Development, Training, and Consulting

wrote in message news:xxxxx@ntdev…
>
> I am trying to run pnpdtest on a driver I’ve written and get some very
> weird behavior. When I run the test for rebalance, the following
happens:
>
> 1. Driver receives an IRP_MN_QUERY_DEVICE_RELATIONS
> 2. Driver receives an IRP_MN_QUERY_REMOVE_DEVICE
> 3. Driver receives an IRP_MN_REMOVE_DEVICE
> 4. Driver is reloaded
> 5. Debugger displays:
> PipCallDriverAddDevice: Unable to reference driver \Driver\clan
> (c000025e)
> 6. Device is left in an inoperable state till I unloand the driver and
> reload it.
>
> Note, DriverEntry works successfully on the driver reload (step 4) and
the
> add device routine entry is present. Has anyone seen something
similar
> and
> can hopefully give me a hint as what the heck is going on?
>
> Don Burn
> Egenera, Inc
>
>
>


You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

I have found that pnpdtest leaves an entry under my device with a value name of something like ‘UpperFilters’ and a string value of pnpdtest. Whenever I remove it, disable my device, and enable my device everything starts working again.

You might want to get the HCT and look at disabler.exe or denumcmd.exe for test out enabling and disabling. I find pnpdtest leaves my devices in a bad state after running against them.

And anyway, resource rebalance should just involve IRP_MN_STOP_DEVICE & IRP_START_DEVICE, not IRP_MN_REMOVE_DEVICE.

Doug
(Do not respond to my email address. It is set to filter out everything)

wrote in message news:xxxxx@ntdev…
>
> I am trying to run pnpdtest on a driver I’ve written and get some very
> weird behavior. When I run the test for rebalance, the following happens:
>
> 1. Driver receives an IRP_MN_QUERY_DEVICE_RELATIONS
> 2. Driver receives an IRP_MN_QUERY_REMOVE_DEVICE
> 3. Driver receives an IRP_MN_REMOVE_DEVICE
> 4. Driver is reloaded
> 5. Debugger displays:
> PipCallDriverAddDevice: Unable to reference driver \Driver\clan
> (c000025e)
> 6. Device is left in an inoperable state till I unloand the driver and
> reload it.
>
> Note, DriverEntry works successfully on the driver reload (step 4) and the
> add device routine entry is present. Has anyone seen something similar
> and
> can hopefully give me a hint as what the heck is going on?
>
> Don Burn
> Egenera, Inc
>
>
>

test

does anybody see my email on this list?
Pleas reply,
thank you.
Asher

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Asher Hoodin
Sent: Mittwoch, 18. September 2002 21:29
To: NT Developers Interest List
Subject: [ntdev] test

does anybody see my email on this list?
Pleas reply,
thank you.
Asher


You are currently subscribed to ntdev as: xxxxx@fxm.de
To unsubscribe send a blank email to %%email.unsub%%

yes we do!

“NT Developers Interest List” wrote:

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Asher Hoodin
Sent: Mittwoch, 18. September 2002 21:29
To: NT Developers Interest List
Subject: [ntdev] test

does anybody see my email on this list?
Pleas reply,
thank you.
Asher


You are currently subscribed to ntdev as: xxxxx@fxm.de
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: xxxxx@indiatimes.com
To unsubscribe send a blank email to %%email.unsub%%

Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com
Buy Music, Video, CD-ROM, Audio-Books and Music Accessories from http://www.planetm.co.in
Change the way you talk. Indiatimes presents “Valufon”, Your PC to Phone service with clear voice at rates far less than the normal ISD rates. Go to http://www.valufon.indiatimes.com. Choose your plan. BUY NOW.