File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -306,13 +306,17 @@ long long SharedUtil::GetWMITotalPhysicalMemory(void)
306
306
307
307
QueryWMI (result, " Win32_ComputerSystem" , " TotalPhysicalMemory" );
308
308
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
+ }
314
314
}
315
315
316
+ if (llResult == 0 )
317
+ {
318
+ llResult = 2LL * 1024 * 1024 * 1024 ; // 2GB
319
+ }
316
320
return llResult;
317
321
}
318
322
@@ -388,6 +392,10 @@ long long SharedUtil::GetWMIVideoAdapterMemorySize(const SString& strDisplay)
388
392
}
389
393
}
390
394
395
+ if (llResult == 0 )
396
+ {
397
+ llResult = 2LL * 1024 * 1024 * 1024 ; // 2GB
398
+ }
391
399
return llResult;
392
400
}
393
401
You can’t perform that action at this time.
0 commit comments