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.

110 lines
2.8 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: exit.h
  7. //
  8. // Contents: CCertExitSample definition
  9. //
  10. //---------------------------------------------------------------------------
  11. #include "certxsam.h"
  12. #include "resource.h" // main symbols
  13. HRESULT
  14. GetServerCallbackInterface(
  15. OUT ICertServerExit** ppServer,
  16. IN LONG Context);
  17. HRESULT
  18. exitGetProperty(
  19. IN ICertServerExit *pServer,
  20. IN BOOL fRequest,
  21. IN WCHAR const *pwszPropertyName,
  22. IN DWORD PropType,
  23. OUT VARIANT *pvarOut);
  24. /////////////////////////////////////////////////////////////////////////////
  25. // certexit
  26. class CCertExitSample:
  27. public CComDualImpl<ICertExit2, &IID_ICertExit2, &LIBID_CERTEXITSAMPLELib>,
  28. public ISupportErrorInfo,
  29. public CComObjectRoot,
  30. public CComCoClass<CCertExitSample, &CLSID_CCertExitSample>
  31. {
  32. public:
  33. CCertExitSample()
  34. {
  35. m_strDescription = NULL;
  36. m_strCAName = NULL;
  37. m_pwszRegStorageLoc = NULL;
  38. m_hExitKey = NULL;
  39. m_dwExitPublishFlags = 0;
  40. m_cCACert = 0;
  41. }
  42. ~CCertExitSample();
  43. BEGIN_COM_MAP(CCertExitSample)
  44. COM_INTERFACE_ENTRY(IDispatch)
  45. COM_INTERFACE_ENTRY(ICertExit)
  46. COM_INTERFACE_ENTRY(ICertExit2)
  47. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  48. END_COM_MAP()
  49. DECLARE_NOT_AGGREGATABLE(CCertExitSample)
  50. DECLARE_REGISTRY(
  51. CCertExitSample,
  52. wszCLASS_CERTEXITSAMPLE TEXT(".1"),
  53. wszCLASS_CERTEXITSAMPLE,
  54. IDS_CERTEXIT_DESC,
  55. THREADFLAGS_BOTH)
  56. // ISupportsErrorInfo
  57. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  58. // ICertExit
  59. public:
  60. STDMETHOD(Initialize)(
  61. /* [in] */ BSTR const strConfig,
  62. /* [retval][out] */ LONG __RPC_FAR *pEventMask);
  63. STDMETHOD(Notify)(
  64. /* [in] */ LONG ExitEvent,
  65. /* [in] */ LONG Context);
  66. STDMETHOD(GetDescription)(
  67. /* [retval][out] */ BSTR *pstrDescription);
  68. // ICertExit2
  69. public:
  70. STDMETHOD(GetManageModule)(
  71. /* [out, retval] */ ICertManageModule **ppManageModule);
  72. private:
  73. HRESULT _NotifyNewCert(IN LONG Context);
  74. HRESULT _NotifyCRLIssued(IN LONG Context);
  75. HRESULT _WriteCertToFile(
  76. IN ICertServerExit *pServer,
  77. IN BYTE const *pbCert,
  78. IN DWORD cbCert);
  79. HRESULT _ExpandEnvironmentVariables(
  80. IN WCHAR const *pwszIn,
  81. OUT WCHAR *pwszOut,
  82. IN DWORD cwcOut);
  83. // Member variables & private methods here:
  84. BSTR m_strDescription;
  85. BSTR m_strCAName;
  86. LPWSTR m_pwszRegStorageLoc;
  87. HKEY m_hExitKey;
  88. DWORD m_dwExitPublishFlags;
  89. DWORD m_cCACert;
  90. };