* 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:
@ -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]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user