Sample code in windows application using windows API 'GetUserName'
dwUserNameLen := cnMaxUserNameLen - 1;
SetLength(UserName, cnMaxUserNameLen);
GetUserName(PChar(UserName), dwUserNameLen);
SetLength(UserName, dwUserNameLen);
Self.AddLog('GetUserName:'+UserName);
In Windows application, it can return the correct logon windows Id, but the same code does not work in ISAPI mode, it only return the default id defined in IIS (Server).