get_ui_context() upgraded

This commit is contained in:
2017-02-01 10:52:57 +01:00
parent 57372b8f95
commit b632f0202f
8 changed files with 50 additions and 45 deletions

View File

@@ -209,19 +209,23 @@ void eap::method_eaphost::get_result(
}
void eap::method_eaphost::get_ui_context(
_Out_ BYTE **ppUIContextData,
_Out_ DWORD *pdwUIContextDataSize)
void eap::method_eaphost::get_ui_context(_Out_ sanitizing_blob &context_data)
{
// Get EapHost peer UI context data.
DWORD dwUIContextDataSize;
LPBYTE pUIContextData;
eap_error_runtime error;
DWORD dwResult = EapHostPeerGetUIContext(
m_session_id,
pdwUIContextDataSize,
ppUIContextData,
&dwUIContextDataSize,
&pUIContextData,
&error._Myptr);
if (dwResult == ERROR_SUCCESS) {
// UI context data successfuly returned.
context_data.assign(pUIContextData, pUIContextData + dwUIContextDataSize);
// TODO: Test if EapHostPeerGetUIContext() requires us to free the buffer.
//EapHostPeerFreeMemory(pUIContextData);
} else if (error)
throw eap_runtime_error(*error , __FUNCTION__ " EapHostPeerGetUIContext failed.");
else