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.

73 lines
1.5 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. History:
  6. --*/
  7. #ifndef __MSMQQ_H__
  8. #define __MSMQQ_H__
  9. #include <unk.h>
  10. #include <wmimsg.h>
  11. #include <sync.h>
  12. #include "msmqhdlr.h"
  13. #include "msmqcomn.h"
  14. /**************************************************************************
  15. CMsgMsmqQueue
  16. ***************************************************************************/
  17. class CMsgMsmqQueue : public CUnk
  18. {
  19. class XQueue : public CImpl<IWmiMessageQueue, CMsgMsmqQueue>
  20. {
  21. public:
  22. STDMETHOD(Open)( LPCWSTR wszEndpoint,
  23. DWORD dwFlags,
  24. IWmiMessageSendReceive* pRcv,
  25. IWmiMessageQueueReceiver** ppRcv )
  26. {
  27. return m_pObject->Open( wszEndpoint, dwFlags, pRcv, ppRcv );
  28. }
  29. XQueue( CMsgMsmqQueue* pObj )
  30. : CImpl<IWmiMessageQueue, CMsgMsmqQueue > ( pObj ) { }
  31. } m_XQueue;
  32. HRESULT EnsureQueue( LPCWSTR wszEndpoint, DWORD dwFlags );
  33. void* GetInterface( REFIID riid );
  34. CCritSec m_cs;
  35. CMsmqApi m_Api;
  36. QUEUEHANDLE m_hQueue;
  37. public:
  38. CMsgMsmqQueue( CLifeControl* pCtl, IUnknown* pUnk = NULL )
  39. : CUnk( pCtl, pUnk ), m_XQueue( this ), m_hQueue( NULL ) { }
  40. ~CMsgMsmqQueue() { Clear(); }
  41. HRESULT Clear();
  42. HRESULT Open( LPCWSTR wszEndpoint,
  43. DWORD dwFlags,
  44. IWmiMessageSendReceive* pRcv,
  45. IWmiMessageQueueReceiver** ppRecv );
  46. };
  47. #endif // __MSMQQ_H__