A drive was \Device\HarddiskVolumeN with N counted over the drives present
for QueryDosDevice but from the letter (C first) for the process image and
mapped file names, so Z: had two device names, and NtQueryObject answered
an empty name for every file. NativePaths now gives each drive one volume
device (C is 1 and the drives after it follow in letter order, A and B
last) and turns a Win32 path into the NT name the object manager uses: a
drive path on its volume device, a UNC path on \Device\Mup. QueryDosDevice,
the image and mapped file names and NtQueryObject (ObjectNameInformation of
a file) use it; the drive list QueryDosDevice and GetLogicalDrives share
moved there as well. Zig reads a file name this way to find its own path.
Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: the volume device naming and its callers
(cherry picked from commit 02cce32c5ee2b0c341e44ae6fa691f28aa51b62f)
CreateProcess with no application name looked for the program of its
command line in the caller's folder, the current folder, System32 and the
Windows folder, but never in PATH, where Windows looks last (after the
16-bit System folder, also added). Nim starts gcc.exe that way and could not
build anything. The folders of PATH come from one place now, which the
library search already used.
Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: the program search of CreateProcess
(cherry picked from commit f1d78cb8c699516f471e44c81252c65f9c896f58)
The standard search order for a library ends with the current directory and
the folders of the PATH variable; Raven stopped at the system folders, so a
program built with llvm-mingw's clang++ could not find libc++.dll on PATH,
and LoadLibrary never found a library there either.
The libraries a program imports are now also looked for in the directory it
starts in and the folders of its PATH (from the environment it was given, or
RAVEN_GUEST_PATH for a program started from the host), and LoadLibrary's
search ends with the PATH the program has at the time.
Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: the search step and the PATH helpers
(cherry picked from commit 1865571d0ccd6e36ace096193e9a7bf71de48161)
duf lists disks with FindFirstVolumeW and FindNextVolumeW, then asks
GetVolumePathNamesForVolumeNameW, GetVolumeInformationW and
GetDiskFreeSpaceExW about each volume by its \\?\Volume{GUID}\ name.
Each drive of the prefix is a volume whose GUID is made from its letter, so
the name is the same every time. The volume functions list them, name the
volume mounted at a drive's root (GetVolumeNameForVolumeMountPointW) and the
root a volume is mounted at, and every path function accepts a volume name
in place of the drive.
Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: the volume functions and the volume name in path resolution
(cherry picked from commit cc93d36368f72f5b43c213643a54abe9aa2564e0)