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.

113 lines
3.3 KiB

  1. /*** WST.H - Public defines and structure definitions for WST tool.
  2. *
  3. *
  4. * Title:
  5. * Working Set Tuner Data Collection Tool include file used by WST.c
  6. *
  7. * Copyright (c) 1992, Microsoft Corporation.
  8. * Reza Baghai.
  9. *
  10. *
  11. * Modification History:
  12. * 92.07.28 RezaB -- Created
  13. *
  14. */
  15. /* * * * * * * * C o m m o n M i s c . D e f i n e s * * * * * * * */
  16. #define Naked _declspec (naked) // For asm functions
  17. #define MEMSIZE 64*1024*1024 // 64 MB virtual memory for data -
  18. // initially RESERVED - will be
  19. // COMITTED as needed.
  20. #define MAX_IMAGES 200 // Limit on num of modules in proc
  21. #define PAGE_SIZE 4096 // 4K pages
  22. #define PATCHFILESZ PAGE_SIZE // WST.INI file maximum size
  23. #define COMMIT_SIZE 96*PAGE_SIZE // Mem chunck to be commited
  24. #define TIMESEG 1000 // Default time seg size in milisecs
  25. #define NUM_ITERATIONS 1000 // Number of iterations used to
  26. // calculate overheads
  27. #define UNKNOWN_SYM "_???"
  28. #define UNKNOWN_ADDR 0xffffffff
  29. #define MAX_SNAPS_DFLT 3200 // Default # snaps if not specified in WST.INI
  30. #define MAX_SNAPS_ENTRY "MAXSNAPS=" // mdg 98/3
  31. #define FILENAMELENGTH 256
  32. #define WSTDLL "WST.DLL"
  33. #define CRTDLL "CRTDLL.DLL"
  34. #define KERNEL32 "KERNEL32.DLL"
  35. #define PATCHEXELIST "[EXES]"
  36. #define PATCHIMPORTLIST "[PATCH IMPORTS]"
  37. #define TIMEINTERVALIST "[TIME INTERVAL]"
  38. #define GLOBALSEMNAME "\\BaseNamedObjects\\WSTGlobalSem"
  39. #define PATCHSECNAME "\\BaseNamedObjects\\WSTPatch"
  40. #define PROFOBJSNAME "\\BaseNamedObjects\\WSTObjs"
  41. #define WSTINIFILE "c:\\wst\\wst.ini"
  42. #define WSTROOT "c:\\wst\\"
  43. #define DONEEVENTNAME "\\BaseNamedObjects\\WSTDoneEvent"
  44. #define DUMPEVENTNAME "\\BaseNamedObjects\\WSTDumpEvent"
  45. #define CLEAREVENTNAME "\\BaseNamedObjects\\WSTClearEvent"
  46. #define PAUSEEVENTNAME "\\BaseNamedObjects\\WSTPauseEvent"
  47. #define SHAREDNAME "\\BaseNamedObjects\\WSTSHARED"
  48. #define WSTUSAGE(x) ((ULONG_PTR)(x->Instrumentation[3]))
  49. /* * * * * * * * * * G l o b a l D e c l a r a t i o n s * * * * * * * * */
  50. typedef enum {
  51. NOT_STARTED,
  52. STARTED,
  53. STOPPED,
  54. } WSTSTATE;
  55. typedef struct _wsp {
  56. PSTR pszSymbol; // Pointer to Symbol name
  57. ULONG_PTR ulFuncAddr; // Function address of symbol
  58. ULONG ulCodeLength; // Length of this symbols code
  59. ULONG ulBitString; // Bitstring for tuning.
  60. } WSP;
  61. typedef WSP * PWSP;
  62. typedef struct _img {
  63. PSTR pszName;
  64. ULONG_PTR ulCodeStart;
  65. ULONG_PTR ulCodeEnd;
  66. PWSP pWsp;
  67. int iSymCnt;
  68. PULONG pulWsi;
  69. PULONG pulWsp;
  70. PULONG pulWsiNxt;
  71. ULONG ulSetSymbols;
  72. BOOL fDumpAll;
  73. } IMG;
  74. typedef IMG * PIMG;
  75. typedef struct tagWSPhdr{
  76. char chFileSignature[4];
  77. ULONG ulTimeStamp;
  78. ULONG ulApiCount;
  79. USHORT usId;
  80. ULONG ulSetSymbols;
  81. ULONG ulModNameLen;
  82. ULONG ulSegSize;
  83. ULONG ulOffset;
  84. ULONG ulSnaps;
  85. }WSPHDR;
  86. /* * * * E x t e r n a l F u n c t i o n D e c l a r a t i o n s * * * */
  87. extern void GdiGetCsInfo (PDWORD, PDWORD, PDWORD);
  88. extern void GdiResetCsInfo (void);
  89. #ifdef i386
  90. extern void SaveAllRegs (void);
  91. extern void RestoreAllRegs (void);
  92. #endif
  93. #define STUB_SIGNATURE 0xfefe55aa // Mips Patch Stub signature
  94. #define CAIROCRT "CAIROCRT.DLL"