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.

115 lines
2.7 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // SADiskEvent.h
  7. //
  8. // Description:
  9. // description-for-module
  10. //
  11. // [Implementation Files:]
  12. // SADiskEvent.cpp
  13. //
  14. // History:
  15. // Xing Jin (i-xingj) 06-Dec-2000
  16. //
  17. //////////////////////////////////////////////////////////////////////////////
  18. #pragma once
  19. #include <Pdh.h>
  20. //
  21. // Define GUID
  22. //
  23. // {29D534E2-ADCA-45f8-B10C-00B286558C4B}
  24. DEFINE_GUID(CLSID_DiskEventProvider,
  25. 0x29d534e2, 0xadca, 0x45f8, 0xb1, 0xc, 0x0, 0xb2, 0x86, 0x55, 0x8c, 0x4b);
  26. //////////////////////////////////////////////////////////////////////////////
  27. //
  28. //
  29. // class CSADiskEvent
  30. //
  31. // Description:
  32. // class-description
  33. //
  34. // History
  35. // Xing Jin (i-xingj) 06-Dec-2000
  36. //
  37. //////////////////////////////////////////////////////////////////////////////
  38. class CSADiskEvent :
  39. public IWbemEventProvider,
  40. public IWbemProviderInit
  41. {
  42. //
  43. // Private data
  44. //
  45. private:
  46. IWbemServices *m_pNs;
  47. IWbemObjectSink *m_pSink;
  48. IWbemClassObject *m_pEventClassDef;
  49. LONG m_lStatus;
  50. ULONG m_cRef;
  51. DWORD m_dwDiskTimeInterval;
  52. HKEY m_hQueryInterval;
  53. HANDLE m_hThread;
  54. HQUERY m_hqryQuery;
  55. HCOUNTER m_hcntCounter;
  56. static DWORD WINAPI EventThread(LPVOID pArg);
  57. VOID InstanceThread();
  58. BOOL InitDiskQueryContext();
  59. VOID NotifyDiskEvent(
  60. LONG lDisplayInformationIDIn,
  61. LONG lCurrentStateIn
  62. );
  63. //
  64. // Private data
  65. //
  66. public:
  67. enum { Pending, Running, PendingStop, Stopped };
  68. CSADiskEvent();
  69. ~CSADiskEvent();
  70. //
  71. // IUnknown members
  72. //
  73. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  74. STDMETHODIMP_(ULONG) AddRef(void);
  75. STDMETHODIMP_(ULONG) Release(void);
  76. //
  77. // Inherited from IWbemEventProvider
  78. // =================================
  79. HRESULT STDMETHODCALLTYPE ProvideEvents(
  80. IWbemObjectSink __RPC_FAR *pSinkIn,
  81. long lFlagsIn
  82. );
  83. //
  84. // Inherited from IWbemProviderInit
  85. //
  86. HRESULT STDMETHODCALLTYPE Initialize(
  87. LPWSTR pszUserIn,
  88. LONG lFlagsIn,
  89. LPWSTR pszNamespaceIn,
  90. LPWSTR pszLocaleIn,
  91. IWbemServices __RPC_FAR * pNamespaceIn,
  92. IWbemContext __RPC_FAR * pCtxIn,
  93. IWbemProviderInitSink __RPC_FAR * pInitSinkIn
  94. );
  95. };