diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 6256739..617557c 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -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 diff --git a/ExplorerPatcher/utility.c b/ExplorerPatcher/utility.c index 8bc528d..50766a2 100644 --- a/ExplorerPatcher/utility.c +++ b/ExplorerPatcher/utility.c @@ -2,6 +2,8 @@ #include #pragma comment(lib, "Wininet.lib") +RTL_OSVERSIONINFOW global_rovi; + #pragma region "Weird stuff" INT64 STDMETHODCALLTYPE nimpl4_1(INT64 a1, DWORD* a2) { diff --git a/ExplorerPatcher/utility.h b/ExplorerPatcher/utility.h index aabd4b2..380962f 100644 --- a/ExplorerPatcher/utility.h +++ b/ExplorerPatcher/utility.h @@ -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; }