Author: pschweitzer
Date: Sun Jun 4 16:59:25 2017
New Revision: 74914
URL:
http://svn.reactos.org/svn/reactos?rev=74914&view=rev
Log:
[UDFS]
Fix broken implementation of UDFGetFullNameInformation().
Always return full name length so that caller can allocate a big-enough buffer for later
call.
CORE-4375
Modified:
trunk/reactos/drivers/filesystems/udfs/fileinfo.cpp
Modified: trunk/reactos/drivers/filesystems/udfs/fileinfo.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/udfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/udfs/fileinfo.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/udfs/fileinfo.cpp [iso-8859-1] Sun Jun 4 16:59:25
2017
@@ -831,20 +831,22 @@
IN OUT PLONG PtrReturnedLength
)
{
+ ULONG BytesToCopy;
NTSTATUS RC = STATUS_SUCCESS;
AdPrint(("UDFGetFullNameInformation\n"));
PtrBuffer->FileNameLength = FileObject->FileName.Length;
+ BytesToCopy = FileObject->FileName.Length;
if (PtrBuffer->FileNameLength + sizeof( ULONG ) > (ULONG)(*PtrReturnedLength))
{
- PtrBuffer->FileNameLength = *PtrReturnedLength - sizeof( ULONG );
+ BytesToCopy = *PtrReturnedLength - sizeof( ULONG );
RC = STATUS_BUFFER_OVERFLOW;
}
- RtlCopyMemory( PtrBuffer->FileName, FileObject->FileName.Buffer,
PtrBuffer->FileNameLength );
+ RtlCopyMemory( PtrBuffer->FileName, FileObject->FileName.Buffer, BytesToCopy
);
// Reduce the available bytes by the amount stored into this buffer.
*PtrReturnedLength -= sizeof( ULONG ) + PtrBuffer->FileNameLength;