#include <stdio.h>
#include <windows.h>
int main(){
NTSTATUS(WINAPI * RtlGetVersion)(LPOSVERSIONINFOEXW);
OSVERSIONINFOEXW osvInfo;
*(FARPROC*)&RtlGetVersion = GetProcAddress(GetModuleHandleA("ntdll"), "RtlGetVersion");
if (RtlGetVersion != NULL) {
osvInfo.dwOSVersionInfoSize = sizeof(osvInfo);
RtlGetVersion(&osvInfo);
}
printf("Version is %d.%d (%d)\n",
osvInfo.dwMajorVersion,
osvInfo.dwMinorVersion,
osvInfo.dwBuildNumber);
return 0;
}
/*
run:
Version is 10.0 (19044)
*/