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.

95 lines
2.3 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. History:
  6. --*/
  7. #ifndef __MSMQSEND_H__
  8. #define __MSMQSEND_H__
  9. #include <unk.h>
  10. #include <comutl.h>
  11. #include <wstring.h>
  12. #include <sync.h>
  13. #include <wmimsg.h>
  14. #include <msgsig.h>
  15. #include "msmqcomn.h"
  16. /**************************************************************************
  17. CMsgMsmqSender
  18. ***************************************************************************/
  19. class CMsgMsmqSender
  20. : public CUnkBase<IWmiMessageSender,&IID_IWmiMessageSender>
  21. {
  22. public:
  23. STDMETHOD(Open)( LPCWSTR wszTarget,
  24. DWORD dwFlags,
  25. WMIMSG_SNDR_AUTH_INFOP pAuthInfo,
  26. LPCWSTR wszResponse,
  27. IWmiMessageTraceSink* pTraceSink,
  28. IWmiMessageSendReceive** ppSend );
  29. CMsgMsmqSender( CLifeControl* pCtl )
  30. : CUnkBase<IWmiMessageSender,&IID_IWmiMessageSender>( pCtl ) { }
  31. };
  32. /**************************************************************************
  33. CMsgMsmqSend
  34. ***************************************************************************/
  35. class CMsgMsmqSend
  36. : public CUnkBase<IWmiMessageSendReceive, &IID_IWmiMessageSendReceive>
  37. {
  38. CCritSec m_cs;
  39. CMsmqApi m_Api;
  40. QUEUEHANDLE m_hQueue;
  41. WString m_wsTarget;
  42. WString m_wsResponse;
  43. WString m_wsComputer;
  44. DWORD m_dwFlags;
  45. BOOL m_bInit;
  46. HANDLE m_hSecCtx;
  47. CWbemPtr<CSignMessage> m_pSign;
  48. CWbemPtr<IWmiMessageTraceSink> m_pTraceSink;
  49. void Clear();
  50. HRESULT HandleTrace( HRESULT hRes, IUnknown* pContext );
  51. HRESULT Send( PBYTE pData,
  52. ULONG cData,
  53. PBYTE pAuxData,
  54. ULONG cAuxData,
  55. DWORD dwFlagStatus,
  56. IUnknown* pContext );
  57. public:
  58. CMsgMsmqSend( CLifeControl* pCtl,
  59. LPCWSTR wszTarget,
  60. DWORD dwFlags,
  61. LPCWSTR wszResponse,
  62. IWmiMessageTraceSink* pTraceSink );
  63. virtual ~CMsgMsmqSend();
  64. HRESULT EnsureSender();
  65. STDMETHOD(SendReceive)( PBYTE pData,
  66. ULONG cData,
  67. PBYTE pAuxData,
  68. ULONG cAuxData,
  69. DWORD dwFlagStatus,
  70. IUnknown* pContext );
  71. };
  72. #endif // __MSMQSEND_H__