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
I find my mistake from: http://www.pinvoke.net/default.aspx/kernel32/GlobalMemoryStatusEx.html
I Changed
internal static extern bool GlobalMemoryStatusEx(ref MEMORYSTATUSEX lpBuffer);
To
static extern bool GlobalMemoryStatusEx([In, Out] MEMORYSTATUSEX lpBuffer);
and changed
GlobalMemoryStatusEx(ref statEX);
To
GlobalMemoryStatusEx(statEX);
It work correctly. Tanks