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.

88 lines
2.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: E N U M . H
  7. //
  8. // Contents: Enumerator for connection objects.
  9. //
  10. // Notes:
  11. //
  12. // Author: shaunco 21 Sep 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "nmbase.h"
  17. #include "nmres.h"
  18. class ATL_NO_VTABLE CConnectionManagerEnumConnection :
  19. public CComObjectRootEx <CComMultiThreadModel>,
  20. public CComCoClass <CConnectionManagerEnumConnection,
  21. &CLSID_ConnectionManagerEnumConnection>,
  22. public IEnumNetConnection
  23. {
  24. private:
  25. NETCONMGR_ENUM_FLAGS m_EnumFlags;
  26. // m_ClassManagers is a binary tree (STL map) of pointers to the
  27. // INetConnectionManager interfaces implemented by our registered
  28. // class managers, indexed by the GUIDs of the class manager.
  29. //
  30. CLASSMANAGERMAP m_mapClassManagers;
  31. // m_iCurClassMgr is the iterator into the above map for the current
  32. // class manager involved in the enumeration.
  33. //
  34. CLASSMANAGERMAP::iterator m_iterCurClassMgr;
  35. // m_penumCurClassMgr is the enumerator corresponding to the current
  36. // class manager.
  37. IEnumNetConnection* m_penumCurClassMgr;
  38. private:
  39. VOID ReleaseCurrentClassEnumerator ()
  40. {
  41. ReleaseObj (m_penumCurClassMgr);
  42. m_penumCurClassMgr = NULL;
  43. }
  44. public:
  45. CConnectionManagerEnumConnection ()
  46. {
  47. m_EnumFlags = NCME_DEFAULT;
  48. m_penumCurClassMgr = NULL;
  49. m_iterCurClassMgr = m_mapClassManagers.begin();
  50. }
  51. VOID FinalRelease ();
  52. DECLARE_REGISTRY_RESOURCEID(IDR_CONMAN_ENUM)
  53. BEGIN_COM_MAP(CConnectionManagerEnumConnection)
  54. COM_INTERFACE_ENTRY(IEnumNetConnection)
  55. END_COM_MAP()
  56. // IEnumNetConnection
  57. STDMETHOD (Next) (
  58. ULONG celt,
  59. INetConnection** rgelt,
  60. ULONG* pceltFetched);
  61. STDMETHOD (Skip) (
  62. ULONG celt);
  63. STDMETHOD (Reset) ();
  64. STDMETHOD (Clone) (
  65. IEnumNetConnection** ppenum);
  66. public:
  67. static HRESULT CreateInstance (
  68. NETCONMGR_ENUM_FLAGS Flags,
  69. CLASSMANAGERMAP& mapClassManagers,
  70. REFIID riid,
  71. VOID** ppv);
  72. };