Really fix OS version detection for Windows 8.1 and later

Fix several problems in d61b52a60e.

See #15321.

Closes https://github.com/wxWidgets/wxWidgets/pull/114
This commit is contained in:
Vadim Zeitlin
2015-10-31 18:05:43 +01:00
parent 0b2263c25d
commit 98176fd7ac
2 changed files with 6 additions and 3 deletions

View File

@@ -181,7 +181,7 @@ wxMSW:
- Correct wxGetOsDescription() for Windows 10 (Tobias Taschner).
- Make wxListCtrl &c appearance more native on modern systems (Tobias Taschner).
- Don't send wxActivateEvent for minimized windows (bzcdr).
- Return correct OS version under Windows 8 and later.
- Return correct OS version under Windows 8.1 and later.
wxOSX/Cocoa:

View File

@@ -1009,13 +1009,16 @@ OSVERSIONINFOEXW wxGetWindowsVersionInfo()
// RtlGetVersion() directly, if it is available.
#if wxUSE_DYNLIB_CLASS
wxDynamicLibrary dllNtDll;
if ( dllNtDll.RawLoad(wxS("ntdll.dll")) )
if ( dllNtDll.Load(wxS("ntdll.dll"), wxDL_VERBATIM | wxDL_QUIET) )
{
typedef LONG /* NTSTATUS */ (WINAPI *RtlGetVersion_t)(OSVERSIONINFOEXW*);
RtlGetVersion_t wxDL_INIT_FUNC(pfn, RtlGetVersion, dllNtDll);
if ( pfnRtlGetVersion && pfnRtlGetVersion(&info) )
if ( pfnRtlGetVersion &&
(pfnRtlGetVersion(&info) == 0 /* STATUS_SUCCESS */) )
{
return info;
}
}
#endif // wxUSE_DYNLIB_CLASS