All: Optimized IsWindows11 routine

This commit is contained in:
Valentin Radu
2022-03-05 06:56:09 +02:00
parent fb204c7d3c
commit a360b40db6
3 changed files with 9 additions and 2 deletions
+4
View File
@@ -40,6 +40,10 @@ IEPWeather* epw = NULL;
SRWLOCK lock_epw = { .Ptr = SRWLOCK_INIT };
#endif
#ifndef _WIN64
RTL_OSVERSIONINFOW global_rovi;
#endif
#define WINX_ADJUST_X 5
#define WINX_ADJUST_Y 5
+2
View File
@@ -2,6 +2,8 @@
#include <Wininet.h>
#pragma comment(lib, "Wininet.lib")
RTL_OSVERSIONINFOW global_rovi;
#pragma region "Weird stuff"
INT64 STDMETHODCALLTYPE nimpl4_1(INT64 a1, DWORD* a2)
{
+3 -2
View File
@@ -571,10 +571,11 @@ BOOL PleaseWait_UpdateTimeout(int timeout);
VOID CALLBACK PleaseWait_TimerProc(HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime);
LRESULT CALLBACK PleaseWait_HookProc(int code, WPARAM wParam, LPARAM lParam);
extern RTL_OSVERSIONINFOW global_rovi;
inline BOOL IsWindows11()
{
RTL_OSVERSIONINFOW rovi;
if (VnGetOSVersion(&rovi) && rovi.dwBuildNumber >= 21996)
if (!global_rovi.dwMajorVersion) VnGetOSVersion(&global_rovi);
if (global_rovi.dwBuildNumber >= 21996)
{
return TRUE;
}