Hi everyone, may I ask why my minifilter program cannot clear the cache when I enable verifier? And when I didn't turn on the verifier, I was able to clear the cache normally。thanks!
this is my code:
NTSTATUS FlushAndPurgeCache(
IN PFLT_INSTANCE Instance,
IN PFILE_OBJECT FileObject)
{
if (NULL == Instance)
{
return STATUS_INVALID_PARAMETER;
}
if (NULL == FileObject)
{
return STATUS_INVALID_PARAMETER;
}
NTSTATUS Status = STATUS_UNSUCCESSFUL;
PFLT_CALLBACK_DATA Data = NULL;
Status = FltAllocateCallbackData(Instance, FileObject, &Data);
if (STATUS_SUCCESS != Status)
{
return Status;
}
Data->Iopb->MajorFunction = IRP_MJ_FLUSH_BUFFERS;
Data->Iopb->MinorFunction = IRP_MN_FLUSH_AND_PURGE;
Data->Iopb->IrpFlags = IRP_SYNCHRONOUS_API;
FltPerformSynchronousIo(Data);
FltFreeCallbackData(Data);
return Data->IoStatus.Status;
}