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.

107 lines
3.5 KiB

  1. /*++
  2. Copyright (C) 2000-2001 Microsoft Corporation
  3. Module Name:
  4. CookerUtils.h
  5. Abstract:
  6. Tricks and utilities used by the WMI cooker
  7. History:
  8. a-dcrews 01-Mar-00 Created
  9. --*/
  10. #ifndef _COOKERUTILS_H_
  11. #define _COOKERUTILS_H_
  12. typedef DWORD WMISTATUS;
  13. #include <wbemcli.h>
  14. ////////////////////////////////////////////////////////////////
  15. //
  16. // Macro Definitions
  17. //
  18. ////////////////////////////////////////////////////////////////
  19. #define WMI_COOKER_VERSION (1)
  20. #define AUTOCOOK_RAWDEFAULT_CURRENT_ACCEPTED (1)
  21. #define WMI_COOKER_HIPERF_QUALIFIER L"Hiperf"
  22. #define WMI_COOKER_COOKING_QUALIFIER L"Cooked"
  23. #define WMI_COOKER_AUTOCOOK_QUALIFIER L"AutoCook"
  24. #define WMI_COOKER_RAWCLASS_QUALIFIER L"AutoCook_RawClass"
  25. #define WMI_COOKER_AUTOCOOK_RAWDEFAULT L"AutoCook_RawDefault"
  26. // properties required for AutoCook_RawDefault
  27. #define WMI_COOKER_REQ_TIMESTAMP_PERFTIME L"TimeStamp_PerfTime"
  28. #define WMI_COOKER_REQ_TIMESTAMP_SYS100NS L"TimeStamp_Sys100ns"
  29. #define WMI_COOKER_REQ_TIMESTAMP_OBJECT L"TimeStamp_Object"
  30. #define WMI_COOKER_REQ_FREQUENCY_PERFTIME L"Frequency_PerfTime"
  31. #define WMI_COOKER_REQ_FREQUENCY_SYS100NS L"Frequency_Sys100ns"
  32. #define WMI_COOKER_REQ_FREQUENCY_OBJECT L"Frequency_Object"
  33. #define WMI_COOKER_COUNTER_TYPE L"CounterType"
  34. #define WMI_COOKER_COOKING_PROPERTY_ATTRIBUTE L"CookingType"
  35. #define WMI_COOKER_COOKING_PROPERTY_ATTRIBUTE_TYPE L"VT_I4"
  36. #define WMI_COOKER_RAW_COUNTER L"Counter"
  37. #define WMI_COOKER_RAW_BASE L"Base"
  38. #define WMI_COOKER_RAW_TIME L"PerfTimeStamp"
  39. #define WMI_COOKER_RAW_FREQUENCY L"PerfTimeFreq"
  40. #define WMI_COOKER_SAMPLE_WINDOW L"SampleWindow"
  41. #define WMI_COOKER_TIME_WINDOW L"TimeWindow"
  42. #define WMI_COOKER_SCALE_FACT L"Scale"
  43. #define WMI_COOKER_RAW_TIME_SYS L"PerfSysTimeStamp"
  44. #define WMI_COOKER_RAW_TIME_100NS L"Perf100NSTimeStamp"
  45. #define WMI_COOKER_RAW_TIME_OBJ L"PerfObjTimeStamp"
  46. #define WMI_COOKER_RAW_FREQ_SYS L"PerfSysTimeFreq"
  47. #define WMI_COOKER_RAW_FREQ_100NS L"Perf100NSTimeFreq"
  48. #define WMI_COOKER_RAW_FREQ_OBJ L"PerfObjTimeFreq"
  49. ////////////////////////////////////////////////////////////////
  50. //
  51. // Which property have to be defined in the Raw class
  52. // for the counter to be cooked
  53. //
  54. ////////////////////////////////////////////////////////////////
  55. #define REQ_NONE 0x00
  56. #define REQ_1VALUE 0x01
  57. #define REQ_2VALUE 0x02
  58. #define REQ_TIME 0x04
  59. #define REQ_FREQ 0x08
  60. #define REQ_BASE 0x10
  61. ////////////////////////////////////////////////////////////////
  62. //
  63. // Function Definitions
  64. //
  65. ////////////////////////////////////////////////////////////////
  66. BOOL IsSingleton(IWbemClassObject * pCls);
  67. LPWSTR GetKey( IWbemObjectAccess* pObj );
  68. WMISTATUS CopyBlob( IWbemClassObject* pSource, IWbemClassObject* pTarget );
  69. BOOL IsCookingClass( IWbemClassObject* pCookingClassObject );
  70. BOOL IsCookingProperty( BSTR strPropName, IWbemClassObject* pCookingClassObject, DWORD* pdwCounterType, DWORD* pdwReqProp);
  71. BOOL IsHiPerfObj(IWbemObjectAccess* pObject);
  72. BOOL IsHiPerf( IWbemServices* pNamespace, LPCWSTR wszObject );
  73. WMISTATUS GetRawClassName( IWbemClassObject* pCookingInst, WCHAR** pwszRawClassName );
  74. WMISTATUS GetClassName( IWbemObjectAccess* pAccess, WCHAR** pwszClassName );
  75. #endif // _COOKERUTILS_H_