reading current file in IRP_MJ_CREATE

hi all,
I have made a file system filter driver which redirects the path names(on the fly redirection). This works fine.
-The requirement is to redirect to a file based on the contents of the current file.
-so i need to read the first few lines of each file.
-is it fesable to use ZwCreate in IRP_MJ_CREATE?

thanks
sachin

Yahoo! India Matrimony: Find your partner online.

> -is it fesable to use ZwCreate in IRP_MJ_CREATE?

Yes. But you have to send the create request to the
lower driver directly, not to the whole filter stack.
Use device shadowing or IoCreateFileSpecifyDeviceObjectHint
(XP only) otherwise you’ll face heavy recursion problems,
especially with antivirus programs.

L.

Sachin,

You should avoid using ZwCreate inside IRP_MJ_CREATE. While you can
eventually make it work, doing so requires a LOT of effort. Instead, it
is best if you can use IoCreateFileSpecifyDeviceObjectHint, because this
will avoid many of the issues inherent in re-entering the OS while
processing an IRP_MJ_CREATE. This list has a long history and this
topic has been discussed many times - I would suggest reviewing it.

Regards,

Tony Mason
Consulting Partner
OSR Open Systems Resources Inc.
http://www.osr.com, http://www.osronline.com


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Sachin Chanchani
Sent: Tuesday, May 04, 2004 6:41 AM
To: ntfsd redirect
Subject: [ntfsd] reading current file in IRP_MJ_CREATE

hi all,
I have made a file system filter driver which redirects the
path names(on the fly redirection). This works fine.
-The requirement is to redirect to a file based on the contents of the
current file.
-so i need to read the first few lines of each file.
-is it fesable to use ZwCreate in IRP_MJ_CREATE?

thanks
sachin

Yahoo! India Matrimony
http:atrimony/> : Find your partner online
http:matrimony/community.php> . — Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed
to ntfsd as: xxxxx@osr.com To unsubscribe send a blank email to
xxxxx@lists.osr.com</http:></http:>

Alas im on a Win 2000 DDK.
This means ill have to do with ZwCreate right? ill check the archives of this list
thanks anyway

sachin

Tony Mason wrote:
Sachin,

You should avoid using ZwCreate inside IRP_MJ_CREATE. While you can eventually make it work, doing so requires a LOT of effort. Instead, it is best if you can use IoCreateFileSpecifyDeviceObjectHint, because this will avoid many of the issues inherent in re-entering the OS while processing an IRP_MJ_CREATE. This list has a long history and this topic has been discussed many times - I would suggest reviewing it.

Regards,

Tony Mason
Consulting Partner
OSR Open Systems Resources Inc.
http://www.osr.com, http://www.osronline.com

---------------------------------
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Sachin Chanchani
Sent: Tuesday, May 04, 2004 6:41 AM
To: ntfsd redirect
Subject: [ntfsd] reading current file in IRP_MJ_CREATE

hi all,
I have made a file system filter driver which redirects the path names(on the fly redirection). This works fine.
-The requirement is to redirect to a file based on the contents of the current file.
-so i need to read the first few lines of each file.
-is it fesable to use ZwCreate in IRP_MJ_CREATE?

thanks
sachin

Yahoo! India Matrimony: Find your partner online. — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@osr.com To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@yahoo.co.in
To unsubscribe send a blank email to xxxxx@lists.osr.com
Yahoo! India Matrimony: Find your partner online.