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.

106 lines
3.1 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. //
  4. // File: msgguid.h
  5. //
  6. // Description: Contains definitions of CAQMsgGuidList and CAQMsgGuidListEntry
  7. // which provide functionality to supersede outdated msg ID's
  8. //
  9. // Author: Mike Swafford (MikeSwa)
  10. //
  11. // History:
  12. // 10/10/98 - MikeSwa Created
  13. //
  14. // Copyright (C) 1998 Microsoft Corporation
  15. //
  16. //-----------------------------------------------------------------------------
  17. #ifndef __MSGGUID_H__
  18. #define __MSGGUID_H__
  19. #include <cpool.h>
  20. class CMsgRef;
  21. class CAQMsgGuidList;
  22. class CAQSvrInst;
  23. #define MSGGUIDLIST_SIG ' LGM'
  24. #define MSGGUIDLIST_ENTRY_SIG 'EgsM'
  25. #define MSGGUIDLIST_ENTRY_SIG_INVALID 'sgM!'
  26. //---[ CAQMsgGuidListEntry ]---------------------------------------------------
  27. //
  28. //
  29. // Description:
  30. // Entry for CAQMsgGuidList
  31. // Hungarian:
  32. // mgle, pmgle
  33. //
  34. //-----------------------------------------------------------------------------
  35. class CAQMsgGuidListEntry : public CBaseObject
  36. {
  37. protected:
  38. DWORD m_dwSignature;
  39. CMsgRef *m_pmsgref;
  40. LIST_ENTRY m_liMsgGuidList;
  41. CAQMsgGuidList *m_pmgl;
  42. GUID m_guidMsgID;
  43. public:
  44. static CPool s_MsgGuidListEntryPool;
  45. void * operator new (size_t stIgnored); //should not be used
  46. void operator delete(void *p, size_t size);
  47. CAQMsgGuidListEntry(CMsgRef *pmsgref, GUID *pguid, PLIST_ENTRY pliHead,
  48. CAQMsgGuidList *pmgl);
  49. ~CAQMsgGuidListEntry();
  50. //Used by CAQMsgGuidList
  51. static inline CAQMsgGuidListEntry * pmgleGetEntry(PLIST_ENTRY pli);
  52. inline BOOL fCompareGuid(GUID *pguid);
  53. inline CMsgRef *pmsgrefGetAndClearMsgRef();
  54. //Used by CMsgRef to remove from list when done delivering msg
  55. void RemoveFromList();
  56. void SupersedeMsg();
  57. };
  58. //---[ CAQMsgGuidList ]--------------------------------------------------------
  59. //
  60. //
  61. // Description:
  62. // Class that exposes functionality to store and search for message ID's.
  63. // Used to provide "supersedes msg ID" functionality
  64. // Hungarian:
  65. // mgl, pmgl
  66. //
  67. //-----------------------------------------------------------------------------
  68. class CAQMsgGuidList
  69. {
  70. protected:
  71. DWORD m_dwSignature;
  72. DWORD *m_pcSupersededMsgs;
  73. LIST_ENTRY m_liMsgGuidListHead;
  74. CShareLockNH m_slPrivateData;
  75. public:
  76. CAQMsgGuidList(DWORD *pcSupersededMsgs = NULL);
  77. ~CAQMsgGuidList();
  78. CAQMsgGuidListEntry *pmgleAddMsgGuid(CMsgRef *pmsgref,
  79. GUID *pguidID,
  80. GUID *pguidSuperseded);
  81. void Deinitialize(CAQSvrInst *paqinst);
  82. void RemoveFromList(PLIST_ENTRY pli);
  83. };
  84. inline void *CAQMsgGuidListEntry::operator new(size_t size)
  85. {
  86. return s_MsgGuidListEntryPool.Alloc();
  87. }
  88. inline void CAQMsgGuidListEntry::operator delete(void *p, size_t size)
  89. {
  90. s_MsgGuidListEntryPool.Free(p);
  91. }
  92. #endif //__MSGGUID_H__