ntdll: Fill the VM counters in NtQuerySystemInformation(SystemProcessInformation).
Process Hacker displays this information. Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cb511b82bd
commit
829c759513
dlls/ntdll/unix
|
@ -1002,10 +1002,13 @@ NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code )
|
|||
|
||||
#if defined(HAVE_MACH_MACH_H)
|
||||
|
||||
static void fill_VM_COUNTERS( VM_COUNTERS_EX *pvmi )
|
||||
void fill_vm_counters( VM_COUNTERS_EX *pvmi, int unix_pid )
|
||||
{
|
||||
#if defined(MACH_TASK_BASIC_INFO)
|
||||
struct mach_task_basic_info info;
|
||||
|
||||
if (unix_pid != -1) return; /* FIXME: Retrieve information for other processes. */
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -1019,13 +1022,17 @@ static void fill_VM_COUNTERS( VM_COUNTERS_EX *pvmi )
|
|||
|
||||
#elif defined(linux)
|
||||
|
||||
static void fill_VM_COUNTERS( VM_COUNTERS_EX *pvmi )
|
||||
void fill_vm_counters( VM_COUNTERS_EX *pvmi, int unix_pid )
|
||||
{
|
||||
FILE *f;
|
||||
char line[256];
|
||||
char line[256], path[26];
|
||||
unsigned long value;
|
||||
|
||||
f = fopen("/proc/self/status", "r");
|
||||
if (unix_pid == -1)
|
||||
strcpy( path, "/proc/self/status" );
|
||||
else
|
||||
sprintf( path, "/proc/%u/status", unix_pid);
|
||||
f = fopen( path, "r" );
|
||||
if (!f) return;
|
||||
|
||||
while (fgets(line, sizeof(line), f))
|
||||
|
@ -1050,7 +1057,7 @@ static void fill_VM_COUNTERS( VM_COUNTERS_EX *pvmi )
|
|||
|
||||
#else
|
||||
|
||||
static void fill_VM_COUNTERS( VM_COUNTERS_EX *pvmi )
|
||||
void fill_vm_counters( VM_COUNTERS_EX *pvmi, int unix_pid )
|
||||
{
|
||||
/* FIXME : real data */
|
||||
}
|
||||
|
@ -1171,7 +1178,7 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
|
|||
else
|
||||
{
|
||||
memset(&pvmi, 0, sizeof(pvmi));
|
||||
if (handle == GetCurrentProcess()) fill_VM_COUNTERS(&pvmi);
|
||||
if (handle == GetCurrentProcess()) fill_vm_counters( &pvmi, -1 );
|
||||
else
|
||||
{
|
||||
SERVER_START_REQ(get_process_vm_counters)
|
||||
|
|
|
@ -2147,6 +2147,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
|
|||
nt_process->ParentProcessId = UlongToHandle(server_process->parent_pid);
|
||||
nt_process->HandleCount = server_process->handle_count;
|
||||
get_thread_times( server_process->unix_pid, -1, &nt_process->KernelTime, &nt_process->UserTime );
|
||||
fill_vm_counters( &nt_process->vmCounters, server_process->unix_pid );
|
||||
}
|
||||
|
||||
pos = (pos + 7) & ~7;
|
||||
|
|
|
@ -221,6 +221,7 @@ extern void DECLSPEC_NORETURN signal_start_thread( PRTL_THREAD_START_ROUTINE ent
|
|||
BOOL suspend, void *relay, TEB *teb ) DECLSPEC_HIDDEN;
|
||||
extern void DECLSPEC_NORETURN signal_exit_thread( int status, void (*func)(int) ) DECLSPEC_HIDDEN;
|
||||
extern void __wine_syscall_dispatcher(void) DECLSPEC_HIDDEN;
|
||||
extern void fill_vm_counters( VM_COUNTERS_EX *pvmi, int unix_pid ) DECLSPEC_HIDDEN;
|
||||
|
||||
extern NTSTATUS cdrom_DeviceIoControl( HANDLE device, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user,
|
||||
IO_STATUS_BLOCK *io, ULONG code, void *in_buffer,
|
||||
|
|
Loading…
Reference in New Issue