How can I detect Windows 8.1 in a Desktop application

后端 未结 4 975
滥情空心
滥情空心 2020-12-03 08:36

In the Windows 8.1 preview Environment.OSVersion.Version returns the same version numbers as Windows 8. Is there alternative way of detecting Windows 8.1.

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 08:56

    Use ntdll!RtlGetVersion. This is what both GetVersionEx and VerifyVersionInfo use, and it gives the correct version number. It takes a pointer to an OSVersionInfoExW structure, like GetVersionExW does. If it succeeds, it returns STATUS_SUCCESS (0).

提交回复
热议问题