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.

131 lines
3.3 KiB

  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Microsoft Windows, Copyright (C) Microsoft Corporation, 2000
  3. File: Qualifier.h
  4. Content: Declaration of the CQualifier.
  5. History: 11-15-2001 dsie created
  6. ------------------------------------------------------------------------------*/
  7. #ifndef __QUALIFIER_H_
  8. #define __QUALIFIER_H_
  9. #include "Resource.h"
  10. #include "Lock.h"
  11. #include "Error.h"
  12. #include "Debug.h"
  13. ////////////////////////////////////////////////////////////////////////////////
  14. //
  15. // Exported functions.
  16. //
  17. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  18. Function : CreateQualifierObject
  19. Synopsis : Create and initialize an CQualifier object.
  20. Parameter: PCERT_POLICY_QUALIFIER_INFO pQualifier - Pointer to qualifier.
  21. IQualifier ** ppIQualifier - Pointer to pointer IQualifier object.
  22. Remark :
  23. ------------------------------------------------------------------------------*/
  24. HRESULT CreateQualifierObject (PCERT_POLICY_QUALIFIER_INFO pQualifier,
  25. IQualifier ** ppIQualifier);
  26. ////////////////////////////////////////////////////////////////////////////////
  27. //
  28. // CQualifier
  29. //
  30. class ATL_NO_VTABLE CQualifier :
  31. public CComObjectRootEx<CComMultiThreadModel>,
  32. public CComCoClass<CQualifier, &CLSID_Qualifier>,
  33. public ICAPICOMError<CQualifier, &IID_IQualifier>,
  34. public IDispatchImpl<IQualifier, &IID_IQualifier, &LIBID_CAPICOM,
  35. CAPICOM_MAJOR_VERSION, CAPICOM_MINOR_VERSION>
  36. {
  37. public:
  38. CQualifier()
  39. {
  40. }
  41. DECLARE_NO_REGISTRY()
  42. DECLARE_PROTECT_FINAL_CONSTRUCT()
  43. BEGIN_COM_MAP(CQualifier)
  44. COM_INTERFACE_ENTRY(IQualifier)
  45. COM_INTERFACE_ENTRY(IDispatch)
  46. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  47. END_COM_MAP()
  48. BEGIN_CATEGORY_MAP(CQualifier)
  49. END_CATEGORY_MAP()
  50. HRESULT FinalConstruct()
  51. {
  52. HRESULT hr;
  53. if (FAILED(hr = m_Lock.Initialized()))
  54. {
  55. DebugTrace("Error [%#x]: Critical section could not be created for Qualifier object.\n", hr);
  56. return hr;
  57. }
  58. m_pIOID = NULL;
  59. m_pINoticeNumbers = NULL;
  60. m_bstrCPSPointer.Empty();
  61. m_bstrOrganizationName.Empty();
  62. m_bstrExplicitText.Empty();
  63. return S_OK;
  64. }
  65. void FinalRelease()
  66. {
  67. m_pIOID.Release();
  68. m_pINoticeNumbers.Release();
  69. }
  70. //
  71. // IQualifier
  72. //
  73. public:
  74. STDMETHOD(get_OID)
  75. (/*[out, retval]*/ IOID ** pVal);
  76. STDMETHOD(get_CPSPointer)
  77. (/*[out, retval]*/ BSTR * pVal);
  78. STDMETHOD(get_OrganizationName)
  79. (/*[out, retval]*/ BSTR * pVal);
  80. STDMETHOD(get_NoticeNumbers)
  81. (/*[out, retval]*/ INoticeNumbers ** pVal);
  82. STDMETHOD(get_ExplicitText)
  83. (/*[out, retval]*/ BSTR * pVal);
  84. //
  85. // None COM functions.
  86. //
  87. STDMETHOD(Init)
  88. (PCERT_POLICY_QUALIFIER_INFO pQualifier);
  89. private:
  90. CLock m_Lock;
  91. CComPtr<IOID> m_pIOID;
  92. CComPtr<INoticeNumbers> m_pINoticeNumbers;
  93. CComBSTR m_bstrCPSPointer;
  94. CComBSTR m_bstrOrganizationName;
  95. CComBSTR m_bstrExplicitText;
  96. };
  97. #endif //__QUALIFIER_H_