eap::module::make_error() extended to support EAP_ERROR duplication

This commit is contained in:
Simon Rozman 2016-10-31 16:23:42 +01:00
parent 96d5b95b6f
commit 0d8f243d31
2 changed files with 18 additions and 0 deletions

View File

@ -88,6 +88,11 @@ namespace eap
/// ///
EAP_ERROR* make_error(_In_ std::exception &err) const; EAP_ERROR* make_error(_In_ std::exception &err) const;
///
/// Allocate a EAP_ERROR and fill it according to another EAP_ERROR
///
EAP_ERROR* make_error(_In_ const EAP_ERROR *err) const;
/// ///
/// Allocate BLOB /// Allocate BLOB
/// ///

View File

@ -128,6 +128,19 @@ EAP_ERROR* eap::module::make_error(_In_ std::exception &err) const
} }
EAP_ERROR* eap::module::make_error(_In_ const EAP_ERROR *err) const
{
return make_error(
err->dwWinError,
err->pRootCauseString,
err->pRepairString,
err->dwReasonCode,
&(err->rootCauseGuid),
&(err->repairGuid),
&(err->helpLinkGuid));
}
BYTE* eap::module::alloc_memory(_In_ size_t size) BYTE* eap::module::alloc_memory(_In_ size_t size)
{ {
BYTE *p = (BYTE*)HeapAlloc(m_heap, 0, size); BYTE *p = (BYTE*)HeapAlloc(m_heap, 0, size);