Skip to content

Commit fc3e377

Browse files
committed
Test fix for incorrect RAM report
1 parent 78f1d0b commit fc3e377

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Shared/sdk/SharedUtil.SysInfo.hpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,17 @@ long long SharedUtil::GetWMITotalPhysicalMemory(void)
306306

307307
QueryWMI(result, "Win32_ComputerSystem", "TotalPhysicalMemory");
308308

309-
if (result.empty())
310-
return 0;
311-
312-
const SString& strTotalPhysicalMemory = result[0][0];
313-
llResult = _atoi64(strTotalPhysicalMemory);
309+
if (!result.empty())
310+
{
311+
const SString& strTotalPhysicalMemory = result[0][0];
312+
llResult = _atoi64(strTotalPhysicalMemory);
313+
}
314314
}
315315

316+
if (llResult == 0)
317+
{
318+
llResult = 2LL * 1024 * 1024 * 1024; // 2GB
319+
}
316320
return llResult;
317321
}
318322

@@ -388,6 +392,10 @@ long long SharedUtil::GetWMIVideoAdapterMemorySize(const SString& strDisplay)
388392
}
389393
}
390394

395+
if (llResult == 0)
396+
{
397+
llResult = 2LL * 1024 * 1024 * 1024; // 2GB
398+
}
391399
return llResult;
392400
}
393401

0 commit comments

Comments
 (0)