I'm intrigued why MS decided to have GlobalMemoryStatus return a negative number if there is more than 4GB, rather than returning the maximum value.
The actual behavior of GlobalMemoryStatus is a bit more complicated, see https://ftp.zx.net.nz/pub/archive/ftp.microsoft.com/MISC/KB/....
that's a pretty bad assumption for an OS that is notorious for its backwards compatibility.