For a certain IRP asking for bulk out transfer data is issued by upper
driver, the lower filter driver will send a return
STATUS_MORE_PROCESSING_REQUIRED to hold the IRP and build another bulk
transfer ,and complete the certain IRP.
So.. in the lower filter driver. It is like the following.
-----------------------------------------------------------------------
DispatchFromUppderDriver ( )
{
if (Irp type != the special irp type)
passIrp(pdx) ; // I only care a certain IRP.
....
Start_Bulk_Tansfer(pdx);
return STATUS_MORE_PROCESSING_REQUIRED;
}
Start_Bulk_Transfer( pdx )
{
....
IoSetCompletionRoutine ( .... , CompleteRoutine,..) ;
IoCallDriver(.., pdx->Hold_Irp) ;
}
CompleteRoutine(..)
{
SetIoCompleteRequest( Hold_Irp);
}
-----------------------------------------------------------------------
But, for some reason, I have to improve the response speed for the
certain Irp.
I just think that I can simply call the same Start_Bulk_Tansfer(pdx)
when the complete routine happen. And, in the meanwhile, lower filter
driver still response the irp with the data updated by previous
Start_Bulk_Tansfer(pdx)
So, in my imagnation, I can do something like the following..
-----------------------------------------------------------------------
AddDevice ()
{
pdx->data_exist = FALSE;
}
DispatchFromUppderDriver ( )
{
if (Irp type != the special irp type)
passIrp(pdx) ;
// I expect the data will be updated by Start_Bulk_Tansfer(pdx);
// The Irp will be complete by the lower filter driver with those
data.
if( pdx->data_exist)
{
//Copy the data to irp parameter and complete the irp.
return;
}
Start_Bulk_Tansfer(pdx); // Start_Bulk_Transfer will set complete
routine and do IoCallDriver( ) ;
return STATUS_MORE_PROCESSING_REQUIRED;
}
Start_Bulk_Transfer( pdx )
{
....
IoSetCompletionRoutine ( .... , CompleteRoutine,..) ;
IoCallDriver(.., pdx->Hold_Irp) ;
}
CompleteRoutine(..)
{
SetIoCompleteRequest( Hold_Irp);
Start_Bulk_Tansfer(pdx); <------ I call it again when the
complete routine happen.
}
-----------------------------------------------------------------------
But the true is that, ony first time Start_Bulk_Tansfer( ) and the
completeRoutine( ) actually happen. And, the 2nd Start_Bulk_Tansfer( )
won't get the complete routine. It looks like the completeRoutine has
been pending. So the certian Irp only can get the 1st time data and
the data won't be updated.
I also do a experimentation. I set a counter to ten, every time the
certain Irp arrived and been finish , the counter will decrease. When
it become zero, the certain Irp will not be complete immediately. The
lower filter driver will return STATUS_MORE_PROCESSING_REQUIRED; Then
the complete routine will happen right away. Just like the following..
if( pdx->data_exist)
{
if (pdx->count == 0)
return STATUS_MORE_PROCESSING_REQUIRED;
else
//Copy the data to irp parameter and complete the irp.
return;
}
I really don't know what mistakes I made. Could someone tell me the
reason of completeRoutine is pending ? or you have other suggestion?
PS : the certain Irp arrived in Dispatche_Level
Thanks,
by
Caro
Oh ~ someone suggest me to markpending on Irp from dispach(). But the
situation is the same. I check the book " Programming the Microsoft
Windoes Driver Model". It looks like only issulate how to split one
Irp to severals Irp. So I just wonder if this issue is related multi-
thread. Could someone know how to handle Irp from uppder driver and
send self Irp to lower driver at the same times ? I hope the Irp from
upper driver won't be pending.
Regards,
Caro
<caro...@gmail.com> wrote in message
news:b2faa154-d135-488e...@i4g2000prm.googlegroups.com...
d
--
This posting is provided "AS IS" with no warranties, and confers no rights.
<caro...@gmail.com> wrote in message
news:446523c9-cbc4-4e96...@g1g2000yqh.googlegroups.com...