Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
System Information
 GetProductInfo Function
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.

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.

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
0x00000006

Business Edition

PRODUCT_BUSINESS_N
0x00000010

Business Edition

PRODUCT_CLUSTER_SERVER
0x00000012

Cluster Server Edition

PRODUCT_DATACENTER_SERVER
0x00000008

Server Datacenter Edition (full installation)

PRODUCT_DATACENTER_SERVER_CORE
0x0000000C

Server Datacenter Edition (core installation)

PRODUCT_DATACENTER_SERVER_CORE_V
0x00000027

Server Datacenter Edition without Hyper-V (core installation)

PRODUCT_DATACENTER_SERVER_V
0x00000025

Server Datacenter Edition without Hyper-V (full installation)

PRODUCT_ENTERPRISE
0x00000004

Enterprise Edition

PRODUCT_ENTERPRISE_N
0x0000001B

Enterprise Edition

PRODUCT_ENTERPRISE_SERVER
0x0000000A

Server Enterprise Edition (full installation)

PRODUCT_ENTERPRISE_SERVER_CORE
0x0000000E

Server Enterprise Edition (core installation)

PRODUCT_ENTERPRISE_SERVER_CORE_V
0x00000029

Server Enterprise Edition without Hyper-V (core installation)

PRODUCT_ENTERPRISE_SERVER_IA64
0x0000000F

Server Enterprise Edition for Itanium-based Systems

PRODUCT_ENTERPRISE_SERVER_V
0x00000026

Server Enterprise Edition without Hyper-V (full installation)

PRODUCT_HOME_BASIC
0x00000002

Home Basic Edition

PRODUCT_HOME_BASIC_N
0x00000005

Home Basic Edition

PRODUCT_HOME_PREMIUM
0x00000003

Home Premium Edition

PRODUCT_HOME_PREMIUM_N
0x0000001A

Home Premium Edition

PRODUCT_HOME_SERVER
0x00000013

Home Server Edition

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_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_SMALLBUSINESS_SERVER
0x00000009

Windows Small Business Server

PRODUCT_STANDARD_SERVER
0x00000007

Server Standard Edition (full installation)

PRODUCT_STANDARD_SERVER_CORE
0x0000000D

Server Standard Edition (core installation)

PRODUCT_STANDARD_SERVER_CORE_V
0x00000028

Server Standard Edition without Hyper-V (core installation)

PRODUCT_STANDARD_SERVER_V
0x00000024

Server Standard Edition without Hyper-V (full installation)

PRODUCT_STARTER
0x0000000B

Starter Edition

PRODUCT_STORAGE_ENTERPRISE_SERVER
0x00000017

Storage Server Enterprise Edition

PRODUCT_STORAGE_EXPRESS_SERVER
0x00000014

Storage Server Express Edition

PRODUCT_STORAGE_STANDARD_SERVER
0x00000015

Storage Server Standard Edition

PRODUCT_STORAGE_WORKGROUP_SERVER
0x00000016

Storage Server Workgroup Edition

PRODUCT_UNDEFINED
0x00000000

An unknown product

PRODUCT_ULTIMATE
0x00000001

Ultimate Edition

PRODUCT_ULTIMATE_N
0x0000001C

Ultimate Edition

PRODUCT_WEB_SERVER
0x00000011

Web Server Edition (full installation)

PRODUCT_WEB_SERVER_CORE
0x0000001D

Web Server Edition (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

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.

You can also use the OperatingSystemSKU property of the Win32_OperatingSystem WMI class.

To retrieve product type information on versions of Windows prior to 6.0.0.0, use the GetVersionEx function.

To detect whether a server role or feature is installed, use the Server Feature WMI provider.

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

ClientRequires Windows Vista.
ServerRequires Windows Server 2008.
HeaderDeclared in Winbase.h; include Windows.h.
LibraryUse Kernel32.lib.
DLLRequires Kernel32.dll.

See Also

System Information Functions


Send comments about this topic to Microsoft

Build date: 10/2/2008

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker