Author: tfaber
Date: Thu Nov  6 00:07:01 2014
New Revision: 65278

URL: http://svn.reactos.org/svn/reactos?rev=65278&view=rev
Log:
[FASTFAT]
- Fix failure case handling in vfatUpdateFCB
- NULL output parameters on failure in vfatGetFCBForFile
- Fix a few typos

Modified:
    trunk/reactos/drivers/filesystems/fastfat/create.c
    trunk/reactos/drivers/filesystems/fastfat/fcb.c

Modified: trunk/reactos/drivers/filesystems/fastfat/create.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat/create.c?rev=65278&r1=65277&r2=65278&view=diff
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/create.c  [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/create.c  [iso-8859-1] Thu Nov  6 
00:07:01 2014
@@ -583,7 +583,7 @@
 
         idx = FileObject->FileName.Length / sizeof(WCHAR) - 1;
 
-        /* Skip tailing \ - if any */
+        /* Skip trailing \ - if any */
         if (PathNameU.Buffer[idx] == L'\\')
         {
             --idx;

Modified: trunk/reactos/drivers/filesystems/fastfat/fcb.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat/fcb.c?rev=65278&r1=65277&r2=65278&view=diff
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/fcb.c     [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fcb.c     [iso-8859-1] Thu Nov  6 
00:07:01 2014
@@ -371,21 +371,21 @@
 
     DPRINT("vfatUpdateFCB(%p, %p, %wZ, %wZ, %p)\n", pVCB, Fcb, LongName, 
ShortName, ParentFcb);
 
-    /* Delete old name */
-    if (Fcb->PathNameBuffer)
-    {
-        ExFreePoolWithTag(Fcb->PathNameBuffer, TAG_FCB);
-    }
-
-    /* Delete from table */
-    vfatDelFCBFromTable(pVCB, Fcb);
-
     /* Get full path name */
     Status = vfatMakeFullName(ParentFcb, LongName, ShortName, &Fcb->PathNameU);
     if (!NT_SUCCESS(Status))
     {
         return Status;
     }
+
+    /* Delete old name */
+    if (Fcb->PathNameBuffer)
+    {
+        ExFreePoolWithTag(Fcb->PathNameBuffer, TAG_FCB);
+    }
+
+    /* Delete from table */
+    vfatDelFCBFromTable(pVCB, Fcb);
 
     /* Split it properly */
     Fcb->PathNameBuffer = Fcb->PathNameU.Buffer;
@@ -414,8 +414,8 @@
     /* Add to the table */
     vfatAddFCBToTable(pVCB, Fcb);
 
-    /* If we moved accross directories, dereferenced our old parent
-     * We also derefence in case we're just renaming since AddFCBToTable 
references it
+    /* If we moved across directories, dereference our old parent
+     * We also dereference in case we're just renaming since AddFCBToTable 
references it
      */
     vfatReleaseFCB(pVCB, OldParent);
 
@@ -887,7 +887,7 @@
         if (parentFCB)
         {
             vfatReleaseFCB(pVCB, parentFCB);
-            parentFCB = 0;
+            parentFCB = NULL;
         }
         //  fail if element in FCB is not a directory
         if (!vfatFCBIsDirectory(FCB))
@@ -910,6 +910,8 @@
                 if (FileNameU.Length + parentFCB->LongNameU.Length - Length > 
FileNameU.MaximumLength)
                 {
                     vfatReleaseFCB(pVCB, parentFCB);
+                    *pParentFCB = NULL;
+                    *pFCB = NULL;
                     return STATUS_OBJECT_NAME_INVALID;
                 }
                 RtlMoveMemory(prev + parentFCB->LongNameU.Length / 
sizeof(WCHAR), curr,


Reply via email to