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.

124 lines
3.2 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. Provider.h
  5. Abstract:
  6. Implementation of the high performance provider interface
  7. History:
  8. a-dcrews 01-Mar-00 Created
  9. --*/
  10. #ifndef _HIPERFPROV_H_
  11. #define _HIPERFPROV_H_
  12. #include <tchar.h>
  13. #include <wbemprov.h>
  14. #include "Cache.h"
  15. #include "Refresher.h"
  16. class CRefCacheElement;
  17. //////////////////////////////////////////////////////////////
  18. //
  19. //
  20. // Constants and globals
  21. //
  22. //
  23. //////////////////////////////////////////////////////////////
  24. #define WMI_HPCOOKER_ENUM_FLAG 0x10000000L
  25. //////////////////////////////////////////////////////////////
  26. //
  27. // CHiPerfProvider
  28. //
  29. // The provider maintains a single IWbemClassObject to be used
  30. // as a template to spawn instances for the Refresher as well
  31. // as QueryInstances. It also maintains the static sample
  32. // data source which provides all data to the instances.
  33. //
  34. //////////////////////////////////////////////////////////////
  35. class CHiPerfProvider : public IWbemProviderInit, public IWbemHiPerfProvider
  36. {
  37. long m_lRef;
  38. public:
  39. CHiPerfProvider();
  40. ~CHiPerfProvider();
  41. // Standard COM methods
  42. // ====================
  43. STDMETHODIMP QueryInterface(REFIID riid, void** ppv);
  44. STDMETHODIMP_(ULONG) AddRef();
  45. STDMETHODIMP_(ULONG) Release();
  46. // IWbemProviderInit COM interface
  47. // ===============================
  48. STDMETHODIMP Initialize(
  49. /* [unique][in] */ LPWSTR wszUser,
  50. /* [in] */ long lFlags,
  51. /* [in] */ LPWSTR wszNamespace,
  52. /* [unique][in] */ LPWSTR wszLocale,
  53. /* [in] */ IWbemServices __RPC_FAR *pNamespace,
  54. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  55. /* [in] */ IWbemProviderInitSink __RPC_FAR *pInitSink );
  56. // IWbemHiPerfProvider COM interfaces
  57. // ==================================
  58. STDMETHODIMP CreateRefresher(
  59. /* [in] */ IWbemServices __RPC_FAR *pNamespace,
  60. /* [in] */ long lFlags,
  61. /* [out] */ IWbemRefresher __RPC_FAR *__RPC_FAR *ppRefresher );
  62. STDMETHODIMP CreateRefreshableObject(
  63. /* [in] */ IWbemServices __RPC_FAR *pNamespace,
  64. /* [in] */ IWbemObjectAccess __RPC_FAR *pTemplate,
  65. /* [in] */ IWbemRefresher __RPC_FAR *pRefresher,
  66. /* [in] */ long lFlags,
  67. /* [in] */ IWbemContext __RPC_FAR *pContext,
  68. /* [out] */ IWbemObjectAccess __RPC_FAR *__RPC_FAR *ppRefreshable,
  69. /* [out] */ long __RPC_FAR *plId );
  70. STDMETHODIMP StopRefreshing(
  71. /* [in] */ IWbemRefresher __RPC_FAR *pRefresher,
  72. /* [in] */ long lId,
  73. /* [in] */ long lFlags );
  74. STDMETHODIMP CreateRefreshableEnum(
  75. /* [in] */ IWbemServices* pNamespace,
  76. /* [in, string] */ LPCWSTR wszClass,
  77. /* [in] */ IWbemRefresher* pRefresher,
  78. /* [in] */ long lFlags,
  79. /* [in] */ IWbemContext* pContext,
  80. /* [in] */ IWbemHiPerfEnum* pHiPerfEnum,
  81. /* [out] */ long* plId);
  82. STDMETHODIMP QueryInstances(
  83. /* [in] */ IWbemServices __RPC_FAR *pNamespace,
  84. /* [string][in] */ WCHAR __RPC_FAR *wszClass,
  85. /* [in] */ long lFlags,
  86. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  87. /* [in] */ IWbemObjectSink __RPC_FAR *pSink );
  88. STDMETHODIMP GetObjects(
  89. /* [in] */ IWbemServices* pNamespace,
  90. /* [in] */ long lNumObjects,
  91. /* [in,size_is(lNumObjects)] */ IWbemObjectAccess** apObj,
  92. /* [in] */ long lFlags,
  93. /* [in] */ IWbemContext* pContext);
  94. };
  95. #endif // _HIPERFPROV_H_