GetProductInfo function (sysinfoapi.h)
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 GetProductInfo(
[in] DWORD dwOSMajorVersion,
[in] DWORD dwOSMinorVersion,
[in] DWORD dwSpMajorVersion,
[in] DWORD dwSpMinorVersion,
[out] PDWORD pdwReturnedProductType
);
Parameters
[in] dwOSMajorVersion
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. All Windows 10 based releases will be listed as version 6.3.
[in] dwOSMinorVersion
The minor version number of the operating system. The minimum value is 0.
[in] dwSpMajorVersion
The major version number of the operating system service pack. The minimum value is 0.
[in] dwSpMinorVersion
The minor version number of the operating system service pack. The minimum value is 0.
[out] pdwReturnedProductType
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 (some products below may be out of support).
Value | Meaning |
---|---|
|
Business |
|
Business N |
|
HPC Edition |
|
Server Hyper Core V |
|
Windows 10 Home |
|
Windows 10 Home China |
|
Windows 10 Home N |
|
Windows 10 Home Single Language |
|
Server Datacenter (evaluation installation) |
|
Server Datacenter, Semi-Annual Channel (core installation) |
|
Server Standard, Semi-Annual Channel (core installation) |
|
Server Datacenter (full installation. For Server Core installations of Windows Server 2012 and later, use the method, Determining whether Server Core is running.) |
|
Server Datacenter (core installation, Windows Server 2008 R2 and earlier) |
|
Server Datacenter without Hyper-V (core installation) |
|
Server Datacenter without Hyper-V (full installation) |
|
Windows 10 Education |
|
Windows 10 Education N |
|
Windows 10 Enterprise |
|
Windows 10 Enterprise E |
|
Windows 10 Enterprise Evaluation |
|
Windows 10 Enterprise N |
|
Windows 10 Enterprise N Evaluation |
|
Windows 10 Enterprise 2015 LTSB |
|
Windows 10 Enterprise 2015 LTSB Evaluation |
|
Windows 10 Enterprise 2015 LTSB N |
|
Windows 10 Enterprise 2015 LTSB N Evaluation |
|
Server Enterprise (full installation) |
|
Server Enterprise (core installation) |
|
Server Enterprise without Hyper-V (core installation) |
|
Server Enterprise for Itanium-based Systems |
|
Server Enterprise without Hyper-V (full installation) |
|
Windows Essential Server Solution Additional |
|
Windows Essential Server Solution Additional SVC |
|
Windows Essential Server Solution Management |
|
Windows Essential Server Solution Management SVC |
|
Home Basic |
|
Not supported |
|
Home Basic N |
|
Home Premium |
|
Not supported |
|
Home Premium N |
|
Windows Home Server 2011 |
|
Windows Storage Server 2008 R2 Essentials |
|
Microsoft Hyper-V Server |
|
Windows IoT Enterprise |
|
Windows IoT Enterprise LTSC |
|
Windows 10 IoT Core |
|
Windows 10 IoT Core Commercial |
|
Windows Essential Business Server Management Server |
|
Windows Essential Business Server Messaging Server |
|
Windows Essential Business Server Security Server |
|
Windows 10 Mobile |
|
Windows 10 Mobile Enterprise |
|
Windows MultiPoint Server Premium (full installation) |
|
Windows MultiPoint Server Standard (full installation) |
|
Windows 10 Team |
|
Windows 10 Pro Education |
|
Windows 10 Pro for Workstations |
|
Windows 10 Pro for Workstations N |
|
Windows 10 Pro |
|
Not supported |
|
Windows 10 Pro N |
|
Professional with Media Center |
|
Windows Small Business Server 2011 Essentials |
|
Server For SB Solutions EM |
|
Server For SB Solutions |
|
Server For SB Solutions EM |
|
Windows Server 2008 for Windows Essential Server Solutions |
|
Windows Server 2008 without Hyper-V for Windows Essential Server Solutions |
|
Server Foundation |
|
Windows 10 Enterprise for Virtual Desktops |
|
Windows Small Business Server |
|
Small Business Server Premium |
|
Small Business Server Premium (core installation) |
|
Windows MultiPoint Server |
|
Server Standard (evaluation installation) |
|
Server Standard (full installation. For Server Core installations of Windows Server 2012 and later, use the method, Determining whether Server Core is running.) |
|
Server Standard (core installation, Windows Server 2008 R2 and earlier) |
|
Server Standard without Hyper-V (core installation) |
|
Server Standard without Hyper-V |
|
Server Solutions Premium |
|
Server Solutions Premium (core installation) |
|
Starter |
|
Not supported |
|
Starter N |
|
Storage Server Enterprise |
|
Storage Server Enterprise (core installation) |
|
Storage Server Express |
|
Storage Server Express (core installation) |
|
Storage Server Standard (evaluation installation) |
|
Storage Server Standard |
|
Storage Server Standard (core installation) |
|
Storage Server Workgroup (evaluation installation) |
|
Storage Server Workgroup |
|
Storage Server Workgroup (core installation) |
|
Ultimate |
|
Not supported |
|
Ultimate N |
|
An unknown product |
|
Web Server (full installation) |
|
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, and later. 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. As noted above, for Server Core installations of Windows Server 2012 and later, use the method Determining whether Server Core is running.
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.0 | Value returned with 6.0.0.0 |
---|---|
PRODUCT_PROFESSIONAL | PRODUCT_BUSINESS |
PRODUCT_PROFESSIONAL_N | PRODUCT_BUSINESS_N |
PRODUCT_STARTER_N | PRODUCT_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
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | sysinfoapi.h (include Windows.h) |
Library | Kernel32.lib |
DLL | Kernel32.dll |