Windows drive letters are not limited to A-Z
11 days ago
- #Object Manager
- #Windows Internals
- #Drive Letters
- Windows allows non-standard drive letters (e.g., '+', '€') via `subst` or direct NT namespace manipulation.
- Drive letters in Windows are symbolic links in the Object Manager's `\??\` virtual folder, resolving to device paths like `\Device\HarddiskVolume4`.
- `RtlDosPathNameToNtPathName_U` converts Win32 paths (e.g., `C:\foo`) to NT paths (e.g., `\??\C:\foo`), treating any valid symbol as a drive letter.
- Explorer.exe and PowerShell restrict drive letters to A-Z, but cmd.exe supports non-ASCII letters (e.g., '€', 'λ').
- Non-ASCII drive letters must be ≤ U+FFFF (single UTF-16 code unit); higher code points fail in `subst` but can be created via `MountPointManager`.
- APIs like `SetVolumeMountPointW` may truncate non-ASCII drive letters (e.g., '€' → '¬'), revealing edge-case behavior.
- Path-handling libraries (e.g., Rust's `std::path`) often hardcode A-Z drive letters, causing mismatches with NT path conversion.