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.

276 lines
6.0 KiB

  1. /*++
  2. Copyright (c) 1995-1997 Microsoft Corporation
  3. Module Name:
  4. dbgwreq.cxx
  5. Abstract:
  6. This module contains the default ntsd debugger extensions for
  7. IIS - W3SVC WAM_REQUEST
  8. Author:
  9. David Kaplan (DaveK) 6-Oct-1997
  10. Revision History:
  11. --*/
  12. #include "inetdbgp.h"
  13. # undef DBG_ASSERT
  14. /***********************************************************************
  15. * WAM_REQUEST functions
  16. **********************************************************************/
  17. VOID
  18. PrintWamRequestThunk( PVOID pccDebuggee,
  19. PVOID pccDebugger,
  20. CHAR verbosity,
  21. DWORD iCount);
  22. VOID
  23. PrintWamRequest( WAM_REQUEST * pwreqOriginal,
  24. WAM_REQUEST * pwreq,
  25. CHAR Verbosity );
  26. VOID
  27. PrintWamRequestThunk( PVOID pccDebuggee,
  28. PVOID pccDebugger,
  29. CHAR verbosity,
  30. DWORD iCount)
  31. {
  32. //
  33. // 'local' ==> inetdbg process
  34. // 'remote' ==> inetinfo process
  35. //
  36. DEFINE_CPP_VAR( HTTP_REQUEST, hreq ); // local HTTP_REQUEST
  37. DEFINE_CPP_VAR( WAM_REQUEST, wreq ); // local WAM_REQUEST
  38. HTTP_REQUEST * phreq; // remote HTTP_REQUEST ptr
  39. WAM_REQUEST * pwreq; // remote WAM_REQUEST ptr
  40. //
  41. // get local CLIENT_CONN ptr from caller
  42. //
  43. //
  44. CLIENT_CONN * pcc = (CLIENT_CONN *) pccDebugger;
  45. //
  46. // get remote HTTP_REQUEST ptr from CLIENT_CONN
  47. // and copy its contents into local HTTP_REQUEST
  48. //
  49. phreq = (HTTP_REQUEST *) pcc->_phttpReq;
  50. move( hreq, phreq);
  51. //
  52. // get remote WAM_REQUEST ptr from local HTTP_REQUEST
  53. //
  54. // if non-null, copy its contents into local WAM_REQUEST
  55. // and print it
  56. //
  57. pwreq = (WAM_REQUEST *) ( ((HTTP_REQUEST *) &hreq)->_pWamRequest );
  58. if ( pwreq != NULL) {
  59. move( wreq, pwreq);
  60. PrintWamRequest(
  61. pwreq
  62. , GET_CPP_VAR_PTR( WAM_REQUEST, wreq)
  63. , verbosity
  64. );
  65. }
  66. } // PrintWamRequestThunk()
  67. DECLARE_API( wreq )
  68. /*++
  69. Routine Description:
  70. This function is called as an NTSD extension to format and dump
  71. an object attributes structure.
  72. Arguments:
  73. hCurrentProcess - Supplies a handle to the current process (at the
  74. time the extension was called).
  75. hCurrentThread - Supplies a handle to the current thread (at the
  76. time the extension was called).
  77. CurrentPc - Supplies the current pc at the time the extension is
  78. called.
  79. lpExtensionApis - Supplies the address of the functions callable
  80. by this extension.
  81. lpArgumentString - Supplies the asciiz string that describes the
  82. ansi string to be dumped.
  83. Return Value:
  84. None.
  85. --*/
  86. {
  87. DEFINE_CPP_VAR( WAM_REQUEST, wreq );
  88. WAM_REQUEST * pwreq;
  89. INIT_API();
  90. while (*lpArgumentString == ' ')
  91. lpArgumentString++;
  92. if ( !*lpArgumentString )
  93. {
  94. PrintUsage( "wreq" );
  95. return;
  96. }
  97. if ( *lpArgumentString == '-' )
  98. {
  99. lpArgumentString++;
  100. if ( *lpArgumentString == 'h' )
  101. {
  102. PrintUsage( "wreq" );
  103. return;
  104. }
  105. if ( *lpArgumentString == 'l' ) {
  106. DumpClientConnList( lpArgumentString[1],
  107. PrintWamRequestThunk);
  108. return;
  109. }
  110. } // if
  111. //
  112. // Treat the argument as the address of an AtqContext
  113. //
  114. pwreq = (WAM_REQUEST * ) GetExpression( lpArgumentString );
  115. if ( !pwreq )
  116. {
  117. dprintf( "inetdbg.wreq: Unable to evaluate \"%s\"\n",
  118. lpArgumentString );
  119. return;
  120. }
  121. move( wreq, pwreq );
  122. PrintWamRequest( pwreq, GET_CPP_VAR_PTR( WAM_REQUEST, wreq), '2');
  123. return;
  124. } // DECLARE_API( hreq )
  125. VOID
  126. PrintWamRequest( WAM_REQUEST * pwreqOriginal,
  127. WAM_REQUEST * pwreq,
  128. CHAR Verbosity )
  129. /*++
  130. Description:
  131. This function takes the WAM_REQUEST object and prints out
  132. the details for the same in the debugger. The granularity of the
  133. deatils are controlled by the verbosity flag
  134. Arguments:
  135. pwreqOriginal - pointer to the location where the original WAM_REQUEST
  136. object is located.
  137. Note: pwreqOriginal points to object inside debuggee process
  138. pwreq - pointer to the WAM_REQUEST object that is a copy
  139. of the contents located at [pwreqOriginal]
  140. Note: pwreq points to object inside the debugger process
  141. Verbostiy - level of details requested.
  142. Returns:
  143. None
  144. --*/
  145. {
  146. if ( Verbosity >= '0') {
  147. //
  148. // print Brief information about the WAM_REQUEST
  149. //
  150. dprintf(
  151. "WAM_REQUEST: %p m_pHttpRequest = %p m_pExec = %p\n"
  152. "Ref count = %d m_dwRequestID = %d\n"
  153. , pwreqOriginal
  154. , pwreq->m_pHttpRequest
  155. , pwreq->m_pExec
  156. , pwreq->m_cRefs
  157. , pwreq->m_dwRequestID
  158. );
  159. }
  160. if ( Verbosity >= '1' ) {
  161. //
  162. // Print all details for the WAM_REQUEST object
  163. //
  164. // UNDONE add support for strings
  165. //
  166. dprintf(
  167. // "\t Path-translated = %s \n"
  168. // "\t ISA DLL path = %s \n"
  169. "\t m_pWamInfo = %p m_dwWamVersion = %08x\n"
  170. "\t m_pWamExecInfo = %p m_hFileTfi = %p\n"
  171. "\t m_fFinishWamRequest = %08x m_fWriteHeaders = %08x\n"
  172. "\t m_leOOP.Flink = %p m_leOOP.Blink = %p \n"
  173. // , pwreq->m_strPathTrans
  174. // , pwreq->m_strISADllPath
  175. , pwreq->m_pWamInfo
  176. , pwreq->m_dwWamVersion
  177. , pwreq->m_pWamExecInfo
  178. , pwreq->m_hFileTfi
  179. , pwreq->m_fFinishWamRequest
  180. , pwreq->m_fWriteHeaders
  181. , pwreq->m_leOOP.Flink
  182. , pwreq->m_leOOP.Blink
  183. );
  184. }
  185. if ( Verbosity >= '2' ) {
  186. //
  187. // UNDONE
  188. //
  189. }
  190. return;
  191. } // PrintWamRequest()
  192. /************* end of file ********************************************/