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.

100 lines
2.3 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: saconsumer.h
  4. //
  5. // Synopsis: This file holds the declaration of the
  6. // CSAConsumer class
  7. //
  8. // History: 12/10/2000 serdarun Created
  9. //
  10. // Copyright (C) 1999-2000 Microsoft Corporation
  11. // All rights reserved.
  12. //
  13. //#--------------------------------------------------------------
  14. #ifndef __SACONSUMER_H_
  15. #define __SACONSUMER_H_
  16. #include "resource.h" // main symbols
  17. #include <atlctl.h>
  18. #include "elementmgr.h"
  19. #include <string>
  20. #include <map>
  21. using namespace std;
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CSAConsumer
  24. //
  25. // Class for receiving WMI events, specifically SA Alerts
  26. //
  27. class CSAConsumer :
  28. public IWbemObjectSink
  29. {
  30. public:
  31. CSAConsumer()
  32. :m_pLocalUIAlertEnum(NULL),
  33. m_lRef(0),
  34. m_hwndMainWindow(NULL)
  35. {
  36. }
  37. //
  38. // IUnknown members
  39. //
  40. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  41. STDMETHODIMP_(ULONG) AddRef(void);
  42. STDMETHODIMP_(ULONG) Release(void);
  43. private:
  44. //
  45. // handle to the main window
  46. //
  47. HWND m_hwndMainWindow;
  48. //
  49. // points to localui alerts enumeration
  50. //
  51. CComPtr<IWebElementEnum> m_pLocalUIAlertEnum;
  52. //
  53. // calculate the new localui msg code and notify saldm
  54. //
  55. STDMETHOD(CalculateMsgCodeAndNotify)(void);
  56. //
  57. // reference counter
  58. //
  59. LONG m_lRef;
  60. public:
  61. //
  62. // public method to receive handle to service window
  63. //
  64. STDMETHOD(SetServiceWindow) (
  65. /*[in]*/ HWND hwndMainWindow
  66. );
  67. //
  68. // ---------IWbemUnboundObjectSink interface methods----------
  69. //
  70. STDMETHOD(Indicate) (
  71. /*[in]*/ LONG lObjectCount,
  72. /*[in]*/ IWbemClassObject **ppObjArray
  73. );
  74. STDMETHOD(SetStatus) (
  75. /*[in]*/ LONG lFlags,
  76. /*[in]*/ HRESULT hResult,
  77. /*[in]*/ BSTR strParam,
  78. /*[in]*/ IWbemClassObject *pObjParam
  79. );
  80. };
  81. #endif //__SACONSUMER_H_