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.

121 lines
3.0 KiB

  1. //+------------------------------------------------------------
  2. //
  3. // Copyright (C) 1998, Microsoft Corporation
  4. //
  5. // File: icatasync.h
  6. //
  7. // Contents: Implementation of ICategorizerAsyncContext
  8. //
  9. // Classes: CICategorizerAyncContext
  10. //
  11. // Functions:
  12. //
  13. // History:
  14. // jstamerj 1998/07/16 11:13:50: Created.
  15. //
  16. //-------------------------------------------------------------
  17. #ifndef _ICATASYNC_H_
  18. #define _ICATASYNC_H_
  19. #include <windows.h>
  20. #include <smtpevent.h>
  21. #include <dbgtrace.h>
  22. CatDebugClass(CICategorizerAsyncContextIMP),
  23. public ICategorizerAsyncContext
  24. {
  25. public:
  26. //IUnknown
  27. STDMETHOD (QueryInterface) (REFIID iid, LPVOID *ppv);
  28. STDMETHOD_(ULONG, AddRef) ();
  29. STDMETHOD_(ULONG, Release) ();
  30. public:
  31. //ICategorizerAsyncContext
  32. STDMETHOD (CompleteQuery) (
  33. IN PVOID pvQueryContext,
  34. IN HRESULT hrResolutionStatus,
  35. IN DWORD dwcResults,
  36. IN ICategorizerItemAttributes **rgpItemAttributes,
  37. IN BOOL fFinalCompletion);
  38. public:
  39. VOID SetISMTPServerEx(ISMTPServerEx *pISMTPServerEx)
  40. {
  41. _ASSERT(m_pISMTPServerEx == NULL);
  42. m_pISMTPServerEx = pISMTPServerEx;
  43. if(m_pISMTPServerEx)
  44. m_pISMTPServerEx->AddRef();
  45. }
  46. ISMTPServerEx * GetISMTPServerEx()
  47. {
  48. return m_pISMTPServerEx;
  49. }
  50. private:
  51. CICategorizerAsyncContextIMP();
  52. ~CICategorizerAsyncContextIMP();
  53. private:
  54. #define SIGNATURE_CICATEGORIZERASYNCCONTEXTIMP (DWORD)'ICAC'
  55. #define SIGNATURE_CICATEGORIZERASYNCCONTEXTIMP_INVALID (DWORD)'XCAC'
  56. DWORD m_dwSignature;
  57. ULONG m_cRef;
  58. ISMTPServerEx *m_pISMTPServerEx;
  59. friend class CAsyncLookupContext;
  60. friend class CSearchRequestBlock;
  61. };
  62. //+------------------------------------------------------------
  63. //
  64. // Function: CICategorizerAsyncContext::CICategorizerAsyncContext
  65. //
  66. // Synopsis: Initialize signature/refcount
  67. //
  68. // Arguments: NONE
  69. //
  70. // Returns: NOTHING
  71. //
  72. // History:
  73. // jstamerj 1998/07/16 11:21:36: Created.
  74. //
  75. //-------------------------------------------------------------
  76. inline CICategorizerAsyncContextIMP::CICategorizerAsyncContextIMP()
  77. {
  78. m_dwSignature = SIGNATURE_CICATEGORIZERASYNCCONTEXTIMP;
  79. m_cRef = 0;
  80. m_pISMTPServerEx = NULL;
  81. }
  82. //+------------------------------------------------------------
  83. //
  84. // Function: CICategorizerAsyncContext::~CICategorizerAsyncContext
  85. //
  86. // Synopsis: Assert check member variables before destruction
  87. //
  88. // Arguments: NONE
  89. //
  90. // Returns: NOTHING
  91. //
  92. // History:
  93. // jstamerj 1998/07/16 11:23:26: Created.
  94. //
  95. //-------------------------------------------------------------
  96. inline CICategorizerAsyncContextIMP::~CICategorizerAsyncContextIMP()
  97. {
  98. _ASSERT(m_cRef == 0);
  99. if(m_pISMTPServerEx)
  100. m_pISMTPServerEx->Release();
  101. _ASSERT(m_dwSignature == SIGNATURE_CICATEGORIZERASYNCCONTEXTIMP);
  102. m_dwSignature = SIGNATURE_CICATEGORIZERASYNCCONTEXTIMP_INVALID;
  103. }
  104. #endif //_ICATASYNC_H_