SEC_WINNT_AUTH_IDENTITY_EX domain member question



I have setup a struct with user/pass/domain information. And it successfully binds, but while testing I purposely entered in an incorrect domain and it still binds successfully. Was wondering why? Maybe it also searches the domain your window user is logged into at the time of the bind??? Code snippet is below, pretty straight forward. Thanks for any help!

Nate


SEC_WINNT_AUTH_IDENTITY clientCredentials;

clientCredentials.User = (unsigned char*)(_userName.gets());
clientCredentials.UserLength = _userName.size();
clientCredentials.Password = (unsigned char*)(_password.gets());
clientCredentials.PasswordLength = _password.size();
clientCredentials.Domain = (unsigned char*)(_domain.gets());
clientCredentials.DomainLength = _domain.size();
#ifdef UNICODE
clientCredentials.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
#else
clientCredentials.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
#endif

// Bind with user provided credentials
ldapResult = ldap_bind_s(
_pADConnection, // Session Handle
NIL, // Domain DN
(TCHAR *) &clientCredentials, // Credential structure
LDAP_AUTH_NTLM); // Auth mode
.