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.

117 lines
2.7 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (C) 1999-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // SANetEvent.h
  7. //
  8. // Implementation Files:
  9. // SANetEvent.cpp
  10. //
  11. // Description:
  12. // Declare the class CSANetEvent
  13. //
  14. // History:
  15. // 1. lustar.li (Guogang Li), creation date in 7-DEC-2000
  16. //
  17. // Notes:
  18. //
  19. //
  20. //////////////////////////////////////////////////////////////////////////////
  21. #ifndef _SANETEVENT_H_
  22. #define _SANETEVENT_H_
  23. #include "SAQueryNetInfo.h"
  24. //
  25. // Define Guid {9B4612B0-BB2F-4d24-A3DC-B354E4FF595C}
  26. //
  27. DEFINE_GUID(CLSID_SaNetEventProvider,
  28. 0x9B4612B0, 0xBB2F, 0x4d24, 0xA3, 0xDC, 0xB3, 0x54, 0xE4, 0xFF,
  29. 0x59, 0x5C);
  30. //////////////////////////////////////////////////////////////////////////////
  31. //++
  32. //
  33. // class CSANetEvent
  34. //
  35. // Description:
  36. // The class generates a new event and delivers it to sink
  37. //
  38. // History:
  39. // 1. lustar.li (Guogang Li), creation date in 7-DEC-2000
  40. //--
  41. //////////////////////////////////////////////////////////////////////////////
  42. class CSANetEvent :
  43. public IWbemEventProvider,
  44. public IWbemProviderInit
  45. {
  46. //
  47. // Private data
  48. //
  49. private:
  50. int m_eStatus;
  51. ULONG m_cRef;
  52. HANDLE m_hThread;
  53. IWbemServices *m_pNs;
  54. IWbemObjectSink *m_pSink;
  55. IWbemClassObject *m_pEventClassDef;
  56. CSAQueryNetInfo *m_pQueryNetInfo;
  57. //
  58. // Public data
  59. //
  60. public:
  61. enum { Pending, Running, PendingStop, Stopped };
  62. //
  63. // Constructors & Destructors
  64. //
  65. public:
  66. CSANetEvent();
  67. ~CSANetEvent();
  68. //
  69. // Private methods
  70. //
  71. private:
  72. static DWORD WINAPI EventThread(LPVOID pArg);
  73. void InstanceThread();
  74. //
  75. // public methods
  76. //
  77. public:
  78. //
  79. // IUnknown members
  80. //
  81. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  82. STDMETHODIMP_(ULONG) AddRef(void);
  83. STDMETHODIMP_(ULONG) Release(void);
  84. //
  85. // Inherited from IWbemEventProvider
  86. //
  87. HRESULT STDMETHODCALLTYPE ProvideEvents(
  88. /* [in] */ IWbemObjectSink *pSink,
  89. /* [in] */ long lFlags
  90. );
  91. //
  92. // Inherited from IWbemProviderInit
  93. //
  94. HRESULT STDMETHODCALLTYPE Initialize(
  95. /* [in] */ LPWSTR pszUser,
  96. /* [in] */ LONG lFlags,
  97. /* [in] */ LPWSTR pszNamespace,
  98. /* [in] */ LPWSTR pszLocale,
  99. /* [in] */ IWbemServices *pNamespace,
  100. /* [in] */ IWbemContext *pCtx,
  101. /* [in] */ IWbemProviderInitSink *pInitSink
  102. );
  103. };
  104. #endif //_SANETEVENT_H_