博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OSVERSIONINFOEX structure
阅读量:4977 次
发布时间:2019-06-12

本文共 7701 字,大约阅读时间需要 25 分钟。

OSVERSIONINFOEX structure
 

收藏:Contains operating system version information. The information includes major and minor version numbers, a build number, a platform identifier, and information about product suites and the latest Service Pack installed on the system. This structure is used with the  and  functions.

Syntax

typedef struct _OSVERSIONINFOEX {  DWORD dwOSVersionInfoSize;  DWORD dwMajorVersion;  DWORD dwMinorVersion;  DWORD dwBuildNumber;  DWORD dwPlatformId;  TCHAR szCSDVersion[128];  WORD  wServicePackMajor;  WORD  wServicePackMinor;  WORD  wSuiteMask;  BYTE  wProductType;  BYTE  wReserved;} OSVERSIONINFOEX, *POSVERSIONINFOEX, *LPOSVERSIONINFOEX;

Members

dwOSVersionInfoSize

The size of this data structure, in bytes. Set this member to sizeof(OSVERSIONINFOEX).

dwMajorVersion

The major version number of the operating system. For more information, see Remarks.

dwMinorVersion

The minor version number of the operating system. For more information, see Remarks.

dwBuildNumber

The build number of the operating system.

dwPlatformId

The operating system platform. This member can be VER_PLATFORM_WIN32_NT (2).

szCSDVersion

A null-terminated string, such as "Service Pack 3", that indicates the latest Service Pack installed on the system. If no Service Pack has been installed, the string is empty.

wServicePackMajor

The major version number of the latest Service Pack installed on the system. For example, for Service Pack 3, the major version number is 3. If no Service Pack has been installed, the value is zero.

wServicePackMinor

The minor version number of the latest Service Pack installed on the system. For example, for Service Pack 3, the minor version number is 0.

wSuiteMask

A bit mask that identifies the product suites available on the system. This member can be a combination of the following values.

Value Meaning
VER_SUITE_BACKOFFICE 0x00000004

Microsoft BackOffice components are installed.

VER_SUITE_BLADE 0x00000400

Windows Server 2003, Web Edition is installed.

VER_SUITE_COMPUTE_SERVER 0x00004000

Windows Server 2003, Compute Cluster Edition is installed.

VER_SUITE_DATACENTER 0x00000080

Windows Server 2008 Datacenter, Windows Server 2003, Datacenter Edition, or Windows 2000 Datacenter Server is installed.

VER_SUITE_ENTERPRISE 0x00000002

Windows Server 2008 Enterprise, Windows Server 2003, Enterprise Edition, or Windows 2000 Advanced Server is installed. Refer to the Remarks section for more information about this bit flag.

VER_SUITE_EMBEDDEDNT 0x00000040

Windows XP Embedded is installed.

VER_SUITE_PERSONAL 0x00000200

Windows Vista Home Premium, Windows Vista Home Basic, or Windows XP Home Edition is installed.

VER_SUITE_SINGLEUSERTS 0x00000100

Remote Desktop is supported, but only one interactive session is supported. This value is set unless the system is running in application server mode.

VER_SUITE_SMALLBUSINESS 0x00000001

Microsoft Small Business Server was once installed on the system, but may have been upgraded to another version of Windows. Refer to the Remarks section for more information about this bit flag.

VER_SUITE_SMALLBUSINESS_RESTRICTED 0x00000020

Microsoft Small Business Server is installed with the restrictive client license in force. Refer to the Remarks section for more information about this bit flag.

VER_SUITE_STORAGE_SERVER 0x00002000

Windows Storage Server 2003 R2 or Windows Storage Server 2003is installed.

VER_SUITE_TERMINAL 0x00000010

Terminal Services is installed. This value is always set.

If VER_SUITE_TERMINAL is set but VER_SUITE_SINGLEUSERTS is not set, the system is running in application server mode.

VER_SUITE_WH_SERVER 0x00008000

Windows Home Server is installed.

 

wProductType

Any additional information about the system. This member can be one of the following values.

Value Meaning
VER_NT_DOMAIN_CONTROLLER 0x0000002

The system is a domain controller and the operating system is Windows Server 2012 , Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, or Windows 2000 Server.

VER_NT_SERVER 0x0000003

The operating system is Windows Server 2012, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, or Windows 2000 Server.

Note that a server that is also a domain controller is reported as VER_NT_DOMAIN_CONTROLLER, not VER_NT_SERVER.

VER_NT_WORKSTATION 0x0000001

The operating system is Windows 8, Windows 7, Windows Vista, Windows XP Professional, Windows XP Home Edition, or Windows 2000 Professional.

 

wReserved

Reserved for future use.

Remarks

Relying on version information is not the best way to test for a feature. Instead, refer to the documentation for the feature of interest. For more information on common techniques for feature detection, see .

If you must require a particular operating system, be sure to use it as a minimum supported version, rather than design the test for the one operating system. This way, your detection code will continue to work on future versions of Windows.

The following table summarizes the values returned by supported versions of Windows. Use the information in the Other column to distinguish between operating systems with identical version numbers.

Operating system Version number dwMajorVersion dwMinorVersion Other
Windows 8 6.2 6 2 OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
Windows Server 2012 6.2 6 2 OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
Windows 7 6.1 6 1 OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
Windows Server 2008 R2 6.1 6 1 OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
Windows Server 2008 6.0 6 0 OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
Windows Vista 6.0 6 0 OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
Windows Server 2003 R2 5.2 5 2 GetSystemMetrics(SM_SERVERR2) != 0
Windows Home Server 5.2 5 2 OSVERSIONINFOEX.wSuiteMask & VER_SUITE_WH_SERVER
Windows Server 2003 5.2 5 2 GetSystemMetrics(SM_SERVERR2) == 0
Windows XP Professional x64 Edition 5.2 5 2 (OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION) && (SYSTEM_INFO.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64)
Windows XP 5.1 5 1 Not applicable
Windows 2000 5.0 5 0 Not applicable

 

You should not rely upon only the VER_SUITE_SMALLBUSINESS flag to determine whether Small Business Server has been installed on the system, as both this flag and the VER_SUITE_SMALLBUSINESS_RESTRICTED flag are set when this product suite is installed. If you upgrade this installation to Windows Server, Standard Edition, theVER_SUITE_SMALLBUSINESS_RESTRICTED flag will be cleared—however, the VER_SUITE_SMALLBUSINESS flag will remain set. In this case, this indicates that Small Business Server was once installed on this system. If this installation is further upgraded to Windows Server, Enterprise Edition, the VER_SUITE_SMALLBUSINESS flag will remain set.

If compatibility mode is in effect, the OSVERSIONINFOEX structure contains information about the operating system that is selected for .

To determine whether a Win32-based application is running on WOW64, call the  function. To determine whether the system is running a 64-bit version of Windows, call the  function.

The  function provides the following additional information about the current operating system.

Product Setting
Windows Server 2003 R2 SM_SERVERR2
Windows XP Media Center Edition SM_MEDIACENTER
Windows XP Starter Edition SM_STARTER
Windows XP Tablet PC Edition SM_TABLETPC

 

Examples

For an example, see .

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winnt.h (include Windows.h)

Unicode and ANSI names

OSVERSIONINFOEXW (Unicode) and OSVERSIONINFOEXA (ANSI)

See also

 

转载于:https://www.cnblogs.com/lzlsky/archive/2012/11/13/2768379.html

你可能感兴趣的文章
添加日期选择控件
查看>>
bzoj4765: 普通计算姬 (分块 && BIT)
查看>>
看完漫画秒懂区块链
查看>>
Oracle命令类别
查看>>
stc12c5a60s2驱动TEA5767收音机模块硬件调试总结
查看>>
vue中提示$index is not defined
查看>>
css选择器
查看>>
ASP.NET上传下载文件
查看>>
Galaxy Nexus 全屏显示-隐藏Navigation Bar
查看>>
Spring中使用Velocity模板
查看>>
上周热点回顾(8.18-8.24)
查看>>
Feature toggle
查看>>
day02
查看>>
gvim 配置Pydiction
查看>>
Linux安装指定mysql版本
查看>>
分布式锁的三种实现方式
查看>>
poj 2109 pow函数也能这么用?p的开n次方
查看>>
Oracle database link
查看>>
python调用shell小技巧
查看>>
TL431的几种常用用法
查看>>