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.

72 lines
2.0 KiB

  1. // **************************************************************************
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation.
  4. //
  5. // File: EVPROV.H
  6. //
  7. // Description:
  8. // Sample event provider - header file defines event provider class
  9. //
  10. // History:
  11. //
  12. // **************************************************************************
  13. #ifndef _EVPROV_H_
  14. #define _EVPROV_H_
  15. // {C0A94C66-CB70-4D06-91D2-5DE68C0D0EC5}
  16. DEFINE_GUID(CLSID_MyEventProvider,
  17. 0xC0A94C66, 0xCB70, 0x4D06, 0x91, 0xD2, 0x5D, 0xE6, 0x8C, 0x0D, 0x0E, 0xC5);
  18. #define EVENTCLASS L"PolicyRefreshEvent"
  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