I am using the GlobalMemoryStatusEx function to retrieve information about memory, but this function doesn\'t work correctly. It returns 0 for all properties. I
GlobalMemoryStatusEx
You forgot to set statEX.dwLength before calling GlobalMemoryStatusEx.
statEX.dwLength
MEMORYSTATUSEX statEX = new MEMORYSTATUSEX(); statEX.dwLength = (uint)Marshal.SizeOf(typeof(MEMORYSTATUSEX)); GlobalMemoryStatusEx(ref statEX);