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.

121 lines
2.7 KiB

  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Microsoft Windows
  3. Copyright (C) Microsoft Corporation, 1995 - 1999.
  4. File: EKU.h
  5. Content: Declaration of CEKU.
  6. History: 11-15-99 dsie created
  7. ------------------------------------------------------------------------------*/
  8. #ifndef __EKU_H_
  9. #define __EKU_H_
  10. #include "Resource.h"
  11. #include "Error.h"
  12. #include "Lock.h"
  13. #include "Debug.h"
  14. ////////////////////////////////////////////////////////////////////////////////
  15. //
  16. // Exported functions.
  17. //
  18. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  19. Function : CreateEKUObject
  20. Synopsis : Create an IEKU object and initialize the object with data
  21. from the specified OID.
  22. Parameter: LPTSTR * pszOID - Pointer to EKU OID string.
  23. IEKU ** ppIEKU - Pointer to pointer IEKU object.
  24. Remark :
  25. ------------------------------------------------------------------------------*/
  26. HRESULT CreateEKUObject (LPSTR pszOID, IEKU ** ppIEKU);
  27. ////////////////////////////////////////////////////////////////////////////////
  28. //
  29. // CEKU
  30. //
  31. class ATL_NO_VTABLE CEKU :
  32. public CComObjectRootEx<CComMultiThreadModel>,
  33. public CComCoClass<CEKU, &CLSID_EKU>,
  34. public ICAPICOMError<CEKU, &IID_IEKU>,
  35. public IDispatchImpl<IEKU, &IID_IEKU, &LIBID_CAPICOM,
  36. CAPICOM_MAJOR_VERSION, CAPICOM_MINOR_VERSION>
  37. {
  38. public:
  39. CEKU()
  40. {
  41. }
  42. DECLARE_NO_REGISTRY()
  43. DECLARE_GET_CONTROLLING_UNKNOWN()
  44. DECLARE_PROTECT_FINAL_CONSTRUCT()
  45. BEGIN_COM_MAP(CEKU)
  46. COM_INTERFACE_ENTRY(IEKU)
  47. COM_INTERFACE_ENTRY(IDispatch)
  48. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  49. END_COM_MAP()
  50. BEGIN_CATEGORY_MAP(CEKU)
  51. END_CATEGORY_MAP()
  52. HRESULT FinalConstruct()
  53. {
  54. HRESULT hr;
  55. if (FAILED(hr = m_Lock.Initialized()))
  56. {
  57. DebugTrace("Error [%#x]: Critical section could not be created for EKU object.\n", hr);
  58. return hr;
  59. }
  60. m_Name = CAPICOM_EKU_OTHER;
  61. return S_OK;
  62. }
  63. //
  64. // IEKU
  65. //
  66. public:
  67. STDMETHOD(get_OID)
  68. (/*[out, retval]*/ BSTR * pVal);
  69. STDMETHOD(put_OID)
  70. (/*[out, retval]*/ BSTR newVal);
  71. STDMETHOD(get_Name)
  72. (/*[out, retval]*/ CAPICOM_EKU * pVal);
  73. STDMETHOD(put_Name)
  74. (/*[out, retval]*/ CAPICOM_EKU newVal);
  75. //
  76. // C++ member function needed to initialize the object.
  77. //
  78. STDMETHOD(Init)
  79. (CAPICOM_EKU EkuName, LPSTR pszOID);
  80. private:
  81. CLock m_Lock;
  82. CAPICOM_EKU m_Name;
  83. CComBSTR m_bstrOID;
  84. };
  85. #endif //__EKU_H_