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.

58 lines
1.2 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. THROTTLE.H
  5. Abstract:
  6. provide a way to do slow down an application, allowing it to execute
  7. only when there is no user activity (last input was XXX mseconds ago)
  8. and the IO level is very low (below YYY bytes per second)
  9. History:
  10. 24-Oct-200 ivanbrug created.
  11. --*/
  12. #ifndef __THROTTLE_H__
  13. #define __THROTTLE_H__
  14. //
  15. // valid values for dwFlags
  16. //
  17. #define THROTTLE_USER 1
  18. #define THROTTLE_IO 2
  19. #define THROTTLE_ALLOWED_FLAGS (THROTTLE_USER | THROTTLE_IO)
  20. //
  21. // returned values, might be a combination
  22. //
  23. #define THROTTLE_MAX_WAIT 1
  24. #define THROTTLE_USER_IDLE 2
  25. #define THROTTLE_IO_IDLE 4
  26. #define THROTTLE_FORCE_EXIT 8
  27. HRESULT POLARITY
  28. Throttle(DWORD dwFlags,
  29. DWORD IdleMSec, // in MilliSeconds
  30. DWORD IoIdleBytePerSec, // in BytesPerSecond
  31. DWORD SleepLoop, // in MilliSeconds
  32. DWORD MaxWait); // in MilliSeconds
  33. //
  34. // strings for registry settings to UnThrottle/Throttle the dredges
  35. //
  36. #define HOME_REG_PATH TEXT("Software\\Microsoft\\WBEM\\CIMOM")
  37. #define DO_THROTTLE TEXT("ThrottleDrege")
  38. #endif /*__THROTTLE_H__*/