Skip to content

Commit 2d2b9d3

Browse files
authored
Merge pull request #7049 from BOINC/dpa_wsl13
client (Win): if dont_use_wsl is set in cc_config.xml, don't query for WSL
2 parents 39aaaf5 + 78c2160 commit 2d2b9d3

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

client/hostinfo_win.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,14 +1665,21 @@ int HOST_INFO::get_host_info(bool init) {
16651665
get_os_information(
16661666
os_name, sizeof(os_name), os_version, sizeof(os_version)
16671667
);
1668+
16681669
#ifdef _WIN64
1669-
OSVERSIONINFOEX osvi;
1670-
if (get_OSVERSIONINFO(osvi) && osvi.dwMajorVersion >= 10) {
1671-
retval = get_wsl_information(wsl_distros);
1672-
if (retval) {
1673-
msg_printf(0, MSG_INTERNAL_ERROR,
1674-
"get_wsl_information(): %s", boincerror(retval)
1675-
);
1670+
// apparently if WSL is not present, querying for it pops up an alert.
1671+
// Avoid this if WSL disabled in config
1672+
//
1673+
wsl_distros.clear();
1674+
if (!cc_config.dont_use_wsl) {
1675+
OSVERSIONINFOEX osvi;
1676+
if (get_OSVERSIONINFO(osvi) && osvi.dwMajorVersion >= 10) {
1677+
retval = get_wsl_information(wsl_distros);
1678+
if (retval) {
1679+
msg_printf(0, MSG_INTERNAL_ERROR,
1680+
"get_wsl_information(): %s", boincerror(retval)
1681+
);
1682+
}
16761683
}
16771684
}
16781685
#endif

0 commit comments

Comments
 (0)