summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/ntdll.h
diff options
context:
space:
mode:
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]);
+ }
}