Browse Source

libobs: Log correct amount of memory on 32bit (windows)

Closes jp9000/obs-studio#764
Alexandre Vicenzi 8 years ago
parent
commit
1d5a5558ab
1 changed files with 7 additions and 5 deletions
  1. 7 5
      libobs/obs-windows.c

+ 7 - 5
libobs/obs-windows.c

@@ -157,18 +157,20 @@ static void log_processor_cores(void)
 
 static void log_available_memory(void)
 {
-	MEMORYSTATUS ms;
-	GlobalMemoryStatus(&ms);
+	MEMORYSTATUSEX ms;
+	ms.dwLength = sizeof(ms);
+
+	GlobalMemoryStatusEx(&ms);
 
 #ifdef _WIN64
 	const char *note = "";
 #else
-	const char *note = " (NOTE: 2 or 4 gigs max is normal for 32bit programs)";
+	const char *note = " (NOTE: 32bit programs cannot use more than 3gb)";
 #endif
 
 	blog(LOG_INFO, "Physical Memory: %luMB Total, %luMB Free%s",
-			(DWORD)(ms.dwTotalPhys / 1048576),
-			(DWORD)(ms.dwAvailPhys / 1048576),
+			(DWORD)(ms.ullTotalPhys / 1048576),
+			(DWORD)(ms.ullAvailPhys / 1048576),
 			note);
 }