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.

118 lines
2.8 KiB

  1. /*++
  2. Copyright (C) 2000-2001 Microsoft Corporation
  3. Module Name:
  4. RefreshCooker.h
  5. Abstract:
  6. The implementation of the refresher
  7. History:
  8. a-dcrews 01-Mar-00 Created
  9. --*/
  10. #ifndef _REFRESHCOOKER_H_
  11. #define _REFRESHCOOKER_H_
  12. #include "Cache.h"
  13. #include "WMIObjCooker.h"
  14. #define WMI_COOKED_ENUM_MASK 0x70000000
  15. class CRefresher : public IWMIRefreshableCooker, public IWbemRefresher
  16. {
  17. bool m_bOK; // Creation status indicator
  18. long m_lRef; // Object refrence counter
  19. CCache<CWMISimpleObjectCooker, CObjRecord<CWMISimpleObjectCooker> >
  20. m_CookingClassCache; // The cooking class cache
  21. IWbemRefresher* m_pRefresher; // The internal refrehser for the short term solution
  22. IWbemConfigureRefresher* m_pConfig; // The internal configuration mgr for the short term solution
  23. CEnumeratorCache m_EnumCache;
  24. DWORD m_dwRefreshId;
  25. // Gets the raw class name that is used by the
  26. // cooked class in to obtain the raw data values
  27. // =============================================
  28. /* WMISTATUS GetRawClassName( IWbemClassObject* pCookingInst,
  29. WCHAR** pwszRawClassName );
  30. */
  31. WMISTATUS SearchCookingClassCache( WCHAR* wszCookingClass,
  32. CWMISimpleObjectCooker** ppObjectCooker );
  33. WMISTATUS AddRawInstance( IWbemServices* pNamespace,
  34. IWbemContext * pContext,
  35. IWbemObjectAccess* pCookingInst,
  36. IWbemObjectAccess** ppRawInst );
  37. WMISTATUS AddRawEnum( IWbemServices* pNamespace,
  38. IWbemContext * pContext,
  39. WCHAR * wszRawClassName,
  40. IWbemHiPerfEnum** ppRawEnum,
  41. long* plID );
  42. WMISTATUS CreateObjectCooker( WCHAR* wszCookingClassName,
  43. IWbemObjectAccess* pCookingAccess,
  44. IWbemObjectAccess* pRawAccess,
  45. CWMISimpleObjectCooker** ppObjectCooker,
  46. IWbemServices * pNamespace = NULL);
  47. public:
  48. CRefresher();
  49. virtual ~CRefresher();
  50. // Non-interface methods
  51. // =====================
  52. bool IsOK(){ return m_bOK; }
  53. // Standard COM methods
  54. // ====================
  55. STDMETHODIMP QueryInterface(REFIID riid, void** ppv);
  56. STDMETHODIMP_(ULONG) AddRef();
  57. STDMETHODIMP_(ULONG) Release();
  58. // IWMIRefreshableCooker methods
  59. // =============================
  60. STDMETHODIMP AddInstance(
  61. /*[in] */ IWbemServices* pNamespace,
  62. /*[in] */ IWbemContext * pCtx,
  63. /*[in] */ IWbemObjectAccess* pCookingClass,
  64. /*[in] */ IWbemObjectAccess* pRefreshableRawInstance,
  65. /*[out] */ IWbemObjectAccess** ppRefreshableInstance,
  66. /*[out] */ long* plId
  67. );
  68. STDMETHODIMP AddEnum(
  69. /*[in] */ IWbemServices* pNamespace,
  70. /*[in] */ IWbemContext * pCtx,
  71. /*[in,string] */ LPCWSTR szCookingClass,
  72. /*[in] */ IWbemHiPerfEnum* pRefreshableEnum,
  73. /*[out] */ long* plId
  74. );
  75. STDMETHODIMP Remove(
  76. /*[in] */ long lId
  77. );
  78. STDMETHODIMP Refresh();
  79. // IWbemRefresher methods
  80. // ======================
  81. STDMETHODIMP Refresh( /* [in] */ long lFlags );
  82. };
  83. #endif //_REFRESHCOOKER_H_