Hi
I have a minifilter which handles some data. When handling the IRP_MJ_CLEANUP I need to close a file that was opened by the minifilter. I do this by calling FltClose.
My Problem is that if the FILE_OBJECT has the FO_FILE_MODIFIED bit set then the FltClose never returns. I get the same result on both cases when I call on the Pre or on the Post handling routine. Below the stack of the thread in this case FltClose was handled in the Post routine.
Stack was obtained on a Win2003 X64 OS.
IRP List:
fffffabf53bb0c60: (0006,03a0) Flags: 40000404 Mdl: 00000000
fffffabf52e8ce10: (0006,01f0) Flags: 40000404 Mdl: 00000000
Not impersonating
DeviceMap fffffa8000004b90
Owning Process fffffadff3f84040 Image: System
Wait Start TickCount 10338 Ticks: 240 (0:00:00:03.750)
Context Switch Count 14556 LargeStack
UserTime 00:00:02.0468
KernelTime 00:00:03.0125
Start Address 0x0000000078d59630
Win32 Start Address 0x0000000000771280
Stack Init fffffadfeacbfe00 Current fffffadfeacbe420
Base fffffadfeacc0000 Limit fffffadfeacb4000 Call 0
Priority 8 BasePriority 8 PriorityDecrement 0
Child-SP RetAddr Call Site
fffffadfeacbe460 fffff8000103b403 nt!KiSwapContext+0x85
fffffadfeacbe5e0 fffff8000103c750 nt!KiSwapThread+0xc3
fffffadfeacbe620 fffff8000100b4a3 nt!KeWaitForSingleObject+0x525
fffffadfeacbe6b0 fffff8000105acad nt!ExpWaitForResource+0x1cb
fffffadfeacbe720 fffffadff1ae0a35 nt!ExAcquireResourceExclusiveLite+0x12a
fffffadfeacbe750 fffffadff1ae1351 Ntfs!NtfsCommonCleanup+0x260
fffffadfeacbeb50 fffff800013c82ab Ntfs!NtfsFsdCleanup+0x124
fffffadfeacbed50 fffffadff1ba7962 nt!IovCallDriver+0x20b
fffffadfeacbedd0 fffff800013c82ab fltMgr!FltpDispatch+0x1c2
fffffadfeacbee30 fffffadff1ba7962 nt!IovCallDriver+0x20b
fffffadfeacbeeb0 fffff800013c82ab fltMgr!FltpDispatch+0x1c2
fffffadfeacbef10 fffff800012c344e nt!IovCallDriver+0x20b
fffffadfeacbef90 fffff800012b3956 nt!IopCloseFile+0x342
fffffadfeacbf030 fffff800012b381e nt!ObpDecrementHandleCount+0x157
fffffadfeacbf090 fffff800012b3714 nt!ObpCloseHandleTableEntry+0x245
fffffadfeacbf130 fffff80001041422 nt!ObpCloseHandle+0xb0
fffffadfeacbf1b0 fffff80001041880 nt!KiSystemServiceCopyEnd+0x3 (TrapFrame @ fffffadfeacbf1b0) fffffadfeacbf348 fffffadfec510bcc nt!KiServiceLinkage fffffadfeacbf350 fffffadff1bd3629 myflt!MYFLT_PostCleanupOperation+0x30 fffffadfeacbf390 fffffadff1ba1fa6 fltMgr!FltvPostOperation+0x79 fffffadfeacbf3c0 fffffadff1ba67f7 fltMgr!FltpPerformPostCallbacks+0x286 fffffadfeacbf480 fffff800013c8a4c fltMgr!FltpPassThroughCompletion+0xe7 fffffadfeacbf4d0 fffff8000103c595 nt!IovpLocalCompletionRoutine+0xfc fffffadfeacbf520 fffff800013c88f8 nt!IopfCompleteRequest+0x117 fffffadfeacbf570 fffffadfee5a1e42 nt!IovCompleteRequest+0x1d8 fffffadfeacbf650 fffffadfee58fec7 Fastfat!FatCompleteRequest_Real+0xc2 fffffadfeacbf680 fffffadfee58f2c5 Fastfat!FatCommonCleanup+0xb67 fffffadfeacbf760 fffff800013c82ab Fastfat!FatFsdCleanup+0x75 fffffadfeacbf7a0 fffffadff1ba7962 nt!IovCallDriver+0x20b fffffadfeacbf820 fffff800013c82ab fltMgr!FltpDispatch+0x1c2 fffffadfeacbf880 fffffadff1ba759a nt!IovCallDriver+0x20b fffffadfeacbf900 fffffadff1ba791f fltMgr!FltpLegacyProcessingAfterPreCallbacksCompleted+0x41a fffffadfeacbf970 fffff800013c82ab fltMgr!FltpDispatch+0x17f fffffadfeacbf9d0 fffff800012c344e nt!IovCallDriver+0x20b fffffadfeacbfa50 fffff800012b3956 nt!IopCloseFile+0x342 fffffadfeacbfaf0 fffff800012b381e nt!ObpDecrementHandleCount+0x157 fffffadfeacbfb50 fffff800012b3714 nt!ObpCloseHandleTableEntry+0x245 fffffadfeacbfbf0 fffff80001041422 nt!ObpCloseHandle+0xb0 fffffadfeacbfc70 0000000078ef135a nt!KiSystemServiceCopyEnd+0x3 (TrapFrame @ fffffadfeacbfc70)
000000000012e508 0000000000000000 0x78ef135a
could anyone give me a hint what could be the reason for that ?
thanks
horatiu