wine/dlls/kernel file.c

Alexandre Julliard julliard at wine.codeweavers.com
Tue Nov 1 15:37:05 CST 2005


ChangeSet ID:	21024
CVSROOT:	/opt/cvs-commit
Module name:	wine
Changes by:	julliard at winehq.org	2005/11/01 15:37:05

Modified files:
	dlls/kernel    : file.c 

Log message:
	Bernd Schmidt <bernds_cb1 at t-online.de>
	Implemented FindExSearchLimitToDirectories.

Patch: http://cvs.winehq.org/patch.py?id=21024

Old revision  New revision  Changes     Path
 1.43          1.44          +16 -10     wine/dlls/kernel/file.c

Index: wine/dlls/kernel/file.c
diff -u -p wine/dlls/kernel/file.c:1.43 wine/dlls/kernel/file.c:1.44
--- wine/dlls/kernel/file.c:1.43	1 Nov 2005 21:37: 5 -0000
+++ wine/dlls/kernel/file.c	1 Nov 2005 21:37: 5 -0000
@@ -55,15 +55,16 @@ HANDLE dos_handles[DOS_TABLE_SIZE];
 /* info structure for FindFirstFile handle */
 typedef struct
 {
-    DWORD            magic;       /* magic number */
-    HANDLE           handle;      /* handle to directory */
-    CRITICAL_SECTION cs;          /* crit section protecting this structure */
-    UNICODE_STRING   mask;        /* file mask */
-    UNICODE_STRING   path;        /* NT path used to open the directory */
-    BOOL             is_root;     /* is directory the root of the drive? */
-    UINT             data_pos;    /* current position in dir data */
-    UINT             data_len;    /* length of dir data */
-    BYTE             data[8192];  /* directory data */
+    DWORD             magic;       /* magic number */
+    HANDLE            handle;      /* handle to directory */
+    CRITICAL_SECTION  cs;          /* crit section protecting this structure */
+    FINDEX_SEARCH_OPS search_op;   /* Flags passed to FindFirst.  */
+    UNICODE_STRING    mask;        /* file mask */
+    UNICODE_STRING    path;        /* NT path used to open the directory */
+    BOOL              is_root;     /* is directory the root of the drive? */
+    UINT              data_pos;    /* current position in dir data */
+    UINT              data_len;    /* length of dir data */
+    BYTE              data[8192];  /* directory data */
 } FIND_FIRST_INFO;
 
 #define FIND_FIRST_MAGIC  0xc0ffee11
@@ -1500,7 +1501,8 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR 
 
     TRACE("%s %d %p %d %p %lx\n", debugstr_w(filename), level, data, search_op, filter, flags);
 
-    if ((search_op != FindExSearchNameMatch) || (flags != 0))
+    if ((search_op != FindExSearchNameMatch && search_op != FindExSearchLimitToDirectories)
+	|| flags != 0)
     {
         FIXME("options not implemented 0x%08x 0x%08lx\n", search_op, flags );
         return INVALID_HANDLE_VALUE;
@@ -1572,6 +1574,7 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR 
     info->magic    = FIND_FIRST_MAGIC;
     info->data_pos = 0;
     info->data_len = 0;
+    info->search_op = search_op;
 
     if (!FindNextFileW( (HANDLE)info, data ))
     {
@@ -1650,6 +1653,9 @@ BOOL WINAPI FindNextFileW( HANDLE handle
         {
             if (!check_dir_symlink( info, dir_info )) continue;
         }
+	if (info->search_op == FindExSearchLimitToDirectories &&
+	    (dir_info->FileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
+	    continue;
 
         data->dwFileAttributes = dir_info->FileAttributes;
         data->ftCreationTime   = *(FILETIME *)&dir_info->CreationTime;



More information about the wine-cvs mailing list