windows-nt/Source/XPSP1/NT/net/homenet/alg/exe/adapterinfo.cpp

63 lines
907 B
C++
Raw Normal View History

2020-09-26 03:20:57 -05:00
/////////////////////////////////////////////////////////////////////////////
//
// CAdapterInfo
//
// AdapterInfo.cpp : Implementation of CAdapterInfo
//
#include "PreComp.h"
#include "AdapterInfo.h"
//
//
//
STDMETHODIMP
CAdapterInfo::GetAdapterIndex(
ULONG* pulAdapterIndex
)
{
*pulAdapterIndex = m_nAdapterIndex;
return S_OK;
}
//
//
//
STDMETHODIMP
CAdapterInfo::GetAdapterType(
ALG_ADAPTER_TYPE* pAdapterType
)
{
*pAdapterType = (ALG_ADAPTER_TYPE )m_eType;
return S_OK;
}
//
//
//
STDMETHODIMP
CAdapterInfo::GetAdapterAddresses(
ULONG* pulAddressCount,
ULONG** prgAddresses
)
{
*pulAddressCount = m_nAddressCount;
*prgAddresses = (ULONG*)CoTaskMemAlloc(m_nAddressCount*sizeof(ULONG));
if ( *prgAddresses == NULL )
return ERROR_OUTOFMEMORY;
memcpy(*prgAddresses, m_anAddress, m_nAddressCount*sizeof(ULONG));
return S_OK;
}