Address code analysis warnings

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
2019-08-22 20:44:38 +02:00
parent a459823beb
commit 6fb5cb88d2
60 changed files with 935 additions and 960 deletions

View File

@@ -83,7 +83,7 @@ namespace eap
///
/// \param[in] other Configuration to move from
///
config(_Inout_ config &&other);
config(_Inout_ config &&other) noexcept;
///
/// Copies configuration
@@ -101,7 +101,7 @@ namespace eap
///
/// \returns Reference to this object
///
config& operator=(_Inout_ config &&other);
config& operator=(_Inout_ config &&other) noexcept;
///
/// Clones this object
@@ -187,7 +187,7 @@ namespace eap
///
/// \param[in] other Configuration to move from
///
config_method(_Inout_ config_method &&other);
config_method(_Inout_ config_method &&other) noexcept;
///
/// Copies configuration
@@ -205,7 +205,7 @@ namespace eap
///
/// \returns Reference to this object
///
config_method& operator=(_Inout_ config_method &&other);
config_method& operator=(_Inout_ config_method &&other) noexcept;
/// \name XML management
/// @{
@@ -271,7 +271,7 @@ namespace eap
///
/// \param[in] other Configuration to move from
///
config_method_with_cred(_Inout_ config_method_with_cred &&other);
config_method_with_cred(_Inout_ config_method_with_cred &&other) noexcept;
///
/// Copies configuration
@@ -289,7 +289,7 @@ namespace eap
///
/// \returns Reference to this object
///
config_method_with_cred& operator=(_Inout_ config_method_with_cred &&other);
config_method_with_cred& operator=(_Inout_ config_method_with_cred &&other) noexcept;
/// \name XML management
/// @{
@@ -335,7 +335,7 @@ namespace eap
///
/// \param[in] other Configuration to move from
///
config_provider(_Inout_ config_provider &&other);
config_provider(_Inout_ config_provider &&other) noexcept;
///
/// Copies configuration
@@ -353,7 +353,7 @@ namespace eap
///
/// \returns Reference to this object
///
config_provider& operator=(_Inout_ config_provider &&other);
config_provider& operator=(_Inout_ config_provider &&other) noexcept;
virtual config* clone() const;
@@ -431,7 +431,7 @@ namespace eap
///
/// \param[in] other Configuration to move from
///
config_connection(_Inout_ config_connection &&other);
config_connection(_Inout_ config_connection &&other) noexcept;
///
/// Copies configuration
@@ -449,7 +449,7 @@ namespace eap
///
/// \returns Reference to this object
///
config_connection& operator=(_Inout_ config_connection &&other);
config_connection& operator=(_Inout_ config_connection &&other) noexcept;
virtual config* clone() const;

View File

@@ -86,7 +86,7 @@ namespace eap
///
/// \param[in] other Credentials to move from
///
credentials(_Inout_ credentials &&other);
credentials(_Inout_ credentials &&other) noexcept;
///
/// Copies credentials
@@ -104,7 +104,7 @@ namespace eap
///
/// \returns Reference to this object
///
credentials& operator=(_Inout_ credentials &&other);
credentials& operator=(_Inout_ credentials &&other) noexcept;
///
/// Resets credentials
@@ -216,7 +216,7 @@ namespace eap
///
virtual source_t combine(
_In_ DWORD dwFlags,
_In_ HANDLE hTokenImpersonateUser,
_In_opt_ HANDLE hTokenImpersonateUser,
_In_opt_ const credentials *cred_cached,
_In_ const config_method &cfg,
_In_opt_z_ LPCTSTR pszTargetName) = 0;
@@ -251,7 +251,7 @@ namespace eap
///
/// \param[in] other Credentials to move from
///
credentials_identity(_Inout_ credentials_identity &&other);
credentials_identity(_Inout_ credentials_identity &&other) noexcept;
///
/// Copies credentials
@@ -269,7 +269,7 @@ namespace eap
///
/// \returns Reference to this object
///
credentials_identity& operator=(_Inout_ credentials_identity &&other);
credentials_identity& operator=(_Inout_ credentials_identity &&other) noexcept;
virtual config* clone() const;
@@ -311,7 +311,7 @@ namespace eap
///
virtual source_t combine(
_In_ DWORD dwFlags,
_In_ HANDLE hTokenImpersonateUser,
_In_opt_ HANDLE hTokenImpersonateUser,
_In_opt_ const credentials *cred_cached,
_In_ const config_method &cfg,
_In_opt_z_ LPCTSTR pszTargetName);
@@ -354,7 +354,7 @@ namespace eap
///
/// \param[in] other Credentials to move from
///
credentials_pass(_Inout_ credentials_pass &&other);
credentials_pass(_Inout_ credentials_pass &&other) noexcept;
///
/// Copies credentials
@@ -372,7 +372,7 @@ namespace eap
///
/// \returns Reference to this object
///
credentials_pass& operator=(_Inout_ credentials_pass &&other);
credentials_pass& operator=(_Inout_ credentials_pass &&other) noexcept;
virtual config* clone() const;
virtual void clear();
@@ -423,7 +423,7 @@ namespace eap
///
virtual source_t combine(
_In_ DWORD dwFlags,
_In_ HANDLE hTokenImpersonateUser,
_In_opt_ HANDLE hTokenImpersonateUser,
_In_opt_ const credentials *cred_cached,
_In_ const config_method &cfg,
_In_opt_z_ LPCTSTR pszTargetName);
@@ -465,7 +465,7 @@ namespace eap
///
/// \param[in] other Credentials to move from
///
credentials_connection(_Inout_ credentials_connection &&other);
credentials_connection(_Inout_ credentials_connection &&other) noexcept;
///
/// Copies credentials
@@ -483,7 +483,7 @@ namespace eap
///
/// \returns Reference to this object
///
credentials_connection& operator=(_Inout_ credentials_connection &&other);
credentials_connection& operator=(_Inout_ credentials_connection &&other) noexcept;
virtual config* clone() const;

View File

@@ -551,7 +551,7 @@ inline unsigned __int64 htonll(unsigned __int64 val);
/// \param[in ] val A 24-bit unsigned number in host byte order
/// \param[out] out A 24-bit unsigned number in network byte order
///
inline void hton24(_In_ unsigned int val, _Out_ unsigned char out[3]);
inline void hton24(_In_ unsigned int val, _Out_writes_(3) unsigned char out[3]);
///
/// Converts a 24-bit integer from TCP/IP network to host byte order.
@@ -658,6 +658,9 @@ namespace eap
///
/// Constructor
///
/// Note: This constructor does not initialize data. Use sanitizing_blob_zf class when zero-initialization is required.
///
#pragma warning(suppress: 26495)
inline sanitizing_blob_f()
{
}
@@ -677,7 +680,7 @@ namespace eap
///
/// \param[inout] other BLOB to move from
///
inline sanitizing_blob_f(_Inout_ sanitizing_blob_f<N> &&other)
inline sanitizing_blob_f(_Inout_ sanitizing_blob_f<N> &&other) noexcept
{
memcpy(data, other.data, N);
}
@@ -687,7 +690,7 @@ namespace eap
///
/// \param[inout] other Zero-initialized BLOB to move from
///
inline sanitizing_blob_f(_Inout_ sanitizing_blob_zf<N> &&other)
inline sanitizing_blob_f(_Inout_ sanitizing_blob_zf<N> &&other) noexcept
{
memcpy(data, other.data, N);
memset(other.data, 0, N);
@@ -722,7 +725,7 @@ namespace eap
///
/// \returns Reference to this object
///
inline sanitizing_blob_f& operator=(_Inout_ sanitizing_blob_f<N> &&other)
inline sanitizing_blob_f& operator=(_Inout_ sanitizing_blob_f<N> &&other) noexcept
{
if (this != std::addressof(other))
memcpy(data, other.data, N);
@@ -736,7 +739,7 @@ namespace eap
///
/// \returns Reference to this object
///
inline sanitizing_blob_f& operator=(_Inout_ sanitizing_blob_zf<N> &&other)
inline sanitizing_blob_f& operator=(_Inout_ sanitizing_blob_zf<N> &&other) noexcept
{
if (this != std::addressof(other)) {
memcpy(data, other.data, N);
@@ -827,7 +830,7 @@ namespace eap
///
/// \param[inout] other Zero-initialized BLOB to move from
///
inline sanitizing_blob_zf(_Inout_ sanitizing_blob_zf<N> &&other) :
inline sanitizing_blob_zf(_Inout_ sanitizing_blob_zf<N> &&other) noexcept :
sanitizing_blob_f<N>(std::move(other))
{
memset(other.data, 0, N);
@@ -848,7 +851,7 @@ namespace eap
///
/// \param[inout] other BLOB to move from
///
inline sanitizing_blob_zf(_Inout_ sanitizing_blob_f<N> &&other) :
inline sanitizing_blob_zf(_Inout_ sanitizing_blob_f<N> &&other) noexcept :
sanitizing_blob_f<N>(std::move(other))
{
}
@@ -874,7 +877,7 @@ namespace eap
///
/// \returns Reference to this object
///
inline sanitizing_blob_zf& operator=(_Inout_ sanitizing_blob_zf<N> &&other)
inline sanitizing_blob_zf& operator=(_Inout_ sanitizing_blob_zf<N> &&other) noexcept
{
if (this != std::addressof(other)) {
memcpy(data, other.data, N);
@@ -904,7 +907,7 @@ namespace eap
///
/// \returns Reference to this object
///
inline sanitizing_blob_zf& operator=(_Inout_ sanitizing_blob_f<N> &&other)
inline sanitizing_blob_zf& operator=(_Inout_ sanitizing_blob_f<N> &&other) noexcept
{
if (this != std::addressof(other))
memcpy(data, other.data, N);
@@ -1110,7 +1113,7 @@ inline void operator<<(_Inout_ eap::cursor_out &cursor, _In_ const std::basic_st
template<class _Traits, class _Ax>
inline size_t pksizeof(_In_ const std::basic_string<wchar_t, _Traits, _Ax> &val)
{
return sizeof(char)*(WideCharToMultiByte(CP_UTF8, 0, val.c_str(), (int)val.length(), NULL, 0, NULL, NULL) + 1);
return sizeof(char)*(WideCharToMultiByte(CP_UTF8, 0, val.c_str(), (int)val.length(), NULL, 0, NULL, NULL)) + sizeof(char);
}
@@ -1407,7 +1410,7 @@ inline unsigned __int64 htonll(unsigned __int64 val)
#endif
inline void hton24(_In_ unsigned int val, _Out_ unsigned char out[3])
inline void hton24(_In_ unsigned int val, _Out_writes_(3) unsigned char out[3])
{
assert(val <= 0xffffff);
out[0] = (val >> 16) & 0xff;

View File

@@ -357,7 +357,7 @@ namespace eapxml
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_element_base64(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
inline HRESULT put_element_base64(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Creates a new child element with hexadecimal encoded text from BLOB
@@ -376,7 +376,7 @@ namespace eapxml
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_element_hex(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
inline HRESULT put_element_hex(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement = NULL);
///
/// Returns attribute text
@@ -481,7 +481,7 @@ namespace eapxml
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_opt_z_ _In_z_ const BSTR bstrValue);
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_z_ const BSTR bstrValue);
///
/// Sets node attribute converted from number
@@ -496,7 +496,7 @@ namespace eapxml
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_opt_z_ _In_ DWORD dwValue);
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_ DWORD dwValue);
///
/// Sets node attribute converted from boolean
@@ -511,7 +511,7 @@ namespace eapxml
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_opt_z_ _In_ bool bValue);
inline HRESULT put_attrib_value(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_ bool bValue);
///
/// Sets node attribute to Base64 encoded text from BLOB
@@ -527,7 +527,7 @@ namespace eapxml
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_attrib_base64(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_opt_z_ _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen);
inline HRESULT put_attrib_base64(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen);
///
/// Sets node attribute to hexadecimal encoded text from BLOB
///
@@ -542,7 +542,7 @@ namespace eapxml
/// - <0 if failed.
/// Use `SUCCEEDED()` macro to test for first two cases (>=0) or `FAILED()` to test for failure.
///
inline HRESULT put_attrib_hex(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen);
inline HRESULT put_attrib_hex(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen);
///
/// Builds XPath for a given node
@@ -786,7 +786,7 @@ namespace eapxml
pbstrValue = std::move(bstrEn);
return S_OK;
} else
return ERROR_NOT_FOUND;
return HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
}
winstd::com_obj<IXMLDOMNode> pXmlElLocalizedText;
@@ -831,7 +831,6 @@ namespace eapxml
{
assert(pDoc);
assert(pCurrentDOMNode);
assert(ppXmlElement);
static const VARIANT varNodeTypeEl = { VT_I4, 0, 0, 0, { NODE_ELEMENT } };
HRESULT hr;
@@ -878,7 +877,7 @@ namespace eapxml
}
inline HRESULT put_element_base64(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement)
inline HRESULT put_element_base64(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement)
{
std::wstring sBase64;
winstd::base64_enc enc;
@@ -887,7 +886,7 @@ namespace eapxml
}
inline HRESULT put_element_hex(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement)
inline HRESULT put_element_hex(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrElementName, _In_opt_z_ const BSTR bstrNamespace, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen, _Out_opt_ winstd::com_obj<IXMLDOMElement> *ppXmlElement)
{
std::wstring sHex;
winstd::hex_enc enc;
@@ -936,8 +935,6 @@ namespace eapxml
inline HRESULT get_attrib_value(_In_ IXMLDOMNode *pXmlParent, _In_z_ const BSTR bstrAttributeName, _Out_ bool &pbValue)
{
assert(pbValue);
winstd::bstr bstr;
HRESULT hr = get_attrib_value(pXmlParent, bstrAttributeName, bstr);
if (SUCCEEDED(hr)) {
@@ -1012,7 +1009,7 @@ namespace eapxml
}
inline HRESULT put_attrib_base64(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen)
inline HRESULT put_attrib_base64(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen)
{
std::wstring sBase64;
winstd::base64_enc enc;
@@ -1021,7 +1018,7 @@ namespace eapxml
}
inline HRESULT put_attrib_hex(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_count_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen)
inline HRESULT put_attrib_hex(_In_ IXMLDOMNode *pCurrentDOMNode, _In_z_ const BSTR bstrAttributeName, _In_bytecount_(nValueLen) LPCVOID pValue, _In_ SIZE_T nValueLen)
{
std::wstring sHex;
winstd::hex_enc enc;

View File

@@ -69,7 +69,7 @@ namespace eap
///
/// \param[in] other Method to move from
///
method(_Inout_ method &&other);
method(_Inout_ method &&other) noexcept;
///
/// Moves a method
@@ -78,7 +78,7 @@ namespace eap
///
/// \returns Reference to this object
///
method& operator=(_Inout_ method &&other);
method& operator=(_Inout_ method &&other) noexcept;
/// \name Session management
/// @{
@@ -144,12 +144,12 @@ namespace eap
///
/// \sa [EapPeerGetResult function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363611.aspx)
///
/// \param[in ] reason The reason code for the authentication result returned in \p pResult.
/// \param[out] pResult A pointer to a structure that contains the authentication results.
/// \param[in ] reason The reason code for the authentication result returned in \p pResult.
/// \param[inout] pResult A pointer to a structure that contains the authentication results.
///
virtual void get_result(
_In_ EapPeerMethodResultReason reason,
_Out_ EapPeerMethodResult *pResult);
_In_ EapPeerMethodResultReason reason,
_Inout_ EapPeerMethodResult *pResult);
/// \name User Interaction
/// @{
@@ -236,7 +236,7 @@ namespace eap
///
/// \param[in] other Method to move from
///
method_tunnel(_Inout_ method_tunnel &&other);
method_tunnel(_Inout_ method_tunnel &&other) noexcept;
///
/// Moves a method
@@ -245,7 +245,7 @@ namespace eap
///
/// \returns Reference to this object
///
method_tunnel& operator=(_Inout_ method_tunnel &&other);
method_tunnel& operator=(_Inout_ method_tunnel &&other) noexcept;
/// \name Session management
/// @{
@@ -274,8 +274,8 @@ namespace eap
/// @}
virtual void get_result(
_In_ EapPeerMethodResultReason reason,
_Out_ EapPeerMethodResult *pResult);
_In_ EapPeerMethodResultReason reason,
_Inout_ EapPeerMethodResult *pResult);
/// \name User Interaction
/// @{
@@ -326,7 +326,7 @@ namespace eap
///
/// \param[in] other Method to move from
///
method_eap(_Inout_ method_eap &&other);
method_eap(_Inout_ method_eap &&other) noexcept;
///
/// Moves a method
@@ -335,7 +335,7 @@ namespace eap
///
/// \returns Reference to this object
///
method_eap& operator=(_Inout_ method_eap &&other);
method_eap& operator=(_Inout_ method_eap &&other) noexcept;
/// \name Session management
/// @{

View File

@@ -93,17 +93,17 @@ namespace eap
///
/// Allocate BLOB
///
BYTE* alloc_memory(_In_ size_t size);
BYTE* alloc_memory(_In_ size_t size) const;
///
/// Free BLOB allocated with this peer
///
void free_memory(_In_ BYTE *ptr);
void free_memory(_In_ BYTE *ptr) const;
///
/// Free EAP_ERROR allocated with `make_error()` method
///
void free_error_memory(_In_ EAP_ERROR *err);
void free_error_memory(_In_ EAP_ERROR *err) const;
///
/// Makes a new method configuration
@@ -147,6 +147,35 @@ namespace eap
///
void log_error(_In_ const EAP_ERROR *err) const;
///
/// Logs error and optionally returns EAP_ERROR
///
inline DWORD log_error(_Out_opt_ EAP_ERROR **eap_err, _In_ DWORD dwErrorCode, _In_opt_z_ LPCWSTR pszRootCauseString = NULL, _In_opt_z_ LPCWSTR pszRepairString = NULL, _In_opt_ DWORD dwReasonCode = 0, _In_opt_ LPCGUID pRootCauseGuid = NULL, _In_opt_ LPCGUID pRepairGuid = NULL, _In_opt_ LPCGUID pHelpLinkGuid = NULL) const
{
EAP_ERROR *e = make_error(dwErrorCode, pszRootCauseString, pszRepairString, dwReasonCode, pRootCauseGuid, pRepairGuid, pHelpLinkGuid);
log_error(e);
if (eap_err)
*eap_err = e;
else
free_error_memory(e);
return dwErrorCode;
}
///
/// Logs error and optionally returns EAP_ERROR
///
inline DWORD log_error(_Out_opt_ EAP_ERROR **eap_err, _In_ std::exception &err) const
{
EAP_ERROR *e = make_error(err);
log_error(e);
DWORD dwWinError = e->dwWinError;
if (eap_err)
*eap_err = e;
else
free_error_memory(e);
return dwWinError;
}
///
/// Logs Unicode string config value
///
@@ -288,7 +317,7 @@ namespace eap
///
/// \returns Encrypted data
///
std::vector<unsigned char> encrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _Out_opt_ HCRYPTHASH hHash = NULL) const;
std::vector<unsigned char> encrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _In_opt_ HCRYPTHASH hHash = NULL) const;
///
@@ -301,7 +330,7 @@ namespace eap
/// \returns Encrypted data
///
template<class _Elem, class _Traits, class _Ax>
std::vector<unsigned char> encrypt(_In_ HCRYPTPROV hProv, _In_ const std::basic_string<_Elem, _Traits, _Ax> &val, _Out_opt_ HCRYPTHASH hHash = NULL) const
std::vector<unsigned char> encrypt(_In_ HCRYPTPROV hProv, _In_ const std::basic_string<_Elem, _Traits, _Ax> &val, _In_opt_ HCRYPTHASH hHash = NULL) const
{
return encrypt(hProv, val.c_str(), val.length()*sizeof(_Elem), hHash);
}
@@ -317,7 +346,7 @@ namespace eap
/// \returns Encrypted data
///
template<class _Traits, class _Ax>
std::vector<unsigned char> encrypt(_In_ HCRYPTPROV hProv, _In_ const std::basic_string<wchar_t, _Traits, _Ax> &val, _Out_opt_ HCRYPTHASH hHash = NULL) const
std::vector<unsigned char> encrypt(_In_ HCRYPTPROV hProv, _In_ const std::basic_string<wchar_t, _Traits, _Ax> &val, _In_opt_ HCRYPTHASH hHash = NULL) const
{
winstd::sanitizing_string val_utf8;
WideCharToMultiByte(CP_UTF8, 0, val, val_utf8, NULL, NULL);
@@ -380,13 +409,15 @@ namespace eap
/// \returns Decrypted data
///
template<class _Ty, class _Ax>
std::vector<_Ty, _Ax> decrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _Out_opt_ HCRYPTHASH hHash = NULL) const
std::vector<_Ty, _Ax> decrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _In_opt_ HCRYPTHASH hHash = NULL) const
{
// Import the private RSA key.
HRSRC res = FindResource(m_instance, MAKEINTRESOURCE(IDR_EAP_KEY_PRIVATE), RT_RCDATA);
assert(res);
if (!res)
throw winstd::win_runtime_error(__FUNCTION__ " FindResource failed.");
HGLOBAL res_handle = LoadResource(m_instance, res);
assert(res_handle);
if (!res_handle)
throw winstd::win_runtime_error(__FUNCTION__ " LoadResource failed.");
winstd::crypt_key key_rsa;
std::unique_ptr<unsigned char[], winstd::LocalFree_delete<unsigned char[]> > keyinfo_data;
DWORD keyinfo_size = 0;
@@ -423,7 +454,7 @@ namespace eap
/// \returns Decrypted string
///
template<class _Elem, class _Traits, class _Ax>
std::basic_string<_Elem, _Traits, _Ax> decrypt_str(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _Out_opt_ HCRYPTHASH hHash = NULL) const
std::basic_string<_Elem, _Traits, _Ax> decrypt_str(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _In_opt_ HCRYPTHASH hHash = NULL) const
{
std::vector<_Elem, sanitizing_allocator<_Elem> > buf(std::move(decrypt(hProv, data, size, hHash)));
return std::basic_string<_Elem, _Traits, _Ax>(buf.data(), buf.size());
@@ -441,7 +472,7 @@ namespace eap
/// \returns Decrypted string
///
template<class _Traits, class _Ax>
std::basic_string<wchar_t, _Traits, _Ax> decrypt_str(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _Out_opt_ HCRYPTHASH hHash = NULL) const
std::basic_string<wchar_t, _Traits, _Ax> decrypt_str(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _In_opt_ HCRYPTHASH hHash = NULL) const
{
winstd::sanitizing_string buf(std::move(decrypt_str(hProv, data, size, hHash)));
std::basic_string<wchar_t, _Traits, _Ax> dec;
@@ -865,13 +896,13 @@ namespace eap
/// \param[out] ppDataFromInteractiveUI A pointer that receives a credentials BLOB that can be used in authentication. The caller should free the inner pointers using the function \p EapPeerFreeMemory(), starting at the innermost pointer. If a non-NULL value is supplied for this parameter, meaning that an existing data BLOB is passed to it, the supplied data BLOB will be updated and returned in this parameter.
///
virtual void query_ui_blob_from_interactive_ui_input_fields(
_In_ DWORD dwVersion,
_In_ DWORD dwFlags,
_In_ DWORD dwUIContextDataSize,
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_In_ const EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData,
_Out_ DWORD *pdwDataFromInteractiveUISize,
_Out_ BYTE **ppDataFromInteractiveUI) const;
_In_ DWORD dwVersion,
_In_ DWORD dwFlags,
_In_ DWORD dwUIContextDataSize,
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_In_ const EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData,
_Out_ DWORD *pdwDataFromInteractiveUISize,
_Outptr_result_buffer_(*pdwDataFromInteractiveUISize) BYTE **ppDataFromInteractiveUI) const;
/// \name Session management
/// @{
@@ -942,9 +973,9 @@ namespace eap
/// \param[inout] pdwSendPacketSize A pointer to a value that contains the size in bytes of the buffer allocated for the response packet. On return, this parameter receives a pointer to the actual size in bytes of \p pSendPacket.
///
virtual void get_response_packet(
_In_ EAP_SESSION_HANDLE hSession,
_Inout_bytecap_(*dwSendPacketSize) EapPacket *pSendPacket,
_Inout_ DWORD *pdwSendPacketSize) = 0;
_In_ EAP_SESSION_HANDLE hSession,
_Out_bytecapcount_(*pdwSendPacketSize) EapPacket *pSendPacket,
_Inout_ DWORD *pdwSendPacketSize) = 0;
/// @}
@@ -953,14 +984,14 @@ namespace eap
///
/// \sa [EapPeerGetResult function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363611.aspx)
///
/// \param[in ] hSession A unique handle for this EAP authentication session on the EAPHost server. This handle is returned in the \p pSessionHandle parameter in a previous call to `EapPeerBeginSession()`.
/// \param[in ] reason The reason code for the authentication result returned in \p pResult.
/// \param[out] pResult A pointer to a structure that contains the authentication results.
/// \param[in ] hSession A unique handle for this EAP authentication session on the EAPHost server. This handle is returned in the \p pSessionHandle parameter in a previous call to `EapPeerBeginSession()`.
/// \param[in ] reason The reason code for the authentication result returned in \p pResult.
/// \param[inout] pResult A pointer to a structure that contains the authentication results.
///
virtual void get_result(
_In_ EAP_SESSION_HANDLE hSession,
_In_ EapPeerMethodResultReason reason,
_Out_ EapPeerMethodResult *pResult) = 0;
_In_ EAP_SESSION_HANDLE hSession,
_In_ EapPeerMethodResultReason reason,
_Inout_ EapPeerMethodResult *pResult) = 0;
/// \name User Interaction
/// @{

View File

@@ -66,7 +66,7 @@ namespace eap
///
/// \param[in] other Credentials to move from
///
ui_context(_Inout_ ui_context &&other);
ui_context(_Inout_ ui_context &&other) noexcept;
///
/// Copies context
@@ -84,7 +84,7 @@ namespace eap
///
/// \returns Reference to this object
///
ui_context& operator=(_Inout_ ui_context &&other);
ui_context& operator=(_Inout_ ui_context &&other) noexcept;
/// \name BLOB management
/// @{

View File

@@ -40,7 +40,7 @@ eap::config::config(_In_ const config &other) :
}
eap::config::config(_Inout_ config &&other) :
eap::config::config(_Inout_ config &&other) noexcept :
m_module(other.m_module)
{
}
@@ -55,7 +55,7 @@ eap::config& eap::config::operator=(_In_ const config &other)
}
eap::config& eap::config::operator=(_Inout_ config &&other)
eap::config& eap::config::operator=(_Inout_ config &&other) noexcept
{
if (this != &other)
assert(&m_module == &other.m_module);
@@ -103,7 +103,7 @@ eap::config_method::config_method(_In_ const config_method &other) :
}
eap::config_method::config_method(_Inout_ config_method &&other) :
eap::config_method::config_method(_Inout_ config_method &&other) noexcept :
m_level (std::move(other.m_level )),
m_allow_save (std::move(other.m_allow_save )),
m_last_status(std::move(other.m_last_status)),
@@ -127,7 +127,7 @@ eap::config_method& eap::config_method::operator=(_In_ const config_method &othe
}
eap::config_method& eap::config_method::operator=(_Inout_ config_method &&other)
eap::config_method& eap::config_method::operator=(_Inout_ config_method &&other) noexcept
{
if (this != &other) {
assert(m_level == other.m_level); // Allow move within same configuration level only.
@@ -231,7 +231,7 @@ eap::config_method_with_cred::config_method_with_cred(_In_ const config_method_w
}
eap::config_method_with_cred::config_method_with_cred(_Inout_ config_method_with_cred &&other) :
eap::config_method_with_cred::config_method_with_cred(_Inout_ config_method_with_cred &&other) noexcept :
m_use_cred (std::move(other.m_use_cred)),
m_cred (std::move(other.m_cred )),
config_method(std::move(other ))
@@ -251,7 +251,7 @@ eap::config_method_with_cred& eap::config_method_with_cred::operator=(_In_ const
}
eap::config_method_with_cred& eap::config_method_with_cred::operator=(_Inout_ config_method_with_cred &&other)
eap::config_method_with_cred& eap::config_method_with_cred::operator=(_Inout_ config_method_with_cred &&other) noexcept
{
if (this != &other) {
(config_method&)*this = std::move(other );
@@ -362,7 +362,7 @@ eap::config_provider::config_provider(_In_ const config_provider &other) :
}
eap::config_provider::config_provider(_Inout_ config_provider &&other) :
eap::config_provider::config_provider(_Inout_ config_provider &&other) noexcept :
m_namespace (std::move(other.m_namespace )),
m_id (std::move(other.m_id )),
m_read_only (std::move(other.m_read_only )),
@@ -404,7 +404,7 @@ eap::config_provider& eap::config_provider::operator=(_In_ const config_provider
}
eap::config_provider& eap::config_provider::operator=(_Inout_ config_provider &&other)
eap::config_provider& eap::config_provider::operator=(_Inout_ config_provider &&other) noexcept
{
if (this != &other) {
(config&&)*this = std::move(other );
@@ -700,7 +700,7 @@ eap::config_connection::config_connection(_In_ const config_connection &other) :
}
eap::config_connection::config_connection(_Inout_ config_connection &&other) :
eap::config_connection::config_connection(_Inout_ config_connection &&other) noexcept :
m_providers(std::move(other.m_providers)),
config (std::move(other ))
{
@@ -718,7 +718,7 @@ eap::config_connection& eap::config_connection::operator=(_In_ const config_conn
}
eap::config_connection& eap::config_connection::operator=(_Inout_ config_connection &&other)
eap::config_connection& eap::config_connection::operator=(_Inout_ config_connection &&other) noexcept
{
if (this != &other) {
(config&&)*this = std::move(other );

View File

@@ -53,7 +53,7 @@ eap::credentials::credentials(_In_ const credentials &other) :
}
eap::credentials::credentials(_Inout_ credentials &&other) :
eap::credentials::credentials(_Inout_ credentials &&other) noexcept :
m_identity(std::move(other.m_identity)),
config(std::move(other))
{
@@ -71,7 +71,7 @@ eap::credentials& eap::credentials::operator=(_In_ const credentials &other)
}
eap::credentials& eap::credentials::operator=(_Inout_ credentials &&other)
eap::credentials& eap::credentials::operator=(_Inout_ credentials &&other) noexcept
{
if (this != &other) {
(config&)*this = std::move(other);
@@ -177,7 +177,7 @@ eap::credentials_identity::credentials_identity(_In_ const credentials_identity
}
eap::credentials_identity::credentials_identity(_Inout_ credentials_identity &&other) : credentials(std::move(other))
eap::credentials_identity::credentials_identity(_Inout_ credentials_identity &&other) noexcept : credentials(std::move(other))
{
}
@@ -191,7 +191,7 @@ eap::credentials_identity& eap::credentials_identity::operator=(_In_ const crede
}
eap::credentials_identity& eap::credentials_identity::operator=(_Inout_ credentials_identity &&other)
eap::credentials_identity& eap::credentials_identity::operator=(_Inout_ credentials_identity &&other) noexcept
{
if (this != &other)
(credentials&)*this = std::move(other);
@@ -297,7 +297,7 @@ LPCTSTR eap::credentials_identity::target_suffix() const
eap::credentials::source_t eap::credentials_identity::combine(
_In_ DWORD dwFlags,
_In_ HANDLE hTokenImpersonateUser,
_In_opt_ HANDLE hTokenImpersonateUser,
_In_opt_ const credentials *cred_cached,
_In_ const config_method &cfg,
_In_opt_z_ LPCTSTR pszTargetName)
@@ -359,7 +359,7 @@ eap::credentials_pass::credentials_pass(_In_ const credentials_pass &other) :
}
eap::credentials_pass::credentials_pass(_Inout_ credentials_pass &&other) :
eap::credentials_pass::credentials_pass(_Inout_ credentials_pass &&other) noexcept :
m_password (std::move(other.m_password)),
m_enc_alg (std::move(other.m_enc_alg )),
credentials(std::move(other ))
@@ -379,7 +379,7 @@ eap::credentials_pass& eap::credentials_pass::operator=(_In_ const credentials_p
}
eap::credentials_pass& eap::credentials_pass::operator=(_Inout_ credentials_pass &&other)
eap::credentials_pass& eap::credentials_pass::operator=(_Inout_ credentials_pass &&other) noexcept
{
if (this != &other) {
(credentials&)*this = std::move(other );
@@ -603,7 +603,7 @@ LPCTSTR eap::credentials_pass::target_suffix() const
eap::credentials::source_t eap::credentials_pass::combine(
_In_ DWORD dwFlags,
_In_ HANDLE hTokenImpersonateUser,
_In_opt_ HANDLE hTokenImpersonateUser,
_In_opt_ const credentials *cred_cached,
_In_ const config_method &cfg,
_In_opt_z_ LPCTSTR pszTargetName)
@@ -737,7 +737,7 @@ eap::credentials_connection::credentials_connection(_In_ const credentials_conne
}
eap::credentials_connection::credentials_connection(_Inout_ credentials_connection &&other) :
eap::credentials_connection::credentials_connection(_Inout_ credentials_connection &&other) noexcept :
m_cfg ( other.m_cfg ),
m_namespace(std::move(other.m_namespace)),
m_id (std::move(other.m_id )),
@@ -760,7 +760,7 @@ eap::credentials_connection& eap::credentials_connection::operator=(_In_ const c
}
eap::credentials_connection& eap::credentials_connection::operator=(_Inout_ credentials_connection &&other)
eap::credentials_connection& eap::credentials_connection::operator=(_Inout_ credentials_connection &&other) noexcept
{
if (this != &other) {
(config&)*this = std::move(other );
@@ -948,7 +948,7 @@ template<class _Elem, class _Traits, class _Ax>
inline static basic_string<_Elem, _Traits, _Ax> kph_encrypt(_In_ HCRYPTPROV hProv, _In_z_ const char *src)
{
basic_string<_Elem, _Traits, _Ax> str;
unsigned short key[8];
unsigned short key[8] = { 0 };
// Generate the key.
if (!CryptGenRandom(hProv, sizeof(key), (BYTE*)key))

View File

@@ -34,13 +34,13 @@ eap::method::method(_In_ module &mod) :
}
eap::method::method(_Inout_ method &&other) :
eap::method::method(_Inout_ method &&other) noexcept :
m_module(other.m_module)
{
}
eap::method& eap::method::operator=(_Inout_ method &&other)
eap::method& eap::method::operator=(_Inout_ method &&other) noexcept
{
if (this != std::addressof(other)) {
assert(std::addressof(m_module) == std::addressof(other.m_module)); // Move method within same module only!
@@ -96,7 +96,7 @@ EapPeerMethodResponseAction eap::method::set_ui_context(
}
void eap::method::get_response_attributes(_Inout_ EapAttributes *pAttribs)
void eap::method::get_response_attributes(_Out_ EapAttributes *pAttribs)
{
assert(pAttribs);
@@ -126,14 +126,14 @@ eap::method_tunnel::method_tunnel(_In_ module &mod, _In_ method *inner) :
}
eap::method_tunnel::method_tunnel(_Inout_ method_tunnel &&other) :
eap::method_tunnel::method_tunnel(_Inout_ method_tunnel &&other) noexcept :
m_inner(std::move(other.m_inner)),
method (std::move(other ))
{
}
eap::method_tunnel& eap::method_tunnel::operator=(_Inout_ method_tunnel &&other)
eap::method_tunnel& eap::method_tunnel::operator=(_Inout_ method_tunnel &&other) noexcept
{
if (this != std::addressof(other)) {
(method&)*this = std::move(other );
@@ -213,7 +213,7 @@ EapPeerMethodResponseAction eap::method_tunnel::set_ui_context(
}
void eap::method_tunnel::get_response_attributes(_Inout_ EapAttributes *pAttribs)
void eap::method_tunnel::get_response_attributes(_Out_ EapAttributes *pAttribs)
{
assert(m_inner);
m_inner->get_response_attributes(pAttribs);
@@ -240,7 +240,7 @@ eap::method_eap::method_eap(_In_ module &mod, _In_ winstd::eap_type_t eap_method
}
eap::method_eap::method_eap(_Inout_ method_eap &&other) :
eap::method_eap::method_eap(_Inout_ method_eap &&other) noexcept :
m_eap_method (std::move(other.m_eap_method)),
m_id (std::move(other.m_id )),
m_send_nak (std::move(other.m_send_nak )),
@@ -249,7 +249,7 @@ eap::method_eap::method_eap(_Inout_ method_eap &&other) :
}
eap::method_eap& eap::method_eap::operator=(_Inout_ method_eap &&other)
eap::method_eap& eap::method_eap::operator=(_Inout_ method_eap &&other) noexcept
{
if (this != std::addressof(other)) {
assert(m_eap_method == other.m_eap_method); // Move method within same EAP method type only!
@@ -274,7 +274,7 @@ void eap::method_eap::begin_session(
// Inner method can generate packets of up to 64kB (less the EAP packet header).
// Initialize inner method with appropriately less packet size maximum.
if (dwMaxSendPacketSize < sizeof(EapPacket))
throw invalid_argument(string_printf(__FUNCTION__ " Maximum packet size too small (minimum: %u, available: %u).", sizeof(EapPacket) + 1, dwMaxSendPacketSize));
throw invalid_argument(string_printf(__FUNCTION__ " Maximum packet size too small (minimum: %zu, available: %u).", sizeof(EapPacket) + 1, dwMaxSendPacketSize));
assert(m_inner);
m_inner->begin_session(dwFlags, pAttributeArray, hTokenImpersonateUser, std::min<DWORD>(dwMaxSendPacketSize, MAXWORD) - sizeof(EapPacket));
}
@@ -337,7 +337,7 @@ void eap::method_eap::get_response_packet(
// Check packet size. We will suggest one EAP method alone, so we need one byte for data.
size_t size_packet = sizeof(EapPacket) + 1;
if (size_packet > size_max)
throw invalid_argument(string_printf(__FUNCTION__ " This method does not support packet fragmentation, but the data size is too big to fit in one packet (packet: %u, maximum: %u).", size_packet, size_max));
throw invalid_argument(string_printf(__FUNCTION__ " This method does not support packet fragmentation, but the data size is too big to fit in one packet (packet: %zu, maximum: %u).", size_packet, size_max));
packet.reserve(size_packet); // To avoid reallocation when inserting EAP packet header later.
// Data of Legacy Nak packet is a list of supported EAP types: our method alone.

View File

@@ -28,7 +28,7 @@ using namespace winstd;
// eap::module
//////////////////////////////////////////////////////////////////////
eap::module::module(eap_type_t eap_method) :
eap::module::module(_In_ eap_type_t eap_method) :
m_eap_method(eap_method),
m_instance(NULL)
{
@@ -141,16 +141,16 @@ EAP_ERROR* eap::module::make_error(_In_ const EAP_ERROR *err) const
}
BYTE* eap::module::alloc_memory(_In_ size_t size)
BYTE* eap::module::alloc_memory(_In_ size_t size) const
{
BYTE *p = (BYTE*)HeapAlloc(m_heap, 0, size);
if (!p)
throw win_runtime_error(winstd::string_printf(__FUNCTION__ " Error allocating memory for BLOB (%uB).", size));
throw win_runtime_error(winstd::string_printf(__FUNCTION__ " Error allocating memory for BLOB (%zuB).", size));
return p;
}
void eap::module::free_memory(_In_ BYTE *ptr)
void eap::module::free_memory(_In_ BYTE *ptr) const
{
#if !EAP_ENCRYPT_BLOBS
// Since we do security here and some of the BLOBs contain credentials, sanitize every memory block before freeing.
@@ -160,7 +160,7 @@ void eap::module::free_memory(_In_ BYTE *ptr)
}
void eap::module::free_error_memory(_In_ EAP_ERROR *err)
void eap::module::free_error_memory(_In_ EAP_ERROR *err) const
{
// pRootCauseString and pRepairString always trail the ppEapError to reduce number of (de)allocations.
HeapFree(m_heap, 0, err);
@@ -193,7 +193,7 @@ eap::config_method* eap::module::make_config_method()
}
std::vector<unsigned char> eap::module::encrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _Out_opt_ HCRYPTHASH hHash) const
std::vector<unsigned char> eap::module::encrypt(_In_ HCRYPTPROV hProv, _In_bytecount_(size) const void *data, _In_ size_t size, _In_opt_ HCRYPTHASH hHash) const
{
// Generate 256-bit AES session key.
crypt_key key_aes;
@@ -202,9 +202,11 @@ std::vector<unsigned char> eap::module::encrypt(_In_ HCRYPTPROV hProv, _In_bytec
// Import the public RSA key.
HRSRC res = FindResource(m_instance, MAKEINTRESOURCE(IDR_EAP_KEY_PUBLIC), RT_RCDATA);
assert(res);
if (!res)
throw winstd::win_runtime_error(__FUNCTION__ " FindResource failed.");
HGLOBAL res_handle = LoadResource(m_instance, res);
assert(res_handle);
if (!res_handle)
throw winstd::win_runtime_error(__FUNCTION__ " LoadResource failed.");
crypt_key key_rsa;
unique_ptr<CERT_PUBLIC_KEY_INFO, LocalFree_delete<CERT_PUBLIC_KEY_INFO> > keyinfo_data;
DWORD keyinfo_size = 0;
@@ -321,13 +323,13 @@ void eap::peer::query_interactive_ui_input_fields(
void eap::peer::query_ui_blob_from_interactive_ui_input_fields(
_In_ DWORD dwVersion,
_In_ DWORD dwFlags,
_In_ DWORD dwUIContextDataSize,
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_In_ const EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData,
_Out_ DWORD *pdwDataFromInteractiveUISize,
_Out_ BYTE **ppDataFromInteractiveUI) const
_In_ DWORD dwVersion,
_In_ DWORD dwFlags,
_In_ DWORD dwUIContextDataSize,
_In_count_(dwUIContextDataSize) const BYTE *pUIContextData,
_In_ const EAP_INTERACTIVE_UI_DATA *pEapInteractiveUIData,
_Out_ DWORD *pdwDataFromInteractiveUISize,
_Outptr_result_buffer_(*pdwDataFromInteractiveUISize) BYTE **ppDataFromInteractiveUI) const
{
UNREFERENCED_PARAMETER(dwVersion);
UNREFERENCED_PARAMETER(dwFlags);

View File

@@ -43,7 +43,7 @@ eap::ui_context::ui_context(_In_ const ui_context &other) :
}
eap::ui_context::ui_context(_Inout_ ui_context &&other) :
eap::ui_context::ui_context(_Inout_ ui_context &&other) noexcept :
m_cfg ( other.m_cfg ),
m_cred ( other.m_cred ),
packable(std::move(other ))
@@ -63,7 +63,7 @@ eap::ui_context& eap::ui_context::operator=(_In_ const ui_context &other)
}
eap::ui_context& eap::ui_context::operator=(_Inout_ ui_context &&other)
eap::ui_context& eap::ui_context::operator=(_Inout_ ui_context &&other) noexcept
{
if (this != &other) {
assert(std::addressof(m_cfg ) == std::addressof(other.m_cfg )); // Move context within same configuration only!