winstd::eap_packet EapPacket wrapper class introduced

This commit is contained in:
2016-08-04 10:06:52 +02:00
parent b1f5846d8c
commit 431c7d9960
2 changed files with 198 additions and 1 deletions

View File

@@ -25,9 +25,40 @@
// winstd::eap_attr
//////////////////////////////////////////////////////////////////////
winstd::eap_attr::~eap_attr()
{
if (pValue)
delete []pValue;
}
//////////////////////////////////////////////////////////////////////
// winstd::eap_packet
//////////////////////////////////////////////////////////////////////
winstd::eap_packet::~eap_packet()
{
if (m_h)
HeapFree(GetProcessHeap(), 0, m_h);
}
void winstd::eap_packet::free_internal()
{
HeapFree(GetProcessHeap(), 0, m_h);
}
winstd::eap_packet::handle_type winstd::eap_packet::duplicate_internal(_In_ handle_type h) const
{
WORD n = ntohs(*(WORD*)h->Length);
handle_type h2 = (handle_type)HeapAlloc(GetProcessHeap(), 0, n);
if (!h2) {
SetLastError(ERROR_OUTOFMEMORY);
return NULL;
}
memcpy(h2, h, n);
return h2;
}