NameLength = (USHORT)dosName.MaximumLength + Data->Iopb->TargetFileObject->FileName.MaximumLength + 2;
NameBuffer = ExAllocatePoolWithTag(PagedPool,NameLength,NC_MAPPING_TAG);
NameString.Length = 0;
NameString.MaximumLength = NameLength;
NameString.Buffer = NameBuffer;
RtlCopyUnicodeString(&NameString, &dosName);
RtlAppendUnicodeStringToString(&NameString, &Data->Iopb->TargetFileObject->FileName);
Here we need to allocate pool for string. But Be careful pool allocation may lead to BSOD.