Export (0) Print
Expand All

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 specified in the Requirements section, use the GetVersionEx function. You can also use the OperatingSystemSKU property of the Win32_OperatingSystem WMI class.

Syntax


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.

This parameter can be one of the following values.

ValueMeaning
PRODUCT_BUSINESS
0x00000006

Business

PRODUCT_BUSINESS_N
0x00000010

Business N

PRODUCT_CLUSTER_SERVER
0x00000012

HPC Edition

PRODUCT_CLUSTER_SERVER_V
0x00000040

Server Hyper Core V

PRODUCT_CORE
0x00000065

Windows 8

PRODUCT_CORE_N
0x00000062

Windows 8 N

PRODUCT_CORE_COUNTRYSPECIFIC
0x00000063

Windows 8 China

PRODUCT_CORE_SINGLELANGUAGE
0x00000064

Windows 8 Single Language

PRODUCT_DATACENTER_EVALUATION_SERVER
0x00000050

Server Datacenter (evaluation installation)

PRODUCT_DATACENTER_SERVER
0x00000008

Server Datacenter (full installation)

PRODUCT_DATACENTER_SERVER_CORE
0x0000000C

Server Datacenter (core installation)

PRODUCT_DATACENTER_SERVER_CORE_V
0x00000027

Server Datacenter without Hyper-V (core installation)

PRODUCT_DATACENTER_SERVER_V
0x00000025

Server Datacenter without Hyper-V (full installation)

PRODUCT_ENTERPRISE
0x00000004

Enterprise

PRODUCT_ENTERPRISE_E
0x00000046

Not supported

PRODUCT_ENTERPRISE_N_EVALUATION
0x00000054

Enterprise N (evaluation installation)

PRODUCT_ENTERPRISE_N
0x0000001B

Enterprise N

PRODUCT_ENTERPRISE_EVALUATION
0x00000048

Server Enterprise (evaluation installation)

PRODUCT_ENTERPRISE_SERVER
0x0000000A

Server Enterprise (full installation)

PRODUCT_ENTERPRISE_SERVER_CORE
0x0000000E

Server Enterprise (core installation)

PRODUCT_ENTERPRISE_SERVER_CORE_V
0x00000029

Server Enterprise without Hyper-V (core installation)

PRODUCT_ENTERPRISE_SERVER_IA64
0x0000000F

Server Enterprise for Itanium-based Systems

PRODUCT_ENTERPRISE_SERVER_V
0x00000026

Server Enterprise without Hyper-V (full installation)

PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT
0x0000003B

Windows Essential Server Solution Management

PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL
0x0000003C

Windows Essential Server Solution Additional

PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC
0x0000003D

Windows Essential Server Solution Management SVC

PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC
0x0000003E

Windows Essential Server Solution Additional SVC

PRODUCT_HOME_BASIC
0x00000002

Home Basic

PRODUCT_HOME_BASIC_E
0x00000043

Not supported

PRODUCT_HOME_BASIC_N
0x00000005

Home Basic N

PRODUCT_HOME_PREMIUM
0x00000003

Home Premium

PRODUCT_HOME_PREMIUM_E
0x00000044

Not supported

PRODUCT_HOME_PREMIUM_N
0x0000001A

Home Premium N

PRODUCT_HOME_PREMIUM_SERVER
0x00000022

Windows Home Server 2011

PRODUCT_HOME_SERVER
0x00000013

Windows Storage Server 2008 R2 Essentials

PRODUCT_HYPERV
0x0000002A

Microsoft Hyper-V Server

PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT
0x0000001E

Windows Essential Business Server Management Server

PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING
0x00000020

Windows Essential Business Server Messaging Server

PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY
0x0000001F

Windows Essential Business Server Security Server

PRODUCT_MULTIPOINT_STANDARD_SERVER
0x0000004C

Windows MultiPoint Server Standard (full installation)

PRODUCT_MULTIPOINT_PREMIUM_SERVER
0x0000004D

Windows MultiPoint Server Premium (full installation)

PRODUCT_PROFESSIONAL
0x00000030

Professional

PRODUCT_PROFESSIONAL_E
0x00000045

Not supported

PRODUCT_PROFESSIONAL_N
0x00000031

Professional N

PRODUCT_PROFESSIONAL_WMC
0x00000067

Professional with Media Center

PRODUCT_SB_SOLUTION_SERVER_EM
0x00000036

Server For SB Solutions EM

PRODUCT_SERVER_FOR_SB_SOLUTIONS
0x00000033

Server For SB Solutions

PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM
0x00000037

Server For SB Solutions EM

PRODUCT_SERVER_FOR_SMALLBUSINESS
0x00000018

Windows Server 2008 for Windows Essential Server Solutions

PRODUCT_SERVER_FOR_SMALLBUSINESS_V
0x00000023

Windows Server 2008 without Hyper-V for Windows Essential Server Solutions

PRODUCT_SERVER_FOUNDATION
0x00000021

Server Foundation

PRODUCT_SB_SOLUTION_SERVER
0x00000032

Windows Small Business Server 2011 Essentials

PRODUCT_SMALLBUSINESS_SERVER
0x00000009

Windows Small Business Server

PRODUCT_SMALLBUSINESS_SERVER_PREMIUM
0x00000019

Small Business Server Premium

PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE
0x0000003F

Small Business Server Premium (core installation)

PRODUCT_SOLUTION_EMBEDDEDSERVER
0x00000038

Windows MultiPoint Server

PRODUCT_STANDARD_EVALUATION_SERVER
0x0000004F

Server Standard (evaluation installation)

PRODUCT_STANDARD_SERVER
0x00000007

Server Standard

PRODUCT_STANDARD_SERVER_CORE
0x0000000D

Server Standard (core installation)

PRODUCT_STANDARD_SERVER_V
0x00000024

Server Standard without Hyper-V

PRODUCT_STANDARD_SERVER_CORE_V
0x00000028

Server Standard without Hyper-V (core installation)

PRODUCT_STANDARD_SERVER_SOLUTIONS
0x00000034

Server Solutions Premium

PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE
0x00000035

Server Solutions Premium (core installation)

PRODUCT_STARTER
0x0000000B

Starter

PRODUCT_STARTER_E
0x00000042

Not supported

PRODUCT_STARTER_N
0x0000002F

Starter N

PRODUCT_STORAGE_ENTERPRISE_SERVER
0x00000017

Storage Server Enterprise

PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE
0x0000002E

Storage Server Enterprise (core installation)

PRODUCT_STORAGE_EXPRESS_SERVER
0x00000014

Storage Server Express

PRODUCT_STORAGE_EXPRESS_SERVER_CORE
0x0000002B

Storage Server Express (core installation)

PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER
0x00000060

Storage Server Standard (evaluation installation)

PRODUCT_STORAGE_STANDARD_SERVER
0x00000015

Storage Server Standard

PRODUCT_STORAGE_STANDARD_SERVER_CORE
0x0000002C

Storage Server Standard (core installation)

PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER
0x0000005F

Storage Server Workgroup (evaluation installation)

PRODUCT_STORAGE_WORKGROUP_SERVER
0x00000016

Storage Server Workgroup

PRODUCT_STORAGE_WORKGROUP_SERVER_CORE
0x0000002D

Storage Server Workgroup (core installation)

PRODUCT_UNDEFINED
0x00000000

An unknown product

PRODUCT_ULTIMATE
0x00000001

Ultimate

PRODUCT_ULTIMATE_E
0x00000047

Not supported

PRODUCT_ULTIMATE_N
0x0000001C

Ultimate N

PRODUCT_WEB_SERVER
0x00000011

Web Server (full installation)

PRODUCT_WEB_SERVER_CORE
0x0000001D

Web Server (core installation)

 

Return value

If the function succeeds, the return value is a nonzero value.

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.

PRODUCT_*_SERVER_CORE values are not returned in Windows Server 2012. For example, the base server edition, Server Datacenter, is used to build the two different installation options: "full server" and "core server". With Windows Server 2012, GetProductInfo will return PRODUCT_DATACENTER regardless of the option used during product installation.

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_PROFESSIONALPRODUCT_BUSINESS
PRODUCT_PROFESSIONAL_NPRODUCT_BUSINESS_N
PRODUCT_STARTER_NPRODUCT_STARTER

 

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 client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

System Information Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft