fn wToPrefixedFileW(path: [:0]const u16) !PathSpace

Converts the path to WTF16, null-terminated. If the path contains any namespace prefix, or is anything but a relative path (rooted, drive relative, etc) the result will have the NT-style prefix \??\.

Similar to RtlDosPathNameToNtPathName_U with a few differences:

  • Does not allocate on the heap.
  • Relative paths are kept as relative unless they contain too many .. components, in which case they are treated as drive-relative and resolved against the CWD.
  • Special case device names like COM1, NUL, etc are not handled specially (TODO)
  • . and space are not stripped from the end of relative paths (potential TODO)

Parameters

path: [:0]const u16,