Author: pschweitzer
Date: Mon Jun 22 18:42:56 2015
New Revision: 68242
URL:
http://svn.reactos.org/svn/reactos?rev=68242&view=rev
Log:
[CDFS]
Prevent code duplication by making CdfsGetEntryName() call CdfsGetDirEntryName() which is
now available driver-wide
Modified:
trunk/reactos/drivers/filesystems/cdfs/cdfs.h
trunk/reactos/drivers/filesystems/cdfs/dirctl.c
trunk/reactos/drivers/filesystems/cdfs/fcb.c
trunk/reactos/drivers/filesystems/cdfs/misc.c
Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] Mon Jun 22 18:42:56 2015
@@ -484,6 +484,11 @@
CdfsIsRecordValid(IN PDEVICE_EXTENSION DeviceExt,
IN PDIR_RECORD Record);
+VOID
+CdfsGetDirEntryName(PDEVICE_EXTENSION DeviceExt,
+ PDIR_RECORD Record,
+ PWSTR Name);
+
/* rw.c */
NTSTATUS
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] Mon Jun 22 18:42:56 2015
@@ -117,31 +117,7 @@
DPRINT("Index %lu RecordLength %lu Offset %lu\n",
*pIndex, Record->RecordLength, *CurrentOffset);
- if (Record->FileIdLength == 1 && Record->FileId[0] == 0)
- {
- wcscpy(Name, L".");
- }
- else if (Record->FileIdLength == 1 && Record->FileId[0] == 1)
- {
- wcscpy(Name, L"..");
- }
- else
- {
- if (DeviceExt->CdInfo.JolietLevel == 0)
- {
- ULONG i;
-
- for (i = 0; i < Record->FileIdLength && Record->FileId[i] !=
';'; i++)
- Name[i] = (WCHAR)Record->FileId[i];
- Name[i] = 0;
- }
- else
- {
- CdfsSwapString(Name, Record->FileId, Record->FileIdLength);
- }
- }
-
- DPRINT("Name '%S'\n", Name);
+ CdfsGetDirEntryName(DeviceExt, Record, Name);
*Ptr = Record;
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] Mon Jun 22 18:42:56 2015
@@ -326,44 +326,6 @@
}
-static VOID
-CdfsGetDirEntryName(PDEVICE_EXTENSION DeviceExt,
- PDIR_RECORD Record,
- PWSTR Name)
- /*
- * FUNCTION: Retrieves the file name from a directory record.
- */
-{
- if (Record->FileIdLength == 1 && Record->FileId[0] == 0)
- {
- wcscpy(Name, L".");
- }
- else if (Record->FileIdLength == 1 && Record->FileId[0] == 1)
- {
- wcscpy(Name, L"..");
- }
- else
- {
- if (DeviceExt->CdInfo.JolietLevel == 0)
- {
- ULONG i;
-
- for (i = 0; i < Record->FileIdLength && Record->FileId[i] !=
';'; i++)
- Name[i] = (WCHAR)Record->FileId[i];
- Name[i] = 0;
- }
- else
- {
- CdfsSwapString(Name,
- Record->FileId,
- Record->FileIdLength);
- }
- }
-
- DPRINT("Name '%S'\n", Name);
-}
-
-
NTSTATUS
CdfsMakeFCBFromDirEntry(PVCB Vcb,
PFCB DirectoryFCB,
Modified: trunk/reactos/drivers/filesystems/cdfs/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/m…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/misc.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/misc.c [iso-8859-1] Mon Jun 22 18:42:56 2015
@@ -346,4 +346,41 @@
DPRINT("Returning short name %wZ for long name %wZ\n", ShortName,
LongName);
}
+VOID
+CdfsGetDirEntryName(PDEVICE_EXTENSION DeviceExt,
+ PDIR_RECORD Record,
+ PWSTR Name)
+ /*
+ * FUNCTION: Retrieves the file name from a directory record.
+ */
+{
+ if (Record->FileIdLength == 1 && Record->FileId[0] == 0)
+ {
+ wcscpy(Name, L".");
+ }
+ else if (Record->FileIdLength == 1 && Record->FileId[0] == 1)
+ {
+ wcscpy(Name, L"..");
+ }
+ else
+ {
+ if (DeviceExt->CdInfo.JolietLevel == 0)
+ {
+ ULONG i;
+
+ for (i = 0; i < Record->FileIdLength && Record->FileId[i] !=
';'; i++)
+ Name[i] = (WCHAR)Record->FileId[i];
+ Name[i] = 0;
+ }
+ else
+ {
+ CdfsSwapString(Name,
+ Record->FileId,
+ Record->FileIdLength);
+ }
+ }
+
+ DPRINT("Name '%S'\n", Name);
+}
+
/* EOF */