Browse Source

All: Optimized `IsWindows11` routine

pull/996/head
Valentin Radu 4 years ago
parent
commit
a360b40db6
  1. 4
      ExplorerPatcher/dllmain.c
  2. 2
      ExplorerPatcher/utility.c
  3. 5
      ExplorerPatcher/utility.h

4
ExplorerPatcher/dllmain.c

@ -40,6 +40,10 @@ IEPWeather* epw = NULL;
SRWLOCK lock_epw = { .Ptr = SRWLOCK_INIT }; SRWLOCK lock_epw = { .Ptr = SRWLOCK_INIT };
#endif #endif
#ifndef _WIN64
RTL_OSVERSIONINFOW global_rovi;
#endif
#define WINX_ADJUST_X 5 #define WINX_ADJUST_X 5
#define WINX_ADJUST_Y 5 #define WINX_ADJUST_Y 5

2
ExplorerPatcher/utility.c

@ -2,6 +2,8 @@
#include <Wininet.h> #include <Wininet.h>
#pragma comment(lib, "Wininet.lib") #pragma comment(lib, "Wininet.lib")
RTL_OSVERSIONINFOW global_rovi;
#pragma region "Weird stuff" #pragma region "Weird stuff"
INT64 STDMETHODCALLTYPE nimpl4_1(INT64 a1, DWORD* a2) INT64 STDMETHODCALLTYPE nimpl4_1(INT64 a1, DWORD* a2)
{ {

5
ExplorerPatcher/utility.h

@ -571,10 +571,11 @@ BOOL PleaseWait_UpdateTimeout(int timeout);
VOID CALLBACK PleaseWait_TimerProc(HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime); VOID CALLBACK PleaseWait_TimerProc(HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime);
LRESULT CALLBACK PleaseWait_HookProc(int code, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK PleaseWait_HookProc(int code, WPARAM wParam, LPARAM lParam);
extern RTL_OSVERSIONINFOW global_rovi;
inline BOOL IsWindows11() inline BOOL IsWindows11()
{ {
RTL_OSVERSIONINFOW rovi; if (!global_rovi.dwMajorVersion) VnGetOSVersion(&global_rovi);
if (VnGetOSVersion(&rovi) && rovi.dwBuildNumber >= 21996) if (global_rovi.dwBuildNumber >= 21996)
{ {
return TRUE; return TRUE;
} }

Loading…
Cancel
Save