Have you confirmed that the system is not preforming a rename? How are
you testing the delete processing in your setup?
Pete
–
Kernel Drivers
Windows File System and Device Driver Consulting www.KernelDrivers.comhttp:</http:>
866.263.9295
------ Original Message ------
From: xxxxx@yahoo.com
To: “Windows File Systems Devs Interest List” Sent: 5/16/2016 3:23:46 AM Subject: RE:[ntfsd] Win10 x64 PreSetInfo cannot block DELETE operation ?
>Gabriel, the DELETE sample also does not consists any >STATUS_ACCESS_DENIED operation under pre-create operation. > >I have tracked DELETE signal and returned STATUS_ACCESS_DENIED on >pre-create(), pre-setinfo()operation based on: > >Data->Iopb->Parameters.Create.Options & FO_DELETE_ON_CLOSE > >FltObjects->FileObject->Flags & FO_DELETE_ON_CLOSE > >IS_DELETE_OPERATION( Data ) > >WHERE IS_DELETE_OPERATION() is: >#define IS_DELETE_OPERATION(Data) ( ( Data->Iopb->MajorFunction == >IRP_MJ_SET_INFORMATION ) && >( Data->Iopb->Parameters.SetFileInformation.FileInformationClass == >FileDispositionInformation ) && >( ( ( >PFILE_DISPOSITION_INFORMATION)Data->Iopb->Parameters.SetFileInformation.InfoBuffer)->DeleteFile >) ) > >However, none of this can block the DELETE operation under both Windows >10 x64 and x86. > >I am running out of solution or idea. > >Please adivse. > > >— >NTFSD is sponsored by OSR > > >MONTHLY seminars on crash dump analysis, WDF, Windows internals and >software drivers! >Details at http: > >To unsubscribe, visit the List Server section of OSR Online at >http:</http:></http:>
This is because the behavior of how file deletion is done change (Windows 8?) - rather than open/set information/close the sequence is now open-with-delete-on-close/close.
Look to see if you observe FILE_DELETE_ON_CLOSE specified in the create path.
I detected FILE_DELETE_ON_CLOSE at pre_create() stage and return a STATUS_ACCESS_DENIED and FLT_PREOP_COMPLETE, still cannot stop
Win10 from deleting a file.
I try to set DeleteFile to FALSE at pre_create() using FltSetInformationFile()
but FltSetInformationFile() returns a STATUS_INVALID_PARAMETER.
I detected FILE_DELETE_ON_CLOSE at pre_create() stage and return a
STATUS_ACCESS_DENIED and FLT_PREOP_COMPLETE, still cannot stop
Win10 from deleting a file.
I try to set DeleteFile to FALSE at pre_create() using
FltSetInformationFile()
but FltSetInformationFile() returns a STATUS_INVALID_PARAMETER.
I am not sure why the last CreateFile with Options DeleteOnClose can pass through the filter driver after Credential UAC Prompt is granted under Windows 10 ?
I just resolved the issues as when deleting a file under Windows 10 via SHELL context menu Delete option, immediately after the UAC Credential Prompt is granted, I found out kernel detects the behavior with abbreviation as shown below:
When right click and clicked the “Delete” option from shell context menu on a file (“License Agreement.txt” ).
pre_create(): fdoc=[1] exec=[0] \windows\explorer.exe —> \demo\readonly\license agreement.txt
Windows 10 pops up UAC Credential Prompt and clicked OK to grant:
pre_create(): fdoc=[0] exec=[1] \windows\system32\svchost.exe —> \windows\system32\dllhost.exe
pre_create(): fdoc=[1] exec=[0] \windows\system32\dllhost.exe —> \demo\readonly\license agreement.txt
Is my programming mistake that skipped any caller from \windows\system32\ where initially my intention was not to touch any caller application from windows\system32.
I am not sure this filtering method is efficient but it does work as expected via the same rejection method eg. STATUS_ACCESS_DENIED.
If there is any further comments or suggestions, I am ok to hear from it.