Ah, fair. On modern Windows it's really cmd.exe faking it with env vars, not the API. Didn't know NT reserved space for per-drive CWDs and then never used it.
> Didn't know NT reserved space for per-drive CWDs and then never used it.
RTL_USER_PROCESS_PARAMETERS has a field “RTL_DRIVE_LETTER_CURDIR CurrentDirectores[32]” (note the misspelling). And then RTL_DRIVE_LETTER_CURDIR is defined as:
typedef struct _RTL_DRIVE_LETTER_CURDIR
{
WORD Flags;
WORD Length;
ULONG TimeStamp;
STRING DosPath;
} RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
But, AFAIK, Microsoft has never shipped anything that uses it. My own impression is this was the original design for handling compatibility with the DOS current directory behaviour, but they ended up deciding on doing it in cmd.exe instead. And of course, NTVDM and 16-bit Windows app support, but I think that just used the 16-bit DOS code and its associated data structures.
RTL_USER_PROCESS_PARAMETERS has a field “RTL_DRIVE_LETTER_CURDIR CurrentDirectores[32]” (note the misspelling). And then RTL_DRIVE_LETTER_CURDIR is defined as:
But, AFAIK, Microsoft has never shipped anything that uses it. My own impression is this was the original design for handling compatibility with the DOS current directory behaviour, but they ended up deciding on doing it in cmd.exe instead. And of course, NTVDM and 16-bit Windows app support, but I think that just used the 16-bit DOS code and its associated data structures.https://www.geoffchappell.com/studies/windows/km/ntoskrnl/in...