[SHLWAPI] Implement SHIsLowMemoryMachine (#2783)
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Thu, 14 May 2020 00:47:21 +0000 (09:47 +0900)
committerGitHub <noreply@github.com>
Thu, 14 May 2020 00:47:21 +0000 (09:47 +0900)
Implement shlwapi!SHIsLowMemoryMachine function.

dll/win32/shlwapi/ordinal.c

index db932c7..8423486 100644 (file)
@@ -4324,16 +4324,28 @@ HRESULT WINAPI SHGetInverseCMAP(LPDWORD dest, DWORD dwSize)
  * Determine if the current computer has low memory.
  *
  * PARAMS
- *  x [I] FIXME
+ *  dwType [I] Zero.
  *
  * RETURNS
  *  TRUE if the users machine has 16 Megabytes of memory or less,
  *  FALSE otherwise.
  */
-BOOL WINAPI SHIsLowMemoryMachine (DWORD x)
+BOOL WINAPI SHIsLowMemoryMachine(DWORD dwType)
 {
-  FIXME("(0x%08x) stub\n", x);
+#ifdef __REACTOS__
+    MEMORYSTATUS status;
+    static int is_low = -1;
+    TRACE("(0x%08x)\n", dwType);
+    if (dwType == 0 && is_low == -1)
+    {
+        GlobalMemoryStatus(&status);
+        is_low = (status.dwTotalPhys <= 0x1000000);
+    }
+    return is_low;
+#else
+  FIXME("(0x%08x) stub\n", dwType);
   return FALSE;
+#endif
 }
 
 /*************************************************************************