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.

82 lines
2.2 KiB

  1. #ifndef _CLASSES_H_
  2. #define _CLASSES_H_
  3. #include <wtypes.h>
  4. struct TESTSETTINGS
  5. {
  6. BSTR *pstrDevices; // array of device IDs, NULL terminated
  7. LONG fLogMask; // what to log
  8. TCHAR szLogFile[MAX_PATH]; // where to log
  9. UINT nIter;// number of iterations to run
  10. HWND hEdit; // edit window for logging
  11. BOOL bExit; // exit when complete
  12. BOOL bManual; // whether to wait for user input
  13. };
  14. #define LOG_WINDOW_ONLY 0
  15. #define LOG_APIS 1
  16. #define LOG_FILE 2
  17. #define LOG_TIME 4
  18. //
  19. // log settings
  20. #define TESTFUNC(x) static VOID (x)(CTest *pThis, BSTR strDeviceId);
  21. class CTest
  22. {
  23. public:
  24. CTest (TESTSETTINGS *pSettings);
  25. // LIST TESTS HERE
  26. TESTFUNC( TstCreateDevice)
  27. TESTFUNC( TstShowThumbs )
  28. TESTFUNC( TstEnumCmds )
  29. TESTFUNC( TstDownload )
  30. TESTFUNC( TstBandedDownload)
  31. // END TESTS LIST
  32. void LogTime (LPTSTR szAction, LARGE_INTEGER &liTimeElapsed);
  33. void LogString (LPTSTR sz, ...);
  34. void LogAPI (LPTSTR szApi, HRESULT hr);
  35. void LogDevInfo (BSTR strDeviceId);
  36. ~CTest ();
  37. private:
  38. void OpenLogFile ();
  39. void CloseLogFile ();
  40. void RecursiveDownload (IWiaItem *pFolder, DWORD &dwPix, ULONG &ulSize, bool bBanded=false);
  41. void DownloadItem (IWiaItem *pItem, DWORD &dwPix, ULONG &ulSize, bool bBanded=false);
  42. HANDLE m_hLogFile;
  43. TESTSETTINGS *m_pSettings;
  44. };
  45. typedef VOID (*TESTPROC)(CTest* pTest, BSTR strDeviceId);
  46. class CPerfTest
  47. {
  48. public:
  49. bool Init (HINSTANCE hInst);
  50. CPerfTest ();
  51. ~CPerfTest () {};
  52. private:
  53. HWND m_hwnd;
  54. HWND m_hEdit;
  55. HINSTANCE m_hInst;
  56. TESTSETTINGS m_settings;
  57. VOID RunTests ();
  58. VOID GetSettings ();
  59. static LRESULT CALLBACK WndProc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
  60. LRESULT RealWndProc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
  61. LRESULT OnCreate ();
  62. LRESULT OnCommand (WPARAM wp, LPARAM lp);
  63. };
  64. // These functions manage the settings dialog
  65. INT_PTR CALLBACK SettingsDlgProc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
  66. VOID InitControls (HWND hwnd, TESTSETTINGS *pSettings);
  67. VOID FillSettings (HWND hwnd, TESTSETTINGS *pSettings);
  68. VOID FreeDialogData (HWND hwnd) ;
  69. #endif