Recently I have updated my article published on CodeGuru about determining Windows version and edition. The update offers support for determining the Windows Vista and Windows Server 2008 edition installed on a machine.

Since both these new operating systems have the same major and minor version returned by GetVersionEx, i.e. 6 for major and 0 for minor, a first differentiation between the two is done based on the product type returned by the same function: 1 is used for Vista and 3 for Server 2008. To identify the edition a new function available in Vista and Server 2008 must be used: GetProductInfo. Based on the major and minor version of the product and the major and minor version of the service pack, it returns a number identifying the edition type. The article explains how to differentiate between Windows Vista Starter, Vista Home Basic, Vista Home Premium, Vista Enterprise, Vista Business and Vista Ultimate, as well as different editions of Windows Server 2008, such as Standard, Datacenter, Enterprise or Webserver.

The article offers source code that can be integrated in any C++ application, as well as a demo application.

Hits for this post: 9440 .
Trackback

only 1 comment untill now

  1. Gravatar
    Adrian Lixandru @ 2009-03-12 01:35

    I wonder if a solution exists for correctly determining Windows Version from a compatibility layer mode. From a Windows Vista ,inside a program runned as XP SP2 compatible , GetVersionEx returns 5/1 as major/minor version :(

Add your comment now