user-0 提问: GetVersion返回的一串数字应该如何解读？

回复:
user: user-1
content: Platform SDK: Windows System Information  GetVersion The GetVersion function returns the current version number of the operating system.   Note  This function has been superseded by GetVersionEx. New applications should use GetVersionEx or VerifyVersionInfo.   DWORD GetVersion(VOID); Parameters This function has no parameters.   Return Values If the function succeeds, the return value is a DWORD value that contains the major and minor version numbers of the operating system in the low order word, and information about the operating system platform in the high order word.   For all platforms, the low order word contains the version number of the operating system. The low-order byte of this word specifies the major version number, in hexadecimal notation. The high-order byte specifies the minor version (revision) number, in hexadecimal notation.   To distinguish between operating system platforms, use the high order bit and the low order byte, as shown in the following table:  Platform High-order bit Next 7 bits Low-order byte  Windows NT 3.51 0 Build number 3  Windows NT 4.0 0 Build number 4  Windows 2000 or Windows XP 0 Build number 5  Windows 95, Windows 98, or Windows Me 1  Reserved 4  Win32s with Windows 3.1 1 Build number 3    Remarks The GetVersionEx function was developed because many existing applications err when examining the packed DWORD value returned by GetVersion, transposing the major and minor version numbers. GetVersionEx forces applications to explicitly examine each element of version information. VerifyVersionInfo eliminates further potential for error by comparing the required system version with the current system version for you.   The following code fragment illustrates how to extract information from the GetVersion return value:  dwVersion = GetVersion();   // Get the Windows version.  dwWindowsMajorVersion =  (DWORD)(LOBYTE(LOWORD(dwVersion))); dwWindowsMinorVersion =  (DWORD)(HIBYTE(LOWORD(dwVersion)));  // Get the build number.  if (dwVersion < 0x80000000)              // Windows NT/2000/XP     dwBuild = (DWORD)(HIWORD(dwVersion)); else if (dwWindowsMajorVersion < 4)      // Win32s     dwBuild = (DWORD)(HIWORD(dwVersion) & ~0x8000); else                                     // Windows 95/98/Me     dwBuild =  0; Requirements    Windows NT/2000/XP: Included in Windows NT 3.1 and later.   Windows 95/98/Me: Included in Windows 95 and later.   Header: Declared in Winbase.h; include Windows.h.   Library: Use Kernel32.lib.   Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP.  See Also System Information Overview, System Information Functions, GetVersionEx, VerifyVersionInfo   Platform SDK Release: August 2001  What did you think of this topic? Let us know.  Order a Platform SDK CD Online (U.S/Canada)   (International)      Requirements    Windows NT/2000/XP: Included in Windows NT 3.1 and later.   Windows 95/98/Me: Included in Windows 95 and later.   Header: Declared in Winbase.h; include Windows.h.   Library: Use Kernel32.lib.   Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP. See Also System Information Overview, System Information Functions, GetVersionEx, VerifyVersionInfo

user: user-2
content: 他的返回值包含了主次版本等信息：  https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx  If the function succeeds, the return value includes the major and minor version numbers of the operating system in the low-order word, and information about the operating system platform in the high-order word.  可以参看上面的例子

user: user-3
content: 分开高16字节和低16字节； 返回值的低字部分（低16位）是操作系统的主次版本号，高字部分（高16位）保存着操作系统平台的信息。