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.

283 lines
9.4 KiB

  1. /*++
  2. Copyright (c) 1992-2001 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. // Separator.
  91. #define IDM_FILE_MAP_NET_DRIVE ( IDM_FILE + 20 )
  92. #define IDM_FILE_DISCONN_NET_DRIVE ( IDM_FILE + 21 )
  93. // Separator.
  94. // MRUs must be in sequential order. That way a position can be
  95. // calculated by: IDM_FILE_MRU_FILE5 - IDM_FILE_MRU_FILE1, etc...
  96. #define IDM_FILE_MRU_FILE1 ( IDM_FILE + 23 )
  97. #define IDM_FILE_MRU_FILE2 ( IDM_FILE_MRU_FILE1 + 1 )
  98. #define IDM_FILE_MRU_FILE3 ( IDM_FILE_MRU_FILE1 + 2 )
  99. #define IDM_FILE_MRU_FILE4 ( IDM_FILE_MRU_FILE1 + 3 )
  100. #define IDM_FILE_MRU_FILE5 ( IDM_FILE_MRU_FILE1 + 4 )
  101. #define IDM_FILE_MRU_FILE6 ( IDM_FILE_MRU_FILE1 + 5 )
  102. #define IDM_FILE_MRU_FILE7 ( IDM_FILE_MRU_FILE1 + 6 )
  103. #define IDM_FILE_MRU_FILE8 ( IDM_FILE_MRU_FILE1 + 7 )
  104. #define IDM_FILE_MRU_FILE9 ( IDM_FILE_MRU_FILE1 + 8 )
  105. #define IDM_FILE_MRU_FILE10 ( IDM_FILE_MRU_FILE1 + 9 )
  106. #define IDM_FILE_MRU_FILE11 ( IDM_FILE_MRU_FILE1 + 10 )
  107. #define IDM_FILE_MRU_FILE12 ( IDM_FILE_MRU_FILE1 + 11 )
  108. #define IDM_FILE_MRU_FILE13 ( IDM_FILE_MRU_FILE1 + 12 )
  109. #define IDM_FILE_MRU_FILE14 ( IDM_FILE_MRU_FILE1 + 13 )
  110. #define IDM_FILE_MRU_FILE15 ( IDM_FILE_MRU_FILE1 + 14 )
  111. #define IDM_FILE_MRU_FILE16 ( IDM_FILE_MRU_FILE1 + 15 )
  112. // ditto. same as above
  113. #define IDM_FILE_MRU_WORKSPACE1 ( IDM_FILE_MRU_FILE16 + 1 )
  114. #define IDM_FILE_MRU_WORKSPACE2 ( IDM_FILE_MRU_WORKSPACE1 + 1 )
  115. #define IDM_FILE_MRU_WORKSPACE3 ( IDM_FILE_MRU_WORKSPACE1 + 2 )
  116. #define IDM_FILE_MRU_WORKSPACE4 ( IDM_FILE_MRU_WORKSPACE1 + 3 )
  117. #define IDM_FILE_MRU_WORKSPACE5 ( IDM_FILE_MRU_WORKSPACE1 + 4 )
  118. #define IDM_FILE_MRU_WORKSPACE6 ( IDM_FILE_MRU_WORKSPACE1 + 5 )
  119. #define IDM_FILE_MRU_WORKSPACE7 ( IDM_FILE_MRU_WORKSPACE1 + 6 )
  120. #define IDM_FILE_MRU_WORKSPACE8 ( IDM_FILE_MRU_WORKSPACE1 + 7 )
  121. #define IDM_FILE_MRU_WORKSPACE9 ( IDM_FILE_MRU_WORKSPACE1 + 8 )
  122. #define IDM_FILE_MRU_WORKSPACE10 ( IDM_FILE_MRU_WORKSPACE1 + 9 )
  123. #define IDM_FILE_MRU_WORKSPACE11 ( IDM_FILE_MRU_WORKSPACE1 + 10 )
  124. #define IDM_FILE_MRU_WORKSPACE12 ( IDM_FILE_MRU_WORKSPACE1 + 11 )
  125. #define IDM_FILE_MRU_WORKSPACE13 ( IDM_FILE_MRU_WORKSPACE1 + 12 )
  126. #define IDM_FILE_MRU_WORKSPACE14 ( IDM_FILE_MRU_WORKSPACE1 + 13 )
  127. #define IDM_FILE_MRU_WORKSPACE15 ( IDM_FILE_MRU_WORKSPACE1 + 14 )
  128. #define IDM_FILE_MRU_WORKSPACE16 ( IDM_FILE_MRU_WORKSPACE1 + 15 )
  129. // Included temporarily
  130. #define IDM_FILE_EXIT ( IDM_FILE_MRU_WORKSPACE16 + 1)
  131. #define IDM_FILE_FIRST IDM_FILE
  132. #define IDM_FILE_LAST IDM_FILE_EXIT
  133. //
  134. // Edit
  135. //
  136. #define IDM_EDIT ( 200 | MENU_SIGNATURE )
  137. #define IDM_EDIT_CUT ( IDM_EDIT + 1 )
  138. #define IDM_EDIT_COPY ( IDM_EDIT + 2 )
  139. #define IDM_EDIT_PASTE ( IDM_EDIT + 3 )
  140. #define IDM_EDIT_SELECT_ALL ( IDM_EDIT + 4 )
  141. #define IDM_EDIT_ADD_TO_COMMAND_HISTORY ( IDM_EDIT + 5 )
  142. #define IDM_EDIT_CLEAR_COMMAND_HISTORY ( IDM_EDIT + 6 )
  143. #define IDM_EDIT_FIND ( IDM_EDIT + 7 )
  144. #define IDM_EDIT_GOTO_ADDRESS ( IDM_EDIT + 8 )
  145. #define IDM_EDIT_GOTO_LINE ( IDM_EDIT + 9 )
  146. #define IDM_EDIT_BREAKPOINTS ( IDM_EDIT + 10 )
  147. #define IDM_EDIT_TOGGLEBREAKPOINT ( IDM_EDIT + 11 )
  148. #define IDM_EDIT_LOG_FILE ( IDM_EDIT + 12 )
  149. #define IDM_EDIT_PROPERTIES ( IDM_EDIT + 13 )
  150. #define IDM_EDIT_FIRST IDM_EDIT
  151. #define IDM_EDIT_LAST IDM_EDIT_PROPERTIES
  152. //
  153. // View
  154. //
  155. #define IDM_VIEW ( 300 | MENU_SIGNATURE )
  156. #define IDM_VIEW_WATCH ( IDM_VIEW + 1 )
  157. #define IDM_VIEW_CALLSTACK ( IDM_VIEW + 2 )
  158. #define IDM_VIEW_MEMORY ( IDM_VIEW + 3 )
  159. #define IDM_VIEW_LOCALS ( IDM_VIEW + 4 )
  160. #define IDM_VIEW_REGISTERS ( IDM_VIEW + 5 )
  161. #define IDM_VIEW_DISASM ( IDM_VIEW + 6 )
  162. #define IDM_VIEW_COMMAND ( IDM_VIEW + 7 )
  163. #define IDM_VIEW_SCRATCH ( IDM_VIEW + 8 )
  164. #define IDM_VIEW_PROCESS_THREAD ( IDM_VIEW + 9 )
  165. #define IDM_VIEW_TOGGLE_VERBOSE ( IDM_VIEW + 10 )
  166. #define IDM_VIEW_SHOW_VERSION ( IDM_VIEW + 11 )
  167. #define IDM_VIEW_TOOLBAR ( IDM_VIEW + 12 )
  168. #define IDM_VIEW_STATUS ( IDM_VIEW + 13 )
  169. #define IDM_VIEW_FONT ( IDM_VIEW + 14 )
  170. #define IDM_VIEW_COLORS ( IDM_VIEW + 15 )
  171. #define IDM_VIEW_OPTIONS ( IDM_VIEW + 16 )
  172. #define IDM_VIEW_FIRST IDM_VIEW
  173. #define IDM_VIEW_LAST IDM_VIEW_OPTIONS
  174. //
  175. // Debug
  176. //
  177. #define IDM_DEBUG ( 400 | MENU_SIGNATURE )
  178. #define IDM_DEBUG_GO ( IDM_DEBUG + 1 )
  179. #define IDM_DEBUG_GO_HANDLED ( IDM_DEBUG + 2 )
  180. #define IDM_DEBUG_GO_UNHANDLED ( IDM_DEBUG + 3 )
  181. #define IDM_DEBUG_RESTART ( IDM_DEBUG + 4 )
  182. #define IDM_DEBUG_STOPDEBUGGING ( IDM_DEBUG + 5 )
  183. #define IDM_DEBUG_BREAK ( IDM_DEBUG + 6 )
  184. #define IDM_DEBUG_STEPINTO ( IDM_DEBUG + 7 )
  185. #define IDM_DEBUG_STEPOVER ( IDM_DEBUG + 8 )
  186. #define IDM_DEBUG_STEPOUT ( IDM_DEBUG + 9 )
  187. #define IDM_DEBUG_RUNTOCURSOR ( IDM_DEBUG + 10 )
  188. #define IDM_DEBUG_SOURCE_MODE ( IDM_DEBUG + 11 )
  189. #define IDM_DEBUG_EVENT_FILTERS ( IDM_DEBUG + 12 )
  190. #define IDM_DEBUG_MODULES ( IDM_DEBUG + 13 )
  191. #define IDM_DEBUG_KDEBUG ( IDM_DEBUG + 14 )
  192. // These are not used by the menu but by the toolbar
  193. #define IDM_DEBUG_SOURCE_MODE_ON ( IDM_DEBUG + 15 )
  194. #define IDM_DEBUG_SOURCE_MODE_OFF ( IDM_DEBUG + 16 )
  195. // Not used by the toolbar or menu, but by the accelerator table
  196. #define IDM_DEBUG_CTRL_C ( IDM_DEBUG + 17 )
  197. #define IDM_DEBUG_FIRST IDM_DEBUG
  198. #define IDM_DEBUG_LAST IDM_DEBUG_KDEBUG
  199. //
  200. // Window
  201. //
  202. #define IDM_WINDOW ( 500 | MENU_SIGNATURE )
  203. #define IDM_WINDOW_CASCADE ( IDM_WINDOW + 1 )
  204. #define IDM_WINDOW_TILE_HORZ ( IDM_WINDOW + 2 )
  205. #define IDM_WINDOW_TILE_VERT ( IDM_WINDOW + 3 )
  206. #define IDM_WINDOW_ARRANGE ( IDM_WINDOW + 4 )
  207. #define IDM_WINDOW_ARRANGE_ICONS ( IDM_WINDOW + 5 )
  208. #define IDM_WINDOW_AUTO_ARRANGE ( IDM_WINDOW + 6 )
  209. #define IDM_WINDOW_ARRANGE_ALL ( IDM_WINDOW + 7 )
  210. #define IDM_WINDOW_OVERLAY_SOURCE ( IDM_WINDOW + 8 )
  211. #define IDM_WINDOW_AUTO_DISASM ( IDM_WINDOW + 9 )
  212. #define IDM_WINDOWCHILD ( IDM_WINDOW + 10 )
  213. #define IDM_WINDOW_FIRST IDM_WINDOW
  214. #define IDM_WINDOW_LAST IDM_WINDOWCHILD
  215. //
  216. // Help
  217. //
  218. #define IDM_HELP ( 600 | MENU_SIGNATURE )
  219. #define IDM_HELP_CONTENTS ( IDM_HELP + 1 )
  220. #define IDM_HELP_INDEX ( IDM_HELP + 2 )
  221. #define IDM_HELP_SEARCH ( IDM_HELP + 3 )
  222. #define IDM_HELP_ABOUT ( IDM_HELP + 4 )
  223. #define IDM_HELP_FIRST IDM_HELP
  224. #define IDM_HELP_LAST IDM_HELP_ABOUT
  225. //
  226. // Debug.Kernel submenu.
  227. //
  228. #define IDM_KDEBUG ( 10000 | MENU_SIGNATURE )
  229. #define IDM_KDEBUG_TOGGLE_BAUDRATE ( IDM_KDEBUG + 1 )
  230. #define IDM_KDEBUG_TOGGLE_DEBUG ( IDM_KDEBUG + 2 )
  231. #define IDM_KDEBUG_TOGGLE_INITBREAK ( IDM_KDEBUG + 3 )
  232. #define IDM_KDEBUG_RECONNECT ( IDM_KDEBUG + 4 )