We're now looking for the location of krb5.ini on Windows like this:
len = GetWindowsDirectory(NULL, 0);
TCHAR* path = new TCHAR(len);
// krb5.ini should be in path now
However, in some Windows Server 2008 SP1 installations, a strange behavior is observed:
GetWindowsDirectory(NULL, 0) return 11, looks like length of "C:\Windows" + 1
GetWindowsDirectory(path, 11) returns 12, and fills path with ""
GetWindowsDirectory(longpath, 999) returns 20, and fills path with "C:\Users\Me\Windows"
The reason is unknown yet, but the result is Java looks for krb5.ini in "", and -- unfound.
This only happens in Windows 2008 (and Vista) when Terminal Services are installed.