Browse Source

libobs/util: Fix Windows 10 revision detection

Follow-up to 47aa56b (PR #620). Windows 10 revision detection broke in
Build 15036 (Creators Update) after Revision 296. This aims to further
fix revision detection on Windows 10.
Ryan Foster 8 years ago
parent
commit
d6ee57ae83
1 changed files with 3 additions and 2 deletions
  1. 3 2
      libobs/util/platform-windows.c

+ 3 - 2
libobs/util/platform-windows.c

@@ -814,7 +814,7 @@ void get_win_ver(struct win_version_info *info)
 		get_dll_ver(L"kernel32", &ver);
 		get_dll_ver(L"kernel32", &ver);
 		got_version = true;
 		got_version = true;
 
 
-		if (ver.major == 10 && ver.revis == 0) {
+		if (ver.major == 10) {
 			HKEY    key;
 			HKEY    key;
 			DWORD   size, win10_revision;
 			DWORD   size, win10_revision;
 			LSTATUS status;
 			LSTATUS status;
@@ -829,7 +829,8 @@ void get_win_ver(struct win_version_info *info)
 			status = RegQueryValueExW(key, L"UBR", NULL, NULL,
 			status = RegQueryValueExW(key, L"UBR", NULL, NULL,
 					(LPBYTE)&win10_revision, &size);
 					(LPBYTE)&win10_revision, &size);
 			if (status == ERROR_SUCCESS)
 			if (status == ERROR_SUCCESS)
-				ver.revis = (int)win10_revision;
+				ver.revis = (int)win10_revision > ver.revis ?
+						(int)win10_revision : ver.revis;
 
 
 			RegCloseKey(key);
 			RegCloseKey(key);
 		}
 		}