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.
This commit is contained in:
Ryan Foster 2017-10-06 01:27:15 -04:00
parent 3dc96fbe43
commit d6ee57ae83

View File

@ -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);
} }