LTSC (Long-Term Servicing Channel) の判定方法

こんにちは、Platform SDK (Windows SDK) サポートチームです。

今回は、Microsoft の新しいサービシング モデルである LTSC (Long-Term Servicing Channel) の Windows をプログラムから判定する方法をご案内します。

 

プログラムから判定する方法には二つあります。
一つは WMI の Win32_OperatingSystem クラスの OperatingSystemSKU プロパティを参照する方法で、もう一つは Win32 API の GetProductInfo() の第五引数に返される値を参照する方法です。

以下に、MSDN ライブラリのリファレンスから該当箇所を引用し、それぞれ URL をご紹介します。

 

Win32_OperatingSystem class https://msdn.microsoft.com/ja-jp/library/windows/desktop/aa394239.aspx

OperatingSystemSKU

Data type: uint32
Access type: Read-only
Qualifiers: MappingStrings ("WMI")

Stock Keeping Unit (SKU) number for the operating system.
These values are the same as the PRODUCT_* constants defined in WinNT.h that are used with the GetProductInfo function.

GetProductInfo function https://msdn.microsoft.com/ja-jp/library/windows/desktop/ms724358.aspx

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.

 

Windows 毎の定義値は、Windows SDK から提供されている WinNT.h に定義されています。
このため、前述した二つの方法のいずれかによりプログラムから参照して得られた値を、WinNT.h に定義されている値と比較すれば、Windows を判定することが可能です。

 

なお、2017 年 11 月現在の時点で LTSC の対象となっている Windows は、Windows Server 2016 です。
この Windows Server 2016 では、Server Core と Server with Desktop の二種類を、LTSC の対象としています。
ただし、実際にリリースされている Windows Server 2016 は、Server Core と Nano Server の二種類のみです。
このため、2017 年 11 月現在の時点で LTSC の対象となる Windows は、Windows Server 2016 の Server Core のみとなります。

最新の Windows 10 SDK Fall Creators Update (10.0.16299.15) で提供されている WinNT.h では、Windows Server 2016 の Server Core のための定義値として以下を定義しています。
前述した二つの方法のいずれかによりプログラムから参照して得られた値が、下記いずれかの定義値であった場合は、LTSC と判定することが可能です。

 

// 以下は、Windows 10 SDK Fall Creators Update (10.0.16299.15) の Winnt.h から抜粋しています。
#define PRODUCT_DATACENTER_A_SERVER_CORE 0x00000091
#define PRODUCT_STANDARD_A_SERVER_CORE 0x00000092
#define PRODUCT_DATACENTER_WS_SERVER_CORE 0x00000093
#define PRODUCT_STANDARD_WS_SERVER_CORE 0x00000094
#define PRODUCT_DATACENTER_EVALUATION_SERVER_CORE 0x0000009F
#define PRODUCT_STANDARD_EVALUATION_SERVER_CORE 0x000000A0

 

なお、LTSC 以外の Windows についても、前述した二つの方法のいずれかにより判定することが可能です。
例として最新の Windows 10 SDK Fall Creators Update (10.0.16299.15) で提供されている WinNT.h では、Windows 10 の LTSB のための定義値として以下を定義しています。
前述した二つの方法のいずれかによりプログラムから参照して得られた値が、下記いずれかの定義値であった場合は、Windows 10 の 2015 LTSB または 2016 LTSB と判定することが可能です。

 

// 以下は、Windows 10 SDK Fall Creators Update (10.0.16299.15) の Winnt.h から抜粋しています。
#define PRODUCT_ENTERPRISE_S 0x0000007D
#define PRODUCT_ENTERPRISE_S_N 0x0000007E
#define PRODUCT_ENTERPRISE_S_EVALUATION 0x00000081
#define PRODUCT_ENTERPRISE_S_N_EVALUATION 0x00000082

 

今後も 新しい Windows がリリースされる度に、新しい定義値が WinNT.h に追加される予定です。
以下の URL から、是非最新の Windows SDK を入手の上、WinNT.h 内に定義されている新しい定義値をご参照ください。

 

Windows 10 SDK https://developer.microsoft.com/ja-jp/windows/downloads/windows-10-sdk