- Fixed the parameters for NtOpenFile in InternalFindFirstFile.  
- Closed the opened directory on error in InternalFindFirstFile.
Modified: trunk/reactos/lib/kernel32/file/find.c

Modified: trunk/reactos/lib/kernel32/file/find.c
--- trunk/reactos/lib/kernel32/file/find.c	2005-05-05 11:05:05 UTC (rev 14990)
+++ trunk/reactos/lib/kernel32/file/find.c	2005-05-05 11:07:28 UTC (rev 14991)
@@ -256,8 +256,8 @@
 	                     FILE_LIST_DIRECTORY,
 	                     &ObjectAttributes,
 	                     &IoStatusBlock,
-	                     FILE_OPEN_IF,
-	                     OPEN_EXISTING);
+	                     FILE_SHARE_READ|FILE_SHARE_WRITE,
+	                     FILE_DIRECTORY_FILE);
 
 	RtlFreeHeap (hProcessHeap,
 	             0,
@@ -298,6 +298,7 @@
 	if (!NT_SUCCESS(Status))
 	{
 	   DPRINT("Status %lx\n", Status);
+	   CloseHandle (IData->DirectoryHandle);
 	   RtlFreeHeap (hProcessHeap, 0, IData);
 	   SetLastErrorByStatus (Status);
 	   return NULL;