网站首页  词典首页

请输入您要查询的函数:

 

术语 getproductinfo
释义 GetProductInfo
语法:
C++
BOOL WINAPI GetProductInfo(
__in DWORD dwOSMajorVersion,
__in DWORD dwOSMinorVersion,
__in DWORD dwSpMajorVersion,
__in DWORD dwSpMinorVersion,
__out PDWORD pdwReturnedProductType
);
GetProductInfo功能
为获取本地计算机上的操作系统产品类型,映射类型的产品由指定的操作系统支持的类型。
要检索产品的Windows版本类型信息之前,最低支持的操作系统的需求一节中列出,请使用GetVersionEx函数。您也可以使用该Win32_OperatingSystem WMI类OperatingSystemSKU财产。
参数
dwOSMajorVersion [in]
该操作系统的主版本号。最低值为6。
该dwOSMajorVersion,dwOSMinorVersion,dwSpMajorVersion结合,dwSpMinorVersion参数描述了应用程序的最大目标操作系统版本。例如,Windows Vista和Windows Server 2008的那些版本6.0.0.0和Windows 7和Windows服务器2008 R2的版本6.1.0.0。
dwOSMinorVersion [in]
该操作系统的次要版本号。最低值为0。
dwSpMajorVersion [in]
该操作系统的Service Pack的主版本号。最低值为0。
dwSpMinorVersion [in]
该操作系统的服务包次要版本号。最低值为0。
pdwReturnedProductType [out]
该产品类型。这个参数不能为NULL。如果指定的操作系统是比当前操作系统较少,这些信息被映射到所指定的操作系统支持的类型。如果指定的操作系统是比最高支持的操作系统更大,这些信息被映射到由当前操作系统支持的类型。
如果产品没有被激活,并不再在宽限期,这个参数设置为PRODUCT_UNLICENSED(0xABCDABCD)。否则,这个参数可以是下列值之一。
ValueMeaning
PRODUCT_BUSINESS
0x00000006Business
PRODUCT_BUSINESS_N
0x00000010Business ?
PRODUCT_CLUSTER_SERVER
0x00000012HPC版
PRODUCT_DATACENTER_SERVER
0x00000008Server数据中心(完全安装)
PRODUCT_DATACENTER_SERVER_CORE
0x0000000CServer数据中心(核心安装)
PRODUCT_DATACENTER_SERVER_CORE_V
0x00000027Server数据中心不超- V(核心安装)
PRODUCT_DATACENTER_SERVER_V
0x00000025Server数据中心不超- V(完全安装)
PRODUCT_ENTERPRISE
0x00000004Enterprise
PRODUCT_ENTERPRISE_E
0x00000046Enterprise首页
PRODUCT_ENTERPRISE_N
0x0000001BEnterprise ?
PRODUCT_ENTERPRISE_SERVER
0x0000000AServer企业(完全安装)
PRODUCT_ENTERPRISE_SERVER_CORE
0x0000000EServer企业(核心安装)
PRODUCT_ENTERPRISE_SERVER_CORE_V
0x00000029Server企业不超- V(核心安装)
PRODUCT_ENTERPRISE_SERVER_IA64
0x0000000FServer企业用于基于Itanium的系统
PRODUCT_ENTERPRISE_SERVER_V
0x00000026Server企业不超- V(完全安装)
PRODUCT_HOME_BASIC
0x00000002Home基本
PRODUCT_HOME_BASIC_E
0x00000043Home基本电子
PRODUCT_HOME_BASIC_N
0x00000005Home基本?
PRODUCT_HOME_PREMIUM
0x00000003Home高级
PRODUCT_HOME_PREMIUM_E
0x00000044Home高级首页
PRODUCT_HOME_PREMIUM_N
0x0000001AHome高级?
PRODUCT_HYPERV
0x0000002AMicrosoft Hyper - V服务器
PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT
0x0000001EWindows基础商务服务器管理服务器
PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING
0x00000020Windows基本Business Server的消息服务器
PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY
0x0000001FWindows基础商务服务器安全服务器
PRODUCT_PROFESSIONAL
0x00000030Professional
PRODUCT_PROFESSIONAL_E
0x00000045Professional首页
PRODUCT_PROFESSIONAL_N
0x00000031Professional ?
PRODUCT_SERVER_FOR_SMALLBUSINESS
0x00000018Windows服务器2008的Windows Essential Server解决方案
PRODUCT_SERVER_FOR_SMALLBUSINESS_V
Server 2008中没有超0x00000023Windows为的Windows Essential Server解决方案V
PRODUCT_SERVER_FOUNDATION
0x00000021Server基金会
PRODUCT_SMALLBUSINESS_SERVER
0x00000009Windows的Small Business Server
PRODUCT_STANDARD_SERVER
0x00000007Server标准(完全安装)
PRODUCT_STANDARD_SERVER_CORE
0x0000000DServer标准(核心安装)
PRODUCT_STANDARD_SERVER_CORE_V
0x00000028Server标准不超- V(核心安装)
PRODUCT_STANDARD_SERVER_V
0x00000024Server标准不超- V(完全安装)
PRODUCT_STARTER
0x0000000BStarter
PRODUCT_STARTER_E
0x00000042Starter首页
PRODUCT_STARTER_N
0x0000002FStarter ?
PRODUCT_STORAGE_ENTERPRISE_SERVER
0x00000017Storage服务器企业
PRODUCT_STORAGE_EXPRESS_SERVER
0x00000014Storage Server Express的
PRODUCT_STORAGE_STANDARD_SERVER
0x00000015Storage服务器标准
PRODUCT_STORAGE_WORKGROUP_SERVER
0x00000016Storage服务器工作组
PRODUCT_UNDEFINED
0x00000000An不知名的产品
PRODUCT_ULTIMATE
0x00000001Ultimate
PRODUCT_ULTIMATE_E
0x00000047Ultimate首页
PRODUCT_ULTIMATE_N
0x0000001CUltimate ?
PRODUCT_WEB_SERVER
0x00000011Web服务器(完全安装)
PRODUCT_WEB_SERVER_CORE
0x0000001DWeb服务器(核心安装)
返回值
如果函数成功,返回值是一个非零值。如果该软件的授权是无效或过期,函数成功,但pdwReturnedProductType参数设置为PRODUCT_UNLICENSED。
如果函数失败,返回值是零。这个函数失败如果输入的参数之一是无效的。
备注
为了检测是否服务器角色或功能部件的安装,使用服务器功能WMI提供程序。
Windows的后续版本将地图的产品种类它支持对每个支持的Windows版本6.0.0.0回到以前的版本支持的产品类型设置。因此,应用程序,并为这些值中的任何一个平等的测试将继续努力,将来的版本,甚至当新产品类型增加。
下表列出的产品类型,在6.1.0.0介绍,以及他们将映射到如果GetProductInfo与上一版本6.1.0.0系统6.0.0.0要求。
新产生的6.1.0.0Value与6.0.0.0
PRODUCT_ENTERPRISE_EPRODUCT_ENTERPRISE
PRODUCT_HOME_BASIC_EPRODUCT_HOME_BASIC
PRODUCT_HOME_PREMIUM_EPRODUCT_HOME_PREMIUM
PRODUCT_PROFESSIONALPRODUCT_BUSINESS
PRODUCT_PROFESSIONAL_EPRODUCT_BUSINESS
PRODUCT_PROFESSIONAL_NPRODUCT_BUSINESS_N
PRODUCT_STARTER_EPRODUCT_STARTER
PRODUCT_STARTER_NPRODUCT_STARTER
PRODUCT_ULTIMATE_EPRODUCT_ULTIMATE
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0600或更高版本。有关详细信息,请参阅使用Windows头。
实例
有关示例,请参阅使用的系统版本。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
系统信息功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetProductInfo Function
Retrieves the product type for the operating system on the local computer, and maps the type to the product types supported by the specified operating system.
To retrieve product type information on versions of Windows prior to the minimum supported operating systems listed in the Requirements section, use the GetVersionEx function. You can also use the OperatingSystemSKU property of the Win32_OperatingSystem WMI class.
Syntax
C++
BOOL WINAPI GetProductInfo(
__in DWORD dwOSMajorVersion,
__in DWORD dwOSMinorVersion,
__in DWORD dwSpMajorVersion,
__in DWORD dwSpMinorVersion,
__out PDWORD pdwReturnedProductType
);
Parameters
dwOSMajorVersion [in]
The major version number of the operating system. The minimum value is 6.
The combination of the dwOSMajorVersion, dwOSMinorVersion, dwSpMajorVersion, and dwSpMinorVersion parameters describes the maximum target operating system version for the application. For example, Windows Vista and Windows Server 2008 are version 6.0.0.0 and Windows 7 and Windows Server 2008 R2 are version 6.1.0.0.
dwOSMinorVersion [in]
The minor version number of the operating system. The minimum value is 0.
dwSpMajorVersion [in]
The major version number of the operating system service pack. The minimum value is 0.
dwSpMinorVersion [in]
The minor version number of the operating system service pack. The minimum value is 0.
pdwReturnedProductType [out]
The product type. This parameter cannot be NULL. If the specified operating system is less than the current operating system, this information is mapped to the types supported by the specified operating system. If the specified operating system is greater than the highest supported operating system, this information is mapped to the types supported by the current operating system.
If the product has not been activated and is no longer in the grace period, this parameter is set to PRODUCT_UNLICENSED (0xABCDABCD). Otherwise, this parameter can be one of the following values.
ValueMeaning
PRODUCT_BUSINESS
0x00000006Business
PRODUCT_BUSINESS_N
0x00000010Business N
PRODUCT_CLUSTER_SERVER
0x00000012HPC Edition
PRODUCT_DATACENTER_SERVER
0x00000008Server Datacenter (full installation)
PRODUCT_DATACENTER_SERVER_CORE
0x0000000CServer Datacenter (core installation)
PRODUCT_DATACENTER_SERVER_CORE_V
0x00000027Server Datacenter without Hyper-V (core installation)
PRODUCT_DATACENTER_SERVER_V
0x00000025Server Datacenter without Hyper-V (full installation)
PRODUCT_ENTERPRISE
0x00000004Enterprise
PRODUCT_ENTERPRISE_E
0x00000046Enterprise E
PRODUCT_ENTERPRISE_N
0x0000001BEnterprise N
PRODUCT_ENTERPRISE_SERVER
0x0000000AServer Enterprise (full installation)
PRODUCT_ENTERPRISE_SERVER_CORE
0x0000000EServer Enterprise (core installation)
PRODUCT_ENTERPRISE_SERVER_CORE_V
0x00000029Server Enterprise without Hyper-V (core installation)
PRODUCT_ENTERPRISE_SERVER_IA64
0x0000000FServer Enterprise for Itanium-based Systems
PRODUCT_ENTERPRISE_SERVER_V
0x00000026Server Enterprise without Hyper-V (full installation)
PRODUCT_HOME_BASIC
0x00000002Home Basic
PRODUCT_HOME_BASIC_E
0x00000043Home Basic E
PRODUCT_HOME_BASIC_N
0x00000005Home Basic N
PRODUCT_HOME_PREMIUM
0x00000003Home Premium
PRODUCT_HOME_PREMIUM_E
0x00000044Home Premium E
PRODUCT_HOME_PREMIUM_N
0x0000001AHome Premium N
PRODUCT_HYPERV
0x0000002AMicrosoft Hyper-V Server
PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT
0x0000001EWindows Essential Business Server Management Server
PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING
0x00000020Windows Essential Business Server Messaging Server
PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY
0x0000001FWindows Essential Business Server Security Server
PRODUCT_PROFESSIONAL
0x00000030Professional
PRODUCT_PROFESSIONAL_E
0x00000045Professional E
PRODUCT_PROFESSIONAL_N
0x00000031Professional N
PRODUCT_SERVER_FOR_SMALLBUSINESS
0x00000018Windows Server 2008 for Windows Essential Server Solutions
PRODUCT_SERVER_FOR_SMALLBUSINESS_V
0x00000023Windows Server 2008 without Hyper-V for Windows Essential Server Solutions
PRODUCT_SERVER_FOUNDATION
0x00000021Server Foundation
PRODUCT_SMALLBUSINESS_SERVER
0x00000009Windows Small Business Server
PRODUCT_STANDARD_SERVER
0x00000007Server Standard (full installation)
PRODUCT_STANDARD_SERVER_CORE
0x0000000DServer Standard (core installation)
PRODUCT_STANDARD_SERVER_CORE_V
0x00000028Server Standard without Hyper-V (core installation)
PRODUCT_STANDARD_SERVER_V
0x00000024Server Standard without Hyper-V (full installation)
PRODUCT_STARTER
0x0000000BStarter
PRODUCT_STARTER_E
0x00000042Starter E
PRODUCT_STARTER_N
0x0000002FStarter N
PRODUCT_STORAGE_ENTERPRISE_SERVER
0x00000017Storage Server Enterprise
PRODUCT_STORAGE_EXPRESS_SERVER
0x00000014Storage Server Express
PRODUCT_STORAGE_STANDARD_SERVER
0x00000015Storage Server Standard
PRODUCT_STORAGE_WORKGROUP_SERVER
0x00000016Storage Server Workgroup
PRODUCT_UNDEFINED
0x00000000An unknown product
PRODUCT_ULTIMATE
0x00000001Ultimate
PRODUCT_ULTIMATE_E
0x00000047Ultimate E
PRODUCT_ULTIMATE_N
0x0000001CUltimate N
PRODUCT_WEB_SERVER
0x00000011Web Server (full installation)
PRODUCT_WEB_SERVER_CORE
0x0000001DWeb Server (core installation)

Return Value
If the function succeeds, the return value is a nonzero value. If the software license is invalid or expired, the function succeeds but the pdwReturnedProductType parameter is set to PRODUCT_UNLICENSED.
If the function fails, the return value is zero. This function fails if one of the input parameters is invalid.
Remarks
To detect whether a server role or feature is installed, use the Server Feature WMI provider.
Subsequent releases of Windows will map the product types it supports to the set of product types supported by each supported previous release of Windows, back to version 6.0.0.0. Therefore, an application that does an equality test for any of these values will continue to work on future releases, even when new product types are added.
The following table indicates the product types that were introduced in 6.1.0.0, and what they will map to if GetProductInfo is called with version 6.0.0.0 on a 6.1.0.0 system.
New for 6.1.0.0Value returned with 6.0.0.0
PRODUCT_ENTERPRISE_EPRODUCT_ENTERPRISE
PRODUCT_HOME_BASIC_EPRODUCT_HOME_BASIC
PRODUCT_HOME_PREMIUM_EPRODUCT_HOME_PREMIUM
PRODUCT_PROFESSIONALPRODUCT_BUSINESS
PRODUCT_PROFESSIONAL_EPRODUCT_BUSINESS
PRODUCT_PROFESSIONAL_NPRODUCT_BUSINESS_N
PRODUCT_STARTER_EPRODUCT_STARTER
PRODUCT_STARTER_NPRODUCT_STARTER
PRODUCT_ULTIMATE_EPRODUCT_ULTIMATE

To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later. For more information, see Using the Windows Headers .
Examples
For an example, see Getting the System Version .
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
System Information Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724358(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:22:56