Commit Graph

169 Commits

Author SHA1 Message Date
Ken Thomases 3b74ac0f08 ntdll: Fix the "not found" status set by read_directory_stat() and read_directory_getattrlist() for when restart_scan is set. 2015-06-12 21:22:42 +09:00
Ken Thomases e7fa766378 Revert "ntdll: Avoid one of the calls to getattrlist() when read_directory_getattrlist() checks the case sensitivity of the file system.".
This was wrong-headed and could never have worked.  The second getattrlist()
call that I was trying to avoid was only necessary when the first fails.  Given
that the first failed, its results can't be used to avoid the second, no matter
what information we requested.

This reverts commit 5514df9d4e.
2015-06-12 21:22:42 +09:00
Ken Thomases 5514df9d4e ntdll: Avoid one of the calls to getattrlist() when read_directory_getattrlist() checks the case sensitivity of the file system.
Extract a new function, get_dir_case_sensitivity_attr_by_id(), from
get_dir_case_sensitivity_attr().  Call that instead of get_dir_case_sensitivity()
from read_directory_getattrlist().  We get the device and file system IDs from
the same getattrlist() call we're already doing, so that avoids an extra call.
2015-05-22 14:11:03 +09:00
Alexandre Julliard ee1528040e ntdll: Remove the special case for the NUL device. 2015-05-21 17:38:19 +09:00
Ken Thomases bb89f10e5e ntdll: Fix read_directory_getattrlist() to get the name of a symlink rather than its target, but still detect if the symlink is broken. 2015-05-21 13:59:56 +09:00
Ken Thomases 5c98448aa3 ntdll: If read_directory_getattrlist() finds that the file doesn't exist, return successful "no file" result to stop search. 2015-05-21 13:58:01 +09:00
Ken Thomases f6926b3515 ntdll: Increase name buffer size in read_directory_getattrlist() for UTF-8 encoding.
The docs for getattrlist() say that ATTR_CMN_NAME can return up to NAME_MAX + 1
Unicode characters (code points) encoded in UTF-8, which means it can be up to
NAME_MAX * 3 + 1 bytes.
2015-05-21 13:57:45 +09:00
Matteo Bruni 2f0febe60a ntdll: Ignore positive matches in read_directory_stat() for case-insensitive filesystems.
It's necessary to return the actual filename with correct casing and a
plain stat doesn't allow that. Make read_directory_stat() return the
result of the stat() call on a case-insensitive filesystem only when the
file is missing.
2015-05-20 17:32:16 +09:00
Matteo Bruni 5d65b9d0c2 ntdll: Implement a read_directory_getattrlist() function.
When searching for a specific filename on a case-insensitive filesystem
we first try with stat(). If stat() does find the file we currently
return the requested filename back.

That presents an issue when the application cares about the casing of the
actual file stored on-disk. Specifically, NtQueryDirectoryFile is
supposed to return the actual filename with correct casing.

One possible solution to the issue, without having to resort to manually
scanning the directory entries, is to make use of the OS X getattrlist()
function, since it can return the filename stored on the filesystem.
2015-05-20 17:32:09 +09:00
Francois Gouget ca1545cf17 ntdll: Remove unneeded NONAMELESSXXX directives. 2015-03-16 15:04:50 +09:00
Alexandre Julliard ff84bf8bdd ntdll: Move NtNotifyChangeDirectoryFile to file.c and make it use the standard fileio structure. 2015-03-02 23:00:28 +09:00
Erich E. Hoover ca51e113e4 ntdll: Unify retrieving the attributes of a file. 2014-12-17 19:42:23 +01:00
André Hentschel 6d50cfcac2 ntdll: Use a dynamic buffer for change notification data. 2014-09-23 17:17:11 +02:00
Felix Janda 3ae113a957 ntdll: getdents64 might have been defined previously. 2014-09-05 15:26:55 +02:00
Ken Thomases a14ed527d8 ntdll: In find_file_in_dir(), don't test directory entries' short names if the target name isn't a short name.
hash_short_file_name() will always create a short name of at least 8 characters
with the 5th being a tilde (~).  If the target name isn't of that form, then it
can never match any short name constructed from the directory entries.
2014-07-30 11:31:55 -05:00
Martin Storsjo 8cb42d4135 ntdll: Align FILE_*_DIRECTORY_INFORMATION structs to 8 bytes. 2014-05-15 19:04:56 +02:00
Martin Storsjo 114444ca9c ntdll: Don't write uninitialized bytes at the end of filenames. 2014-05-15 19:04:55 +02:00
Huw Davies ac79e160e7 ntdll: For Android look in /proc/mounts for mounted file systems. 2014-04-07 15:34:44 +02:00
Huw Davies 2139df003f ntdll: Add a replacement getmntent for Android.
Bionic has a stub function named getmntent which outputs an unimplemented message.
2014-04-07 15:34:43 +02:00
Frédéric Delanoy 502fc1aef9 ntdll: Use boolean type where appropriate. 2013-12-09 11:45:50 +01:00
Huw Davies fed9f67bc4 ntdll: Don't reduce the size of the local buffer when we come to read another batch of entries.
In the wildcard case, we can't know how much to reduce it by anyway.
2013-12-03 19:40:22 +01:00
Frédéric Delanoy 86fdca6750 ntdll: Use BOOL type where appropriate. 2013-10-30 09:45:20 +01:00
Alexandre Julliard 6666614a19 ntdll: Actually return the mount point in get_device_mount_point on Mac OS. 2013-09-04 16:28:10 +02:00
Alexandre Julliard d191d5bca0 ntdll: Use a RunOnce function to initialize directory lookup options. 2013-08-29 19:56:18 +02:00
Alexandre Julliard 581cef082e ntdll: Use fclose instead of endmntent since we use fopen anyway. 2013-07-29 21:07:12 +02:00
Alexandre Julliard 96b7c71cfe ntdll: Leave NtQueryDirectoryFile early when a non-wildcard mask is used in the getdirentries case.
This avoids having to retry the getdirentries call which may fail if
the buffer size is too small.
2013-07-01 19:51:20 +02:00
Andrew Talbot d0d28b96a4 ntdll: Avoid signed-unsigned integer comparisons. 2013-02-21 08:34:13 +01:00
Alexandre Julliard 606c88a348 ntdll: Use the __NR_ names for Linux system calls. 2013-01-21 21:37:02 +01:00
Alexandre Julliard 90e90e3b6a ntdll: Make the page_size variable global. 2013-01-08 16:35:30 +01:00
Vincas Miliūnas 6314cf0295 kernel32: Added implementation of FileIdBothDirectoryInfo for GetFileInformationByHandleEx. 2012-10-12 13:14:43 +02:00
André Hentschel aac478f51b ntdll: Catch bad pointers in RtlWow64EnableFsRedirectionEx. 2012-08-22 12:11:19 +02:00
André Hentschel 54a9c0fc60 ntdll: Add a helper function that returns the record length of a dirent struct. 2012-06-04 12:17:56 +02:00
André Hentschel 1b1af34173 ntdll: Change default COM device for FreeBSD 8.0. 2012-06-04 12:17:55 +02:00
André Hentschel 1748f0de4e ntdll: Add default COM device for DragonFly BSD. 2012-06-04 12:17:54 +02:00
André Hentschel 1013d2e75c ntdll: Enhance FreeBSD checks to also check for DragonFly BSD when appropriate. 2012-06-04 12:17:54 +02:00
Grazvydas Ignotas edd4356dba ntdll: Fix restart size calculation. 2011-11-02 20:01:15 +01:00
Marcus Meissner 811ae03aeb ntdll: Avoid shadowing "de" variable. 2011-10-20 11:07:08 +02:00
Marcus Meissner 956487434d ntdll: Handle errno also for non ENOENT errors on lseek (Coverity). 2011-08-31 19:43:07 +02:00
Grazvydas Ignotas 006413afe4 ntdll: Use swapping method to return . and .. as first entries. 2011-08-24 13:56:37 +02:00
Alexandre Julliard f4024eaa49 ntdll: Fetch the windows directory from the shared user data. 2011-06-16 12:29:21 +02:00
Bart Van Assche e5fe510720 ntdll: Avoid examining uninitialized data. 2011-03-31 12:49:34 +02:00
Andrew Nguyen c698fc86b9 ntdll: Fix one-time warning message output. 2011-02-01 12:38:57 +01:00
Charles Davis 4e44e153c5 ntdll: Check for case-insensitive volumes. 2011-01-28 17:23:57 +01:00
Piotr Caban b614a15328 server: Return multiple events in read_changes. 2011-01-19 14:13:33 +01:00
Alexandre Julliard 0f9e93afaa ntdll: Use the getdents64 system call on all Linux platforms. 2010-12-27 12:01:43 +01:00
Alexandre Julliard 37ae7a533c ntdll: Use the syscall function instead of inline assembly. 2010-12-23 16:10:18 +01:00
Gerald Pfeifer dfa200d1e8 ntdll: Avoid compiler warning in the default case in append_entry. 2010-03-15 13:41:39 +01:00
Alexandre Julliard 25bee84030 ntdll: Don't require read access to the root directory for normal opens, similarly to the open by id case. 2010-01-08 15:54:20 +01:00
Gerald Pfeifer e8158e48cb ntdll: Avoid one warning around assert(0). 2009-12-29 13:17:30 +01:00
Gerald Pfeifer e8d387fd45 ntdll: Use #ifdef instead of #if to check for _DARWIN_FEATURE_64_BIT_INODE. 2009-12-28 12:27:15 +01:00