Commit 1f9fe124 authored by Snorri Sturluson's avatar Snorri Sturluson Committed by Alexandre Julliard

ntdll: Fill in memory counters under OS X.

parent 008f14f0
......@@ -40,6 +40,10 @@
#include "ntdll_misc.h"
#include "wine/server.h"
#ifdef HAVE_MACH_MACH_H
#include <mach/mach.h>
#endif
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
static ULONG execute_flags = MEM_EXECUTE_OPTION_DISABLE;
......@@ -110,6 +114,32 @@ ULONG_PTR get_system_affinity_mask(void)
return ((ULONG_PTR)1 << num_cpus) - 1;
}
#if defined(HAVE_MACH_MACH_H)
static void fill_VM_COUNTERS(VM_COUNTERS* pvmi)
{
#if defined(MACH_TASK_BASIC_INFO)
struct mach_task_basic_info info;
mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
if(task_info(mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t)&info, &infoCount) == KERN_SUCCESS)
{
pvmi->VirtualSize = info.resident_size + info.virtual_size;
pvmi->PagefileUsage = info.virtual_size;
pvmi->WorkingSetSize = info.resident_size;
pvmi->PeakWorkingSetSize = info.resident_size_max;
}
#endif
}
#else
static void fill_VM_COUNTERS(VM_COUNTERS* pvmi)
{
/* FIXME : real data */
}
#endif
/******************************************************************************
* NtQueryInformationProcess [NTDLL.@]
* ZwQueryInformationProcess [NTDLL.@]
......@@ -240,8 +270,8 @@ NTSTATUS WINAPI NtQueryInformationProcess(
ret = STATUS_INVALID_HANDLE;
else
{
/* FIXME : real data */
memset(&pvmi, 0 , sizeof(VM_COUNTERS));
fill_VM_COUNTERS(&pvmi);
len = ProcessInformationLength;
if (len != FIELD_OFFSET(VM_COUNTERS,PrivatePageCount)) len = sizeof(VM_COUNTERS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment