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.

184 lines
4.7 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: view.h
  7. //
  8. // Contents: Declaration of CCertView
  9. //
  10. //---------------------------------------------------------------------------
  11. #include "certsrvd.h"
  12. #include "cscomres.h"
  13. HRESULT
  14. CopyMarshalledString(
  15. IN CERTTRANSBLOB const *pctb,
  16. IN ULONG obwsz,
  17. IN BYTE *pbEnd,
  18. IN BYTE **ppbNext,
  19. OUT WCHAR **ppwszOut);
  20. #define ICVTABLE_REQCERT 0
  21. #define ICVTABLE_EXTENSION 1
  22. #define ICVTABLE_ATTRIBUTE 2
  23. #define ICVTABLE_CRL 3
  24. #define ICVTABLE_MAX 4
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CCertView
  27. class ATL_NO_VTABLE CCertView:
  28. public IDispatchImpl<ICertView2, &IID_ICertView2, &LIBID_CERTADMINLib>,
  29. public ISupportErrorInfoImpl<&IID_ICertView2>,
  30. public CComObjectRoot,
  31. public CComCoClass<CCertView, &CLSID_CCertView>
  32. {
  33. public:
  34. CCertView();
  35. ~CCertView();
  36. BEGIN_COM_MAP(CCertView)
  37. COM_INTERFACE_ENTRY(IDispatch)
  38. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  39. COM_INTERFACE_ENTRY(ICertView)
  40. COM_INTERFACE_ENTRY(ICertView2)
  41. END_COM_MAP()
  42. DECLARE_NOT_AGGREGATABLE(CCertView)
  43. // Remove the comment from the line above if you don't want your object to
  44. // support aggregation. The default is to support it
  45. #if 1
  46. DECLARE_REGISTRY(
  47. CCertView,
  48. wszCLASS_CERTVIEW TEXT(".1"),
  49. wszCLASS_CERTVIEW,
  50. IDS_CERTVIEW_DESC,
  51. THREADFLAGS_BOTH)
  52. #endif
  53. // ICertView
  54. STDMETHOD(OpenConnection)(
  55. /* [in] */ BSTR const strConfig);
  56. STDMETHOD(EnumCertViewColumn)(
  57. /* [in] */ LONG fResultColumn, // CVRC_COLUMN_*
  58. /* [out, retval] */ IEnumCERTVIEWCOLUMN **ppenum);
  59. STDMETHOD(GetColumnCount)(
  60. /* [in] */ LONG fResultColumn, // CVRC_COLUMN_*
  61. /* [out, retval] */ LONG __RPC_FAR *pcColumn);
  62. STDMETHOD(GetColumnIndex)(
  63. /* [in] */ LONG fResultColumn, // CVRC_COLUMN_*
  64. /* [in] */ BSTR const strColumnName,
  65. /* [out, retval] */ LONG *pColumnIndex);
  66. STDMETHOD(SetResultColumnCount)(
  67. /* [in] */ LONG cColumn);
  68. STDMETHOD(SetResultColumn)(
  69. /* [in] */ LONG ColumnIndex);
  70. STDMETHOD(SetRestriction)(
  71. /* [in] */ LONG ColumnIndex,
  72. /* [in] */ LONG SeekOperator,
  73. /* [in] */ LONG SortOrder,
  74. /* [in] */ VARIANT __RPC_FAR const *pvarValue);
  75. STDMETHOD(OpenView)(
  76. /* [out] */ IEnumCERTVIEWROW **ppenum);
  77. // ICertView2
  78. STDMETHOD(SetTable)(
  79. /* [in] */ LONG Table); // CVRC_TABLE_*
  80. // CCertView
  81. HRESULT GetTable(
  82. OUT LONG *pcvrcTable);
  83. HRESULT FindColumn(
  84. IN LONG Flags, // CVRC_TABLE_* | CVRC_COLUMN_*
  85. IN LONG ColumnIndex,
  86. OUT CERTDBCOLUMN const **ppColumn,
  87. OPTIONAL OUT WCHAR const **ppwszDisplayName);
  88. HRESULT SetViewColumns(
  89. OUT LONG *pcbrowResultNominal);
  90. HRESULT EnumView(
  91. IN LONG cskip,
  92. IN ULONG celt,
  93. OUT ULONG *pceltFetched,
  94. OUT LONG *pieltNext,
  95. OUT LONG *pcbResultRows,
  96. OUT CERTTRANSDBRESULTROW const **ppResultRows);
  97. HRESULT EnumAttributesOrExtensions(
  98. IN DWORD RowId,
  99. IN DWORD Flags,
  100. OPTIONAL IN WCHAR const *pwszLast,
  101. IN DWORD celt,
  102. OUT DWORD *pceltFetched,
  103. CERTTRANSBLOB *pctbOut);
  104. // Internal Functions
  105. private:
  106. VOID _Cleanup();
  107. HRESULT _VerifyServerVersion(
  108. IN DWORD RequiredVersion);
  109. HRESULT _SaveColumnInfo(
  110. IN LONG icvTable,
  111. IN DWORD celt,
  112. IN CERTTRANSBLOB const *pctbColumn);
  113. HRESULT _LoadSchema(
  114. IN LONG icvTable,
  115. IN LONG cvrcTable);
  116. HRESULT _ValidateFlags(
  117. IN BOOL fSchemaOnly,
  118. IN DWORD Flags);
  119. HRESULT _SetTable(
  120. IN LONG Table); // CVRC_TABLE_* or CV_COLUMN_*_DEFAULT
  121. HRESULT _SetErrorInfo(
  122. IN HRESULT hrError,
  123. IN WCHAR const *pwszDescription);
  124. WCHAR *m_pwszServerName;
  125. DWORD m_dwServerVersion;
  126. ICertAdminD2 *m_pICertAdminD;
  127. CERTDBCOLUMN **m_aaaColumn[ICVTABLE_MAX];
  128. DWORD m_acaColumn[ICVTABLE_MAX];
  129. LONG m_acColumn[ICVTABLE_MAX];
  130. CERTVIEWRESTRICTION *m_aRestriction;
  131. LONG m_cRestriction;
  132. BOOL m_fTableSet;
  133. LONG m_icvTable; // ICVTABLE_*
  134. LONG m_cvrcTable; // CVRC_TABLE_*
  135. BOOL m_fAddOk;
  136. LONG m_cColumnResultMax;
  137. LONG m_cColumnResult;
  138. LONG m_cbcolResultNominalTotal;
  139. LONG *m_aColumnResult; // Exposed 0-based Column Index array
  140. DWORD *m_aDBColumnResult; // Server DB Column Index array
  141. WCHAR *m_pwszAuthority;
  142. BOOL m_fOpenConnection;
  143. BOOL m_fOpenView;
  144. BOOL m_fServerOpenView;
  145. LONG m_ielt;
  146. WCHAR const **m_aapwszColumnDisplayName[ICVTABLE_MAX];
  147. };