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.

97 lines
4.9 KiB

  1. /*======================================================================================//
  2. | //
  3. |Copyright (c) 1998 Sequent Computer Systems, Incorporated. All rights reserved. //
  4. | //
  5. |File Name: version.h //
  6. | //
  7. |Description: //
  8. | //
  9. |Created: Paul Skoglund 09-1998 //
  10. | //
  11. |Rev History: //
  12. | //
  13. |=======================================================================================*/
  14. #ifndef __VERSION_H_
  15. #define __VERSION_H_
  16. #pragma warning(push)
  17. #include <string>
  18. #pragma warning(pop)
  19. using std::basic_string;
  20. typedef basic_string<TCHAR> tstring;
  21. class CVersion {
  22. public:
  23. CVersion(HINSTANCE hInst);
  24. ~CVersion() { }
  25. // retrieve info from the fixed section of the version resource
  26. LPCTSTR GetFileVersion() const { return szFileVersion; }
  27. LPCTSTR GetProductVersion() const { return szProductVersion; }
  28. LPCTSTR GetFileFlags() const { return szFileFlags; }
  29. UINT32 GetFixedSignature() const { return m_fixed_info.dwSignature; }
  30. UINT32 GetFixedFileVersionMS() const { return m_fixed_info.dwFileVersionMS; }
  31. UINT32 GetFixedFileVersionLS() const { return m_fixed_info.dwFileVersionLS; }
  32. UINT32 GetFixedProductVersionMS() const { return m_fixed_info.dwProductVersionMS; }
  33. UINT32 GetFixedProductVersionLS() const { return m_fixed_info.dwProductVersionLS; }
  34. UINT32 GetFixedFileFlags() const { return m_fixed_info.dwFileFlags; }
  35. UINT32 GetFixedFileOS() const { return m_fixed_info.dwFileOS; }
  36. UINT32 GetFixedFileType() const { return m_fixed_info.dwFileType; }
  37. UINT32 GetFixedFileSubtype() const { return m_fixed_info.dwFileSubtype; }
  38. UINT32 GetFixedFileDateMS() const { return m_fixed_info.dwFileDateMS; }
  39. UINT32 GetFixedFileDateLS() const { return m_fixed_info.dwFileDateLS; }
  40. BOOL IsDebug() const { return m_bDebug; }
  41. BOOL IsPatched() const { return m_bPatched; }
  42. BOOL IsPreRelease() const { return m_bPreRelease; }
  43. BOOL IsPrivateBuild() const { return m_bPrivateBuild; }
  44. BOOL IsSpecialBuild() const { return m_bSpecialBuild; }
  45. // retrieve info from StringFileInfo section of the version resource
  46. LPCTSTR strGetCompanyName() const { return strCompanyName.c_str(); }
  47. LPCTSTR strGetFileDescription() const { return strFileDescription.c_str(); }
  48. LPCTSTR strGetFileVersion() const { return strFileVersion.c_str(); }
  49. LPCTSTR strGetInternalName() const { return strInternalName.c_str(); }
  50. LPCTSTR strGetLegalCopyright() const { return strLegalCopyright.c_str(); }
  51. LPCTSTR strGetOriginalFilename() const { return strOriginalFilename.c_str();}
  52. LPCTSTR strGetProductName() const { return strProductName.c_str(); }
  53. LPCTSTR strGetProductVersion() const { return strProductVersion.c_str(); }
  54. LPCTSTR strGetComments() const { return strComments.c_str(); }
  55. LPCTSTR strGetLegalTrademarks() const { return strLegalTrademarks.c_str(); }
  56. LPCTSTR strGetPrivateBuild() const { return strPrivateBuild.c_str(); }
  57. LPCTSTR strGetSpecialBuild() const { return strSpecialBuild.c_str(); }
  58. private:
  59. HINSTANCE m_hInst;
  60. BOOL m_bInitializedOK;
  61. BOOL m_bDebug, m_bPatched, m_bPreRelease, m_bPrivateBuild, m_bSpecialBuild;
  62. VS_FIXEDFILEINFO m_fixed_info;
  63. UINT m_fixedLen;
  64. TCHAR szFileVersion[24];
  65. TCHAR szProductVersion[24];
  66. TCHAR szFileFlags[64];
  67. tstring strCompanyName;
  68. tstring strFileDescription;
  69. tstring strFileVersion;
  70. tstring strInternalName;
  71. tstring strLegalCopyright;
  72. tstring strOriginalFilename;
  73. tstring strProductName;
  74. tstring strProductVersion;
  75. tstring strComments;
  76. tstring strLegalTrademarks;
  77. tstring strPrivateBuild;
  78. tstring strSpecialBuild;
  79. BOOL ParseFixedInfo( void );
  80. BOOL LoadStringFileInfo(LPVOID hMen);
  81. };
  82. #endif // __VERSION_H_