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.

77 lines
2.2 KiB

  1. /*++
  2. Copyright (C) 1995-1999 Microsoft Corporation
  3. Module Name:
  4. pdhicalc.h
  5. Abstract:
  6. calculation functions for the Data Provider Helper.
  7. --*/
  8. #ifndef _PDHICALC_H_
  9. #define _PDHICALC_H_
  10. #include <pdh.h> // for public PDH data types
  11. #include <winperf.h> // for perf counter type constants
  12. #if defined(__cplusplus)
  13. #define LINK_SPEC extern "C"
  14. #else
  15. #define LINK_SPEC
  16. #endif
  17. // special perf counter type used by text log files
  18. // value is stored as a double precision floating point value
  19. #define PERF_DOUBLE_RAW (PERF_SIZE_DWORD | 0x00002000 | PERF_TYPE_NUMBER | \
  20. PERF_NUMBER_DECIMAL)
  21. typedef double (APIENTRY COUNTERCALC) (PPDH_RAW_COUNTER, PPDH_RAW_COUNTER, LONGLONG*, LPDWORD);
  22. typedef double (APIENTRY *LPCOUNTERCALC) (PPDH_RAW_COUNTER, PPDH_RAW_COUNTER, LONGLONG*, LPDWORD);
  23. typedef PDH_STATUS (APIENTRY COUNTERSTAT) (LPVOID, DWORD, DWORD, DWORD, PPDH_RAW_COUNTER, PPDH_STATISTICS);
  24. typedef PDH_STATUS (APIENTRY *LPCOUNTERSTAT) (LPVOID, DWORD, DWORD, DWORD, PPDH_RAW_COUNTER, PPDH_STATISTICS);
  25. // calc functions
  26. extern COUNTERCALC PdhiCalcDouble;
  27. extern COUNTERCALC PdhiCalcAverage;
  28. extern COUNTERCALC PdhiCalcElapsedTime;
  29. extern COUNTERCALC PdhiCalcRawFraction;
  30. extern COUNTERCALC PdhiCalcCounter;
  31. extern COUNTERCALC PdhiCalcTimer;
  32. extern COUNTERCALC PdhiCalcInverseTimer;
  33. extern COUNTERCALC PdhiCalcRawCounter;
  34. extern COUNTERCALC PdhiCalcNoData;
  35. extern COUNTERCALC PdhiCalcDelta;
  36. // status functions
  37. extern COUNTERSTAT PdhiComputeFirstLastStats;
  38. extern COUNTERSTAT PdhiComputeRawCountStats;
  39. extern COUNTERSTAT PdhiComputeNoDataStats;
  40. LINK_SPEC
  41. PDH_STATUS
  42. PdhiComputeFormattedValue (
  43. IN LPCOUNTERCALC pCalcFunc,
  44. IN DWORD dwCounterType,
  45. IN LONG lScale,
  46. IN DWORD dwFormat,
  47. IN PPDH_RAW_COUNTER pRawValue1,
  48. IN PPDH_RAW_COUNTER pRawValue2,
  49. IN PLONGLONG pTimeBase,
  50. IN DWORD dwReserved,
  51. IN OUT PPDH_FMT_COUNTERVALUE fmtValue
  52. );
  53. LINK_SPEC
  54. BOOL
  55. AssignCalcFunction (
  56. IN DWORD dwCounterType,
  57. IN LPCOUNTERCALC *pCalcFunc,
  58. IN LPCOUNTERSTAT *pStatFunc
  59. );
  60. #endif // _PDHICALC_H_