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.

70 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. PassportPerfMon.h
  5. Abstract:
  6. Performance Monitor Class Implementation
  7. Author:
  8. Christopher Bergh (cbergh) 10-Sept-1988
  9. Revision History:
  10. - added Instance support 1-Oct-98
  11. --*/
  12. #if !defined(PASSPORTPERFMON_H)
  13. #define PASSPORTPERFMON_H
  14. #include <windows.h>
  15. #include "PassportSharedMemory.h"
  16. #include "PassportPerfInterface.h"
  17. class PassportPerfMon : public PassportPerfInterface, public PassportSharedMemory
  18. {
  19. public:
  20. PassportPerfMon();
  21. ~PassportPerfMon ();
  22. BOOL init ( LPCTSTR lpcPerfObjectName );
  23. // get set counter type
  24. BOOL setCounterType ( const DWORD &dwType,
  25. const PassportPerfInterface::COUNTER_SAMPLING_TYPE &counterSampleType);
  26. PassportPerfInterface::COUNTER_SAMPLING_TYPE getCounterType(
  27. const DWORD &dwType ) const;
  28. // adding/subtracting an instance to this object
  29. BOOL addInstance ( LPCSTR lpszInstanceName );
  30. BOOL deleteInstance ( LPCSTR lpszInstanceName );
  31. BOOL instanceExists ( LPCSTR lpszInstanceName );
  32. BOOL hasInstances ( void );
  33. DWORD numInstances ( void );
  34. // counters: note if hasInstances() is TRUE, then you must
  35. // give the instance name
  36. BOOL incrementCounter ( const DWORD &dwType, LPCSTR lpszInstanceName = NULL );
  37. BOOL decrementCounter ( const DWORD &dwType, LPCSTR lpszInstanceName = NULL );
  38. BOOL setCounter (
  39. const DWORD &dwType,
  40. const DWORD &dwValue,
  41. LPCSTR lpszInstanceName = NULL );
  42. BOOL getCounterValue (
  43. DWORD &dwValue,
  44. const DWORD &dwType,
  45. LPCSTR lpszInstanceName = NULL );
  46. private:
  47. BOOL isInited;
  48. LONG dwNumInstances;
  49. CRITICAL_SECTION mInitLock;
  50. };
  51. #endif