I am trying to get the user context under which the current thread is
executing. For this, I use OpenThreadToken, GetTokenInformation and
LookupAccountSid calls. These calls return results correctly in all cases
except in a case where the context is "ANONYMOUS LOGON" and "NT AUTHORITY".
In this case, all the above three calls succeed, but the LookupAccountSid
returns empty strings as user name and domain name. On NT 4.0, we get empty
strings and on Win 2K we get correctly the "ANONYMOUS LOGON" and "NT
AUTHORITY" as user and domain names.
On NT 4.0, if the OpenThreadToken & LookupAccountSid succeeds and returns
empty username/domain, can we safely assume that the context is ANONYMOUS
LOGON?
Thanks in Advance,
Satya