Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/routine.c
Original file line number Diff line number Diff line change
Expand Up @@ -9168,8 +9168,8 @@ NTSTATUS _r_sys_getmemoryinfo (

out_buffer->physical_memory.used_bytes = out_buffer->physical_memory.total_bytes - out_buffer->physical_memory.free_bytes;

out_buffer->physical_memory.percent = (ULONG)PR_CALC_PERCENTOF (out_buffer->physical_memory.used_bytes, out_buffer->physical_memory.total_bytes);
out_buffer->physical_memory.percent_f = PR_CALC_PERCENTOF (out_buffer->physical_memory.used_bytes, out_buffer->physical_memory.total_bytes);
out_buffer->physical_memory.percent = (ULONG)out_buffer->physical_memory.percent_f;
}

// file cache information
Expand All @@ -9181,8 +9181,8 @@ NTSTATUS _r_sys_getmemoryinfo (
out_buffer->system_cache.free_bytes = (ULONG64)sfci.PeakSize - (ULONG64)sfci.CurrentSize;
out_buffer->system_cache.used_bytes = sfci.CurrentSize;

out_buffer->system_cache.percent = (ULONG)PR_CALC_PERCENTOF (out_buffer->system_cache.used_bytes, out_buffer->system_cache.total_bytes);
out_buffer->system_cache.percent_f = PR_CALC_PERCENTOF (out_buffer->system_cache.used_bytes, out_buffer->system_cache.total_bytes);
out_buffer->system_cache.percent = (ULONG)out_buffer->system_cache.percent_f;
}

// page file information
Expand Down Expand Up @@ -9214,8 +9214,9 @@ NTSTATUS _r_sys_getmemoryinfo (
pagefile = pagefile->NextEntryOffset ? PTR_ADD_OFFSET (pagefile, pagefile->NextEntryOffset) : NULL;
}

out_buffer->page_file.percent = (ULONG)PR_CALC_PERCENTOF (out_buffer->page_file.used_bytes, out_buffer->page_file.total_bytes);
out_buffer->page_file.percent_f = PR_CALC_PERCENTOF (out_buffer->page_file.used_bytes, out_buffer->page_file.total_bytes);
//memory are zeroed at start - no need to reassign zero
if (out_buffer->page_file.total_bytes) out_buffer->page_file.percent_f = PR_CALC_PERCENTOF (out_buffer->page_file.used_bytes, out_buffer->page_file.total_bytes);
out_buffer->page_file.percent = (ULONG)out_buffer->page_file.percent_f;
}

_r_mem_free (pagefiles);
Expand Down
10 changes: 10 additions & 0 deletions src/routine.h
Original file line number Diff line number Diff line change
Expand Up @@ -5586,6 +5586,16 @@ FORCEINLINE BOOLEAN _r_listview_deleteallitems (
return (_r_wnd_sendmessage (hwnd, ctrl_id, LVM_DELETEALLITEMS, 0, 0) == TRUE);
}

FORCEINLINE VOID _r_listview_reset (
_In_ HWND hwnd,
_In_opt_ INT ctrl_id
)
{
_r_listview_deleteallitems(hwnd, ctrl_id);
_r_listview_deleteallgroups(hwnd, ctrl_id);
_r_listview_deleteallcolumns(hwnd, ctrl_id);
}

FORCEINLINE BOOLEAN _r_listview_deleteitem (
_In_ HWND hwnd,
_In_opt_ INT ctrl_id,
Expand Down