I am developing a mini-filter to intercept files and get the name of files which are dragged & dropped to a specific disk and get the file names.
If I drag & drop a file, I can get this file name and intercept it successfully (That's mean this file is not created on disk).
If I drag & drop multiple files, I can only get the first file name and other is not. But when I open the disk, I don't see any file here (That's mean Mini-Filter intercept them successfully). So I can not get the file names (except the first file)
I intercept drag & drop by redirect them:
- Get file name by FltGetFileNameInformation() then FltParseFileNameInformation()
- Split it two part
- First is: \Device\HarddiskVolume1\folder\
- Second is: file.ext
- Append a file name for first part: \Device\HarddiskVolume1\folder\new_file.ext
- Intercept create on disk
- Release this buffer: Data->Iopb->TargetFileObject->FileName.Buffer
- Assign first part to Data->Iopb->TargetFileObject->FileName
- Set this: Data->Iopb->TargetFileObject->RelatedFileObject = NULL;
- Data->IoStatus.Information = IO_REPARSE;
- Data->IoStatus.Status = STATUS_REPARSE;
- return FLT_PREOP_SUCCESS_NO_CALLBACK;
Above code can only intercept all files and get the first file name.
How can I do to intercept each file when I drag & drop multiple file?