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.

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