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.

79 lines
1.8 KiB

  1. /*++
  2. Copyright (C) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. History:
  6. --*/
  7. //***************************************************************************
  8. //
  9. // EVPROV.H
  10. //
  11. // Sample event provider.
  12. //
  13. // raymcc 14-Aug-97
  14. //
  15. //***************************************************************************
  16. #ifndef _EVPROV_H_
  17. #define _EVPROV_H_
  18. #define EVENTCLASS L"MyEvent"
  19. class CMyEventProvider : public IWbemEventProvider, public IWbemProviderInit
  20. {
  21. ULONG m_cRef;
  22. IWbemServices *m_pNs;
  23. IWbemObjectSink *m_pSink;
  24. IWbemClassObject *m_pEventClassDef;
  25. int m_eStatus;
  26. HANDLE m_hThread;
  27. static DWORD WINAPI EventThread(LPVOID pArg);
  28. void InstanceThread();
  29. public:
  30. enum { Pending, Running, PendingStop, Stopped };
  31. CMyEventProvider();
  32. ~CMyEventProvider();
  33. //
  34. // IUnknown members
  35. //
  36. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  37. STDMETHODIMP_(ULONG) AddRef(void);
  38. STDMETHODIMP_(ULONG) Release(void);
  39. // Inherited from IWbemEventProvider
  40. // =================================
  41. HRESULT STDMETHODCALLTYPE ProvideEvents(
  42. /* [in] */ IWbemObjectSink __RPC_FAR *pSink,
  43. /* [in] */ long lFlags
  44. );
  45. // Inherited from IWbemProviderInit
  46. // ================================
  47. HRESULT STDMETHODCALLTYPE Initialize(
  48. /* [in] */ LPWSTR pszUser,
  49. /* [in] */ LONG lFlags,
  50. /* [in] */ LPWSTR pszNamespace,
  51. /* [in] */ LPWSTR pszLocale,
  52. /* [in] */ IWbemServices __RPC_FAR *pNamespace,
  53. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  54. /* [in] */ IWbemProviderInitSink __RPC_FAR *pInitSink
  55. );
  56. };
  57. #endif