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.

78 lines
1.4 KiB

  1. /*++
  2. Copyright (C) 1999-2001 Microsoft Corporation
  3. Module Name:
  4. PERFTHRD.H
  5. Abstract:
  6. History:
  7. --*/
  8. #ifndef __PERFTHRD_H__
  9. #define __PERFTHRD_H__
  10. #include <wbemcomn.h>
  11. #include <wbemint.h>
  12. #include <winperf.h>
  13. #include "adapthrd.h"
  14. // One minute timeout
  15. #define PERFTHREAD_DEFAULT_TIMEOUT 60
  16. class CPerfOpenRequest : public CAdapThreadRequest
  17. {
  18. public:
  19. HRESULT Execute( CAdapPerfLib* pPerfLib );
  20. };
  21. class CPerfCollectRequest : public CAdapThreadRequest
  22. {
  23. private:
  24. // Return data holders
  25. PERF_OBJECT_TYPE* m_pData;
  26. DWORD m_dwBytes;
  27. DWORD m_dwNumObjTypes;
  28. BOOL m_fCostly;
  29. public:
  30. CPerfCollectRequest( BOOL fCostly )
  31. : m_pData( NULL ), m_dwBytes( 0 ), m_dwNumObjTypes( 0 ), m_fCostly( fCostly ){};
  32. HRESULT Execute( CAdapPerfLib* pPerfLib );
  33. void GetData( PERF_OBJECT_TYPE** ppData, DWORD* pdwBytes, DWORD* pdwNumObjTypes )
  34. {
  35. *ppData = m_pData;
  36. *pdwBytes = m_dwBytes;
  37. *pdwNumObjTypes = m_dwNumObjTypes;
  38. }
  39. };
  40. class CPerfCloseRequest : public CAdapThreadRequest
  41. {
  42. public:
  43. HRESULT Execute( CAdapPerfLib* pPerfLib );
  44. };
  45. class CPerfThread : public CAdapThread
  46. {
  47. DWORD m_dwPerflibTimeoutSec;
  48. public:
  49. CPerfThread( CAdapPerfLib* pPerfLib );
  50. HRESULT Open( CAdapPerfLib* pLib );
  51. HRESULT GetPerfBlock( CAdapPerfLib* pLib, PERF_OBJECT_TYPE** ppData, DWORD* pdwBytes, DWORD* pdwNumObjTypes, BOOL fCostly );
  52. HRESULT Close( CAdapPerfLib* pLib );
  53. };
  54. #endif