[2/3] ntdll: don't treat DOS paths starting with / as Unix paths

Chris Howe mrmessiah at gmail.com
Wed Apr 8 03:11:52 CDT 2009

2009/4/8 Ben Klein <shacklein at gmail.com>
> This is what I meant about magic translation. It *shouldn't* work, but
> I'm aware that it does. DOS/Windows uses backslash as the delimiter
> when reporting and storing paths. Is the behaviour of magic
> translation from foreslash to backslash documented (by Microsoft)
> anywhere?

Microsoft's Larry Osterman blogs about it here

"The DOS developers weren't particularly happy about [the choice of path
character] so they coded the OS to accept either "/" or "\" character as the
path character (this continues today, btw - try typing "notepad c:/boot.ini"
on an XP machine (if you're an admin)).  And they went one step further.
They added an undocumented system call to change the switch character.
And updated the utilities to respect this flag.

And then they went and finished out the scenario:  They added a config.sys
option, SWITCHAR= that would let you set the switch character to "-".
Which flipped MS-DOS into a *nix style system where command lines used
"-switch", and paths were / delimited.

I don't know the fate of the switchar API, it's been long gone for many years

At what level this translation takes place - whether it's something in the
command interpreter or further down into the API - I don't know.


More information about the wine-devel mailing list