* 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.
This commit is contained in:
Corinna Vinschen
2007-07-27 10:10:57 +00:00
parent 655639ba89
commit ceaf31f416
3 changed files with 55 additions and 36 deletions

View File

@ -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]);
}
}