28 Oct
2004
28 Oct
'04
10:01 a.m.
[Trent Mick]
There is a subtlety in CreateProcess in the Win32 API in that if one specifies an environment (via the lpEnvironment argument), the environment strings (A) must be sorted alphabetically and (B) that sort must be case-insensitive.
Well, the docs are lying about Win95 (it doesn't sort envar blocks). On NT+, the sort must also be in "Unicode order, without regard to locale" -- WTF that means: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/bas... The best discussion I found: http://www.mail-archive.com/cygwin@cygwin.com/msg15239.html That claims NT+ uses RTLCompareUnicodeString to search for envars (and that function has a case-insensitive option).