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.

125 lines
3.6 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. //
  4. // File: localq.h
  5. //
  6. // Description: Header file for CLocalLinkMsgQueue class... a subclass of
  7. // CLinkMsgQueue that provides the additional functionality need to
  8. // admin a local queue
  9. //
  10. // Author: Mike Swafford (MikeSwa)
  11. //
  12. // History:
  13. // 2/23/99 - MikeSwa Created
  14. //
  15. // Copyright (C) 1999 Microsoft Corporation
  16. //
  17. //-----------------------------------------------------------------------------
  18. #ifndef __LOCALQ_H__
  19. #define __LOCALQ_H__
  20. #include "linkmsgq.h"
  21. #define LOCAL_LINK_MSG_QUEUE_SIG 'QMLL'
  22. //---[ CLocalLinkNotifyWrapper ]-----------------------------------------------
  23. //
  24. //
  25. // Description:
  26. // Implements IAQNotify for the local link. This is encapsulated in a
  27. // different class, because QAPI functions need to call also update
  28. // the perfcounters when a message is removed. We cannot call directly
  29. // into the HrNotify on CLinkMsgQueue... and we cannot override the
  30. // basic HrNotify functionality (because we only need it for QAPI
  31. // functionality).
  32. //
  33. //-----------------------------------------------------------------------------
  34. class CLocalLinkNotifyWrapper : public IAQNotify
  35. {
  36. private:
  37. CAQSvrInst *m_paqinst;
  38. CLinkMsgQueue *m_plmq;
  39. public:
  40. CLocalLinkNotifyWrapper()
  41. {
  42. m_paqinst = NULL;
  43. m_plmq = NULL;
  44. }
  45. inline void Init(CAQSvrInst *paqinst, CLinkMsgQueue *plmq)
  46. {
  47. _ASSERT(paqinst);
  48. _ASSERT(plmq);
  49. m_paqinst = paqinst;
  50. m_plmq = plmq;
  51. }
  52. virtual HRESULT HrNotify(CAQStats *paqstats, BOOL fAdd)
  53. {
  54. UpdateCountersForLinkType(m_paqinst, LI_TYPE_LOCAL_DELIVERY);
  55. if (m_plmq)
  56. return m_plmq->HrNotify(paqstats, fAdd);
  57. else
  58. return S_OK;
  59. }
  60. };
  61. //---[ CLocalLinkMsgQueue ]----------------------------------------------------
  62. //
  63. //
  64. // Description:
  65. // Derived class of CLinkMsgQueue that provides that additional queue
  66. // admin functionality required to handle local delivery
  67. // Hungarian:
  68. // llmq, pllmq
  69. //
  70. //-----------------------------------------------------------------------------
  71. class CLocalLinkMsgQueue :
  72. public CLinkMsgQueue
  73. {
  74. protected:
  75. DWORD m_dwLocalLinkSig;
  76. CAsyncAdminMsgRefQueue *m_paradmq;
  77. CLocalLinkNotifyWrapper m_AQNotify;
  78. public:
  79. CLocalLinkMsgQueue(CAsyncAdminMsgRefQueue *paradmq,
  80. GUID guidLink,
  81. CAQSvrInst *paqinst);
  82. virtual BOOL fIsRemote() {return FALSE;};
  83. public: //IQueueAdminAction
  84. STDMETHOD(HrApplyQueueAdminFunction)(
  85. IQueueAdminMessageFilter *pIQueueAdminMessageFilter);
  86. STDMETHOD_(BOOL, fMatchesID)
  87. (QUEUELINK_ID *QueueLinkID);
  88. STDMETHOD(QuerySupportedActions)(DWORD *pdwSupportedActions,
  89. DWORD *pdwSupportedFilterFlags)
  90. {
  91. return QueryDefaultSupportedActions(pdwSupportedActions,
  92. pdwSupportedFilterFlags);
  93. };
  94. public: //IQueueAdminLink
  95. STDMETHOD(HrGetLinkInfo)(
  96. LINK_INFO *pliLinkInfo,
  97. HRESULT *phrLinkDiagnostic);
  98. STDMETHOD(HrApplyActionToLink)(
  99. LINK_ACTION la);
  100. STDMETHOD(HrGetNumQueues)(
  101. DWORD *pcQueues);
  102. STDMETHOD(HrGetQueueIDs)(
  103. DWORD *pcQueues,
  104. QUEUELINK_ID *rgQueues);
  105. };
  106. #endif //__LOCALQ_H__