Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Development
System Services
System Information
 GetProductInfo function
GetProductInfo function

Applies to: desktop apps only

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_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
0x0000001B

Enterprise N

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_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_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_PROFESSIONAL
0x00000030

Professional

PRODUCT_PROFESSIONAL_E
0x00000045

Not supported

PRODUCT_PROFESSIONAL_N
0x00000031

Professional N

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_HOME_PREMIUM_SERVER
0x00000022

Windows Home Server 2011

PRODUCT_SB_SOLUTION_SERVER
0x00000032

Windows Small Business Server 2011 Essentials

PRODUCT_HOME_SERVER
0x00000013

Windows Storage Server 2008 R2 Essentials

PRODUCT_SMALLBUSINESS_SERVER
0x00000009

Windows Small Business Server

PRODUCT_SOLUTION_EMBEDDEDSERVER
0x00000038

Windows MultiPoint Server

PRODUCT_STANDARD_SERVER
0x00000007

Server Standard (full installation)

PRODUCT_STANDARD_SERVER_CORE
0x0000000D

Server Standard (core installation)

PRODUCT_STANDARD_SERVER_CORE_V
0x00000028

Server Standard without Hyper-V (core installation)

PRODUCT_STANDARD_SERVER_V
0x00000024

Server Standard without Hyper-V (full 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_EXPRESS_SERVER
0x00000014

Storage Server Express

PRODUCT_STORAGE_STANDARD_SERVER
0x00000015

Storage Server Standard

PRODUCT_STORAGE_WORKGROUP_SERVER
0x00000016

Storage Server Workgroup

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.

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

Minimum supported server

Windows Server 2008

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

System Information Functions

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Windows 8 Consumer Preview returns 0x0000004A      _APOO   |   Edit   |   Show History
Could we assume that 0x0000004A means Consumer Preview?
Tags What's this?: Add a tag
Flag as ContentBug
The result is not right when the OS is Windows Server 2008 R2 Core and Hyper-V      Xiaojin   |   Edit   |   Show History
This API returns PRODUCT_HYPERV(0x0000002A).
This is not right. It should also be Core also. The result should be like Core | Hyper-V.
(Continued)      Miðgarðsormr   |   Edit   |   Show History

Alright, here the list of items that had no descriptions when I looked for them:

PRODUCT_SB_SOLUTION_SERVER
PRODUCT_SB_SOLUTION_SERVER_EM
PRODUCT_SERVER_FOR_SB_SOLUTIONS
PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM
PRODUCT_STANDARD_SERVER_SOLUTIONS
PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE
PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT
PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL
PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC
PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC

... and given the fact that PRODUCT_SOLUTION_EMBEDDEDSERVER translates to "Windows MultiPoint Server" it's not quite clear what any of these could potentially be. A function to which I pass the numeric value to get back a descriptive string would probably be in order, don't you think?

Missing descriptions inconsistent naming in the table      Miðgarðsormr   |   Edit   |   Show History

What about PRODUCT_SB_SOLUTION_SERVER or PRODUCT_SERVER_FOR_SB_SOLUTIONS which are missing completely from the table?

What would be really useful is to see how to put the names together. For example if I already have the part about "Windows 7" or "Windows 2008 R2" and then just append whatever name is given in above table, then I would end up for PRODUCT_SERVER_FOR_SMALLBUSINESS with the quite redundant name:

"Windows Server 2008 Windows Server 2008 for Windows Essential Server Solutions"

There obviously is some scheme that can be followed for some names, but it's not clear enough how that stretches across the various product types. And the "Not supported" items are ... well, what are they meant to be?

What about the K SKUs?      Thayu   |   Edit   |   Show History

I couldn't see any mention of the K and KN SKUs... How do we detect the K or KN SKUs?

Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker