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.

116 lines
4.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. FaxInboundRoutingExtensions.h
  5. Abstract:
  6. Declaration of the CFaxInboundRoutingExtensions class
  7. Author:
  8. Iv Garber (IvG) Jul, 2000
  9. Revision History:
  10. --*/
  11. #ifndef __FAXINBOUNDROUTINGEXTENSIONS_H_
  12. #define __FAXINBOUNDROUTINGEXTENSIONS_H_
  13. #include "resource.h" // main symbols
  14. #include <vector>
  15. #include "VCUE_Copy.h"
  16. #include "FaxCommon.h"
  17. //#include "FaxDeviceProvider.h"
  18. //
  19. // Very same as Device Providers Collection and Device Provider Objects
  20. //
  21. namespace IRExtensionsNamespace
  22. {
  23. //
  24. // Inbound Routing Extension Objects are stored in Vector of STL.
  25. // When initialized, they got ALL their data.
  26. // They never call Fax Server.
  27. // They do not depend neither on Fax Server nor on Extensions Collection
  28. // after they are created and initialized.
  29. // So, they implemented as usual COM Objects.
  30. // The Collection stores Ptrs to them, and makes ONE AddRef().
  31. // Each time User asks for an Object from the Collection, an additional AddRef() happens.
  32. // When killed, Collection calls Release() on all contained in it Extension Objects.
  33. // Those that are not asked by User, dies.
  34. // Those, that have User's AddRef() - remains alive, untill User free its Reference on them.
  35. // The Extension Object can continue to live after all objects are freed,
  36. // including Fax Server and all its Descendants.
  37. // THIS IS BECAUSE Extension Object and their Collection is Snap-Shot
  38. // of the situation on the Server. They are not updatable, but a read-only objects.
  39. // To get the updated data, User must ask new Collection from the Server.
  40. //
  41. typedef std::vector<IFaxInboundRoutingExtension*> ContainerType;
  42. // Use IEnumVARIANT as the enumerator for VB compatibility
  43. typedef VARIANT EnumExposedType;
  44. typedef IEnumVARIANT EnumIfc;
  45. // Copy Classes
  46. typedef VCUE::CopyIfc2Variant<ContainerType::value_type> EnumCopyType;
  47. typedef VCUE::CopyIfc<ContainerType::value_type> CollectionCopyType;
  48. // Enumeration Type, shortcut for next typedef
  49. typedef CComEnumOnSTL< EnumIfc, &__uuidof(EnumIfc), EnumExposedType, EnumCopyType, ContainerType >
  50. EnumType;
  51. // Collection Type, real ancestor of the IR Extensions Collection
  52. typedef ICollectionOnSTLImpl< IFaxInboundRoutingExtensions, ContainerType, ContainerType::value_type,
  53. CollectionCopyType, EnumType > CollectionType;
  54. };
  55. using namespace IRExtensionsNamespace;
  56. //
  57. //===================== INBOUND ROUTING EXTENSIONS COLLECTION =================================
  58. //
  59. class ATL_NO_VTABLE CFaxInboundRoutingExtensions :
  60. public CComObjectRootEx<CComSingleThreadModel>,
  61. public ISupportErrorInfo,
  62. public IDispatchImpl<IRExtensionsNamespace::CollectionType, &IID_IFaxInboundRoutingExtensions,
  63. &LIBID_FAXCOMEXLib>,
  64. public CFaxInitInner
  65. {
  66. public:
  67. CFaxInboundRoutingExtensions() : CFaxInitInner(_T("INBOUND ROUTING EXTENSIONS COLLECTION"))
  68. {}
  69. ~CFaxInboundRoutingExtensions()
  70. {
  71. CCollectionKiller<IRExtensionsNamespace::ContainerType> CKiller;
  72. CKiller.EmptyObjectCollection(&m_coll);
  73. }
  74. DECLARE_REGISTRY_RESOURCEID(IDR_FAXINBOUNDROUTINGEXTENSIONS)
  75. DECLARE_NOT_AGGREGATABLE(CFaxInboundRoutingExtensions)
  76. DECLARE_PROTECT_FINAL_CONSTRUCT()
  77. BEGIN_COM_MAP(CFaxInboundRoutingExtensions)
  78. COM_INTERFACE_ENTRY(IFaxInboundRoutingExtensions)
  79. COM_INTERFACE_ENTRY(IDispatch)
  80. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  81. COM_INTERFACE_ENTRY(IFaxInitInner)
  82. END_COM_MAP()
  83. // Interfaces
  84. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  85. STDMETHOD(get_Item)(/*[in]*/ VARIANT vIndex,
  86. /*[out, retval]*/ IFaxInboundRoutingExtension **ppExtension);
  87. // Internal Use
  88. STDMETHOD(Init)(IFaxServerInner *pServerInner);
  89. static HRESULT Create(IFaxInboundRoutingExtensions **ppIRExtensions);
  90. };
  91. #endif //__FAXINBOUNDROUTINGEXTENSIONS_H_