Skip to content

Commit

Permalink
All: Fixed a bug that crashed explorer on OS builds lower than 2262…
Browse files Browse the repository at this point in the history
…1 (Windows 11 22H2)
  • Loading branch information
Amrsatrio committed Sep 23, 2023
1 parent 2607f9a commit dfee1ae
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions ExplorerPatcher/osutility.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,37 +59,32 @@ inline HRESULT SetMicaMaterialForThisWindow(HWND hWnd, BOOL bApply)
inline BOOL IsWindows11Version22H2OrHigher()
{
if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi);
if (global_rovi.dwBuildNumber >= 22621) return TRUE;
return FALSE;
return global_rovi.dwBuildNumber >= 22621;
}

inline BOOL IsWindows11BuildHigherThan22631()
inline BOOL IsWindows11Version23H2OrHigher()
{
if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi);
if (global_rovi.dwBuildNumber > 22631) return TRUE;
return FALSE;
return global_rovi.dwBuildNumber >= 22631;
}

inline BOOL IsWindows11BuildHigherThan25158()
{
if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi);
if (global_rovi.dwBuildNumber > 25158) return TRUE;
return FALSE;
return global_rovi.dwBuildNumber > 25158;
}

inline BOOL IsWindows11Version22H2Build1413OrHigher()
{
if (IsWindows11BuildHigherThan22631()) return TRUE;
if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi);
if (global_ubr >= 1413) return TRUE;
return FALSE;
if (global_rovi.dwBuildNumber > 22621) return TRUE;
return global_rovi.dwBuildNumber == 22621 && global_ubr >= 1413;
}

inline BOOL IsWindows11Version22H2Build2134OrHigher()
{
if (IsWindows11BuildHigherThan22631()) return TRUE;
if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi);
if (global_ubr >= 2134) return TRUE;
return FALSE;
if (global_rovi.dwBuildNumber > 22621) return TRUE;
return global_rovi.dwBuildNumber == 22621 && global_ubr >= 2134;
}
#endif

0 comments on commit dfee1ae

Please sign in to comment.