Source code of Windows XP (NT5)
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.

77 lines
1.7 KiB

  1. // AdapterInfo.h : Declaration of the CAdapterInfo
  2. #pragma once
  3. #include "resource.h" // main symbols
  4. /////////////////////////////////////////////////////////////////////////////
  5. //
  6. // CAdapterInfo
  7. //
  8. class ATL_NO_VTABLE CAdapterInfo :
  9. public CComObjectRootEx<CComMultiThreadModel>,
  10. public CComCoClass<CAdapterInfo, &CLSID_AdapterInfo>,
  11. public IAdapterInfo
  12. {
  13. public:
  14. CAdapterInfo()
  15. {
  16. MYTRACE_ENTER_NOSHOWEXIT("CAdapterInfo::NEW");
  17. m_nCookie = 0;
  18. m_nAdapterIndex = 0;
  19. m_eType = (ALG_ADAPTER_TYPE)0;
  20. m_nAddressCount = 0;
  21. m_bNotified = false; // Flag to see if a newly added adapter notified the user CallBack notification
  22. // This is used to only notify once the ALG plugin when the IP Address have been assign see CollectionAdapters.cpp
  23. }
  24. ~CAdapterInfo()
  25. {
  26. MYTRACE_ENTER_NOSHOWEXIT("CAdapterInfo::DELETE");
  27. }
  28. DECLARE_REGISTRY_RESOURCEID(IDR_ADAPTERINFO)
  29. DECLARE_NOT_AGGREGATABLE(CAdapterInfo)
  30. DECLARE_PROTECT_FINAL_CONSTRUCT()
  31. BEGIN_COM_MAP(CAdapterInfo)
  32. COM_INTERFACE_ENTRY(IAdapterInfo)
  33. END_COM_MAP()
  34. //
  35. // IAdapterInfo
  36. //
  37. public:
  38. STDMETHODIMP GetAdapterAddresses(
  39. OUT ULONG* pulAddressCount,
  40. OUT ULONG** prgAddresses
  41. );
  42. STDMETHODIMP GetAdapterType(
  43. OUT ALG_ADAPTER_TYPE* pAdapterType
  44. );
  45. STDMETHODIMP GetAdapterIndex(
  46. OUT ULONG* pulIndex
  47. );
  48. //
  49. // Properties
  50. //
  51. public:
  52. ULONG m_nCookie;
  53. ULONG m_nAdapterIndex;
  54. ALG_ADAPTER_TYPE m_eType;
  55. short m_nAddressCount;
  56. DWORD m_anAddress[65];
  57. DWORD m_aMask[65];
  58. bool m_bNotified;
  59. };