PnP Driver Test and IRP_MN_CANCEL_REMOVE

P

Puneet Jain

To All Microsoft Folks who may be monitoring this newsgroup,

I having discussion with Eliyas Yakub in
microsoft.public.development.device.drivers and he suggested to post
this message in this newsgroup as well,

I would appreciate comments from anyone having information in this
area.

Thanks,
Puneet


Eliyas Yakub said:
Without investigating, I can't say why the bus driver returns an error for
IRP_MN_CANCEL_REMOVE. In any case, you should not override the status
returned by the bus driver.

The crash you are seeing could very well be another bug in PNPDTEST. I think
you should discuss the issues with the test tool on
"microsoft.public.windowsxp.winlogo" newsgroup. Microsoft folks monitoring
that newsgroup are charged with improving the test tools for the next
release of the DDK.

--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/hwdev/driver/kb-drv.mspx

Puneet Jain said:
"Eliyas Yakub [MSFT]" <[email protected]> wrote in message
On handling cancel-stop & cancel-remove: I have pasted here the code snippet
from the latest toaster driver (Server 2003 SP1). This is slightly different
from all the previous DDK. Just follow that. I had to change the logic for
SP1 to avoid assert from verifier if you don't forward any PNP IRPs down the
stack (even if it's spurious).
case IRP_MN_CANCEL_REMOVE_DEVICE:

status = ToasterSendIrpSynchronously(fdoData->NextLowerDriver,Irp);

if(NT_SUCCESS(status) && RemovePending == fdoData->DevicePnPState)
{
RESTORE_PREVIOUS_PNP_STATE(fdoData);

fdoData->QueueState = AllowRequests;

ToasterProcessQueuedRequests(fdoData);
}

break;

Eliyas,

Using the above framework, I still have a problem with PnP Driver test
as the NextLowerDriver (PCI Bus Driver) returns 0xC0000184 which is
mapped to STATUS_INVALID_DEVICE_STATE in ntstatus.h.

So, I have 2 questions now,
1. Can Bus driver ever fail this IRP_MN_CANCEL_REMOVE with
STATUS_INVALID_DEVICE_STATE?
2. Assuming it can (as it does in my case), is it still okay for me to
override that with STATUS_SUCESS and complete the IRP? Because if I
don't override the value, just completing the IRP with the value
returned by the Bus driver leads to an assertion by the pnpfiltr.sys
that the IRP cannot be failed.

Thanks,
Puneet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top