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.

123 lines
3.3 KiB

  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Microsoft Windows, Copyright (C) Microsoft Corporation, 2000
  3. File: NoticeNumbers.h
  4. Content: Declaration of CNoticeNumbers.
  5. History: 11-15-99 dsie created
  6. ------------------------------------------------------------------------------*/
  7. #ifndef __NOTICENUMBERS_H_
  8. #define __NOTICENUMBERS_H_
  9. #include "Resource.h"
  10. #include "Error.h"
  11. #include "Lock.h"
  12. #include "Debug.h"
  13. #include "CopyItem.h"
  14. ////////////////////
  15. //
  16. // Locals
  17. //
  18. //
  19. // typdefs to make life easier.
  20. //
  21. typedef std::vector<long> NoticeNumbersContainer;
  22. typedef CComEnumOnSTL<IEnumVARIANT, &IID_IEnumVARIANT, VARIANT, _CopyVariant<long>, NoticeNumbersContainer> NoticeNumberEnum;
  23. typedef ICollectionOnSTLImpl<INoticeNumbers, NoticeNumbersContainer, VARIANT, _CopyVariant<long>, NoticeNumberEnum> INoticeNumbersCollection;
  24. ////////////////////////////////////////////////////////////////////////////////
  25. //
  26. // Exported functions.
  27. //
  28. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  29. Function : CreateNoticeNumbersObject
  30. Synopsis : Create an INoticeNumbers collection object, and load the object with
  31. NoticeNumbers from the specified location.
  32. Parameter: PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE pNoticeReference
  33. INoticeNumbers ** ppINoticeNumbers - Pointer to pointer INoticeNumbers
  34. to recieve the interface pointer.
  35. Remark :
  36. ------------------------------------------------------------------------------*/
  37. HRESULT CreateNoticeNumbersObject (PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE pNoticeReference,
  38. INoticeNumbers ** ppINoticeNumbers);
  39. ////////////////////////////////////////////////////////////////////////////////
  40. //
  41. // CNoticeNumbers
  42. //
  43. class ATL_NO_VTABLE CNoticeNumbers :
  44. public CComObjectRootEx<CComMultiThreadModel>,
  45. public CComCoClass<CNoticeNumbers, &CLSID_NoticeNumbers>,
  46. public ICAPICOMError<CNoticeNumbers, &IID_INoticeNumbers>,
  47. public IDispatchImpl<INoticeNumbersCollection, &IID_INoticeNumbers, &LIBID_CAPICOM,
  48. CAPICOM_MAJOR_VERSION, CAPICOM_MINOR_VERSION>
  49. {
  50. public:
  51. CNoticeNumbers()
  52. {
  53. }
  54. HRESULT FinalConstruct()
  55. {
  56. HRESULT hr;
  57. if (FAILED(hr = m_Lock.Initialized()))
  58. {
  59. DebugTrace("Error [%#x]: Critical section could not be created for NoticeNumbers object.\n", hr);
  60. return hr;
  61. }
  62. return S_OK;
  63. }
  64. DECLARE_NO_REGISTRY()
  65. DECLARE_GET_CONTROLLING_UNKNOWN()
  66. DECLARE_PROTECT_FINAL_CONSTRUCT()
  67. BEGIN_COM_MAP(CNoticeNumbers)
  68. COM_INTERFACE_ENTRY(INoticeNumbers)
  69. COM_INTERFACE_ENTRY(IDispatch)
  70. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  71. END_COM_MAP()
  72. BEGIN_CATEGORY_MAP(CNoticeNumbers)
  73. END_CATEGORY_MAP()
  74. //
  75. // INoticeNumbers
  76. //
  77. public:
  78. //
  79. // These are the only ones that we need to implemented, others will be
  80. // handled by ATL ICollectionOnSTLImpl.
  81. //
  82. //
  83. // None COM functions.
  84. //
  85. STDMETHOD(Init)
  86. (DWORD cNoticeNumbers,
  87. int * rgNoticeNumbers);
  88. private:
  89. CLock m_Lock;
  90. };
  91. #endif //__NOTICENUMBERS_H_