@@ -51,17 +51,19 @@ namespace OS {
51
51
struct OSVersion {
52
52
DWORD major;
53
53
DWORD minor;
54
+ DWORD build;
54
55
const char *name;
55
56
};
56
57
static const struct OSVersion osVersions[] = {
57
- { 10 , 0 , " Windows 10" },
58
- { 6 , 3 , " Windows 8.1" },
59
- { 6 , 2 , " Windows 8" },
60
- { 6 , 1 , " Windows 7" },
61
- { 6 , 0 , " Windows Vista" },
62
- { 5 , 1 , " Windows XP" },
63
- { 5 , 0 , " Windows 2000" },
64
- { 0 , 0 , nullptr }
58
+ { 10 , 0 , 22000 , " Windows 11" }, // fuck microsoft, major minor are the same as Windows 10, but builds from 22000 are Win11
59
+ { 10 , 0 , 0 , " Windows 10" },
60
+ { 6 , 3 , 0 , " Windows 8.1" },
61
+ { 6 , 2 , 0 , " Windows 8" },
62
+ { 6 , 1 , 0 , " Windows 7" },
63
+ { 6 , 0 , 0 , " Windows Vista" },
64
+ { 5 , 1 , 0 , " Windows XP" },
65
+ { 5 , 0 , 0 , " Windows 2000" },
66
+ { 0 , 0 , 0 , nullptr }
65
67
};
66
68
} // namespace
67
69
@@ -198,7 +200,9 @@ namespace OS {
198
200
OSVERSIONINFOEX os;
199
201
if (GetVersionHackNTDLL (&os) == TRUE ) {
200
202
for (const OSVersion *scan = osVersions; scan->name ; scan++) {
201
- if (os.dwMajorVersion >= scan->major && os.dwMinorVersion >= scan->minor ) {
203
+ if (os.dwMajorVersion >= scan->major &&
204
+ os.dwMinorVersion >= scan->minor &&
205
+ os.dwBuildNumber >= scan->build ) {
202
206
name = scan->name ;
203
207
break ;
204
208
}
@@ -213,7 +217,9 @@ namespace OS {
213
217
GetVersionExA (&osa);
214
218
215
219
for (const OSVersion *scan = osVersions; scan->name ; scan++) {
216
- if (osa.dwMajorVersion >= scan->major && osa.dwMinorVersion >= scan->minor ) {
220
+ if (osa.dwMajorVersion >= scan->major &&
221
+ osa.dwMinorVersion >= scan->minor &&
222
+ osa.dwBuildNumber >= scan->build ) {
217
223
name = scan->name ;
218
224
break ;
219
225
}
0 commit comments