From 2a918254f6dcb20f624de444316242b75d9d403a Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 19 Nov 2024 10:18:07 +0100 Subject: [PATCH] WinStd, stdex, wxExtend: Update Signed-off-by: Simon Rozman --- CredWrite/PCH.h | 2 +- EventMonitor/ETWLog.h | 4 ++-- include/Common.props | 1 + lib/EAPBase/include/EAPXML.h | 4 ++-- lib/EapHost/src/Config.cpp | 4 ++-- lib/EapHost/src/Credentials.cpp | 6 +++--- lib/EapHost/src/Method.cpp | 18 +++++++++--------- lib/EapHost/src/PCH.h | 1 + lib/EapHost_UI/src/EapHost_UI.cpp | 4 ++-- lib/EapHost_UI/src/PCH.h | 1 + lib/GTC/src/PCH.h | 2 +- lib/MSCHAPv2/src/PCH.h | 2 +- lib/TTLS/src/Method.cpp | 1 + lib/TTLS_UI/src/Module.cpp | 8 ++++---- lib/TTLS_UI/src/PCH.h | 2 ++ lib/WinStd | 2 +- lib/stdex | 2 +- lib/wxExtend | 2 +- 18 files changed, 36 insertions(+), 30 deletions(-) diff --git a/CredWrite/PCH.h b/CredWrite/PCH.h index ba2826c..5cf8f8f 100644 --- a/CredWrite/PCH.h +++ b/CredWrite/PCH.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include // Must include after diff --git a/EventMonitor/ETWLog.h b/EventMonitor/ETWLog.h index b9761b2..252ca59 100644 --- a/EventMonitor/ETWLog.h +++ b/EventMonitor/ETWLog.h @@ -31,7 +31,7 @@ class wxPersistentETWListCtrl; #include #include -#include +#include #include #include @@ -155,7 +155,7 @@ protected: /// /// Functor for GUID comparison /// - struct less_guid : public std::binary_function + struct less_guid { /// /// Compares two GUIDs diff --git a/include/Common.props b/include/Common.props index 6239b56..45ecdfa 100644 --- a/include/Common.props +++ b/include/Common.props @@ -29,6 +29,7 @@ true true 26812 + stdcpp17 true diff --git a/lib/EAPBase/include/EAPXML.h b/lib/EAPBase/include/EAPXML.h index b3f5d23..45500f0 100644 --- a/lib/EAPBase/include/EAPXML.h +++ b/lib/EAPBase/include/EAPXML.h @@ -544,8 +544,8 @@ namespace eapxml #pragma once -#include -#include +#include +#include #include diff --git a/lib/EapHost/src/Config.cpp b/lib/EapHost/src/Config.cpp index 3f2e516..9e7f133 100644 --- a/lib/EapHost/src/Config.cpp +++ b/lib/EapHost/src/Config.cpp @@ -77,7 +77,7 @@ void eap::config_method_eaphost::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNo // Convert configuration BLOB to XML using EapHost (and ultimately method peer's EapPeerConfigBlob2Xml). com_obj pConfigDoc; eap_error error; - DWORD dwResult = EapHostPeerConfigBlob2Xml(0, m_type, (DWORD)m_cfg_blob.size(), const_cast(m_cfg_blob.data()), &pConfigDoc, get_ptr(error)); + DWORD dwResult = EapHostPeerConfigBlob2Xml(0, m_type, (DWORD)m_cfg_blob.size(), const_cast(m_cfg_blob.data()), &pConfigDoc, stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { HRESULT hr; @@ -108,7 +108,7 @@ void eap::config_method_eaphost::load(_In_ IXMLDOMNode *pConfigRoot) DWORD cfg_data_size = 0; eap_blob cfg_data; eap_error error; - DWORD dwResult = EapHostPeerConfigXml2Blob(0, pXmlElEapHostConfig, &cfg_data_size, get_ptr(cfg_data), &m_type, get_ptr(error)); + DWORD dwResult = EapHostPeerConfigXml2Blob(0, pXmlElEapHostConfig, &cfg_data_size, stdex::get_ptr(cfg_data), &m_type, stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { LPCBYTE _cfg_data = cfg_data.get(); m_cfg_blob.assign(_cfg_data, _cfg_data + cfg_data_size); diff --git a/lib/EapHost/src/Credentials.cpp b/lib/EapHost/src/Credentials.cpp index dc2bef1..eb778c1 100644 --- a/lib/EapHost/src/Credentials.cpp +++ b/lib/EapHost/src/Credentials.cpp @@ -265,9 +265,9 @@ eap::credentials::source_t eap::credentials_eaphost::combine( src != source_t::unknown ? (DWORD)m_cred_blob.size() : 0, src != source_t::unknown ? m_cred_blob.data() : NULL, NULL, &fInvokeUI, - &cred_data_size, get_ptr(cred_data), - get_ptr(identity), - get_ptr(error), + &cred_data_size, stdex::get_ptr(cred_data), + stdex::get_ptr(identity), + stdex::get_ptr(error), NULL); if (dwResult == ERROR_SUCCESS) { if (identity && !fInvokeUI) { diff --git a/lib/EapHost/src/Method.cpp b/lib/EapHost/src/Method.cpp index 6e75aaa..d1f2fc5 100644 --- a/lib/EapHost/src/Method.cpp +++ b/lib/EapHost/src/Method.cpp @@ -50,7 +50,7 @@ void eap::method_eaphost::begin_session( dwMaxSendPacketSize, NULL, NULL, NULL, &m_session_id, - get_ptr(error)); + stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { // Session succesfully created. } else if (error) @@ -64,7 +64,7 @@ void eap::method_eaphost::end_session() { // End EapHost peer session. eap_error_runtime error; - DWORD dwResult = EapHostPeerEndSession(m_session_id, get_ptr(error)); + DWORD dwResult = EapHostPeerEndSession(m_session_id, stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { // Session successfuly ended. } else if (error) @@ -90,7 +90,7 @@ EapPeerMethodResponseAction eap::method_eaphost::process_request_packet( dwReceivedPacketSize, reinterpret_cast(pReceivedPacket), &action, - get_ptr(error)); + stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { // Packet successfuly processed. return action_h2p(action); @@ -112,7 +112,7 @@ void eap::method_eaphost::get_response_packet( m_session_id, &size_max, &_packet, - get_ptr(error)); + stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { // Packet successfuly prepared. packet.assign(_packet, _packet + size_max); @@ -134,7 +134,7 @@ void eap::method_eaphost::get_result( m_session_id, EapHostPeerMethodResultFromMethod, &result, - get_ptr(error)); + stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { // Result successfuly returned. method::get_result(reason, pResult); @@ -181,7 +181,7 @@ void eap::method_eaphost::get_ui_context(_Out_ sanitizing_blob &context_data) m_session_id, &dwUIContextDataSize, &pUIContextData, - get_ptr(error)); + stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { // UI context data successfuly returned. context_data.assign(pUIContextData, pUIContextData + dwUIContextDataSize); @@ -207,7 +207,7 @@ EapPeerMethodResponseAction eap::method_eaphost::set_ui_context( dwUIContextDataSize, pUIContextData, &action, - get_ptr(error)); + stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { // UI context data successfuly returned. return action_h2p(action); @@ -225,7 +225,7 @@ void eap::method_eaphost::get_response_attributes(_Out_ EapAttributes *pAttribs) DWORD dwResult = EapHostPeerGetResponseAttributes( m_session_id, pAttribs, - get_ptr(error)); + stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { // Response attributes successfuly returned. } else if (error) @@ -244,7 +244,7 @@ EapPeerMethodResponseAction eap::method_eaphost::set_response_attributes(_In_ co m_session_id, pAttribs, &action, - get_ptr(error)); + stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { // Response attributes successfuly set. return action_h2p(action); diff --git a/lib/EapHost/src/PCH.h b/lib/EapHost/src/PCH.h index 664c922..b39ac61 100644 --- a/lib/EapHost/src/PCH.h +++ b/lib/EapHost/src/PCH.h @@ -12,6 +12,7 @@ #include "../../EAPBase/include/Module.h" +#include #include #include diff --git a/lib/EapHost_UI/src/EapHost_UI.cpp b/lib/EapHost_UI/src/EapHost_UI.cpp index 549385e..141c360 100644 --- a/lib/EapHost_UI/src/EapHost_UI.cpp +++ b/lib/EapHost_UI/src/EapHost_UI.cpp @@ -37,7 +37,7 @@ wxEapHostMethodConfigPanel::wxEapHostMethodConfigPanel(const eap::config_provide winstd::eap_method_info_array methods; winstd::eap_error error; - DWORD dwResult = EapHostPeerGetMethods(&methods, get_ptr(error)); + DWORD dwResult = EapHostPeerGetMethods(&methods, stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { for (DWORD i = 0; i < methods.dwNumberOfMethods; i++) m_method->Append(methods.pEapMethods[i].pwszFriendlyName, new wxEAPMethodTypeClientData(methods.pEapMethods[i].eaptype, methods.pEapMethods[i].eapProperties)); @@ -112,7 +112,7 @@ void wxEapHostMethodConfigPanel::OnSettings(wxCommandEvent& event) DWORD cfg_data_size = 0; winstd::eap_blob cfg_data; winstd::eap_error error; - DWORD dwResult = EapHostPeerInvokeConfigUI(GetHWND(), 0, data->m_type, (DWORD)data->m_cfg_blob.size(), data->m_cfg_blob.data(), &cfg_data_size, get_ptr(cfg_data), get_ptr(error)); + DWORD dwResult = EapHostPeerInvokeConfigUI(GetHWND(), 0, data->m_type, (DWORD)data->m_cfg_blob.size(), data->m_cfg_blob.data(), &cfg_data_size, stdex::get_ptr(cfg_data), stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { LPCBYTE _cfg_data = cfg_data.get(); data->m_cfg_blob.assign(_cfg_data, _cfg_data + cfg_data_size); diff --git a/lib/EapHost_UI/src/PCH.h b/lib/EapHost_UI/src/PCH.h index 36382b1..9235306 100644 --- a/lib/EapHost_UI/src/PCH.h +++ b/lib/EapHost_UI/src/PCH.h @@ -8,6 +8,7 @@ #include "../include/EapHost_UI.h" +#include #include #include diff --git a/lib/GTC/src/PCH.h b/lib/GTC/src/PCH.h index ceeb0c3..af90ec3 100644 --- a/lib/GTC/src/PCH.h +++ b/lib/GTC/src/PCH.h @@ -11,7 +11,7 @@ #include "../../EAPBase/include/Module.h" -#include +#include #include #include // include after Windows.h diff --git a/lib/MSCHAPv2/src/PCH.h b/lib/MSCHAPv2/src/PCH.h index 70b254a..cf207c2 100644 --- a/lib/MSCHAPv2/src/PCH.h +++ b/lib/MSCHAPv2/src/PCH.h @@ -12,7 +12,7 @@ #include "../../EAPBase/include/Module.h" -#include +#include #include #include // include after Windows.h diff --git a/lib/TTLS/src/Method.cpp b/lib/TTLS/src/Method.cpp index 07bc000..1f7fbac 100644 --- a/lib/TTLS/src/Method.cpp +++ b/lib/TTLS/src/Method.cpp @@ -83,6 +83,7 @@ EapPeerMethodResponseAction eap::method_eapmsg::process_request_packet( break; } // Do not break out of this case to allow continuing with the following case, checking there is no second mandatory EAP-Message present. + [[fallthrough]]; default: if (hdr->flags & diameter_avp_flag_mandatory) diff --git a/lib/TTLS_UI/src/Module.cpp b/lib/TTLS_UI/src/Module.cpp index 88ddea8..f6657bd 100644 --- a/lib/TTLS_UI/src/Module.cpp +++ b/lib/TTLS_UI/src/Module.cpp @@ -215,9 +215,9 @@ void eap::peer_peap_ui::invoke_identity_ui( hwndParent, (DWORD)cfg_inner_eaphost->m_cfg_blob.size(), cfg_inner_eaphost->m_cfg_blob.data(), (DWORD)cred_inner->m_cred_blob.size(), cred_inner->m_cred_blob.data(), - &cred_data_size, get_ptr(cred_data), - get_ptr(identity), - get_ptr(error), + &cred_data_size, stdex::get_ptr(cred_data), + stdex::get_ptr(identity), + stdex::get_ptr(error), NULL); if (dwResult == ERROR_SUCCESS) { // Inner EAP method provided credentials. @@ -330,7 +330,7 @@ void eap::peer_peap_ui::invoke_interactive_ui( ctx.m_data.data(), &dwSizeofDataFromInteractiveUI, &pDataFromInteractiveUI, - get_ptr(error)); + stdex::get_ptr(error)); if (dwResult == ERROR_SUCCESS) { // Inner EAP method provided response. ctx.m_data.assign(pDataFromInteractiveUI, pDataFromInteractiveUI + dwSizeofDataFromInteractiveUI); diff --git a/lib/TTLS_UI/src/PCH.h b/lib/TTLS_UI/src/PCH.h index 66e5df2..280dbc9 100644 --- a/lib/TTLS_UI/src/PCH.h +++ b/lib/TTLS_UI/src/PCH.h @@ -20,4 +20,6 @@ #include "../../EapHost/include/Credentials.h" #include "../../EapBase/include/UIContext.h" +#include + #include diff --git a/lib/WinStd b/lib/WinStd index 9ff26e1..f85047d 160000 --- a/lib/WinStd +++ b/lib/WinStd @@ -1 +1 @@ -Subproject commit 9ff26e14227c1c9243e882e49d5960b215cc9603 +Subproject commit f85047dab9f000b625864eb930e11f650831ef7c diff --git a/lib/stdex b/lib/stdex index ff8ca7f..246f2ba 160000 --- a/lib/stdex +++ b/lib/stdex @@ -1 +1 @@ -Subproject commit ff8ca7f073a34e4e2e7829e914e1db43271a15c4 +Subproject commit 246f2baa1e3a7964f173469da3fd16e8336094cc diff --git a/lib/wxExtend b/lib/wxExtend index e3a59d1..79ec083 160000 --- a/lib/wxExtend +++ b/lib/wxExtend @@ -1 +1 @@ -Subproject commit e3a59d1118053ed48dc15b83d17125da87c434dd +Subproject commit 79ec08365068ab6e03b06caef13de0ce6b06fcd5