c++windows-server

How to detect Windows 2012 Core edition (C++)


I need to detect the edition on Windows 2012 in my program.
On previous OS I used GetProductInfo's pdwReturnedProductType, but according to msdn:

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.

Is there any other possibility to detect core edition?


Solution

  • Actually, I did not find any correct way to detect Windows Core Edition.
    So, the solution was, for Win 2012, to detect dwm.exe process is running (Desktop Window Manager). It is always running, can't be killed by user and not exists on Windows Core editions.