Yes I never hit the breakpoint.
> -----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-301092-
xxxxx@lists.osr.com] On Behalf Of xxxxx@abv.bg
Sent: vendredi 21 septembre 2007 16:55
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] paging i/o problemYes I never hit the breakpoint.
[Edouard A.]
I would add a callback to all entries and see what happens. I’ve read your source and AFAICS nothing’s wrong.
Hope this helps.
–
Edouard A.
Ivan, from what I understand of your very first post you are using a minifilter not legacy. If this is still the case then this may be of interest to you.
I ran into this issue as well, and couldnt get it to give me any type of callbacks at all (whether I placed it before filter registration, or after in the DriverEntry)
Then I thought about it for a second. This would make sense for legacy, but for a minifilter the FltMgr handles this. So I simply added the callback in my registration and it worked like a champ.
So basically Legacy = Minifilter below from what I can tell, and I could be wrong, but it appears to work quite well for me, and makes sense. I think something to annotate where the line is between legacy and minifilter might be helpful in the MS documentation as many things bleed over from one to the other, and you cant always tell where the line is at times without having to dig in on the details.
CONST FLT_OPERATION_REGISTRATION Callbacks = {
…
{ IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION, 0, drvPreAcquireForSectionSynchronization, drvPostAcquireForSectionSynchronization}
…
{ IRP_MJ_OPERATION_END }
}
// This is legacy code, you wouldnt use this in your minifilter model if you are using the above
fsFilterCallbacks.PreAcquireForSectionSynchronization =
drvPreAcquireForSectionSynchronization;
fsFilterCallbacks.PostAcquireForSectionSynchronization = drvPostAcquireForSectionSynchronization; // (if you use this function at all, but this is just to give you the idea)
Then you can get the Data in the callback, use this (performing any safeties needed)
PFSRTL_ADVANCED_FCB_HEADER pFcb;
pFcb = (PFSRTL_ADVANCED_FCB_HEADER) Data->Iopb->TargetFileObject->FsContext;
and you should get what you are looking for. But remember, your function drvPreAcquireForSectionSynchronization uses the minifilter PFLT_PREOPERATION_CALLBACK format and not the legacy format.
Same thing applies for: IRP_MJ_ACQUIRE_FOR_MOD_WRITE, IRP_MJ_ACQUIRE_FOR_CC_FLUSH (and the release methods of them as well).
Look up FLT_REGISTRATION and FLT_OPERATION_REGISTRATION in the DDK docs.
–Royal
Thanks Royal, that was exactly the problem i just can’t believe that I didn’t think of trying to register using the standard minifilter registration. So since it is registered via the minifilter will it be possible to pend it somehow? Because I need to download the file. I tried standatd pend but i got access violation, Will it be bad to block it with FltSendMessage(), the user 32 application will reply after the file is downloaded and i will pass the request down? Is this a bad idea in terms of system performance and stability?