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.

148 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1998-2001 Microsoft Corporation
  3. Module Name:
  4. endp.c
  5. Abstract:
  6. Dumps UL_ENDPOINT structures.
  7. Author:
  8. Keith Moore (keithmo) 26-Jun-1998
  9. Environment:
  10. User Mode.
  11. Revision History:
  12. --*/
  13. #include "precomp.h"
  14. //
  15. // Public functions.
  16. //
  17. DECLARE_API( endp )
  18. /*++
  19. Routine Description:
  20. Dumps UL_ENDPOINT structures.
  21. Arguments:
  22. None.
  23. Return Value:
  24. None.
  25. --*/
  26. {
  27. ULONG_PTR address = 0;
  28. ULONG result;
  29. UL_ENDPOINT endpoint;
  30. ENDPOINT_CONNS Verbosity = ENDPOINT_NO_CONNS;
  31. SNAPSHOT_EXTENSION_DATA();
  32. //
  33. // Skip leading blanks.
  34. //
  35. while (*args == ' ' || *args == '\t')
  36. {
  37. args++;
  38. }
  39. while ((*args == '*') || (*args == '-'))
  40. {
  41. if (*args == '*')
  42. {
  43. DumpAllEndpoints(Verbosity);
  44. return;
  45. }
  46. else if (*args == '-')
  47. {
  48. args++;
  49. switch (*args)
  50. {
  51. case 'c' :
  52. case 'C' :
  53. Verbosity = ENDPOINT_BRIEF_CONNS;
  54. args++;
  55. break;
  56. case 'v' :
  57. case 'V' :
  58. Verbosity = ENDPOINT_VERBOSE_CONNS;
  59. args++;
  60. break;
  61. default :
  62. PrintUsage( "endp" );
  63. return;
  64. }
  65. }
  66. while (*args == ' ' || *args == '\t')
  67. {
  68. args++;
  69. }
  70. }
  71. //
  72. // Snag the address from the command line.
  73. //
  74. address = GetExpression( args );
  75. if (address == 0)
  76. {
  77. PrintUsage( "endp" );
  78. return;
  79. }
  80. //
  81. // Read the endpoint.
  82. //
  83. if (!ReadMemory(
  84. address,
  85. &endpoint,
  86. sizeof(endpoint),
  87. &result
  88. ))
  89. {
  90. dprintf(
  91. "endp: cannot read UL_ENDPOINT @ %p\n",
  92. address
  93. );
  94. return;
  95. }
  96. //
  97. // Dump it.
  98. //
  99. DumpUlEndpoint(
  100. "",
  101. "endp: ",
  102. address,
  103. &endpoint,
  104. Verbosity
  105. );
  106. } // endp