From 8bff2d3060eb406102928ca76517cbc90c5a432c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 15 Jun 2016 10:44:31 +0200 Subject: [PATCH] Test credentials read added to debug builds of CredWrite --- CredWrite/CredWrite.rc | Bin 5904 -> 6068 bytes CredWrite/Main.cpp | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CredWrite/CredWrite.rc b/CredWrite/CredWrite.rc index 5e0e025969acdee873caf0867eb3ee0c27a8693d..07d1ff1c371cfd3c7cef514dda8da2893860a42b 100644 GIT binary patch delta 66 zcmbQBw?%)$4$jG^_~j V@)(pR`wNIp<`a|Ke2vqJ7XVhE5QhK& delta 16 Ycmdm@KS6K94$jG&#N;+taar*K06N$P3IG5A diff --git a/CredWrite/Main.cpp b/CredWrite/Main.cpp index a580998..84dc3ec 100644 --- a/CredWrite/Main.cpp +++ b/CredWrite/Main.cpp @@ -81,12 +81,25 @@ static int CredWrite() } // Write credentials. - EAP_ERROR *pEapError; + EAP_ERROR *pEapError = NULL; DWORD dwResult; +#ifdef _DEBUG + { + eap::credentials_pap cred_stored(g_module); + dwResult = 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); + } +#endif if ((dwResult = cred.store(target_name.c_str(), &pEapError)) != ERROR_SUCCESS) { 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);