Blender V5.3
windows.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2019-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#ifdef _WIN32
6# ifdef WIN32_LEAN_AND_MEAN
7# undef WIN32_LEAN_AND_MEAN
8# endif
9# include <windows.h>
10#endif
11
12#include "util/windows.h"
13
15
16bool system_windows_version_at_least(const int major, const int build)
17{
18#ifdef _WIN32
19 HMODULE hMod = ::GetModuleHandleW(L"ntdll.dll");
20 if (hMod == 0) {
21 return false;
22 }
23
24 typedef NTSTATUS(WINAPI * RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);
25 RtlGetVersionPtr rtl_get_version = (RtlGetVersionPtr)::GetProcAddress(hMod, "RtlGetVersion");
26 if (rtl_get_version == nullptr) {
27 return false;
28 }
29
30 RTL_OSVERSIONINFOW rovi = {0};
31 rovi.dwOSVersionInfoSize = sizeof(rovi);
32 if (rtl_get_version(&rovi) != 0) {
33 return false;
34 }
35
36 return (rovi.dwMajorVersion > major ||
37 (rovi.dwMajorVersion == major && rovi.dwBuildNumber >= build));
38#else
39 (void)major;
40 (void)build;
41 return false;
42#endif
43}
44
void build(btStridingMeshInterface *triangles, bool useQuantizedAabbCompression, const btVector3 &bvhAabbMin, const btVector3 &bvhAabbMax)
#define CCL_NAMESPACE_END
#define L
CCL_NAMESPACE_BEGIN bool system_windows_version_at_least(const int major, const int build)
Definition windows.cpp:16