diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-12-10 00:02:34 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-12-10 00:02:34 +0100 |
commit | eed35efbe67e3b0588d5afbdf7926eb9f52e5766 (patch) | |
tree | 11aa1f6370b9c5cce74850b2f8349436869cf8e1 /winsup/cygwin/path.h | |
parent | a0e7563eb06387eea03c498f4f03dcd29c332a39 (diff) | |
download | cygnal-eed35efbe67e3b0588d5afbdf7926eb9f52e5766.tar.gz cygnal-eed35efbe67e3b0588d5afbdf7926eb9f52e5766.tar.bz2 cygnal-eed35efbe67e3b0588d5afbdf7926eb9f52e5766.zip |
Fetch and store FileAllInformation rather than FileNetworkOpenInformation
* path.h (class path_conv_handle): Use FILE_ALL_INFORMATION instead of
FILE_NETWORK_OPEN_INFORMATION. Use definitions from ntdll.h since it's
included anyway.
(path_conv_handle::fai): Change name from fnoi.
(path_conv::fai): Ditto.
(file_get_fai): Change name from file_get_fnoi. Drop second parameter.
* path.cc (file_get_fai): Ditto. Fetch FileAllInformation rather than
FileNetworkOpenInformation. Convert STATUS_BUFFER_OVERFLOW to
STATUS_SUCCESS. Remove workaround to fetch FileBasicInformation and
FileStandardInformation on filesystems with broken
FileNetworkOpenInformation handling.
(symlink_info::check): Accommodate above changes. In case of using
the NtQueryDirectoryFile fallback, fetch FileIdBothDirectoryInformation
to get inode number as well.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop outdated
comment. Accommodate change to using FileAllInformation. Drop
extra function calls to fetch NumberOfLinks and IndexNumber. Set ino
directly from IndexNumber stored in pc.fai(). Drop second argument
from call to fstat_helper.
(fhandler_base::fstat_by_name): Drop second argument from call to
fstat_helper.
(fhandler_base::fstat_helper): Drop second parameter. Accommodate
the fact that we access a FILE_ALL_INFORMATION structure now.
(fhandler_base::open_fs): Set ino directly from IndexNumber stored in
pc.fai().
* fhandler.h (fhandler_base::fstat_helper): Fix declaration accrdingly.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/path.h')
-rw-r--r-- | winsup/cygwin/path.h | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index ab7222ee0..730f943c9 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -91,23 +91,12 @@ enum path_types }; class symlink_info; -struct _FILE_NETWORK_OPEN_INFORMATION; class path_conv_handle { HANDLE hdl; union { - /* Identical to FILE_NETWORK_OPEN_INFORMATION. We don't want to pull in - ntdll.h here, though. */ - struct { - LARGE_INTEGER CreationTime; - LARGE_INTEGER LastAccessTime; - LARGE_INTEGER LastWriteTime; - LARGE_INTEGER ChangeTime; - LARGE_INTEGER AllocationSize; - LARGE_INTEGER EndOfFile; - ULONG FileAttributes; - } _fnoi; + FILE_ALL_INFORMATION _fai; /* For NFS. */ fattr3 _fattr3; } attribs; @@ -128,8 +117,8 @@ public: hdl = NULL; } inline HANDLE handle () const { return hdl; } - inline struct _FILE_NETWORK_OPEN_INFORMATION *fnoi () - { return (struct _FILE_NETWORK_OPEN_INFORMATION *) &attribs._fnoi; } + inline PFILE_ALL_INFORMATION fai () + { return (PFILE_ALL_INFORMATION) &attribs._fai; } inline struct fattr3 *nfsattr () { return (struct fattr3 *) &attribs._fattr3; } }; @@ -390,7 +379,7 @@ class path_conv bool is_binary (); HANDLE handle () const { return conv_handle.handle (); } - struct _FILE_NETWORK_OPEN_INFORMATION *fnoi () { return conv_handle.fnoi (); } + PFILE_ALL_INFORMATION fai () { return conv_handle.fai (); } struct fattr3 *nfsattr () { return conv_handle.nfsattr (); } void reset_conv_handle () { conv_handle.set (NULL); } void close_conv_handle () { conv_handle.close (); } @@ -444,7 +433,7 @@ bool __reg2 has_dot_last_component (const char *dir, bool test_dot_dot); int __reg3 path_prefix_p (const char *path1, const char *path2, int len1, bool caseinsensitive); -NTSTATUS file_get_fnoi (HANDLE, bool, struct _FILE_NETWORK_OPEN_INFORMATION *); +NTSTATUS file_get_fai (HANDLE, PFILE_ALL_INFORMATION); int normalize_win32_path (const char *, char *, char *&); int normalize_posix_path (const char *, char *, char *&); PUNICODE_STRING __reg3 get_nt_native_path (const char *, UNICODE_STRING&, bool); |