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
3.8 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. // retrive 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. BOOL IsDebug() const { return m_bDebug; }
  30. BOOL IsPatched() const { return m_bPatched; }
  31. BOOL IsPreRelease() const { return m_bPreRelease; }
  32. BOOL IsPrivateBuild() const { return m_bPrivateBuild; }
  33. BOOL IsSpecialBuild() const { return m_bSpecialBuild; }
  34. // retrieve info from StringFileInfo section of the version resource
  35. LPCTSTR strGetCompanyName() const { return strCompanyName.c_str(); }
  36. LPCTSTR strGetFileDescription() const { return strFileDescription.c_str(); }
  37. LPCTSTR strGetFileVersion() const { return strFileVersion.c_str(); }
  38. LPCTSTR strGetInternalName() const { return strInternalName.c_str(); }
  39. LPCTSTR strGetLegalCopyright() const { return strLegalCopyright.c_str(); }
  40. LPCTSTR strGetOriginalFilename() const { return strOriginalFilename.c_str();}
  41. LPCTSTR strGetProductName() const { return strProductName.c_str(); }
  42. LPCTSTR strGetProductVersion() const { return strProductVersion.c_str(); }
  43. LPCTSTR strGetComments() const { return strComments.c_str(); }
  44. LPCTSTR strGetLegalTrademarks() const { return strLegalTrademarks.c_str(); }
  45. LPCTSTR strGetPrivateBuild() const { return strPrivateBuild.c_str(); }
  46. LPCTSTR strGetSpecialBuild() const { return strSpecialBuild.c_str(); }
  47. private:
  48. HINSTANCE m_hInst;
  49. BOOL m_bInitializedOK;
  50. BOOL m_bDebug, m_bPatched, m_bPreRelease, m_bPrivateBuild, m_bSpecialBuild;
  51. TCHAR szFileVersion[24];
  52. TCHAR szProductVersion[24];
  53. TCHAR szFileFlags[64];
  54. tstring strCompanyName;
  55. tstring strFileDescription;
  56. tstring strFileVersion;
  57. tstring strInternalName;
  58. tstring strLegalCopyright;
  59. tstring strOriginalFilename;
  60. tstring strProductName;
  61. tstring strProductVersion;
  62. tstring strComments;
  63. tstring strLegalTrademarks;
  64. tstring strPrivateBuild;
  65. tstring strSpecialBuild;
  66. BOOL ParseFixedInfo(VS_FIXEDFILEINFO &info, UINT uLen);
  67. BOOL LoadStringFileInfo(LPVOID hMen);
  68. };
  69. #endif // __VERSION_H_