Qus on STATUS_INSUFFICIENT_RESOURCES

I am testing my driver with driver verifier in win2k8, driver verifier have an option to fail particular tag. i tried with 100% failure of particular tag. i am completing the request with STATUS_INSUFFICIENT_RESOURCES when particular tag is failed. but application is keep on waiting for longer. after some time all the appication are hung.

I have tried with completing the request with STATUS_UNSUCCESSFUL then application doesn’t hung.

i just want to find the reason , because when driver doesn’t have resource it should complete with STATUS_INSUFFICIENT_RESOURCES.

any help is appreciated.

thanks in advance.

Regards
Sharan

You mighty want to provide a bit more information, such as what type
of device this is, the code segment that is completing the io
requests, and some information about this application or applications.

On Saturday, August 1, 2009, wrote:
> I am testing my driver with driver verifier in win2k8, driver verifier have an option to fail particular tag. i tried with 100% failure of particular tag. i am completing the request with STATUS_INSUFFICIENT_RESOURCES when particular tag is failed. but application is keep on waiting for longer. after some time all the appication are hung.
>
> I have tried with completing the request with STATUS_UNSUCCESSFUL then application doesn’t hung.
>
> i just ?want to find the reason , because when driver doesn’t have resource it should complete with STATUS_INSUFFICIENT_RESOURCES.
>
> any help is appreciated.
>
> thanks in advance.
>
> Regards
> Sharan
>
> —
> 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
>


Mark Roddy

driver is filter driver. it is below the file system driver.

I will mark Irp as pending when I get any IRp and I will do folloing.
pBufCopy = LgtoAllocatePoolWithTag(PagedPool, pIrpCurrentStack->Parameters.Write.Length, ‘s1NN’);
if (NULL == pBufCopy)
{
status = STATUS_INSUFFICIENT_RESOURCES;
goto ERROR;
}
When any allocation fail ,it goes to ERROR then I complete the request as follows,

pReceivedIrp->IoStatus.Status = status;
pReceivedIrp->IoStatus.Information = 0;
IoCompleteRequest(pReceivedIrp, IO_NO_INCREMENT);

and I will return the same status .

I am using IoMeter application.

> and I will return the same status .

And? what is the question?

If you have already called IoMarkIrpPending on the IRP - then you must return STATUS_PENDING from the dispatch path, regardless of whether you have already called IoCompleteRequest, and regardless of what was put to Irp->IoStatus.Status.

This thing:

IoMarkIrpPending
fill IoStatus
IoCompleteRequest
return STATUS_PENDING

works but suboptimal a bit. It is better to avoid calling IoMarkIrpPending if you know that you will call IoCompleteRequest inline.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com