Module: wine Branch: master Commit: 6677565f34d19a55c3f17f4eef764f0dbc5d9b98 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6677565f34d19a55c3f17f4eef...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Dec 2 17:33:28 2009 +0100
ntdll: Don't report a file id for directory entries that are on a different device.
---
dlls/ntdll/directory.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index de8d57c..b01519e 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -166,6 +166,7 @@ static const int is_case_sensitive = FALSE; UNICODE_STRING windows_dir = { 0, 0, NULL }; /* windows directory */ UNICODE_STRING system_dir = { 0, 0, NULL }; /* system directory */
+static struct file_identity curdir; static struct file_identity windir;
static RTL_CRITICAL_SECTION dir_section; @@ -1025,6 +1026,7 @@ static union file_directory_info *append_entry( void *info_ptr, IO_STATUS_BLOCK io->u.Status = STATUS_BUFFER_OVERFLOW; } info = (union file_directory_info *)((char *)info_ptr + io->Information); + if (st.st_dev != curdir.dev) st.st_ino = 0; /* ignore inode if on a different device */ /* all the structures start with a FileDirectoryInformation layout */ fill_stat_info( &st, info, class ); info->dir.NextEntryOffset = total_len; @@ -1713,6 +1715,10 @@ NTSTATUS WINAPI NtQueryDirectoryFile( HANDLE handle, HANDLE event, cwd = open( ".", O_RDONLY ); if (fchdir( fd ) != -1) { + struct stat st; + fstat( fd, &st ); + curdir.dev = st.st_dev; + curdir.ino = st.st_ino; #ifdef VFAT_IOCTL_READDIR_BOTH if ((read_directory_vfat( fd, io, buffer, length, single_entry, mask, restart_scan, info_class )) != -1) goto done;