'How to get osversioninfo for windows 11

The GetVersionEx Api can get version upto Windows10 in C++.

#include <windows.h>
#include <stdio.h>

void main()
{
    OSVERSIONINFO osvi;    
    ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);

    GetVersionEx(&osvi);
}

Version Helper functions have an IsWindows10OrGreater api that can check it's Windows10 or greater but i need exactly the version info of Windows11. Is there any Api like GetVersionEx from there i can get the whole version info of Windows11.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source