Source code of Windows XP (NT5)
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.

90 lines
1.8 KiB

  1. /*++
  2. Copyright (C) 1998-2001 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. History:
  6. --*/
  7. //////////////////////////////////////////////////////////////////////
  8. //
  9. // Main.h
  10. //
  11. // CRefTreeMain contains the logic to manage the stress test.
  12. // After constructing the object, call create() to create the
  13. // locator, build the refresher structure from the registry and
  14. // set up the stress objects. Every refresher that has an Iteration
  15. // value in the registry will be stressed by an object running in a
  16. // seperate thread, calling refreshes at a rate controlled by the
  17. // Wait value in the registry. The Wait value dictates the amount
  18. // of time, in miliseconds, to pause between successive refreshes.
  19. // All threads are created in suspended mode.
  20. //
  21. // Once Create has completed, call Go to start all the stress threads.
  22. //
  23. //////////////////////////////////////////////////////////////////////
  24. #ifndef _MAIN_H_
  25. #define _MAIN_H_
  26. #include <windows.h>
  27. #include "Refresher.h"
  28. #include "Agents.h"
  29. #include "arrtempl.h"
  30. class CMain
  31. {
  32. protected:
  33. CUniquePointerArray<CRefresher> m_apRootRef;
  34. public:
  35. CMain();
  36. virtual ~CMain();
  37. BOOL Create();
  38. virtual BOOL Go() = 0;
  39. };
  40. class CRefTreeMain : public CMain
  41. {
  42. CUniquePointerArray<CBasicRefreshAgent> m_apAgent;
  43. HANDLE m_hRefreshEvent;
  44. BOOL AddChildren(HKEY hKey, WCHAR* wcsRegPath, CRefresher *pRef);
  45. BOOL AddObject(WCHAR *wcsNewPath, CRefresher *pRef);
  46. CRefresher* CreateChildRefresher(WCHAR *wcsRegPath);
  47. BOOL SetStressInfo(HKEY hKey, CRefresher *pRef);
  48. void DumpTree();
  49. void DumpStats(DWORD dwDelta);
  50. public:
  51. CRefTreeMain();
  52. virtual ~CRefTreeMain();
  53. BOOL Create(WCHAR *wcsRoot);
  54. BOOL Go();
  55. };
  56. class CPoundMain : public CMain
  57. {
  58. LONG m_lNumRefs;
  59. public:
  60. CPoundMain(long lNumRefs);
  61. virtual ~CPoundMain();
  62. BOOL Create();
  63. BOOL Go();
  64. };
  65. #endif //_MAIN_H_