Windows NT 4.0 source code leak
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.

212 lines
7.0 KiB

4 years ago
  1. /*
  2. * Module Name: WSDATA.H
  3. *
  4. * Description:
  5. *
  6. * Working set tuner include file. Contains common structure
  7. * declarations and constant definitions.
  8. *
  9. *
  10. * This is an OS/2 2.x specific file
  11. *
  12. * IBM/Microsoft Confidential
  13. *
  14. * Copyright (c) IBM Corporation 1987, 1989
  15. * Copyright (c) Microsoft Corporation 1987, 1989
  16. *
  17. * All Rights Reserved
  18. *
  19. * Modification History:
  20. *
  21. * 03/23/90 - created
  22. *
  23. */
  24. /*
  25. * Constant definitions.
  26. */
  27. #define NUM_VAR_BITS (sizeof(ULONG) << 3)
  28. #ifdef TMIFILEHACK
  29. #define MAXLINE 80
  30. #endif /* TMIFILEHACK */
  31. /*
  32. * Type definitions and structure declarations.
  33. */
  34. typedef ULONG fxnbits_t;
  35. struct dtqo_s {
  36. unsigned long dtqo_hMTE; /* MTE handle */
  37. unsigned short dtqo_usID; /* Identifier */
  38. unsigned short dtqo_resv; /* Reserved */
  39. unsigned long dtqo_cbPathname; /* Module pathname length */
  40. unsigned long dtqo_clSegSize; /* Time Segment size*/
  41. };
  42. typedef struct dtqo_s dtqo_t;
  43. /*
  44. * WSI file layout:
  45. *
  46. * _________________________________________
  47. * | |
  48. * | wsihdr_s |
  49. * |_______________________________________|
  50. * |_______________________________________|
  51. * | sentinel 0 (dtgp_s) | <----------
  52. * |=======================================| |
  53. * | snapshot 0 (dtgp_s) for module X | | S
  54. * |---------------------------------------| | n
  55. * | dynamic trace variables for X | | a
  56. * |---------------------------------------| | p
  57. * | snapshot 0 (dtgp_s) for module Y | | s
  58. * |---------------------------------------| | h
  59. * | dynamic trace variables for Y | | o
  60. * |---------------------------------------| | t
  61. * | etc. | |
  62. * |=======================================| | D
  63. * | sentinel 1 (dtgp_s) | | a
  64. * |=======================================| | t
  65. * | snapshot 1 (dtgp_s) for module X | | a
  66. * |---------------------------------------| |
  67. * | dynamic trace variables for X | |
  68. * |---------------------------------------| |
  69. * | snapshot 1 (dtgp_s) for module Y | |
  70. * |---------------------------------------| |
  71. * | dynamic trace variables for Y | |
  72. * |---------------------------------------| |
  73. * | etc. | |
  74. * |=======================================| |
  75. * | sentinel 2 (dtgp_s) | |
  76. * |=======================================| |
  77. * | etc. | |
  78. * |=======================================| |
  79. * | end sentinel (dtgp_s) | |
  80. * |_______________________________________| <----------
  81. * |_______________________________________|
  82. * | | <---------- Q
  83. * | dtqo_s for module X | | u
  84. * |---------------------------------------| | e
  85. * | module X pathname string | | r
  86. * |=======================================| | y
  87. * | dtqo_s for module Y | |
  88. * |---------------------------------------| | I
  89. * | module Y pathname string | | n
  90. * |=======================================| | f
  91. * | etc. | <---------- o
  92. * |=======================================|
  93. * |_______________________________________|
  94. *
  95. */
  96. /* WSI file header format */
  97. struct wsihdr_s {
  98. CHAR wsihdr_chSignature[4]; // file signature
  99. ULONG wsihdr_ulLevel; // format level
  100. ULONG wsihdr_ulTimeStamp; // time stamp
  101. ULONG wsihdr_ulOffGetvar; // offset to DT_GETVAR data
  102. ULONG wsihdr_ulOffQuery; // offset to DT_QUERY data
  103. ULONG wsihdr_cbFile; // size of file (in bytes)
  104. ULONG wsihdr_ulSnaps; // number of snapshots
  105. };
  106. typedef struct wsihdr_s wsihdr_t;
  107. /*
  108. * WSP file layout:
  109. *
  110. * _________________________________________
  111. * | |
  112. * | wsphdr_s |
  113. * |---------------------------------------|
  114. * | module pathname array |
  115. * |_______________________________________|
  116. * |_______________________________________|
  117. * | function #0 bitstring |
  118. * | (rounded to DWORD boundary) |
  119. * |=======================================|
  120. * | function #1 bitstring |
  121. * |=======================================|
  122. * | etc. |
  123. * |=======================================|
  124. * |_______________________________________|
  125. *
  126. */
  127. /* WSP file header format */
  128. struct wsphdr_s {
  129. CHAR wsphdr_chSignature[4]; // file signature
  130. ULONG wsphdr_ulTimeStamp; // time stamp
  131. dtqo_t wsphdr_dtqo; // query info
  132. ULONG wsphdr_ulOffBits; // offset to first bitstring
  133. ULONG wsphdr_ulSnaps; // number of snapshots
  134. /* followed by module pathname char array, length specified in dtqo */
  135. };
  136. typedef struct wsphdr_s wsphdr_t;
  137. /*
  138. * TMI file layout:
  139. *
  140. * _________________________________________
  141. * | |
  142. * | tmihdr_s |
  143. * |_______________________________________|
  144. * |_______________________________________|
  145. * | function #0 tmirec_s |
  146. * |---------------------------------------|
  147. * | function #0 name array |
  148. * |=======================================|
  149. * | function #1 tmirec_s |
  150. * |---------------------------------------|
  151. * | function #1 name array |
  152. * |=======================================|
  153. * | etc. |
  154. * |=======================================|
  155. * |_______________________________________|
  156. *
  157. */
  158. /* TMI file header. */
  159. typedef struct tmihdr_s {
  160. CHAR tmihdr_chSignature[4]; // "TMI\0"
  161. USHORT tmihdr_usMajor; // Range 0x0001 to 0x00FF
  162. USHORT tmihdr_cTmiRec; // Number of tmirec in file
  163. CHAR tmihdr_chModName[256]; // Name of traced module
  164. USHORT tmihdr_usID; // Module identifier
  165. CHAR tmihdr_resv[30]; // Reserved
  166. };
  167. typedef struct tmihdr_s tmihdr_t;
  168. /* Per-function information from TMI file */
  169. struct tmirec_s {
  170. ULONG tmirec_ulFxnBit; // function's bit reference position
  171. ULONG tmirec_usFxnAddrObj; // object portion of function address
  172. ULONG tmirec_ulFxnAddrOff; // offset portion of function address
  173. ULONG tmirec_cbFxn; // size of function (in bytes)
  174. USHORT tmirec_cbFxnName; // size in bytes of function name
  175. CHAR tmirec_FxnName[1]; // bytes of function name start here
  176. };
  177. typedef struct tmirec_s tmirec_t;
  178. typedef struct tagWSPhdr{
  179. char chFileSignature[4];
  180. ULONG ulTimeStamp;
  181. ULONG ulApiCount;
  182. USHORT usId;
  183. USHORT usSetSymbols;
  184. ULONG ulModNameLen;
  185. ULONG ulSegSize;
  186. ULONG ulOffset;
  187. ULONG ulSnaps;
  188. }WSPHDR;