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.

99 lines
2.6 KiB

  1. //***************************************************************************
  2. //
  3. // Copyright (c) 1998-1999 Microsoft Corporation
  4. //
  5. // events.h
  6. //
  7. // alanbos 27-Mar-00 Created.
  8. //
  9. // CSWbemEventSource definition
  10. //
  11. //***************************************************************************
  12. #ifndef _EVENTS_H_
  13. #define _EVENTS_H_
  14. //***************************************************************************
  15. //
  16. // CLASS NAME:
  17. //
  18. // CSWbemEventSource
  19. //
  20. // DESCRIPTION:
  21. //
  22. // Implements the ISWbemEventSource interface.
  23. //
  24. //***************************************************************************
  25. class CSWbemEventSource : public ISWbemEventSource,
  26. public ISupportErrorInfo,
  27. public IProvideClassInfo
  28. {
  29. private:
  30. CSWbemServices *m_pSWbemServices;
  31. CDispatchHelp m_Dispatch;
  32. CSWbemSecurity *m_SecurityInfo;
  33. protected:
  34. long m_cRef; //Object reference count
  35. public:
  36. CSWbemEventSource (CSWbemServices *pService, IEnumWbemClassObject *pEnum);
  37. ~CSWbemEventSource (void);
  38. //Non-delegating object IUnknown
  39. STDMETHODIMP QueryInterface(REFIID, LPVOID*);
  40. STDMETHODIMP_(ULONG) AddRef(void);
  41. STDMETHODIMP_(ULONG) Release(void);
  42. // IDispatch
  43. STDMETHODIMP GetTypeInfoCount(UINT* pctinfo)
  44. {return m_Dispatch.GetTypeInfoCount(pctinfo);}
  45. STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo)
  46. {return m_Dispatch.GetTypeInfo(itinfo, lcid, pptinfo);}
  47. STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR** rgszNames,
  48. UINT cNames, LCID lcid, DISPID* rgdispid)
  49. {return m_Dispatch.GetIDsOfNames(riid, rgszNames, cNames,
  50. lcid,
  51. rgdispid);}
  52. STDMETHODIMP Invoke(DISPID dispidMember, REFIID riid, LCID lcid,
  53. WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
  54. EXCEPINFO* pexcepinfo, UINT* puArgErr)
  55. {return m_Dispatch.Invoke(dispidMember, riid, lcid, wFlags,
  56. pdispparams, pvarResult, pexcepinfo, puArgErr);}
  57. // ISWbemEventSource methods
  58. HRESULT STDMETHODCALLTYPE NextEvent
  59. (
  60. /* [in] */ long iTimeout,
  61. /* [out] */ ISWbemObject **objEvent
  62. );
  63. HRESULT STDMETHODCALLTYPE get_Security_
  64. (
  65. /* [in] */ ISWbemSecurity **ppSecurity
  66. );
  67. // ISupportErrorInfo methods
  68. HRESULT STDMETHODCALLTYPE InterfaceSupportsErrorInfo
  69. (
  70. /* [in] */ REFIID riid
  71. );
  72. // IProvideClassInfo methods
  73. HRESULT STDMETHODCALLTYPE GetClassInfo
  74. (
  75. /* [in,out] */ ITypeInfo **ppTI
  76. )
  77. {
  78. return m_Dispatch.GetClassInfo (ppTI);
  79. };
  80. };
  81. #endif