Hi all,
I am working on the Filesystem filter driver (Composite filesystem) and I
want to change the
long filename into short filename (8.3) with my logic (I already implemented
the logic to create
the 8.3 filename/string), but I dont know how to change this new string to
file system while
creating the file itself (IRP_MJ_CREATE).
Please check the following code snippets and let me know whether I can try
like this.
*FileName = &(IrpSp->FileObject->FileName);
FileNameBuffer = ExAllocatePool( NonPagedPool, NewFileName.MaximumLength );
if (!FileNameBuffer)
{
//
// Not enough resources. Complete the IRP with the appropriate status.
//
Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
Irp->IoStatus.Information = 0;
IoCompleteRequest( Irp, IO_NO_INCREMENT );
return STATUS_INSUFFICIENT_RESOURCES;
}
ExFreePool( FileName->Buffer );
FileName->Buffer = FileNameBuffer;
FileName->MaximumLength = NewFileName.MaximumLength;
RtlCopyUnicodeString( FileName, &NewFileName );
*
Thanks in advance.
Elango C
Unidesk, Inc.
website:http://celango.blogspot.com
"Obstacles are those frightful things you see
when you take your eyes off your goal."