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.

84 lines
2.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 2000
  6. //
  7. // File: processinfo.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // ProcessInfo.h: interface for the CProcessInfo class.
  11. //
  12. //////////////////////////////////////////////////////////////////////
  13. #if !defined(AFX_PROCESSINFO_H__213C3A76_9FBB_11D2_83A7_000000000000__INCLUDED_)
  14. #define AFX_PROCESSINFO_H__213C3A76_9FBB_11D2_83A7_000000000000__INCLUDED_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif // _MSC_VER > 1000
  18. #ifndef NO_STRICT
  19. #ifndef STRICT
  20. #define STRICT 1
  21. #endif
  22. #endif /* NO_STRICT */
  23. #include <WINDOWS.H>
  24. #include <TCHAR.H>
  25. #include "globals.h"
  26. // Forward declarations
  27. class CProcesses;
  28. class CModuleInfo;
  29. class CModuleInfoNode;
  30. class CModuleInfoCache;
  31. class CFileData;
  32. class CDmpFile;
  33. class CProcessInfo
  34. {
  35. public:
  36. bool GetProcessData();
  37. // bool EnumerateModulesFromUserDmpFile();
  38. CProcessInfo();
  39. virtual ~CProcessInfo();
  40. bool Initialize(CModuleInfoCache *lpModuleInfoCache, CFileData * lpInputFile, CFileData * lpOutputFile, CDmpFile * lpDmpFile);
  41. LPTSTR GetProcessName();
  42. bool EnumerateModules(DWORD iProcessID, CProcesses * lpProcesses, LPTSTR tszProcessName);
  43. bool OutputProcessData(CollectionTypes enumCollectionType, bool fCSVFileContext, bool fDumpHeader = true);
  44. bool SetProcessName(LPTSTR tszFileName);
  45. bool AddNewModuleInfoObject(CModuleInfo * lpModuleInfo);
  46. protected:
  47. bool GetProcessDataFromFile();
  48. // Process Info Objects Required
  49. CFileData * m_lpInputFile;
  50. CFileData * m_lpOutputFile;
  51. CDmpFile * m_lpDmpFile;
  52. CModuleInfoNode * m_lpModuleInfoHead;
  53. CModuleInfoCache * m_lpModuleInfoCache;
  54. // Process Info Data
  55. LPTSTR m_tszProcessName;
  56. HANDLE m_hModuleInfoHeadMutex;
  57. DWORD m_iProcessID;
  58. long m_iNumberOfModules;
  59. bool m_fInitialized;
  60. // Process Info Methods
  61. bool EnumerateModulesFromFile(DWORD iProcessID, LPTSTR tszProcessName);
  62. bool EnumerateModulesForRunningProcessUsingPSAPI(DWORD iProcessID);
  63. bool EnumerateModulesForRunningProcessUsingTOOLHELP32(DWORD iProcessID, LPTSTR tszProcessName);
  64. bool fIsProcessName(LPTSTR tszFileName);
  65. bool fModuleNameMatches(LPTSTR tszProcessName, LPTSTR tszModulePath);
  66. bool OutputProcessDataToStdout(CollectionTypes enumCollectionType, bool fCSVFileContext, bool fDumpHeader);
  67. bool OutputProcessDataToFile(CollectionTypes enumCollectionType, bool fDumpHeader);
  68. };
  69. #endif // !defined(AFX_PROCESSINFO_H__213C3A76_9FBB_11D2_83A7_000000000000__INCLUDED_)