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.

221 lines
9.5 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. help.c
  5. Abstract:
  6. This module dumps out help info for VDMEXTS
  7. Author:
  8. Neil Sandlin (NeilSa) 15-Jan-1996
  9. Notes:
  10. Revision History:
  11. --*/
  12. #include <precomp.h>
  13. #pragma hdrstop
  14. CHAR szAPIUSAGE[] = "Usage: !vdmexts.APIProfDmp [TblName] [APIspec]\n\n where: TblName = kernel | user | gdi | keyboard | sound | shell | mmed\n (no TblName implies 'all tables')\n\n APIspec = API # or API name";
  15. CHAR szMSGUSAGE[] = "Usage: !vdmexts.MsgProfDmp [MessageName | MessageNum (decimal)]\n (no argument implies 'all messages')";
  16. VOID
  17. helpAPIProfDmp(
  18. VOID
  19. )
  20. {
  21. PRINTF("\n\n%s\n", szAPIUSAGE);
  22. }
  23. VOID
  24. helpMsgProfDmp(
  25. VOID
  26. )
  27. {
  28. PRINTF("\n\n%s\n", szMSGUSAGE);
  29. }
  30. VOID
  31. helpFilter(
  32. VOID
  33. )
  34. {
  35. PRINTF("Usage: filter <option> <arg>\n\n");
  36. PRINTF(" where <option>=\n");
  37. PRINTF("<none> - Dump current state\n");
  38. PRINTF("* - Disables logging on all API classes\n");
  39. PRINTF("Reset - Filter is reset to default state\n");
  40. PRINTF("CallId xxxx - Adds api with given callid to list to be filtered\n");
  41. PRINTF("Task xxxx - Filter on a Specific TaskID\n");
  42. PRINTF("Verbose - Toggles Verbose Mode On/Off\n");
  43. PRINTF("Commdlg - Toggles Filtering of Commdlg Calls On/Off\n");
  44. PRINTF("GDI - Toggles Filtering of GDI Calls On/Off\n");
  45. PRINTF("Kernel - Toggles Filtering of Kernel Calls On/Off\n");
  46. PRINTF("Kernel16 - Toggles Filtering of Kernel16 Calls On/Off\n");
  47. PRINTF("Keyboard - Toggles Filtering of Keyboard Calls On/Off\n");
  48. PRINTF("MMedia - Toggles Filtering of MMedia Calls On/Off\n");
  49. PRINTF("Sound - Toggles Filtering of Sound Calls On/Off\n");
  50. PRINTF("User - Toggles Filtering of User Calls On/Off\n");
  51. PRINTF("Winsock - Toggles Filtering of Winsock Calls On/Off\n");
  52. PRINTF("\n");
  53. }
  54. VOID
  55. help_denv(
  56. VOID
  57. )
  58. {
  59. PRINTF("Dump environment block for current DOS process or given environment selector\n");
  60. PRINTF("\n");
  61. PRINTF("!denv <bPMode> <segEnv>\n");
  62. PRINTF("\n");
  63. PRINTF("Examples:\n");
  64. PRINTF("!denv - Dumps environment for current DOS process\n");
  65. PRINTF("!denv 0 145d - Dumps environment at &145d:0 (145d from PDB_environ of DOS process)\n");
  66. PRINTF("!denv 1 16b7 - Dumps environment at #16b7:0 (16b7 from !dt -v segEnvironment)\n");
  67. PRINTF("\n");
  68. }
  69. VOID
  70. helpgdih16(
  71. VOID
  72. )
  73. {
  74. PRINTF("Dumps info for 16-bit GDI handles\n");
  75. PRINTF("\n");
  76. PRINTF("!gdih16 [-v] <h16>\n");
  77. PRINTF("\n");
  78. PRINTF("Examples:\n");
  79. PRINTF("!gdih16 23 - Dumps the gdih32 associated with h16\n");
  80. PRINTF("!gdih16 -v 23 - verbose mode includes mapping table info\n");
  81. PRINTF("\n");
  82. }
  83. VOID
  84. helpgdih32(
  85. VOID
  86. )
  87. {
  88. PRINTF("Dumps info for 32-bit GDI handles\n");
  89. PRINTF("\n");
  90. PRINTF("!gdih32 [-v] <h32>\n");
  91. PRINTF("\n");
  92. PRINTF("Examples:\n");
  93. PRINTF("!gdih32 43502110 - Dumps the gdih16 associated with h32\n");
  94. PRINTF("!gdih32 -v 43502110 - verbose mode includes mapping table info\n");
  95. PRINTF("\n");
  96. }
  97. VOID
  98. help(
  99. CMD_ARGLIST
  100. ) {
  101. CMD_INIT();
  102. if (GetNextToken()) {
  103. if (_strnicmp(lpArgumentString, "filter", 6) == 0) {
  104. helpFilter();
  105. } else if (_strnicmp(lpArgumentString, "apiprofdmp", 10) == 0) {
  106. helpAPIProfDmp();
  107. } else if (_strnicmp(lpArgumentString, "msgprofdmp", 10) == 0) {
  108. helpMsgProfDmp();
  109. } else if (_strnicmp(lpArgumentString, "denv", 4) == 0) {
  110. help_denv();
  111. } else if (_strnicmp(lpArgumentString, "hgdi16", 6) == 0) {
  112. helpgdih16();
  113. } else if (_strnicmp(lpArgumentString, "hgdi32", 6) == 0) {
  114. helpgdih32();
  115. } else {
  116. PRINTF("No specific help information available for '%s'\n", lpArgumentString);
  117. }
  118. return;
  119. }
  120. if (!EXPRESSION("ntvdm!Ldt")) {
  121. PRINTF("\nWARNING: Symbols for NTVDM are not available.\n\n");
  122. }
  123. if (!EXPRESSION("wow32!gptdTaskHead")) {
  124. PRINTF("\nWOW commands are not currently available.\n\n");
  125. } else if (!EXPRESSION("wow32!iLogLevel")) {
  126. PRINTF("\nWOW32 is the free version: Some commands will be unavailable.\n\n");
  127. }
  128. PRINTF("------------- VDMEXTS Debug Extension help:--------------\n\n");
  129. PRINTF("help [cmd] - Displays this list or gives details on command\n");
  130. PRINTF("ApiProfClr - Clears the api profiling table\n");
  131. PRINTF("ApiProfDmp [options] - Dumps the api profiling table\n");
  132. PRINTF("at 0xXXXX - shows name associated with hex atom #\n");
  133. PRINTF("bp <addr> - Sets a vdm breakpoint\n");
  134. PRINTF("bd/be <n> - Disables/enables vdm breakpoint 'n'\n");
  135. PRINTF("bl - Lists vdm breakpoints\n");
  136. PRINTF("chkheap - Checks WOW kernel's global heap\n");
  137. PRINTF("cia - Dump cursor/icon alias list\n");
  138. PRINTF("d<b|w|d> <addr> [len] - Dump vdm memory\n");
  139. PRINTF("ddemem - Dump dde memory thunks\n");
  140. PRINTF("ddte <addr> - Dump dispatch table entry pointed to by <addr>\n");
  141. PRINTF("denv <bProt> <selEnv> - Dump environment for current task or given selector/segment\n");
  142. PRINTF("df [vector] - Dump protect mode fault handler address\n");
  143. PRINTF("dfh [fh [pdb]] - Dump DOS file handles for current or given PDB\n");
  144. PRINTF("dg <sel> - Dump info on a selector\n");
  145. PRINTF("ddh [seg] - Dump DOS heap chain starting at <seg>:0000\n");
  146. PRINTF("dgh [sel|ownersel] - Dump WOW kernel's global heap\n");
  147. PRINTF("dhdib [@<address>] - Dump dib.drv support structures (DIBINFO)\n");
  148. PRINTF("di [vector] - Dump protect mode interrupt handler address\n");
  149. PRINTF("dma - Dump virtual DMA state\n");
  150. PRINTF("dpd - Dump DPMI DOS memory allocations\n");
  151. PRINTF("dpx - Dump DPMI extended memory allocations\n");
  152. PRINTF("dsft [sft] - Dump all or specified DOS system file tables\n");
  153. PRINTF("dt [-v] <addr> - Dump WOW Task Info\n");
  154. PRINTF("dwp <addr> - Dump WOWPORT structure pointed to by <addr>\n");
  155. PRINTF("e<b|w|d> <addr> <data> - Edit vdm memory\n");
  156. PRINTF("filter [options] - Manipulate logging filter\n");
  157. PRINTF("fs <text to find> - Find text in 16:16 memory (case insensitive)\n");
  158. PRINTF("glock <sel> - Increments the lock count on a moveable segment\n");
  159. PRINTF("gmem - Dumps Global/heap memory alloc'd by wow32\n");
  160. PRINTF("gunlock <sel> - Decrements the lock count on a moveable segment\n");
  161. PRINTF("hgdi16 [-v] <h16> - Returns 32-bit GDI handle for <h16>\n");
  162. PRINTF("hgdi32 [-v] <h32> - Returns 16-bit GDI handle for <h32>\n");
  163. PRINTF("ica - Dump Interrupt Controller state\n");
  164. PRINTF("k - Stack trace\n");
  165. PRINTF("kb - Stack trace with symbols\n");
  166. PRINTF("LastLog - Dumps Last Logged WOW APIs from Circular Buffer\n");
  167. PRINTF("lg [#num] [count] - Dumps NTVDM history log\n");
  168. PRINTF("lgr [#num] [count] - Dumps NTVDM history log (with regs)\n");
  169. PRINTF("lgt [1|2|3] - Sets NTVDM history log timer resolution\n");
  170. PRINTF("lm <sel|modname> - List loaded modules\n");
  171. PRINTF("ln [addr] - Determine near symbols\n");
  172. PRINTF("LogFile [path] - Create/close toggle for iloglevel capture to file\n");
  173. PRINTF(" (path defaults to c:\\ilog.log)\n");
  174. PRINTF("MsgProfClr - Clears the msg profiling table\n");
  175. PRINTF("MsgProfDmp [options] - Dumps the msg profiling table\n");
  176. PRINTF("ntsd - Gets an NTSD prompt from the VDM prompt\n");
  177. PRINTF("r - Dump registers\n");
  178. PRINTF("rmcb - Dumps dpmi real mode callbacks\n");
  179. PRINTF("SetLogLevel xx - Sets the WOW Logging Level\n");
  180. PRINTF("StepTrace - Toggles Single Step Tracing On/Off\n");
  181. PRINTF("sx - Displays debugging options\n");
  182. PRINTF("sx<d|e> <flag> - Disables/enables debugging options\n");
  183. PRINTF("u [addr] [len] - Unassemble vdm code with symbols\n");
  184. PRINTF("wc <hwnd16> - Dumps the window class structure of <hwnd16>\n");
  185. PRINTF("ww <hwnd16> - Dumps the window structure of <hwnd16>\n");
  186. PRINTF("x <symbol> - Get symbol's value\n");
  187. #ifdef i386
  188. PRINTF("\n-------------- i386 specific commands\n");
  189. PRINTF("fpu - Dump 487 state\n");
  190. PRINTF("pdump - Dumps profile info to file \\profile.out\n");
  191. PRINTF("pint - Sets the profile interval\n");
  192. PRINTF("pstart - Causes profiling to start\n");
  193. PRINTF("pstop - Causes profiling to stop\n");
  194. PRINTF("vdmtib [addr] - Dumps the register context in the vdmtib\n");
  195. #endif
  196. PRINTF("\n\n");
  197. PRINTF(" where [options] can be displayed with 'help <cmd>'\n\n");
  198. }