Author: pschweitzer
Date: Sat Apr 19 11:03:26 2014
New Revision: 62799
URL:
http://svn.reactos.org/svn/reactos?rev=62799&view=rev
Log:
[CDFS]
Rely on RTL when possible. Spotted by Thomas.
Modified:
trunk/reactos/drivers/filesystems/cdfs/dirctl.c
trunk/reactos/drivers/filesystems/cdfs/fcb.c
Modified: trunk/reactos/drivers/filesystems/cdfs/dirctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] Sat Apr 19 11:03:26 2014
@@ -215,15 +215,14 @@
{
/* it's root : complete essentials fields then return ok */
RtlZeroMemory(Fcb, sizeof(FCB));
+ RtlInitEmptyUnicodeString(&Fcb->PathName, Fcb->PathNameBuffer,
sizeof(Fcb->PathNameBuffer));
Fcb->PathNameBuffer[0] = '\\';
+ Fcb->PathName.Length = sizeof(WCHAR);
Fcb->ObjectName = &Fcb->PathNameBuffer[1];
Fcb->Entry.ExtentLocationL = DeviceExt->CdInfo.RootStart;
Fcb->Entry.DataLengthL = DeviceExt->CdInfo.RootSize;
Fcb->Entry.FileFlags = 0x02; //FILE_ATTRIBUTE_DIRECTORY;
- Fcb->PathName.Length = sizeof(WCHAR);
- Fcb->PathName.MaximumLength = sizeof(Fcb->PathNameBuffer);
- Fcb->PathName.Buffer = Fcb->PathNameBuffer;
if (pDirIndex)
*pDirIndex = 0;
@@ -308,9 +307,8 @@
{
if (Parent->PathName.Buffer[0])
{
+ RtlCopyUnicodeString(&Fcb->PathName, &Parent->PathName);
len = Parent->PathName.Length / sizeof(WCHAR);
- memcpy(Fcb->PathName.Buffer, Parent->PathName.Buffer,
Parent->PathName.Length);
- Fcb->PathName.Length = Parent->PathName.Length;
Fcb->ObjectName=&Fcb->PathName.Buffer[len];
if (len != 1 || Fcb->PathName.Buffer[0] != '\\')
{
@@ -576,8 +574,7 @@
DeviceExtension = DeviceObject->DeviceExtension;
Stack = IoGetCurrentIrpStackLocation(Irp);
FileObject = Stack->FileObject;
- TempFcb.PathName.Buffer = TempFcb.PathNameBuffer;
- TempFcb.PathName.MaximumLength = sizeof(TempFcb.PathNameBuffer);
+ RtlInitEmptyUnicodeString(&TempFcb.PathName, TempFcb.PathNameBuffer,
sizeof(TempFcb.PathNameBuffer));
Ccb = (PCCB)FileObject->FsContext2;
Fcb = (PFCB)FileObject->FsContext;
Modified: trunk/reactos/drivers/filesystems/cdfs/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/fcb.c [iso-8859-1] Sat Apr 19 11:03:26 2014
@@ -73,8 +73,7 @@
if(!Fcb) return NULL;
RtlZeroMemory(Fcb, sizeof(FCB));
- Fcb->PathName.Buffer = Fcb->PathNameBuffer;
- Fcb->PathName.MaximumLength = sizeof(Fcb->PathNameBuffer);
+ RtlInitEmptyUnicodeString(&Fcb->PathName, Fcb->PathNameBuffer,
sizeof(Fcb->PathNameBuffer));
if (FileName)
{