2

I am trying to redirect file creation on a volume of hard disk (i.e \Device\HarddiskVolume2)

I found redirecting file name in minifilter open pre. But I got a system dialog as below

enter image description here

Here is my code:

// I tested with pFileName = &Data->Iopb->TargetFileObject->FileName;
// It has same result
pFileName = &FltObjects->FileObject->FileName;
if (pFileName->Buffer != NULL)
    ExFreePool(pFileName->Buffer);

// gRedirectFullFilePath is \\Device\\HarddiskVolume2\\File.ext
pFileName->Length = gRedirectFullFilePath.Length;
pFileName->MaximumLength = pFileName->Length;
pFileName->Buffer = (PWCH) ExAllocatePool(NonPagedPool, pFileName->MaximumLength);
if (pFileName->Buffer == NULL)
    goto PreOperationCleanup;

RtlCopyUnicodeString(pFileName, &gRedirectFullFilePath);

// Change I/O status
Data->IoStatus.Information = IO_REPARSE;
Data->IoStatus.Status = STATUS_REPARSE;
Data->Iopb->TargetFileObject->RelatedFileObject = NULL;

FltSetCallbackDataDirty(Data);

return FLT_PREOP_COMPLETE;

I want this dialog to be not show. How should I do?

Thanks very much!

4

1 に答える 1