- Free always the name string and the completion context in IopDeleteFile.  
- Fixed the check for synchronous operations in NtQueryDirectoryFile.
Modified: trunk/reactos/ntoskrnl/io/file.c

Modified: trunk/reactos/ntoskrnl/io/file.c
--- trunk/reactos/ntoskrnl/io/file.c	2005-05-05 10:59:34 UTC (rev 14988)
+++ trunk/reactos/ntoskrnl/io/file.c	2005-05-05 11:03:27 UTC (rev 14989)
@@ -227,19 +227,20 @@
             KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
         }
       
-        /* Clear the file name */  
-        if (FileObject->FileName.Buffer)
-        {
-            ExFreePool(FileObject->FileName.Buffer);
-            FileObject->FileName.Buffer = NULL;
-        }
+    }
+
+    /* Clear the file name */  
+    if (FileObject->FileName.Buffer)
+    {
+       ExFreePool(FileObject->FileName.Buffer);
+       FileObject->FileName.Buffer = NULL;
+    }
         
-        /* Free the completion context */
-        if (FileObject->CompletionContext)
-        {
-            ObDereferenceObject(FileObject->CompletionContext->Port);
-            ExFreePool(FileObject->CompletionContext);
-        }
+    /* Free the completion context */
+    if (FileObject->CompletionContext)
+    {
+       ObDereferenceObject(FileObject->CompletionContext->Port);
+       ExFreePool(FileObject->CompletionContext);
     }
 }
 
@@ -2146,7 +2147,7 @@
    IoStack->Parameters.QueryDirectory.Length = Length;
    
    Status = IoCallDriver(FileObject->DeviceObject,Irp);
-   if (Status==STATUS_PENDING && !(FileObject->Flags & FO_SYNCHRONOUS_IO))
+   if (Status==STATUS_PENDING && (FileObject->Flags & FO_SYNCHRONOUS_IO))
      {
  KeWaitForSingleObject(&FileObject->Event,
          Executive,