Hi All,
Iam writing a filesystem filter driver where in i need to synchronize
IRP_MJ_READ for some files.
I do that by having a Synchronization event.
case IRP_MJ_READ:
if(it is a file XXXXXXXX)
{
KeWaitForSingleObject(MYReadEvent,Executive,KernelMode,FALSE,NULL);
/////// Here i call my function that will create a irp and send it to lower
level and get me data/////////////////////
KeSetEvent(MYReadEvent,(KPRIORITY) 0,FALSE);
…
…
…
}
break;
When i get the first read, My function to create irp and send to lower is
called and but while doing that it got the second read irp for the same
file.
So,The second IRP comes and waits in KeWaitForSingleObject.
The first IRP stops at the point it got interupted by the Second IRP and it
doesnot continue.
Why waiting in KeWaitForSingleObject for Second IRP hangs the serviceing of
the first IRP?
Is it because KeWaitForSingleObject block the current thread??
If so, what is the solution by which i can make the second read IRP to wait
until first one is serviced?
With Regards,
A.Ilamparithi.
The scond read is a paging io read. Do not block in the paging io read path.
-Kiran
“A.Ilamparithi” wrote in message news:xxxxx@ntfsd…
> Hi All,
>
> Iam writing a filesystem filter driver where in i need to synchronize
> IRP_MJ_READ for some files.
>
> I do that by having a Synchronization event.
>
> case IRP_MJ_READ:
>
> if(it is a file XXXXXXXX)
> {
> KeWaitForSingleObject(MYReadEvent,Executive,KernelMode,FALSE,NULL);
>
> /////// Here i call my function that will create a irp and send it to
lower
> level and get me data/////////////////////
>
> KeSetEvent(MYReadEvent,(KPRIORITY) 0,FALSE);
>
> …
>
> …
>
> …
> }
> break;
>
> When i get the first read, My function to create irp and send to lower is
> called and but while doing that it got the second read irp for the same
> file.
>
> So,The second IRP comes and waits in KeWaitForSingleObject.
>
> The first IRP stops at the point it got interupted by the Second IRP and
it
> doesnot continue.
>
> Why waiting in KeWaitForSingleObject for Second IRP hangs the serviceing
of
> the first IRP?
>
> Is it because KeWaitForSingleObject block the current thread??
>
> If so, what is the solution by which i can make the second read IRP to
wait
> until first one is serviced?
>
> With Regards,
> A.Ilamparithi.
>
>
>
>
>
>
>
>
>
>
>