IRP_MJ_CREATE and IoCallDriver

Hi,
I have some doubt on file system filter driver. I need to do some post
processing task such as sending a query IRP to lower file system to get the
file attribute.

Can I do the post-processing task for the IRP_MJ_CREATE in the dispatch
routine after IoCallDriver, before I return the status to the IO Manager?

For this case, do I need to initialize an event before IoCallDriver, wait
for the event in the dispatch routine and set the event in completion
routine?

Or should I do the post processing in the create completion routine?

Thanks for any suggestion!
Sin Lam


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Sin Lam,
Do the processing after waiting for the event in the dispatch routine after
calling IoCallDriver is the safest bet. The completion routine should look
something like this:

NTSTATUS CreateComplete(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN
PVOID Context)
{
KEVENT *pEvent = Context;

if (Irp->PendingReturned)
IoMarkIrpPending (Irp);
(void)KeSetEvent(pEvent, 0, FALSE);

return STATUS_MORE_PROCESSING_REQUIRED;
}

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Tan Sin Lam
Sent: Tuesday, September 18, 2001 8:55 AM
To: File Systems Developers
Subject: [ntfsd] IRP_MJ_CREATE and IoCallDriver

Hi,
I have some doubt on file system filter driver. I need to do some post
processing task such as sending a query IRP to lower file system to get the
file attribute.

Can I do the post-processing task for the IRP_MJ_CREATE in the dispatch
routine after IoCallDriver, before I return the status to the IO Manager?

For this case, do I need to initialize an event before IoCallDriver, wait
for the event in the dispatch routine and set the event in completion
routine?

Or should I do the post processing in the create completion routine?

Thanks for any suggestion!
Sin Lam


You are currently subscribed to ntfsd as: xxxxx@legato.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Create should be synchronous, but you can also set an event in a
completion routine just to be safe. Otherwise, what you want to do
should work just fine.

Jamey
xxxxx@storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tan Sin Lam
Sent: Tuesday, September 18, 2001 5:55 AM
To: File Systems Developers
Subject: [ntfsd] IRP_MJ_CREATE and IoCallDriver

Hi,
I have some doubt on file system filter driver. I need to do some post
processing task such as sending a query IRP to lower file system to get
the file attribute.

Can I do the post-processing task for the IRP_MJ_CREATE in the dispatch
routine after IoCallDriver, before I return the status to the IO
Manager?

For this case, do I need to initialize an event before IoCallDriver,
wait for the event in the dispatch routine and set the event in
completion routine?

Or should I do the post processing in the create completion routine?

Thanks for any suggestion!
Sin Lam


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You must do the even wait in the Dispatch, otherwise you will probably bug
check the system, since Completion is very likely to be called at
DISPATCH_LEVEL.

Regards, Dejan.

Tan Sin Lam wrote:

Hi,
I have some doubt on file system filter driver. I need to do some post
processing task such as sending a query IRP to lower file system to get the
file attribute.

Can I do the post-processing task for the IRP_MJ_CREATE in the dispatch
routine after IoCallDriver, before I return the status to the IO Manager?

For this case, do I need to initialize an event before IoCallDriver, wait
for the event in the dispatch routine and set the event in completion
routine?

Or should I do the post processing in the create completion routine?

Thanks for any suggestion!
Sin Lam


You are currently subscribed to ntfsd as: xxxxx@alfasp.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


Kind regards, Dejan M. CEO Alfa Co. www.alfasp.com
E-mail: xxxxx@alfasp.com
ICQ#: 56570367
Professional file&system related components and libraries for Win32 developers.

Alfa File Monitor - #1 file monitoring system for Win32 developers.
Alfa File Protector - #1 file protection and hiding system for Win32
developers.
Alfa Units - #1 file and system handling units for Delphi.


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> if (Irp->PendingReturned)

IoMarkIrpPending (Irp);

This is not necessary if STATUS_MORE_PROCESSING_REQUIRED will be returned.

Max


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Your statement is not completely true. The situation is slighlty different.

When you’re waiting in the dispatch routine for the completion
of the next lower level driver (thus making the request synchronous
in your dispatch routine) and you are returning “more processing required”
from your completion routine (thus making the Irp live even after your wait
in
the dispatch routine is satisfied) you SHOULD NOT (or MUST NOT) propagate
the pending returned flag to your Irp stack location !
[This assumes that you’re not returning STATUS_PENDING and you’re the one
who completes the Irp for your caller - calling IoCompleteRequest]

You can (and should) do that only and only if you return from your dispatch
routine
the same status which is returned by IoCallDriver you’ve called.
But if you’re making the Irp synchronous, there is no reason to occasionally
return
STATUS_PENDING from your dispatch routine, because you’re always knowing the
proper status of the operation in Irp->IoStatus.Status (which must be !=
STATUS_PENDING).

Hope this helps

Paul

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
Sent: Tuesday, September 18, 2001 11:13 PM
To: File Systems Developers
Subject: [ntfsd] RE: IRP_MJ_CREATE and IoCallDriver

if (Irp->PendingReturned)
IoMarkIrpPending (Irp);

This is not necessary if STATUS_MORE_PROCESSING_REQUIRED will be returned.

Max


You are currently subscribed to ntfsd as: xxxxx@compelson.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com