in my minifilter,I want to implement:
if a file will be deleted,I will cancel the delete operation and rename it to a bak file.
I trace a deletepending flag in my streamcontext according to:
in PostCreate,the FILE_DELETE_ON_CLOSE flag;
in postSetInfo,the DeleteFile flag in FileDispositionInformation;
in PreCleanup:
if the deletepending flag is TRUE in my streamcontext,I do the following:
1.I want to cancel the delete operation:
I build a FileDisPositionInformation,and DeleteFile=FALSE,and call FltSetInformationFile;
2.I want to rename the file:
I build a valid FileRenameInformation,and call FltSetInformationFile;
In winxp,win2K3,everything is OK.
the file that the application want to delete will be renamed to a bak file.
But in Win2K(sp4+rollup1),deadlock!
many threads will wait for “Ntfs!NtfsAcquireExclusiveVcb”
ChildEBP RetAddr Args to Child
be31b9dc 8042c2ad 00000000 818854f4 814fc120 nt!KiSwapThread+0xc5
be31ba04 80415082 818a32a8 00000000 00000000 nt!KeWaitForSingleObject+0x1a1
be31ba44 8041457c 81550328 008854f4 be31ba5c nt!ExpWaitForResource+0x1ac
be31ba54 804145c1 be31baf8 bfeafa81 818854f4 nt!ExpAcquireResourceExclusiveLite+0x64
be31ba5c bfeafa81 818854f4 e135d101 81550328 nt!ExAcquireResourceExclusiveLite+0x37
be31ba6c bfe98c75 81550328 818850f0 00000000 Ntfs!NtfsAcquireExclusiveVcb+0x1b
be31baf8 bfe980d7 81550328 e13149b8 e13148e8 Ntfs!NtfsCommonClose+0xe7
be31bbb8 8041dded 81885020 8152d648 00000000 Ntfs!NtfsFsdClose+0x225
be31bbcc bff523ce 81856260 8152d648 81856908 nt!IopfCallDriver+0x35
be31bbf0 bff527e3 be31bc10 81856260 00000000 fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted+0x20e
be31bc28 8041dded 81856260 8152d648 8152d658 fltmgr!FltpDispatch+0x10f
be31bc3c 80428b01 00000000 814e9364 804289c0 nt!IopfCallDriver+0x35
be31bc74 804d5d98 81885000 814e9350 818792a0 nt!IopDeleteFile+0x141
be31bc90 8044e9a5 814e9368 e2104070 814e9350 nt!ObpRemoveObjectRoutine+0xd6
be31bcb4 8044ece4 be31bd64 00125fe4 8044eaec nt!ObfDereferenceObject+0x149
be31bd58 80464f84 00000438 00000000 00000000 nt!NtClose+0x1f8
be31bd58 77f88203 00000438 00000000 00000000 nt!KiSystemService+0xc4
00126020 00000000 00000000 00000000 00000000 NTDLL!NtClose+0xb
why???And what should I do?