STATUS_WAIT_2 and removal

In my query_remove IoCallDriver returns a status of STATUS_WAIT_2 when
passing the IRP down. Does anyone know what this could mean?

What’s happening is this:
disable in device manager -> query_dev_relations -> query_remove ->
cancel_remove

IoCallDriver returns the same thing during cancel_remove as well.

I then get a “Your hardware settings have changed. You must restart… do
you want to now?” message box.

Another one of my drivers is “attached” to this device due to it (it, being
the other driver) calling IoGetDeviceObjectPointer (I also need to rework
this so that I don’t have to name my FDO in order for my other drivers to
get the pointer…any hints here would be great as well). Could this have
anything to do with what I am seeing, since ObDereferenceObject has not been
called on the file object yet (the file object returned by
IoGetDeviceObjectPointer)?

I hope this makes sense.
Thanks, Chris

> (I also need to rework this so that I don’t have to name my FDO in order
for

my other drivers to get the pointer…any hints here would be great as
well)

I think ToastMon just answered this question. Just use the symboliclink name
instead of an actual device name :slight_smile:
Chris

IoCallDriver simply returns what the dispatch routine of the driver you specified returned. If you got back STATUS_WAIT_2 it’s because the lower driver returned STATUS_WAIT_2.

so the better question is, why is the driver below you returning STATUS_WAIT_2. Assuming it’s not your code, you’ll need to say what the driver is before anyone can really help.

-p

-----Original Message-----
From: Chris Dor? [mailto:xxxxx@connecttech.com]
Sent: Thursday, October 17, 2002 9:57 AM
To: NT Developers Interest List
Subject: [ntdev] STATUS_WAIT_2 and removal

In my query_remove IoCallDriver returns a status of STATUS_WAIT_2 when passing the IRP down. Does anyone know what this could mean?

What’s happening is this:
disable in device manager -> query_dev_relations -> query_remove -> cancel_remove

IoCallDriver returns the same thing during cancel_remove as well.

I then get a “Your hardware settings have changed. You must restart… do you want to now?” message box.

Another one of my drivers is “attached” to this device due to it (it, being the other driver) calling IoGetDeviceObjectPointer (I also need to rework this so that I don’t have to name my FDO in order for my other drivers to get the pointer…any hints here would be great as well). Could this have anything to do with what I am seeing, since ObDereferenceObject has not been called on the file object yet (the file object returned by IoGetDeviceObjectPointer)?

I hope this makes sense.
Thanks, Chris


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

STATUS_WAIT_n is returned from KeWaitForMultipleObjects(). Someone is
returning the result of a wait to you.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Thursday, October 17, 2002 12:00 PM
To: NT Developers Interest List
Subject: [ntdev] RE: STATUS_WAIT_2 and removal

IoCallDriver simply returns what the dispatch routine of the driver you
specified returned. If you got back STATUS_WAIT_2 it’s because the
lower driver returned STATUS_WAIT_2.

so the better question is, why is the driver below you returning
STATUS_WAIT_2. Assuming it’s not your code, you’ll need to say what the
driver is before anyone can really help.

-p

-----Original Message-----
From: Chris Dor? [mailto:xxxxx@connecttech.com]
Sent: Thursday, October 17, 2002 9:57 AM
To: NT Developers Interest List
Subject: [ntdev] STATUS_WAIT_2 and removal

In my query_remove IoCallDriver returns a status of STATUS_WAIT_2 when
passing the IRP down. Does anyone know what this could mean?

What’s happening is this:
disable in device manager -> query_dev_relations -> query_remove ->
cancel_remove

IoCallDriver returns the same thing during cancel_remove as well.

I then get a “Your hardware settings have changed. You must restart…
do you want to now?” message box.

Another one of my drivers is “attached” to this device due to it (it,
being the other driver) calling IoGetDeviceObjectPointer (I also need to
rework this so that I don’t have to name my FDO in order for my other
drivers to get the pointer…any hints here would be great as well).
Could this have anything to do with what I am seeing, since
ObDereferenceObject has not been called on the file object yet (the file
object returned by IoGetDeviceObjectPointer)?

I hope this makes sense.
Thanks, Chris


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


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

Also, how does this compare to the status returned in
IoStatusBlock.Status? Maybe you need to key failure on this status and
not the actual return status. STATUS_WAIT_n is not an error, so
NT_SUCCESS() should succeed on it.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Thursday, October 17, 2002 12:00 PM
To: NT Developers Interest List
Subject: [ntdev] RE: STATUS_WAIT_2 and removal

IoCallDriver simply returns what the dispatch routine of the driver you
specified returned. If you got back STATUS_WAIT_2 it’s because the
lower driver returned STATUS_WAIT_2.

so the better question is, why is the driver below you returning
STATUS_WAIT_2. Assuming it’s not your code, you’ll need to say what the
driver is before anyone can really help.

-p

-----Original Message-----
From: Chris Dor? [mailto:xxxxx@connecttech.com]
Sent: Thursday, October 17, 2002 9:57 AM
To: NT Developers Interest List
Subject: [ntdev] STATUS_WAIT_2 and removal

In my query_remove IoCallDriver returns a status of STATUS_WAIT_2 when
passing the IRP down. Does anyone know what this could mean?

What’s happening is this:
disable in device manager -> query_dev_relations -> query_remove ->
cancel_remove

IoCallDriver returns the same thing during cancel_remove as well.

I then get a “Your hardware settings have changed. You must restart…
do you want to now?” message box.

Another one of my drivers is “attached” to this device due to it (it,
being the other driver) calling IoGetDeviceObjectPointer (I also need to
rework this so that I don’t have to name my FDO in order for my other
drivers to get the pointer…any hints here would be great as well).
Could this have anything to do with what I am seeing, since
ObDereferenceObject has not been called on the file object yet (the file
object returned by IoGetDeviceObjectPointer)?

I hope this makes sense.
Thanks, Chris


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


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

Here is an excerpt of my code:

switch (…) {
.
.
.
case IRP_MN_QUERY_REMOVE_DEVICE:
pDevExt->DevicePnPState = RemovePending;
pIrp->IoStatus.Status = STATUS_SUCCESS;
break;

case IRP_MN_CANCEL_REMOVE_DEVICE:
pDevExt->DevicePnPState = Started;
pIrp->IoStatus.Status = STATUS_SUCCESS;
break;
.
.
.
}

IoSkipCurrentIrpStackLocation (pIrp);
Status = IoCallDriver (pDevExt->NextLowerDO, pIrp);
BusFDOIoDec (pDevExt);
BusFDODbgPrint (DBG_PNP_TRACE, (“—BusFDOPnP Leave (Return=0x%X)\n”,
Status));
return (Status);
}

Here is my device stack:

!DevObj !DrvObj !DevExt ObjectName
808642a8 \DRIVER\VERIFIER 80864360

808655a8 \Driver\WHPortBus 80865660
ffbcebc0 \DRIVER\VERIFIER ffbcec78
80a122b0 \Driver\PnpManager 80a12368 00000030
!DevNode 80a12168 :
DeviceInst is “Root\SYSTEM\0003”

…Chris

“Jamey Kirby” wrote in message news:xxxxx@ntdev…

Also, how does this compare to the status returned in
IoStatusBlock.Status? Maybe you need to key failure on this status and
not the actual return status. STATUS_WAIT_n is not an error, so
NT_SUCCESS() should succeed on it.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Thursday, October 17, 2002 12:00 PM
To: NT Developers Interest List
Subject: [ntdev] RE: STATUS_WAIT_2 and removal

IoCallDriver simply returns what the dispatch routine of the driver you
specified returned. If you got back STATUS_WAIT_2 it’s because the
lower driver returned STATUS_WAIT_2.

so the better question is, why is the driver below you returning
STATUS_WAIT_2. Assuming it’s not your code, you’ll need to say what the
driver is before anyone can really help.

-p

-----Original Message-----
From: Chris Doré [mailto:xxxxx@connecttech.com]
Sent: Thursday, October 17, 2002 9:57 AM
To: NT Developers Interest List
Subject: [ntdev] STATUS_WAIT_2 and removal

In my query_remove IoCallDriver returns a status of STATUS_WAIT_2 when
passing the IRP down. Does anyone know what this could mean?

What’s happening is this:
disable in device manager -> query_dev_relations -> query_remove ->
cancel_remove

IoCallDriver returns the same thing during cancel_remove as well.

I then get a “Your hardware settings have changed. You must restart…
do you want to now?” message box.

Another one of my drivers is “attached” to this device due to it (it,
being the other driver) calling IoGetDeviceObjectPointer (I also need to
rework this so that I don’t have to name my FDO in order for my other
drivers to get the pointer…any hints here would be great as well).
Could this have anything to do with what I am seeing, since
ObDereferenceObject has not been called on the file object yet (the file
object returned by IoGetDeviceObjectPointer)?

I hope this makes sense.
Thanks, Chris


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


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

Is driver verifier enabled? Which OS are you running? Are you failing IRP_MN_QUERY_REMOVE_DEVICE when you get a STATUS_WAIT_2?

Rupin

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Thursday, October 17, 2002 3:00 PM
To: NT Developers Interest List
Subject: [ntdev] RE: STATUS_WAIT_2 and removal

IoCallDriver simply returns what the dispatch routine of the driver you specified returned. If you got back STATUS_WAIT_2 it’s because the lower driver returned STATUS_WAIT_2.

so the better question is, why is the driver below you returning STATUS_WAIT_2. Assuming it’s not your code, you’ll need to say what the driver is before anyone can really help.

-p

-----Original Message-----
From: Chris Dor? [mailto:xxxxx@connecttech.com]
Sent: Thursday, October 17, 2002 9:57 AM
To: NT Developers Interest List
Subject: [ntdev] STATUS_WAIT_2 and removal

In my query_remove IoCallDriver returns a status of STATUS_WAIT_2 when passing the IRP down. Does anyone know what this could mean?

What’s happening is this:
disable in device manager -> query_dev_relations -> query_remove -> cancel_remove

IoCallDriver returns the same thing during cancel_remove as well.

I then get a “Your hardware settings have changed. You must restart… do you want to now?” message box.

Another one of my drivers is “attached” to this device due to it (it, being the other driver) calling IoGetDeviceObjectPointer (I also need to rework this so that I don’t have to name my FDO in order for my other drivers to get the pointer…any hints here would be great as well). Could this have anything to do with what I am seeing, since ObDereferenceObject has not been called on the file object yet (the file object returned by IoGetDeviceObjectPointer)?

I hope this makes sense.
Thanks, Chris


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


You are currently subscribed to ntdev as: rupin.mohan@hp.com
To unsubscribe send a blank email to %%email.unsub%%

XP
I’m simply returning the retun value from IoCallDriver (see my reply to
Jamey).

Yes, verfier is running. I have found this information as well but I doesn’t
really help me too much.
http://groups.google.ca/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=9ntaai%24
k41%241%40brokaw.wa.com&rnum=1&prev=/groups%3Fhl%3Den%26ie%3DUTF-8%26oe%3DUT
F-8%26q%3DSTATUS_WAIT_2%26sa%3DN%26tab%3Dwg%26meta%3D

Chris

“Mohan, Rupin” <rupin.mohan> wrote in message news:xxxxx@ntdev…

Is driver verifier enabled? Which OS are you running? Are you failing
IRP_MN_QUERY_REMOVE_DEVICE when you get a STATUS_WAIT_2?

Rupin

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Thursday, October 17, 2002 3:00 PM
To: NT Developers Interest List
Subject: [ntdev] RE: STATUS_WAIT_2 and removal

IoCallDriver simply returns what the dispatch routine of the driver you
specified returned. If you got back STATUS_WAIT_2 it’s because the lower
driver returned STATUS_WAIT_2.

so the better question is, why is the driver below you returning
STATUS_WAIT_2. Assuming it’s not your code, you’ll need to say what the
driver is before anyone can really help.

-p

-----Original Message-----
From: Chris Doré [mailto:xxxxx@connecttech.com]
Sent: Thursday, October 17, 2002 9:57 AM
To: NT Developers Interest List
Subject: [ntdev] STATUS_WAIT_2 and removal

In my query_remove IoCallDriver returns a status of STATUS_WAIT_2 when
passing the IRP down. Does anyone know what this could mean?

What’s happening is this:
disable in device manager -> query_dev_relations -> query_remove ->
cancel_remove

IoCallDriver returns the same thing during cancel_remove as well.

I then get a “Your hardware settings have changed. You must restart… do
you want to now?” message box.

Another one of my drivers is “attached” to this device due to it (it, being
the other driver) calling IoGetDeviceObjectPointer (I also need to rework
this so that I don’t have to name my FDO in order for my other drivers to
get the pointer…any hints here would be great as well). Could this have
anything to do with what I am seeing, since ObDereferenceObject has not been
called on the file object yet (the file object returned by
IoGetDeviceObjectPointer)?

I hope this makes sense.
Thanks, Chris


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


You are currently subscribed to ntdev as: rupin.mohan@hp.com
To unsubscribe send a blank email to %%email.unsub%%</rupin.mohan>

Methinks it is a “gotcha” of VERIFIER. It tends to play with returned
status values to test the ability of the driver to properly handle returns
of other than STATUS_SUCCESS. I have seen this before and hard coded tests
like :

if (status != STATUS_SUCCESS)

will fail, where as

if (!NT_SUCCESS(status))

will properly handle a non-STATUS_SUCCESS condition.


Gary G. Little
Have Computer, Will Travel …
909-698-3191
909-551-2105

“Chris Doré” wrote in message news:xxxxx@ntdev…
>
> XP
> I’m simply returning the retun value from IoCallDriver (see my reply to
> Jamey).
>
> Yes, verfier is running. I have found this information as well but I
doesn’t
> really help me too much.
>
http://groups.google.ca/groups?hl=en&amp;lr=&amp;ie=UTF-8&amp;oe=UTF-8&amp;threadm=9ntaai%24
>
k41%241%40brokaw.wa.com&rnum=1&prev=/groups%3Fhl%3Den%26ie%3DUTF-8%26oe%3DUT
> F-8%26q%3DSTATUS_WAIT_2%26sa%3DN%26tab%3Dwg%26meta%3D
>
> Chris
>
> “Mohan, Rupin” <rupin.mohan> wrote in message news:xxxxx@ntdev…
>
> Is driver verifier enabled? Which OS are you running? Are you failing
> IRP_MN_QUERY_REMOVE_DEVICE when you get a STATUS_WAIT_2?
>
> Rupin
>
> -----Original Message-----
> From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
> Sent: Thursday, October 17, 2002 3:00 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: STATUS_WAIT_2 and removal
>
>
> IoCallDriver simply returns what the dispatch routine of the driver you
> specified returned. If you got back STATUS_WAIT_2 it’s because the lower
> driver returned STATUS_WAIT_2.
>
> so the better question is, why is the driver below you returning
> STATUS_WAIT_2. Assuming it’s not your code, you’ll need to say what the
> driver is before anyone can really help.
>
> -p
>
> -----Original Message-----
> From: Chris Doré [mailto:xxxxx@connecttech.com]
> Sent: Thursday, October 17, 2002 9:57 AM
> To: NT Developers Interest List
> Subject: [ntdev] STATUS_WAIT_2 and removal
>
>
> In my query_remove IoCallDriver returns a status of STATUS_WAIT_2 when
> passing the IRP down. Does anyone know what this could mean?
>
> What’s happening is this:
> disable in device manager -> query_dev_relations -> query_remove ->
> cancel_remove
>
> IoCallDriver returns the same thing during cancel_remove as well.
>
> I then get a “Your hardware settings have changed. You must restart… do
> you want to now?” message box.
>
> Another one of my drivers is “attached” to this device due to it (it,
being
> the other driver) calling IoGetDeviceObjectPointer (I also need to rework
> this so that I don’t have to name my FDO in order for my other drivers to
> get the pointer…any hints here would be great as well). Could this have
> anything to do with what I am seeing, since ObDereferenceObject has not
been
> called on the file object yet (the file object returned by
> IoGetDeviceObjectPointer)?
>
> I hope this makes sense.
> Thanks, Chris
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@microsoft.com To
> unsubscribe send a blank email to %%email.unsub%%
>
>
> —
> You are currently subscribed to ntdev as: rupin.mohan@hp.com
> To unsubscribe send a blank email to %%email.unsub%%
>
>
>
>
>
></rupin.mohan>

It was the file object reference. I totally missed the fact that when I
called IoGetDeviceObjectPointer the target device was being opened. So it
makes sense now. I was succeeding query_remove, but the system knows better
than me so it fails the query_remove, thus sending me the cancel_remove.

So derefferencing the fileobject right after IoGetDeviceObjectPointer closed
the device and everything works the way I expected. The STATUS_WAIT_2 value
has nothing to do with it, in fact it’s there all the time (most likely from
verifier, from what I’ve been reading and hearing).

Thanks to all for your help.
Chris

“Chris Doré” wrote in message news:xxxxx@ntdev…
>
> In my query_remove IoCallDriver returns a status of STATUS_WAIT_2 when
> passing the IRP down. Does anyone know what this could mean?
>
> What’s happening is this:
> disable in device manager -> query_dev_relations -> query_remove ->
> cancel_remove
>
> IoCallDriver returns the same thing during cancel_remove as well.
>
> I then get a “Your hardware settings have changed. You must restart… do
> you want to now?” message box.
>
> Another one of my drivers is “attached” to this device due to it (it,
being
> the other driver) calling IoGetDeviceObjectPointer (I also need to rework
> this so that I don’t have to name my FDO in order for my other drivers to
> get the pointer…any hints here would be great as well). Could this have
> anything to do with what I am seeing, since ObDereferenceObject has not
been
> called on the file object yet (the file object returned by
> IoGetDeviceObjectPointer)?
>
> I hope this makes sense.
> Thanks, Chris
>
>
>
>