我正在尝试在硬盘卷上重定向文件创建(即 \Device\HarddiskVolume2)
我在 minifilter open pre 中找到了重定向文件名。但我有一个系统对话框如下
这是我的代码:
// 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;
我希望这个对话框不显示。我应该怎么做?
非常感谢!