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.

67 lines
1.5 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // File: cversion.h
  4. //
  5. // Module: CMSETUP.LIB
  6. //
  7. // Synopsis: Definition of CVersion, a utility class that wraps up the
  8. // functionality of detecting the version of a given module.
  9. //
  10. // Copyright (c) 1998-1999 Microsoft Corporation
  11. //
  12. // Author: quintinb Created 09/14/98
  13. //
  14. //+----------------------------------------------------------------------------
  15. #ifndef __CVERSION_H
  16. #define __CVERSION_H
  17. #include <windows.h>
  18. #include <tchar.h>
  19. const int c_iShiftAmount = ((sizeof(DWORD)/2) * 8);
  20. class CVersion
  21. {
  22. public: // Public Methods
  23. CVersion(LPTSTR szFile);
  24. CVersion();
  25. ~CVersion();
  26. BOOL IsPresent();
  27. BOOL GetBuildNumberString(LPTSTR szStr);
  28. BOOL GetVersionString(LPTSTR szStr);
  29. BOOL GetFilePath(LPTSTR szStr);
  30. DWORD GetVersionNumber(); // return Major Version in Hiword, Minor in Loword
  31. DWORD GetBuildAndQfeNumber(); // return Build number in Hiword, QFE in Loword
  32. DWORD GetMajorVersionNumber();
  33. DWORD GetMinorVersionNumber();
  34. DWORD GetBuildNumber();
  35. DWORD GetQfeNumber();
  36. DWORD GetLCID();
  37. protected:
  38. //
  39. // Protected Methods
  40. //
  41. void Init();
  42. //
  43. // Member Variables
  44. //
  45. TCHAR m_szPath[MAX_PATH+1];
  46. DWORD m_dwVersion;
  47. DWORD m_dwBuild;
  48. DWORD m_dwLCID;
  49. BOOL m_bIsPresent;
  50. };
  51. //
  52. // This function doesn't belong to this class but makes the GetLCID function more useful, thus
  53. // I have included it here.
  54. //
  55. BOOL ArePrimaryLangIDsEqual(DWORD dwLCID1, DWORD dwLCID2);
  56. #endif // __CVERSION_H