Source code of Windows XP (NT5)
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.

133 lines
3.5 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: request.h
  7. //
  8. // Contents: Implementation of DCOM object for RPC services
  9. //
  10. // History: July-97 xtan created
  11. //
  12. //---------------------------------------------------------------------------
  13. // class definition
  14. // Request Interface
  15. class CCertRequestD : public ICertRequestD2
  16. {
  17. public:
  18. // IUnknown
  19. virtual STDMETHODIMP QueryInterface(const IID& iid, void** ppv);
  20. virtual ULONG STDMETHODCALLTYPE AddRef();
  21. virtual ULONG STDMETHODCALLTYPE Release();
  22. // ICertRequestD
  23. virtual STDMETHODIMP Request(
  24. IN DWORD dwFlags,
  25. IN wchar_t const *pwszAuthority,
  26. IN OUT DWORD *pdwRequestId,
  27. OUT DWORD *pdwDisposition,
  28. IN wchar_t const *pwszAttributes,
  29. IN CERTTRANSBLOB const *pctbRequest,
  30. OUT CERTTRANSBLOB *pctbCertChain,
  31. OUT CERTTRANSBLOB *pctbEncodedCert,
  32. OUT CERTTRANSBLOB *pctbDispositionMessage);
  33. virtual STDMETHODIMP GetCACert(
  34. IN DWORD Flags,
  35. IN wchar_t const *pwszAuthority,
  36. OUT CERTTRANSBLOB *pctbOut);
  37. virtual STDMETHODIMP Ping( // test function
  38. wchar_t const *pwszAuthority);
  39. // ICertRequestD2
  40. virtual STDMETHODIMP Request2(
  41. IN wchar_t const *pwszAuthority,
  42. IN DWORD dwFlags,
  43. IN wchar_t const *pwszSerialNumber,
  44. IN OUT DWORD *pdwRequestId,
  45. OUT DWORD *pdwDisposition,
  46. IN wchar_t const *pwszAttributes,
  47. IN CERTTRANSBLOB const *pctbRequest,
  48. OUT CERTTRANSBLOB *pctbFullResponse,
  49. OUT CERTTRANSBLOB *pctbEncodedCert,
  50. OUT CERTTRANSBLOB *pctbDispositionMessage);
  51. virtual STDMETHODIMP GetCAProperty(
  52. IN wchar_t const *pwszAuthority,
  53. IN LONG PropId, // CR_PROP_*
  54. IN LONG PropIndex,
  55. IN LONG PropType, // PROPTYPE_*
  56. OUT CERTTRANSBLOB *pctbPropertyValue);
  57. virtual STDMETHODIMP GetCAPropertyInfo(
  58. IN wchar_t const *pwszAuthority,
  59. OUT LONG *pcProperty,
  60. OUT CERTTRANSBLOB *pctbPropInfo);
  61. virtual STDMETHODIMP Ping2(
  62. IN wchar_t const *pwszAuthority);
  63. // CCertRequestD
  64. // Constructor
  65. CCertRequestD();
  66. // Destructor
  67. ~CCertRequestD();
  68. private:
  69. // this is a test function
  70. HRESULT _Ping(
  71. IN wchar_t const *pwszAuthority);
  72. HRESULT _Request(
  73. IN WCHAR const *pwszAuthority,
  74. IN DWORD dwFlags,
  75. OPTIONAL IN WCHAR const *pwszSerialNumber,
  76. IN DWORD dwRequestId,
  77. OPTIONAL IN WCHAR const *pwszAttributes,
  78. OPTIONAL IN CERTTRANSBLOB const *pctbRequest,
  79. OUT CERTSRV_RESULT_CONTEXT *pResult);
  80. private:
  81. // Reference count
  82. long m_cRef;
  83. };
  84. // Class of Request factory
  85. class CRequestFactory : public IClassFactory
  86. {
  87. public:
  88. // IUnknown
  89. virtual STDMETHODIMP QueryInterface(const IID& iid, void **ppv);
  90. virtual ULONG STDMETHODCALLTYPE AddRef();
  91. virtual ULONG STDMETHODCALLTYPE Release();
  92. // Interface IClassFactory
  93. virtual STDMETHODIMP CreateInstance(
  94. IUnknown *pUnknownOuter,
  95. const IID& iid,
  96. void **ppv);
  97. virtual STDMETHODIMP LockServer(BOOL bLock);
  98. // Constructor
  99. CRequestFactory() : m_cRef(1) { }
  100. // Destructor
  101. ~CRequestFactory() { }
  102. public:
  103. static HRESULT CanUnloadNow();
  104. static HRESULT StartFactory();
  105. static void StopFactory();
  106. private:
  107. long m_cRef;
  108. };