Redirect File - IO_REPARSE and On the fly decription

Hello guys!
I want to develop a driver in order to decrypt a specific file on the fly. I looked at Microsoft examples SwapBuffers /, but I dind’t understand too much for creating a simple example.
So, I am now trying to “simulate” that features, more exactly I thought that I can redirect on i access the encrypted file to a temporary file which contains plaintext data. I know this is not the best method, but I hope it works. I am new to windows driver and I am intending to use this driver to build an application for my bachelor degree.
I tried to implement this “redirect driver”. This is a code of PreRead operation of IRP_MJ_READ:

FLT_PREOP_CALLBACK_STATUS RedirectPreOperation(
Inout PFLT_CALLBACK_DATA Data,
In PCFLT_RELATED_OBJECTS FltObjects,
Flt_CompletionContext_Outptr PVOID* CompletionContext)
{
NTSTATUS status;

UNREFERENCED_PARAMETER(FltObjects);
UNREFERENCED_PARAMETER(CompletionContext);
WCHAR oldFile[1024] = { 0 };

PFLT_FILE_NAME_INFORMATION FileInfo;
UNICODE_STRING redirectTarget;
status = FltGetFileNameInformation(Data, FLT_FILE_NAME_NORMALIZED | FLT_FILE_NAME_QUERY_DEFAULT | FLT_FILE_NAME_DO_NOT_CACHE, &FileInfo);

if (NT_SUCCESS(status)) {
    status = FltParseFileNameInformation(FileInfo);
    if (NT_SUCCESS(status)) {

        RtlCopyMemory(oldFile, FileInfo->Name.Buffer, FileInfo->Name.MaximumLength);

        if (wcsstr(oldFile, L"write.txt") != NULL) {
            RtlInitUnicodeString(&redirectTarget, L"\\DosDevices\\C:\\Users\\ionut\\OneDrive\\Desktop\\2.txt");

            status = IoReplaceFileObjectName(Data->Iopb->TargetFileObject, redirectTarget.Buffer, redirectTarget.Length);

            if (NT_SUCCESS(status)) {
                Data->IoStatus.Information = IO_REPARSE;
                Data->IoStatus.Status = STATUS_REPARSE;
                Data->Iopb->TargetFileObject->RelatedFileObject = NULL;

                FltSetCallbackDataDirty(Data);
             
                DbgPrintEx(0, 0, "Rediect now \n");
            }

            return FLT_PREOP_COMPLETE;
        }
    }
    FltReleaseFileNameInformation(FileInfo);
}
return FLT_PREOP_SUCCESS_NO_CALLBACK;

}
I don’t know why this is happening.
The problem is after the i open the file “write.text” it redirects me to the “redirectTarget”, but its content was deleted and filled up with some garbage informations:
https://ibb.co/Fnf14gD
I look up at https://docs.microsoft.com/en-us/samples/microsoft/windows-driver-samples/simrep-file-system-minifilter-driver/, but i couldn’t build this sample.
My main goal is to develop a decryption/encryption driver on the fly, so if anyone can help me understanding developing such a driver, i will be very grateful.
Thank you all!

Redirect file name during a read won’t work.
Only in pre-create. It would work in post-create as well, but that opens a lot of cases that cannot be rolled back.