Team Fortress 2 Source Code as on 22/4/2020
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.

62 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. #include <windows.h>
  3. #include "tier1/strtools.h"
  4. #include <conio.h>
  5. #include "utlvector.h"
  6. #include <Dbghelp.h>
  7. #include "vgui_controls/ListPanel.h"
  8. #include "KeyValues.h"
  9. enum moduleType
  10. {
  11. GOOD,
  12. BAD,
  13. UNKNOWN
  14. };
  15. struct version
  16. {
  17. int v1, v2, v3, v4;
  18. bool operator == (version version2){ return v1==version2.v1 && v2==version2.v2 && v3==version2.v3 && v4==version2.v4; }
  19. };
  20. struct module
  21. {
  22. int key;
  23. char name[1024];
  24. moduleType myType;
  25. version versionInfo;
  26. bool knownVersion;
  27. };
  28. class CMiniDumpObject
  29. {
  30. public:
  31. //CMiniDumpObject( char *pszFilename, char *pszKnownFilename );
  32. CMiniDumpObject( const char *pszFilename, CUtlVector<module> *pKnownModuleList );
  33. CMiniDumpObject( HANDLE pMiniDumpHandle, CUtlVector<module> *pKnownModuleList );
  34. void AddToBadList( MINIDUMP_MODULE module );
  35. void AddToGoodList( MINIDUMP_MODULE module );
  36. void AddToUnknownList( MINIDUMP_MODULE module );
  37. void PopulateListPanel( vgui::ListPanel *pTokenList, bool bCumulative );
  38. inline const char *GetName()
  39. {
  40. return m_pszMiniDumpFileName;
  41. }
  42. private:
  43. void Init( HANDLE pFileMap, CUtlVector<module> *pKnownModuleList );
  44. void InitFromFilename( const char *pszFilename, CUtlVector<module> *pKnownModuleList );
  45. void InitFromHandle( HANDLE pMiniDumpHandle, CUtlVector<module> *pKnownModuleList );
  46. int ModuleListToListPanel( vgui::ListPanel *pTokenList, CUtlVector<module> *pModuleList, bool bCumulative, int startingModule);
  47. void GetVersionString( char *pszOutput, version *pVersionInfo );
  48. version GetVersionStruct( VS_FIXEDFILEINFO *pVersionInfo );
  49. void LoadKnownModules();
  50. CUtlVector<module> m_goodModuleList;
  51. CUtlVector<module> m_badModuleList;
  52. CUtlVector<module> m_unknownModuleList;
  53. CUtlVector<module> m_badChecksumList;
  54. char m_pszMiniDumpFileName[1024];
  55. };