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.

159 lines
3.6 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. processdetails.h
  5. Abstract:
  6. This class deals with all the things associated with
  7. a process in the w3wplist utility
  8. Author:
  9. Hamid Mahmood (t-hamidm) 08-13-2001
  10. Revision History:
  11. --*/
  12. #ifndef _process_details_h
  13. #define _process_details_h
  14. //
  15. // exe name to match
  16. //
  17. #define EXE_NAME L"w3wp.exe"
  18. //
  19. // inetinfo name
  20. //
  21. #define INETINFO_NAME L"inetinfo.exe"
  22. #define PROCESS_DETAILS_SIGNATURE CREATE_SIGNATURE( 'PRDT')
  23. #define PROCESS_DETAILS_SIGNATURE_FREE CREATE_SIGNATURE( 'PRDx')
  24. //
  25. // offset of command line parameter from the
  26. // beginning of RTL_USER_PROCESS_PARAMETERS struct.
  27. //
  28. #define CMD_LINE_OFFSET FIELD_OFFSET(RTL_USER_PROCESS_PARAMETERS, CommandLine)
  29. #define ENVIRONMENT_LINE_OFFSET FIELD_OFFSET(RTL_USER_PROCESS_PARAMETERS, Environment)
  30. class ProcessDetails
  31. {
  32. public:
  33. VOID Init( IN DWORD dwPID,
  34. IN CHAR chVerbosity,
  35. IN BOOL bIsListMode
  36. );
  37. VOID Terminate();
  38. HRESULT GetProcessDetails( IN WCHAR* pszInputAppPoolId );
  39. VOID DumpRequests ();
  40. ProcessDetails();
  41. ~ProcessDetails();
  42. private:
  43. HRESULT ReadPEB(IN HANDLE hProcess );
  44. HRESULT GetModuleInfo( IN HANDLE hProcess );
  45. HRESULT GetAppPoolID( IN HANDLE hProcess);
  46. HRESULT ParseAppPoolID( IN WCHAR* pszCmdLine);
  47. HRESULT ReadEnvironmentVar( IN HANDLE hProcess );
  48. HRESULT DebugProcess ( IN HANDLE hProcess );
  49. HRESULT TraverseList( IN HANDLE hProcess );
  50. //
  51. // Signature
  52. //
  53. DWORD m_dwSignature;
  54. //
  55. // process id
  56. //
  57. DWORD m_dwPID;
  58. //
  59. // string that holds the app pool id
  60. //
  61. WCHAR* m_pszAppPoolId;
  62. //
  63. // Whether it is list mode or not
  64. //
  65. BOOL m_fListMode;
  66. //
  67. // pointer to the process parameters for the current worker process
  68. //
  69. RTL_USER_PROCESS_PARAMETERS* m_pProcessParameters;
  70. //
  71. // struct that stores the info of the worker process
  72. //
  73. W3WPLIST_INFO m_w3wpListInfoStruct;
  74. //
  75. // head node of the link list that contains the http requests
  76. // read in from the worker process
  77. //
  78. LIST_ENTRY m_localRequestListHead;
  79. //
  80. // head of the link list in the worker process.
  81. //
  82. LIST_ENTRY m_remoteListHead;
  83. //
  84. // requests served by the worker process
  85. //
  86. DWORD m_dwRequestsServed;
  87. //
  88. // verbosity level
  89. //
  90. CHAR m_chVerbosity;
  91. //
  92. // error code
  93. //
  94. DWORD m_dwErrorCode;
  95. //
  96. // flag that tells whether the current process
  97. // is the inetinfo.exe
  98. //
  99. BOOL m_fIsInetinfo;
  100. //
  101. // set if we're in old mode. This is used by threads
  102. // to exit themselves when fIsOldMode is set.
  103. // The setting thread will get all the info
  104. // from the inetinfo process.
  105. //
  106. static BOOL sm_fIsOldMode;
  107. };
  108. #endif