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
976 B

  1. //
  2. // Universal Resource Consumer: Just an innocent stress program
  3. // Copyright (c) Microsoft Corporation, 1997
  4. //
  5. //
  6. // module: pool.cxx
  7. // author: silviuc
  8. // created: Fri Apr 10 16:44:29 1998
  9. //
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <stdarg.h>
  13. #include <windows.h>
  14. #include "error.hxx"
  15. #include "pool.hxx"
  16. #include "consume.hxx"
  17. //
  18. // Function:
  19. //
  20. // ConsumeAllNonpagedPool
  21. //
  22. // Description:
  23. //
  24. // This function consumes as much non paged pool as possible.
  25. //
  26. void
  27. ConsumeAllNonpagedPool ()
  28. {
  29. DWORD Count;
  30. //
  31. // For ever loop to consume nonpaged pool
  32. //
  33. for (Count = 0; ; )
  34. {
  35. if (CreateEvent (0, 0, 0, 0) == NULL)
  36. {
  37. Sleep (1000);
  38. }
  39. else
  40. {
  41. if (++Count % 1024 == 0)
  42. printf (".");
  43. }
  44. }
  45. }
  46. //
  47. // end of module: pool.cxx
  48. //