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.

169 lines
2.0 KiB

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