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.

289 lines
10 KiB

  1. /*++
  2. Copyright (c) 1992-2002 Microsoft Corporation
  3. Module Name:
  4. Menu.h
  5. Abstract:
  6. This module contains the function prototypes and identifiers for
  7. Windbg's menus and menu items.
  8. --*/
  9. //
  10. // Offset from the bottom of the menu to the popup menu
  11. //
  12. //
  13. //
  14. // File
  15. // |----------------|
  16. // | Open |
  17. //
  18. // etc....
  19. //
  20. // |----------------|
  21. // | MRU Files >| GetMenuItemCount() - 4
  22. // | MRU Files >| GetMenuItemCount() - 3
  23. // |----------------| GetMenuItemCount() - 2
  24. // | Exit | GetMenuItemCount() - 1
  25. // |----------------|
  26. //
  27. // Top-level popup menus must start at this value and
  28. // be separated by this value.
  29. // MENU_SIGNATURE is also added in.
  30. #define IDM_BASE 100
  31. //
  32. // Width of names in File and Program menu.
  33. //
  34. #define FILES_MENU_WIDTH ( 72 )
  35. enum
  36. {
  37. FILE_USE_UNUSED,
  38. FILE_USE_SOURCE,
  39. FILE_USE_DUMP,
  40. FILE_USE_EXECUTABLE,
  41. };
  42. #define MAX_MRU_FILES 16
  43. struct MRU_ENTRY
  44. {
  45. ULONG FileUse;
  46. // This array actually contains the full name, rounded
  47. // to an even multiple of four bytes.
  48. TCHAR FileName[4];
  49. };
  50. extern MRU_ENTRY* g_MruFiles[];
  51. extern HMENU g_MruMenu;
  52. VOID
  53. InitializeMenu(
  54. IN HMENU hmenu
  55. );
  56. UINT
  57. CommandIdEnabled(
  58. IN UINT uMenuID
  59. );
  60. VOID AddFileToMru(ULONG FileUse, PTSTR File);
  61. ULONG GetMruSize(void);
  62. PUCHAR ReadMru(PUCHAR Data, PUCHAR End);
  63. PUCHAR WriteMru(PUCHAR Data);
  64. //
  65. // Menu Resource Signature
  66. //
  67. #define MENU_SIGNATURE 0x4000
  68. //
  69. // File
  70. //
  71. #define IDM_FILE ( 100 | MENU_SIGNATURE )
  72. #define IDM_FILE_OPEN ( IDM_FILE + 1 )
  73. #define IDM_FILE_CLOSE ( IDM_FILE + 2 )
  74. // Separator.
  75. #define IDM_FILE_OPEN_EXECUTABLE ( IDM_FILE + 4 )
  76. #define IDM_FILE_ATTACH ( IDM_FILE + 5 )
  77. #define IDM_FILE_OPEN_CRASH_DUMP ( IDM_FILE + 6 )
  78. #define IDM_FILE_CONNECT_TO_REMOTE ( IDM_FILE + 7 )
  79. #define IDM_FILE_KERNEL_DEBUG ( IDM_FILE + 8 )
  80. // Separator.
  81. #define IDM_FILE_SYMBOL_PATH ( IDM_FILE + 10 )
  82. #define IDM_FILE_SOURCE_PATH ( IDM_FILE + 11 )
  83. #define IDM_FILE_IMAGE_PATH ( IDM_FILE + 12 )
  84. // Separator.
  85. #define IDM_FILE_OPEN_WORKSPACE ( IDM_FILE + 14 )
  86. #define IDM_FILE_SAVE_WORKSPACE ( IDM_FILE + 15 )
  87. #define IDM_FILE_SAVE_WORKSPACE_AS ( IDM_FILE + 16 )
  88. #define IDM_FILE_CLEAR_WORKSPACE ( IDM_FILE + 17 )
  89. #define IDM_FILE_DELETE_WORKSPACES ( IDM_FILE + 18 )
  90. #define IDM_FILE_OPEN_WORKSPACE_FILE ( IDM_FILE + 19 )
  91. #define IDM_FILE_SAVE_WORKSPACE_FILE ( IDM_FILE + 20 )
  92. // Separator.
  93. #define IDM_FILE_MAP_NET_DRIVE ( IDM_FILE + 22 )
  94. #define IDM_FILE_DISCONN_NET_DRIVE ( IDM_FILE + 23 )
  95. // Separator.
  96. // MRUs must be in sequential order. That way a position can be
  97. // calculated by: IDM_FILE_MRU_FILE5 - IDM_FILE_MRU_FILE1, etc...
  98. #define IDM_FILE_MRU_FILE1 ( IDM_FILE + 25 )
  99. #define IDM_FILE_MRU_FILE2 ( IDM_FILE_MRU_FILE1 + 1 )
  100. #define IDM_FILE_MRU_FILE3 ( IDM_FILE_MRU_FILE1 + 2 )
  101. #define IDM_FILE_MRU_FILE4 ( IDM_FILE_MRU_FILE1 + 3 )
  102. #define IDM_FILE_MRU_FILE5 ( IDM_FILE_MRU_FILE1 + 4 )
  103. #define IDM_FILE_MRU_FILE6 ( IDM_FILE_MRU_FILE1 + 5 )
  104. #define IDM_FILE_MRU_FILE7 ( IDM_FILE_MRU_FILE1 + 6 )
  105. #define IDM_FILE_MRU_FILE8 ( IDM_FILE_MRU_FILE1 + 7 )
  106. #define IDM_FILE_MRU_FILE9 ( IDM_FILE_MRU_FILE1 + 8 )
  107. #define IDM_FILE_MRU_FILE10 ( IDM_FILE_MRU_FILE1 + 9 )
  108. #define IDM_FILE_MRU_FILE11 ( IDM_FILE_MRU_FILE1 + 10 )
  109. #define IDM_FILE_MRU_FILE12 ( IDM_FILE_MRU_FILE1 + 11 )
  110. #define IDM_FILE_MRU_FILE13 ( IDM_FILE_MRU_FILE1 + 12 )
  111. #define IDM_FILE_MRU_FILE14 ( IDM_FILE_MRU_FILE1 + 13 )
  112. #define IDM_FILE_MRU_FILE15 ( IDM_FILE_MRU_FILE1 + 14 )
  113. #define IDM_FILE_MRU_FILE16 ( IDM_FILE_MRU_FILE1 + 15 )
  114. // ditto. same as above
  115. #define IDM_FILE_MRU_WORKSPACE1 ( IDM_FILE_MRU_FILE16 + 1 )
  116. #define IDM_FILE_MRU_WORKSPACE2 ( IDM_FILE_MRU_WORKSPACE1 + 1 )
  117. #define IDM_FILE_MRU_WORKSPACE3 ( IDM_FILE_MRU_WORKSPACE1 + 2 )
  118. #define IDM_FILE_MRU_WORKSPACE4 ( IDM_FILE_MRU_WORKSPACE1 + 3 )
  119. #define IDM_FILE_MRU_WORKSPACE5 ( IDM_FILE_MRU_WORKSPACE1 + 4 )
  120. #define IDM_FILE_MRU_WORKSPACE6 ( IDM_FILE_MRU_WORKSPACE1 + 5 )
  121. #define IDM_FILE_MRU_WORKSPACE7 ( IDM_FILE_MRU_WORKSPACE1 + 6 )
  122. #define IDM_FILE_MRU_WORKSPACE8 ( IDM_FILE_MRU_WORKSPACE1 + 7 )
  123. #define IDM_FILE_MRU_WORKSPACE9 ( IDM_FILE_MRU_WORKSPACE1 + 8 )
  124. #define IDM_FILE_MRU_WORKSPACE10 ( IDM_FILE_MRU_WORKSPACE1 + 9 )
  125. #define IDM_FILE_MRU_WORKSPACE11 ( IDM_FILE_MRU_WORKSPACE1 + 10 )
  126. #define IDM_FILE_MRU_WORKSPACE12 ( IDM_FILE_MRU_WORKSPACE1 + 11 )
  127. #define IDM_FILE_MRU_WORKSPACE13 ( IDM_FILE_MRU_WORKSPACE1 + 12 )
  128. #define IDM_FILE_MRU_WORKSPACE14 ( IDM_FILE_MRU_WORKSPACE1 + 13 )
  129. #define IDM_FILE_MRU_WORKSPACE15 ( IDM_FILE_MRU_WORKSPACE1 + 14 )
  130. #define IDM_FILE_MRU_WORKSPACE16 ( IDM_FILE_MRU_WORKSPACE1 + 15 )
  131. // Included temporarily
  132. #define IDM_FILE_EXIT ( IDM_FILE_MRU_WORKSPACE16 + 1)
  133. #define IDM_FILE_FIRST IDM_FILE
  134. #define IDM_FILE_LAST IDM_FILE_EXIT
  135. //
  136. // Edit
  137. //
  138. #define IDM_EDIT ( 200 | MENU_SIGNATURE )
  139. #define IDM_EDIT_CUT ( IDM_EDIT + 1 )
  140. #define IDM_EDIT_COPY ( IDM_EDIT + 2 )
  141. #define IDM_EDIT_PASTE ( IDM_EDIT + 3 )
  142. #define IDM_EDIT_SELECT_ALL ( IDM_EDIT + 4 )
  143. #define IDM_EDIT_WRITE_TEXT_TO_FILE ( IDM_EDIT + 5 )
  144. #define IDM_EDIT_ADD_TO_COMMAND_HISTORY ( IDM_EDIT + 6 )
  145. #define IDM_EDIT_CLEAR_COMMAND_HISTORY ( IDM_EDIT + 7 )
  146. #define IDM_EDIT_FIND ( IDM_EDIT + 8 )
  147. #define IDM_EDIT_FIND_NEXT ( IDM_EDIT + 9 )
  148. #define IDM_EDIT_GOTO_ADDRESS ( IDM_EDIT + 10 )
  149. #define IDM_EDIT_GOTO_LINE ( IDM_EDIT + 11 )
  150. #define IDM_EDIT_GOTO_CURRENT_IP ( IDM_EDIT + 12 )
  151. #define IDM_EDIT_BREAKPOINTS ( IDM_EDIT + 13 )
  152. #define IDM_EDIT_TOGGLEBREAKPOINT ( IDM_EDIT + 14 )
  153. #define IDM_EDIT_LOG_FILE ( IDM_EDIT + 15 )
  154. #define IDM_EDIT_PROPERTIES ( IDM_EDIT + 16 )
  155. #define IDM_EDIT_FIRST IDM_EDIT
  156. #define IDM_EDIT_LAST IDM_EDIT_PROPERTIES
  157. //
  158. // View
  159. //
  160. #define IDM_VIEW ( 300 | MENU_SIGNATURE )
  161. #define IDM_VIEW_WATCH ( IDM_VIEW + 1 )
  162. #define IDM_VIEW_CALLSTACK ( IDM_VIEW + 2 )
  163. #define IDM_VIEW_MEMORY ( IDM_VIEW + 3 )
  164. #define IDM_VIEW_LOCALS ( IDM_VIEW + 4 )
  165. #define IDM_VIEW_REGISTERS ( IDM_VIEW + 5 )
  166. #define IDM_VIEW_DISASM ( IDM_VIEW + 6 )
  167. #define IDM_VIEW_COMMAND ( IDM_VIEW + 7 )
  168. #define IDM_VIEW_SCRATCH ( IDM_VIEW + 8 )
  169. #define IDM_VIEW_PROCESS_THREAD ( IDM_VIEW + 9 )
  170. #define IDM_VIEW_TOGGLE_VERBOSE ( IDM_VIEW + 10 )
  171. #define IDM_VIEW_SHOW_VERSION ( IDM_VIEW + 11 )
  172. #define IDM_VIEW_TOOLBAR ( IDM_VIEW + 12 )
  173. #define IDM_VIEW_STATUS ( IDM_VIEW + 13 )
  174. #define IDM_VIEW_FONT ( IDM_VIEW + 14 )
  175. #define IDM_VIEW_COLORS ( IDM_VIEW + 15 )
  176. #define IDM_VIEW_OPTIONS ( IDM_VIEW + 16 )
  177. #define IDM_VIEW_FIRST IDM_VIEW
  178. #define IDM_VIEW_LAST IDM_VIEW_OPTIONS
  179. //
  180. // Debug
  181. //
  182. #define IDM_DEBUG ( 400 | MENU_SIGNATURE )
  183. #define IDM_DEBUG_GO ( IDM_DEBUG + 1 )
  184. #define IDM_DEBUG_GO_HANDLED ( IDM_DEBUG + 2 )
  185. #define IDM_DEBUG_GO_UNHANDLED ( IDM_DEBUG + 3 )
  186. #define IDM_DEBUG_RESTART ( IDM_DEBUG + 4 )
  187. #define IDM_DEBUG_STOPDEBUGGING ( IDM_DEBUG + 5 )
  188. #define IDM_DEBUG_BREAK ( IDM_DEBUG + 6 )
  189. #define IDM_DEBUG_STEPINTO ( IDM_DEBUG + 7 )
  190. #define IDM_DEBUG_STEPOVER ( IDM_DEBUG + 8 )
  191. #define IDM_DEBUG_STEPOUT ( IDM_DEBUG + 9 )
  192. #define IDM_DEBUG_RUNTOCURSOR ( IDM_DEBUG + 10 )
  193. #define IDM_DEBUG_SOURCE_MODE ( IDM_DEBUG + 11 )
  194. #define IDM_DEBUG_EVENT_FILTERS ( IDM_DEBUG + 12 )
  195. #define IDM_DEBUG_MODULES ( IDM_DEBUG + 13 )
  196. #define IDM_DEBUG_KDEBUG ( IDM_DEBUG + 14 )
  197. // These are not used by the menu but by the toolbar
  198. #define IDM_DEBUG_SOURCE_MODE_ON ( IDM_DEBUG + 15 )
  199. #define IDM_DEBUG_SOURCE_MODE_OFF ( IDM_DEBUG + 16 )
  200. // Not used by the toolbar or menu, but by the accelerator table
  201. #define IDM_DEBUG_CTRL_C ( IDM_DEBUG + 17 )
  202. #define IDM_DEBUG_FIRST IDM_DEBUG
  203. #define IDM_DEBUG_LAST IDM_DEBUG_KDEBUG
  204. //
  205. // Window
  206. //
  207. #define IDM_WINDOW ( 500 | MENU_SIGNATURE )
  208. #define IDM_WINDOW_CASCADE ( IDM_WINDOW + 1 )
  209. #define IDM_WINDOW_TILE_HORZ ( IDM_WINDOW + 2 )
  210. #define IDM_WINDOW_TILE_VERT ( IDM_WINDOW + 3 )
  211. #define IDM_WINDOW_ARRANGE ( IDM_WINDOW + 4 )
  212. #define IDM_WINDOW_ARRANGE_ICONS ( IDM_WINDOW + 5 )
  213. #define IDM_WINDOW_CLOSE_ALL_DOCWIN ( IDM_WINDOW + 6 )
  214. #define IDM_WINDOW_AUTO_ARRANGE ( IDM_WINDOW + 7 )
  215. #define IDM_WINDOW_ARRANGE_ALL ( IDM_WINDOW + 8 )
  216. #define IDM_WINDOW_OVERLAY_SOURCE ( IDM_WINDOW + 9 )
  217. #define IDM_WINDOW_AUTO_DISASM ( IDM_WINDOW + 10 )
  218. #define IDM_WINDOWCHILD ( IDM_WINDOW + 11 )
  219. #define IDM_WINDOW_FIRST IDM_WINDOW
  220. #define IDM_WINDOW_LAST IDM_WINDOWCHILD
  221. //
  222. // Help
  223. //
  224. #define IDM_HELP ( 600 | MENU_SIGNATURE )
  225. #define IDM_HELP_CONTENTS ( IDM_HELP + 1 )
  226. #define IDM_HELP_INDEX ( IDM_HELP + 2 )
  227. #define IDM_HELP_SEARCH ( IDM_HELP + 3 )
  228. #define IDM_HELP_ABOUT ( IDM_HELP + 4 )
  229. #define IDM_HELP_FIRST IDM_HELP
  230. #define IDM_HELP_LAST IDM_HELP_ABOUT
  231. //
  232. // Debug.Kernel submenu.
  233. //
  234. #define IDM_KDEBUG ( 10000 | MENU_SIGNATURE )
  235. #define IDM_KDEBUG_TOGGLE_BAUDRATE ( IDM_KDEBUG + 1 )
  236. #define IDM_KDEBUG_TOGGLE_DEBUG ( IDM_KDEBUG + 2 )
  237. #define IDM_KDEBUG_TOGGLE_INITBREAK ( IDM_KDEBUG + 3 )
  238. #define IDM_KDEBUG_RECONNECT ( IDM_KDEBUG + 4 )