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.

286 lines
9.2 KiB

  1. /******************************************************************************
  2. P V I E W D A T A
  3. Name: pviewdat.h
  4. Description:
  5. Prototypes of functions used in pviewdat.c
  6. ******************************************************************************/
  7. //******************************************************************************
  8. //
  9. // Titles and indexes.
  10. //
  11. // See GetPerfTitleSz() in perfdata.c on how to retrieve these data.
  12. //
  13. // This is not complete, for complete listing
  14. // see under hkey_local_system
  15. // \software
  16. // \microsoft
  17. // \windows nt
  18. // \currentversion
  19. // \perflib
  20. // \###
  21. //
  22. #define PN_PROCESS TEXT("Process")
  23. #define PN_PROCESS_CPU TEXT("% Processor Time")
  24. #define PN_PROCESS_PRIV TEXT("% Privileged Time")
  25. #define PN_PROCESS_USER TEXT("% User Time")
  26. #define PN_PROCESS_WORKING_SET TEXT("Working Set")
  27. #define PN_PROCESS_PEAK_WS TEXT("Working Set Peak")
  28. #define PN_PROCESS_PRIO TEXT("Priority Base")
  29. #define PN_PROCESS_ELAPSE TEXT("Elapsed Time")
  30. #define PN_PROCESS_ID TEXT("ID Process")
  31. #define PN_PROCESS_PRIVATE_PAGE TEXT("Private Bytes")
  32. #define PN_PROCESS_VIRTUAL_SIZE TEXT("Virtual Bytes")
  33. #define PN_PROCESS_PEAK_VS TEXT("Virtual Bytes Peak")
  34. #define PN_PROCESS_FAULT_COUNT TEXT("Page Faults/sec")
  35. #define PN_THREAD TEXT("Thread")
  36. #define PN_THREAD_CPU TEXT("% Processor Time")
  37. #define PN_THREAD_PRIV TEXT("% Privileged Time")
  38. #define PN_THREAD_USER TEXT("% User Time")
  39. #define PN_THREAD_START TEXT("Start Address")
  40. #define PN_THREAD_SWITCHES TEXT("Context Switches/sec")
  41. #define PN_THREAD_PRIO TEXT("Priority Current")
  42. #define PN_THREAD_BASE_PRIO TEXT("Priority Base")
  43. #define PN_THREAD_ELAPSE TEXT("Elapsed Time")
  44. #define PN_THREAD_DETAILS TEXT("Thread Details")
  45. #define PN_THREAD_PC TEXT("User PC")
  46. #define PN_IMAGE TEXT("Image")
  47. #define PN_IMAGE_NOACCESS TEXT("No Access")
  48. #define PN_IMAGE_READONLY TEXT("Read Only")
  49. #define PN_IMAGE_READWRITE TEXT("Read/Write")
  50. #define PN_IMAGE_WRITECOPY TEXT("Write Copy")
  51. #define PN_IMAGE_EXECUTABLE TEXT("Executable")
  52. #define PN_IMAGE_EXE_READONLY TEXT("Exec Read Only")
  53. #define PN_IMAGE_EXE_READWRITE TEXT("Exec Read/Write")
  54. #define PN_IMAGE_EXE_WRITECOPY TEXT("Exec Write Copy")
  55. #define PN_PROCESS_ADDRESS_SPACE TEXT("Process Address Space")
  56. #define PN_PROCESS_PRIVATE_NOACCESS TEXT("Reserved Space No Access")
  57. #define PN_PROCESS_PRIVATE_READONLY TEXT("Reserved Space Read Only")
  58. #define PN_PROCESS_PRIVATE_READWRITE TEXT("Reserved Space Read/Write")
  59. #define PN_PROCESS_PRIVATE_WRITECOPY TEXT("Reserved Space Write Copy")
  60. #define PN_PROCESS_PRIVATE_EXECUTABLE TEXT("Reserved Space Executable")
  61. #define PN_PROCESS_PRIVATE_EXE_READONLY TEXT("Reserved Space Exec Read Only")
  62. #define PN_PROCESS_PRIVATE_EXE_READWRITE TEXT("Reserved Space Exec Read/Write")
  63. #define PN_PROCESS_PRIVATE_EXE_WRITECOPY TEXT("Reserved Space Exec Write Copy")
  64. #define PN_PROCESS_MAPPED_NOACCESS TEXT("Mapped Space No Access")
  65. #define PN_PROCESS_MAPPED_READONLY TEXT("Mapped Space Read Only")
  66. #define PN_PROCESS_MAPPED_READWRITE TEXT("Mapped Space Read/Write")
  67. #define PN_PROCESS_MAPPED_WRITECOPY TEXT("Mapped Space Write Copy")
  68. #define PN_PROCESS_MAPPED_EXECUTABLE TEXT("Mapped Space Executable")
  69. #define PN_PROCESS_MAPPED_EXE_READONLY TEXT("Mapped Space Exec Read Only")
  70. #define PN_PROCESS_MAPPED_EXE_READWRITE TEXT("Mapped Space Exec Read/Write")
  71. #define PN_PROCESS_MAPPED_EXE_WRITECOPY TEXT("Mapped Space Exec Write Copy")
  72. #define PN_PROCESS_IMAGE_NOACCESS TEXT("Image Space No Access")
  73. #define PN_PROCESS_IMAGE_READONLY TEXT("Image Space Read Only")
  74. #define PN_PROCESS_IMAGE_READWRITE TEXT("Image Space Read/Write")
  75. #define PN_PROCESS_IMAGE_WRITECOPY TEXT("Image Space Write Copy")
  76. #define PN_PROCESS_IMAGE_EXECUTABLE TEXT("Image Space Executable")
  77. #define PN_PROCESS_IMAGE_EXE_READONLY TEXT("Image Space Exec Read Only")
  78. #define PN_PROCESS_IMAGE_EXE_READWRITE TEXT("Image Space Exec Read/Write")
  79. #define PN_PROCESS_IMAGE_EXE_WRITECOPY TEXT("Image Space Exec Write Copy")
  80. DWORD PX_PROCESS;
  81. DWORD PX_PROCESS_CPU;
  82. DWORD PX_PROCESS_PRIV;
  83. DWORD PX_PROCESS_USER;
  84. DWORD PX_PROCESS_WORKING_SET;
  85. DWORD PX_PROCESS_PEAK_WS;
  86. DWORD PX_PROCESS_PRIO;
  87. DWORD PX_PROCESS_ELAPSE;
  88. DWORD PX_PROCESS_ID;
  89. DWORD PX_PROCESS_PRIVATE_PAGE;
  90. DWORD PX_PROCESS_VIRTUAL_SIZE;
  91. DWORD PX_PROCESS_PEAK_VS;
  92. DWORD PX_PROCESS_FAULT_COUNT;
  93. DWORD PX_PROCESS_PAGED_POOL_QUOTA;
  94. DWORD PX_PROCESS_PEAK_PAGED_POOL_QUOTA;
  95. DWORD PX_PROCESS_NONPAGED_POOL_QUOTA;
  96. DWORD PX_PROCESS_PEAK_PAGED_POOL;
  97. DWORD PX_PROCESS_PEAK_NONPAGED_POOL;
  98. DWORD PX_PROCESS_CUR_PAGED_POOL;
  99. DWORD PX_PROCESS_CUR_NONPAGED_POOL;
  100. DWORD PX_PROCESS_PAGED_POOL_LIMIT;
  101. DWORD PX_PROCESS_NONPAGED_POOL_LIMIT;
  102. DWORD PX_THREAD;
  103. DWORD PX_THREAD_CPU;
  104. DWORD PX_THREAD_PRIV;
  105. DWORD PX_THREAD_USER;
  106. DWORD PX_THREAD_START;
  107. DWORD PX_THREAD_SWITCHES;
  108. DWORD PX_THREAD_PRIO;
  109. DWORD PX_THREAD_BASE_PRIO;
  110. DWORD PX_THREAD_ELAPSE;
  111. DWORD PX_THREAD_DETAILS;
  112. DWORD PX_THREAD_PC;
  113. DWORD PX_IMAGE;
  114. DWORD PX_IMAGE_NOACCESS;
  115. DWORD PX_IMAGE_READONLY;
  116. DWORD PX_IMAGE_READWRITE;
  117. DWORD PX_IMAGE_WRITECOPY;
  118. DWORD PX_IMAGE_EXECUTABLE;
  119. DWORD PX_IMAGE_EXE_READONLY;
  120. DWORD PX_IMAGE_EXE_READWRITE;
  121. DWORD PX_IMAGE_EXE_WRITECOPY;
  122. DWORD PX_PROCESS_ADDRESS_SPACE;
  123. DWORD PX_PROCESS_PRIVATE_NOACCESS;
  124. DWORD PX_PROCESS_PRIVATE_READONLY;
  125. DWORD PX_PROCESS_PRIVATE_READWRITE;
  126. DWORD PX_PROCESS_PRIVATE_WRITECOPY;
  127. DWORD PX_PROCESS_PRIVATE_EXECUTABLE;
  128. DWORD PX_PROCESS_PRIVATE_EXE_READONLY;
  129. DWORD PX_PROCESS_PRIVATE_EXE_READWRITE;
  130. DWORD PX_PROCESS_PRIVATE_EXE_WRITECOPY;
  131. DWORD PX_PROCESS_MAPPED_NOACCESS;
  132. DWORD PX_PROCESS_MAPPED_READONLY;
  133. DWORD PX_PROCESS_MAPPED_READWRITE;
  134. DWORD PX_PROCESS_MAPPED_WRITECOPY;
  135. DWORD PX_PROCESS_MAPPED_EXECUTABLE;
  136. DWORD PX_PROCESS_MAPPED_EXE_READONLY;
  137. DWORD PX_PROCESS_MAPPED_EXE_READWRITE;
  138. DWORD PX_PROCESS_MAPPED_EXE_WRITECOPY;
  139. DWORD PX_PROCESS_IMAGE_NOACCESS;
  140. DWORD PX_PROCESS_IMAGE_READONLY;
  141. DWORD PX_PROCESS_IMAGE_READWRITE;
  142. DWORD PX_PROCESS_IMAGE_WRITECOPY;
  143. DWORD PX_PROCESS_IMAGE_EXECUTABLE;
  144. DWORD PX_PROCESS_IMAGE_EXE_READONLY;
  145. DWORD PX_PROCESS_IMAGE_EXE_READWRITE;
  146. DWORD PX_PROCESS_IMAGE_EXE_WRITECOPY;
  147. #define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + (double)((x).LowPart))
  148. typedef struct _TIME_FIELD
  149. TIME_FIELD,
  150. *PTIME_FIELD;
  151. struct _TIME_FIELD
  152. {
  153. INT Hours;
  154. INT Mins;
  155. INT Secs;
  156. INT mSecs;
  157. };
  158. void RefreshPviewDlgThreadPC
  159. (HWND hPviewDlg,
  160. LPTSTR szProcessName,
  161. LPTSTR szThreadName,
  162. PPERF_OBJECT pThreadDetailsObject,
  163. PPERF_DATA pCostlyData);
  164. BOOL RefreshMemoryDlg
  165. (HWND hMemDlg,
  166. PPERF_INSTANCE pProcessInstance,
  167. PPERF_OBJECT pProcessObject,
  168. PPERF_OBJECT pAddressObject,
  169. PPERF_OBJECT pImageObject);
  170. void RefreshMemoryDlgImage
  171. (HWND hMemDlg,
  172. DWORD dwIndex,
  173. PPERF_OBJECT pImageObject);
  174. void RefreshPviewDlgMemoryData
  175. (HWND hPviewDlg,
  176. PPERF_INSTANCE pProcessInstance,
  177. PPERF_OBJECT pProcessObject,
  178. PPERF_OBJECT pAddressObject);
  179. PPERF_DATA RefreshPerfData
  180. (HKEY hPerfKey,
  181. LPTSTR szObjectIndex,
  182. PPERF_DATA pData,
  183. DWORD *pDataSize);
  184. void RefreshProcessList
  185. (HWND hProcessList,
  186. PPERF_OBJECT pObject);
  187. void RefreshProcessData
  188. (HWND hWnd,
  189. PPERF_OBJECT pObject,
  190. DWORD ProcessIndex);
  191. void RefreshThreadList
  192. (HWND hThreadList,
  193. PPERF_OBJECT pObject,
  194. DWORD ParentIndex);
  195. void RefreshThreadData
  196. (HWND hWnd,
  197. PPERF_OBJECT pThreadObj,
  198. DWORD ThreadIndex,
  199. PPERF_OBJECT pProcessObj,
  200. PPERF_INSTANCE pProcessInst);
  201. WORD ProcessPriority
  202. (PPERF_OBJECT pObject,
  203. PPERF_INSTANCE pInstance);