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.

76 lines
2.3 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 | PERF_NUMBER_DECIMAL)
  20. typedef double (APIENTRY COUNTERCALC) (PPDH_RAW_COUNTER, PPDH_RAW_COUNTER, LONGLONG *, LPDWORD);
  21. typedef double (APIENTRY * LPCOUNTERCALC) (PPDH_RAW_COUNTER, PPDH_RAW_COUNTER, LONGLONG *, LPDWORD);
  22. typedef PDH_STATUS (APIENTRY COUNTERSTAT) (LPVOID, DWORD, DWORD, DWORD, PPDH_RAW_COUNTER, PPDH_STATISTICS);
  23. typedef PDH_STATUS (APIENTRY * LPCOUNTERSTAT) (LPVOID, DWORD, DWORD, DWORD, PPDH_RAW_COUNTER, PPDH_STATISTICS);
  24. // calc functions
  25. extern COUNTERCALC PdhiCalcDouble;
  26. extern COUNTERCALC PdhiCalcAverage;
  27. extern COUNTERCALC PdhiCalcElapsedTime;
  28. extern COUNTERCALC PdhiCalcRawFraction;
  29. extern COUNTERCALC PdhiCalcCounter;
  30. extern COUNTERCALC PdhiCalcTimer;
  31. extern COUNTERCALC PdhiCalcInverseTimer;
  32. extern COUNTERCALC PdhiCalcRawCounter;
  33. extern COUNTERCALC PdhiCalcNoData;
  34. extern COUNTERCALC PdhiCalcDelta;
  35. // status functions
  36. extern COUNTERSTAT PdhiComputeFirstLastStats;
  37. extern COUNTERSTAT PdhiComputeRawCountStats;
  38. extern COUNTERSTAT PdhiComputeNoDataStats;
  39. LINK_SPEC
  40. PDH_STATUS
  41. PdhiComputeFormattedValue(
  42. IN LPCOUNTERCALC pCalcFunc,
  43. IN DWORD dwCounterType,
  44. IN LONG lScale,
  45. IN DWORD dwFormat,
  46. IN PPDH_RAW_COUNTER pRawValue1,
  47. IN PPDH_RAW_COUNTER pRawValue2,
  48. IN PLONGLONG pTimeBase,
  49. IN DWORD dwReserved,
  50. IN OUT PPDH_FMT_COUNTERVALUE fmtValue
  51. );
  52. LINK_SPEC
  53. BOOL
  54. AssignCalcFunction(
  55. IN DWORD dwCounterType,
  56. IN LPCOUNTERCALC * pCalcFunc,
  57. IN LPCOUNTERSTAT * pStatFunc
  58. );
  59. #endif // _PDHICALC_H_