Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-07-27 14:10:57 +0400
committerCorinna Vinschen <corinna@vinschen.de>2007-07-27 14:10:57 +0400
commitceaf31f416220413feedcad1cc3e9f30f57dc28f (patch)
tree6e99d0266682d6c637a9169194bba47bc8df0d06 /winsup/cygwin/ntdll.h
parent655639ba89fd6f9ca760b052981394cca04e49c9 (diff)
* fhandler_disk_file.cc (fhandler_base::fstat_by_name): Use
RtlSplitUnicodePath. (fhandler_disk_file::fstat): Rename oret to opened. Open file using NT functions right here. Try to open parent dir instead of root directory to avoid call to rootdir. Use NtFsControlFile. * ntdll.h (RtlSplitUnicodePath): Define.
Diffstat (limited to 'winsup/cygwin/ntdll.h')
-rw-r--r--winsup/cygwin/ntdll.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h
index d3837bb99..cb2cccfa1 100644
--- a/winsup/cygwin/ntdll.h
+++ b/winsup/cygwin/ntdll.h
@@ -805,4 +805,18 @@ extern "C"
dest->Length = dest->MaximumLength = len;
dest->Buffer = (PWSTR) buf;
}
+ inline
+ VOID NTAPI RtlSplitUnicodePath (PUNICODE_STRING path, PUNICODE_STRING dir,
+ PUNICODE_STRING file)
+ {
+ USHORT len = path->Length / sizeof (WCHAR);
+ while (len > 0 && path->Buffer[--len] != L'\\')
+ ;
+ ++len;
+ if (dir)
+ RtlInitCountedUnicodeString (dir, len * sizeof (WCHAR), path->Buffer);
+ if (file)
+ RtlInitCountedUnicodeString (file, path->Length - len * sizeof (WCHAR),
+ &path->Buffer[len]);
+ }
}