diff --git a/CASA/logincapture/windows/lcredmgr.cpp b/CASA/logincapture/windows/lcredmgr.cpp index 82c54784..22a7d2f2 100644 --- a/CASA/logincapture/windows/lcredmgr.cpp +++ b/CASA/logincapture/windows/lcredmgr.cpp @@ -377,7 +377,7 @@ NPLogonNotify ( CP_UTF8, 0, pAuthInfo->UserName.Buffer, - -1, + pAuthInfo->UserName.Length/sizeof(WCHAR) + 1, //-1, (LPSTR)&basicCredential.username, NSSCS_MAX_USERID_LEN, NULL, @@ -391,7 +391,7 @@ NPLogonNotify ( CP_UTF8, 0, pAuthInfo->Password.Buffer, - -1, + pAuthInfo->Password.Length/sizeof(WCHAR) + 1, //-1, (LPSTR)&basicCredential.password, NSSCS_MAX_PWORD_LEN, NULL, @@ -431,28 +431,30 @@ NPLogonNotify ( if (pAuthInfo->LogonDomainName.Length != 0) { - domainCredential.len = WideCharToMultiByte( + memset(domainCredential.id, 0, NSSCS_MAX_SECRET_ID_LEN); + + domainCredential.len = WideCharToMultiByte( CP_UTF8, 0, pAuthInfo->LogonDomainName.Buffer, - -1, + pAuthInfo->LogonDomainName.Length/sizeof(WCHAR), (LPSTR)&domainCredential.id, NSSCS_MAX_SECRET_ID_LEN, NULL, NULL); - + if (domainCredential.len) { -// domainCredential.len++; + #ifdef _DEBUG DebugPrint("Domain exists - [%s], length %d\n", domainCredential.id, domainCredential.len); #endif ccode = (*pCASASetCredential)( - 0, - &desktopCredential, - &domainCredential, + 0, + &desktopCredential, + &domainCredential, SSCS_CRED_TYPE_BASIC_F, &basicCredential, &extension);