https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d3a550a6a95cce96d281b6...
commit d3a550a6a95cce96d281b61973ee27eb22a5aa8c Author: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com AuthorDate: Thu May 14 09:47:21 2020 +0900 Commit: GitHub noreply@github.com CommitDate: Thu May 14 09:47:21 2020 +0900
[SHLWAPI] Implement SHIsLowMemoryMachine (#2783)
Implement shlwapi!SHIsLowMemoryMachine function. --- dll/win32/shlwapi/ordinal.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/dll/win32/shlwapi/ordinal.c b/dll/win32/shlwapi/ordinal.c index db932c7932e..84234865b28 100644 --- a/dll/win32/shlwapi/ordinal.c +++ b/dll/win32/shlwapi/ordinal.c @@ -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 }
/*************************************************************************