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.

96 lines
2.4 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: exit.h
  7. //
  8. // Contents: CCertExitSQLSample definition
  9. //
  10. //---------------------------------------------------------------------------
  11. #include "exitsql.h"
  12. #include "resource.h" // main symbols
  13. #include <sql.h>
  14. #include <sqlext.h>
  15. #include <sqltypes.h>
  16. #define wszREG_EXITSQL_DSN L"DatabaseDSN"
  17. #define wszREG_EXITSQL_USER L"DatabaseUser"
  18. #define wszREG_EXITSQL_PASSWORD L"DatabasePassword"
  19. HRESULT
  20. GetServerCallbackInterface(
  21. OUT ICertServerExit** ppServer,
  22. IN LONG Context);
  23. /////////////////////////////////////////////////////////////////////////////
  24. // certexit
  25. class CCertExitSQLSample:
  26. public CComDualImpl<ICertExit, &IID_ICertExit, &LIBID_CERTEXITSAMPLELib>,
  27. public ISupportErrorInfo,
  28. public CComObjectRoot,
  29. public CComCoClass<CCertExitSQLSample, &CLSID_CCertExitSQLSample>
  30. {
  31. public:
  32. CCertExitSQLSample()
  33. {
  34. m_henv = SQL_NULL_HENV;
  35. m_hdbc1 = SQL_NULL_HDBC;
  36. m_strCAName = NULL;
  37. }
  38. ~CCertExitSQLSample();
  39. BEGIN_COM_MAP(CCertExitSQLSample)
  40. COM_INTERFACE_ENTRY(IDispatch)
  41. COM_INTERFACE_ENTRY(ICertExit)
  42. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  43. END_COM_MAP()
  44. DECLARE_NOT_AGGREGATABLE(CCertExitSQLSample)
  45. DECLARE_REGISTRY(
  46. CCertExitSQLSample,
  47. wszCLASS_CERTEXITSAMPLE TEXT(".1"),
  48. wszCLASS_CERTEXITSAMPLE,
  49. IDS_CERTEXIT_DESC,
  50. THREADFLAGS_BOTH)
  51. // ISupportsErrorInfo
  52. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  53. // ICertExit
  54. public:
  55. STDMETHOD(Initialize)(
  56. /* [in] */ BSTR const strConfig,
  57. /* [retval][out] */ LONG __RPC_FAR *pEventMask);
  58. STDMETHOD(Notify)(
  59. /* [in] */ LONG ExitEvent,
  60. /* [in] */ LONG Context);
  61. STDMETHOD(GetDescription)(
  62. /* [retval][out] */ BSTR *pstrDescription);
  63. private:
  64. HRESULT _NotifyNewCert(IN LONG Context);
  65. HRESULT ExitModSetODBCProperty(
  66. IN DWORD dwReqId,
  67. IN LPWSTR pszCAName,
  68. IN LPWSTR pszRequester,
  69. IN LPWSTR pszCertType,
  70. IN FILETIME* pftBefore,
  71. IN FILETIME* pftAfter);
  72. // Member variables & private methods here:
  73. BSTR m_strCAName;
  74. SQLHENV m_henv;
  75. SQLHDBC m_hdbc1;
  76. };