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.

123 lines
3.0 KiB

  1. //+------------------------------------------------------------
  2. //
  3. // Copyright (C) 1998, Microsoft Corporation
  4. //
  5. // File: icatqueries.h
  6. //
  7. // Contents: Implementation of ICategorizerQueries
  8. //
  9. // Classes: CICategorizerQueriesIMP
  10. //
  11. // Functions:
  12. //
  13. // History:
  14. // jstamerj 1998/07/15 14:11:54: Created.
  15. //
  16. //-------------------------------------------------------------
  17. #ifndef __ICATQUERIES_H__
  18. #define __ICATQUERIES_H__
  19. CatDebugClass(CICategorizerQueriesIMP),
  20. public ICategorizerQueries
  21. {
  22. public:
  23. //IUnknown
  24. STDMETHOD (QueryInterface) (REFIID iid, LPVOID *ppv);
  25. STDMETHOD_(ULONG, AddRef) ();
  26. STDMETHOD_(ULONG, Release) ();
  27. public:
  28. //ICategorizerQueries
  29. STDMETHOD (SetQueryString) (
  30. IN LPSTR pszQueryString);
  31. STDMETHOD (GetQueryString) (
  32. OUT LPSTR *ppszQueryString);
  33. public:
  34. CICategorizerQueriesIMP(
  35. IN LPSTR *ppsz);
  36. ~CICategorizerQueriesIMP();
  37. VOID SetISMTPServerEx(ISMTPServerEx *pISMTPServerEx)
  38. {
  39. _ASSERT(m_pISMTPServerEx == NULL);
  40. m_pISMTPServerEx = pISMTPServerEx;
  41. if(m_pISMTPServerEx)
  42. m_pISMTPServerEx->AddRef();
  43. }
  44. ISMTPServerEx *GetISMTPServerEx()
  45. {
  46. return m_pISMTPServerEx;
  47. }
  48. private:
  49. // Internal method for setting the query string to a buffer
  50. // without reallocating/copying
  51. HRESULT SetQueryStringNoAlloc(
  52. IN LPSTR pszQueryString);
  53. private:
  54. #define SIGNATURE_CICATEGORIZERQUERIESIMP (DWORD) 'ICaQ'
  55. #define SIGNATURE_CICATEGORIZERQUERIESIMP_INVALID (DWORD) 'XCaQ'
  56. DWORD m_dwSignature;
  57. ULONG m_cRef;
  58. LPSTR *m_ppsz;
  59. ISMTPServerEx *m_pISMTPServerEx;
  60. friend class CSearchRequestBlock;
  61. };
  62. //+------------------------------------------------------------
  63. //
  64. // Function: CICategorizerQueriesIMP::CICategorizerQueriesIMP
  65. //
  66. // Synopsis: Constructor, initialize member data
  67. //
  68. // Arguments:
  69. // ppsz: Pointer to psz to set
  70. //
  71. // Returns: NOTHING
  72. //
  73. // History:
  74. // jstamerj 1998/07/15 14:18:00: Created.
  75. //
  76. //-------------------------------------------------------------
  77. inline CICategorizerQueriesIMP::CICategorizerQueriesIMP(
  78. IN LPSTR *ppsz)
  79. {
  80. m_dwSignature = SIGNATURE_CICATEGORIZERQUERIESIMP;
  81. _ASSERT(ppsz);
  82. m_ppsz = ppsz;
  83. m_cRef = 0;
  84. m_pISMTPServerEx = NULL;
  85. }
  86. //+------------------------------------------------------------
  87. //
  88. // Function: CICategorizerQueriesIMP::~CICategorizerQueriesIMP
  89. //
  90. // Synopsis: Check signature before destroying object
  91. //
  92. // Arguments: NONE
  93. //
  94. // Returns: NOTHING
  95. //
  96. // History:
  97. // jstamerj 1998/07/15 14:22:33: Created.
  98. //
  99. //-------------------------------------------------------------
  100. inline CICategorizerQueriesIMP::~CICategorizerQueriesIMP()
  101. {
  102. if(m_pISMTPServerEx)
  103. m_pISMTPServerEx->Release();
  104. _ASSERT(m_cRef == 0);
  105. _ASSERT(m_dwSignature == SIGNATURE_CICATEGORIZERQUERIESIMP);
  106. m_dwSignature = SIGNATURE_CICATEGORIZERQUERIESIMP_INVALID;
  107. }
  108. #endif //__ICATQUERIES_H__