Functions using EAP_ERROR descriptor return bool now for code simplicity

This commit is contained in:
2016-06-15 22:59:52 +02:00
parent 03358170f4
commit ec0b283540
27 changed files with 686 additions and 515 deletions

View File

@@ -82,27 +82,26 @@ static int CredWrite()
// Write credentials.
EAP_ERROR *pEapError = NULL;
DWORD dwResult;
#ifdef _DEBUG
{
eap::credentials_pap cred_stored(g_module);
if ((dwResult = cred_stored.retrieve(target_name.c_str(), &pEapError)) != ERROR_SUCCESS) {
if (!cred_stored.retrieve(target_name.c_str(), &pEapError)) {
if (pEapError) {
OutputDebugStr(_T("%ls (error %u)\n"), pEapError->pRootCauseString, pEapError->dwWinError);
g_module.free_error_memory(pEapError);
pEapError = NULL;
} else
OutputDebugStr(_T("Reading credentials failed (error %u).\n"), dwResult);
OutputDebugStr(_T("Reading credentials failed.\n"));
}
}
#endif
if ((dwResult = cred.store(target_name.c_str(), &pEapError)) != ERROR_SUCCESS) {
if (!cred.store(target_name.c_str(), &pEapError)) {
if (pEapError) {
OutputDebugStr(_T("%ls (error %u)\n"), pEapError->pRootCauseString, pEapError->dwWinError);
g_module.free_error_memory(pEapError);
pEapError = NULL;
} else
OutputDebugStr(_T("Writing credentials failed (error %u).\n"), dwResult);
OutputDebugStr(_T("Writing credentials failed.\n"));
return 2;
}