RE: RE:[ntfsd] Deny File Access in Post-CreateHello Ayush,
Regarding the stream context, I was suggesting that after his logic determines if a process should be allowed
or denied access to a file, it should use FltGetRequestorProcessID and store that PID in a context to aleviate
extra processing. Therefor, in the future this would be an easy check opposed to running threw all the logic
required (whatever that may be) to determine if each create should be allowed or denied.
Regarding my coments about FltCancelFileOpen, I was responding to his query of ‘can FltCancelFIleOpen be called
for an already open file?’.
I do agree with you about calling FltCancelFileOpen in post create isn’t the best solution for a simple access check,
given the two create options you mentioned earlier in this thread. Therefor, he would have to check the file in pre-create,
but that leaves me wondering, ‘will filter manager allow you to cancel an IRP_CREATE in the precreate callback?’.
From my understanding, in a legacy filter you could cancel a create in dispatch by setting the apporpriate error in
IRP->IOSTATUS.status, call IoCompleteRequest, and then return the error from the dispatch handler… (something like that).
In a minifilter - how would this be done? Can it be done, surely it must. If not, I suppose one ‘elegant’ way would be
to reparse it to the ‘pits of hell’ and let fltmgr and the IO manager figure it out and clean up (just a wild idea that poped to mind).
Anyhow, Happy Belated New Year,
Matt
----- Original Message -----
From: Ayush Gupta
To: Windows File Systems Devs Interest List
Sent: Wednesday, January 02, 2008 9:34 PM
Subject: RE: RE:[ntfsd] Deny File Access in Post-Create
Hi Matt,
Storing a stream context with your desired app’s PID would allow you to
filter apps out. All calls into your
create handler will be in the context of the caller, both pre and post - so
this should work just fine for you.
How will the stream context help anyways?
I suppose you can associate a stream context only after the IRP_MJ_CREATE has been processed by the file system; basically in your PostCallback routine for IRP_MJ_CREATE or sometime after that.
How will STORING A STREAM CONTEXT help the OP to filter apps out??
You just don’t want to call that function after the create operation has finished (post op), obviously that could have disasterous effects.
If the OP WISHES to use FltCancelFileOpen, he must do that in PostCallback of IRP_MJ_CREATE ONLY.
However, FltCancelFileOpen approach is NOT good for what the OP wants to develop.
Regards,
Ayush Gupta
NTFSD is sponsored by OSR
For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com