Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
969 B

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // CAdapterInfo
  4. //
  5. // AdapterInfo.cpp : Implementation of CAdapterInfo
  6. //
  7. #include "PreComp.h"
  8. #include "AdapterInfo.h"
  9. //
  10. //
  11. //
  12. STDMETHODIMP
  13. CAdapterInfo::GetAdapterIndex(
  14. ULONG* pulAdapterIndex
  15. )
  16. {
  17. *pulAdapterIndex = m_nAdapterIndex;
  18. return S_OK;
  19. }
  20. //
  21. //
  22. //
  23. STDMETHODIMP
  24. CAdapterInfo::GetAdapterType(
  25. ALG_ADAPTER_TYPE* pAdapterType
  26. )
  27. {
  28. *pAdapterType = (ALG_ADAPTER_TYPE )m_eType;
  29. return S_OK;
  30. }
  31. //
  32. //
  33. //
  34. STDMETHODIMP
  35. CAdapterInfo::GetAdapterAddresses(
  36. ULONG* pulAddressCount,
  37. ULONG** prgAddresses
  38. )
  39. {
  40. *pulAddressCount = m_nAddressCount;
  41. *prgAddresses = (ULONG*)CoTaskMemAlloc(m_nAddressCount*sizeof(ULONG));
  42. if ( *prgAddresses == NULL )
  43. return ERROR_OUTOFMEMORY;
  44. memcpy(*prgAddresses, m_anAddress, m_nAddressCount*sizeof(ULONG));
  45. return S_OK;
  46. }