Google Groups

Calling kernel.dll from Mathematica

Alexey Popkov Mar 16, 2010 2:47 AM
Posted in group: comp.soft-sys.math.mathematica
There are nice examples in the Documentstion on calling simple functions
defined in the Windows's kernel.dll from Mathematica. For example, it is
easy to call GetTickCount function:

getTickCount = DefineDLLFunction["GetTickCount", "kernel32.dll", "int", {}]

But I have not found any example on calling a function that returns a
structure. I am interested in use GlobalMemoryStatusEx function that
"retrieves information about the system's current usage of both physical and
virtual memory." In C# it is easy to get this information in numerical form:

But how can this be done in Mathematica?