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

@@ -53,10 +53,10 @@ namespace eap
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
/// - \c true if succeeded
/// - \c false otherwise. See \p ppEapError for details.
///
virtual DWORD invoke_config_ui(
virtual bool invoke_config_ui(
_In_ HWND hwndParent,
_Inout_ config_type &cfg,
_Out_ EAP_ERROR **ppEapError);
@@ -74,10 +74,10 @@ namespace eap
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
/// - \c true if succeeded
/// - \c false otherwise. See \p ppEapError for details.
///
virtual DWORD invoke_identity_ui(
virtual bool invoke_identity_ui(
_In_ HWND hwndParent,
_In_ DWORD dwFlags,
_Inout_ config_type &cfg,
@@ -96,10 +96,10 @@ namespace eap
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
///
/// \returns
/// - \c ERROR_SUCCESS if succeeded
/// - error code otherwise
/// - \c true if succeeded
/// - \c false otherwise. See \p ppEapError for details.
///
virtual DWORD invoke_interactive_ui(
virtual bool invoke_interactive_ui(
_In_ HWND hwndParent,
_In_ const interactive_request_type &req,
_Out_ interactive_response_type &res,

View File

@@ -30,7 +30,7 @@ eap::peer_ttls_ui::peer_ttls_ui() : peer_ui<eap::config_ttls, eap::credentials_t
}
DWORD eap::peer_ttls_ui::invoke_config_ui(
bool eap::peer_ttls_ui::invoke_config_ui(
_In_ HWND hwndParent,
_Inout_ config_type &cfg,
_Out_ EAP_ERROR **ppEapError)
@@ -59,11 +59,16 @@ DWORD eap::peer_ttls_ui::invoke_config_ui(
// Clean-up and return.
wxEntryCleanup();
return result == wxID_OK ? ERROR_SUCCESS : ERROR_CANCELLED;
if (result != wxID_OK) {
*ppEapError = make_error(ERROR_CANCELLED, 0, NULL, NULL, NULL, _T(__FUNCTION__) _T(" Cancelled."), NULL);
return false;
}
return true;
}
DWORD eap::peer_ttls_ui::invoke_identity_ui(
bool eap::peer_ttls_ui::invoke_identity_ui(
_In_ HWND hwndParent,
_In_ DWORD dwFlags,
_Inout_ config_type &cfg,
@@ -80,11 +85,11 @@ DWORD eap::peer_ttls_ui::invoke_identity_ui(
InitCommonControls();
MessageBox(hwndParent, _T(PRODUCT_NAME_STR) _T(" credential prompt goes here!"), _T(PRODUCT_NAME_STR) _T(" Credentials"), MB_OK);
return ERROR_SUCCESS;
return true;
}
DWORD eap::peer_ttls_ui::invoke_interactive_ui(
bool eap::peer_ttls_ui::invoke_interactive_ui(
_In_ HWND hwndParent,
_In_ const interactive_request_type &req,
_Out_ interactive_response_type &res,
@@ -97,5 +102,5 @@ DWORD eap::peer_ttls_ui::invoke_interactive_ui(
InitCommonControls();
MessageBox(hwndParent, _T(PRODUCT_NAME_STR) _T(" interactive UI goes here!"), _T(PRODUCT_NAME_STR) _T(" Prompt"), MB_OK);
return ERROR_SUCCESS;
return true;
}