libobs: Fix reading Windows release name

This commit is contained in:
derrod
2022-11-08 08:47:23 -05:00
committed by Ryan Foster
parent 93456dfde2
commit 567505b2ed
+3 -1
View File
@@ -1187,7 +1187,9 @@ static inline void get_reg_ver(struct win_version_info *ver)
ver->build = wcstol(str, NULL, 10);
}
if (get_reg_sz(key, L"ReleaseId", str, sizeof(str))) {
const wchar_t *release_key = ver->build > 19041 ? L"DisplayVersion"
: L"ReleaseId";
if (get_reg_sz(key, release_key, str, sizeof(str))) {
os_wcs_to_utf8(str, 0, win_release_id, MAX_SZ_LEN);
}