I am trying to connect using RASDIAL API on windows vista and windows 7. I am able to easily do this on windows XP systems.
I am not able to connect on windows vista and windows 7 only in release build. I am able to do this via the debug builds. Any idea why this is happening? I have written down the code i am using for this.
I am using the Aventail VPN 10.x apis to set custom auth data.
NGCUSTOMAUTHDATA NgAuthData;
NgAuthData.dwSize = sizeof(NgAuthData);
NgAuthData.dwOptions = NGCAD_OPTION_DisableGUI;
NgAuthData.dwAuthType = 2;
DWORD returnError=StringCbCopy( NgAuthData.szRealm,sizeof(NgAuthData.szRealm), wstringGroupName.c_str());
if (returnError != ERROR_SUCCESS){
return error;
}
DWORD nError = RasSetCustomAuthData(
pbkPath.c_str(),
wstringProfile.c_str(),
(BYTE *)&NgAuthData, NgAuthData.dwSize );
// Fill RASDIALPARAMS structure
RASDIALPARAMS rasdialparams;
rasdialparams.dwSize = sizeof(RASDIALPARAMS);
returnError |= StringCbCopy( rasdialparams.szEntryName,
sizeof(rasdialparams.szEntryName), wstringProfile.c_str() );
returnError |= StringCbCopy( rasdialparams.szPhoneNumber,
sizeof(rasdialparams.szPhoneNumber), wstringUrl.c_str() );
returnError |= StringCbCopy( rasdialparams.szUserName,
sizeof(rasdialparams.szUserName), wstringUser.c_str());
returnError |= StringCbCopy( rasdialparams.szPassword,
sizeof(rasdialparams.szPassword), wstringPassword.c_str() );
returnError |= StringCbCopy( rasdialparams.szDomain,
sizeof(rasdialparams.szDomain), wstringGroupName.c_str());
returnError |= StringCbCopy( rasdialparams.szDomain,
sizeof(rasdialparams.szDomain), L"\0");
if (returnError != ERROR_SUCCESS){
return error;
}
Most of the time, I keep getting internal authentication error. Please could you point me to the issue???
It was because I wasn't initializing all the parameters in rasdialparams. Also we need to set the mask param in the ngauthdata to its respective values before we use it.