public MemoryInfo GetMemoryInfo() { MemoryInfo.Native native = new MemoryInfo.Native(); native.cb = (uint)Marshal.SizeOf <MemoryInfo.Native>(); bool success = GetProcessMemoryInfo(handle, ref native, native.cb); if (!success) { throw new Win32Exception(); } return(native.AsManaged()); }
internal static unsafe extern bool GetProcessMemoryInfo(SafeProcessHandle handle, ref MemoryInfo.Native native, uint cb);