Hi,
My file system filter driver will determine if a file can be deleted,
I wrote the following code in my dispatch routine to implement this:
// …
if(CanNotBeDeleted)
{
Irp->IoStatus.Status = STATUS_ACCESS_DENIED;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_ACCESS_DENIED;
}
// …
The goal of deletion prevention is achieved, but when I try to open the
protected file, the system says something like “This file is currently
opened by some other process” and fails to open it.
Thanks for any suggestions!
Chen