Commit 9fd54b28 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

- Implemented a few information classes in NtQuerySystemInformation.

- Added handle information to (wineserver) process snapshot.
parent 66824e5f
......@@ -1592,6 +1592,7 @@ struct next_process_reply
void* module;
int threads;
int priority;
int handles;
/* VARARG(filename,string); */
};
......@@ -3664,6 +3665,6 @@ union generic_reply
struct open_token_reply open_token_reply;
};
#define SERVER_PROTOCOL_VERSION 120
#define SERVER_PROTOCOL_VERSION 121
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
......@@ -482,8 +482,10 @@ typedef struct _UNWIND_HISTORY_TABLE {
/* This is used by NtQuerySystemInformation */
/* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
typedef struct {
FILETIME ftCreationTime;
DWORD dwUnknown1;
FILETIME ftKernelTime;
FILETIME ftUserTime;
FILETIME ftCreateTime;
DWORD dwTickCount;
DWORD dwStartAddress;
DWORD dwOwningPID;
DWORD dwThreadID;
......@@ -492,7 +494,6 @@ typedef struct {
DWORD dwContextSwitches;
DWORD dwThreadState;
DWORD dwWaitReason;
DWORD dwUnknown2[5];
} THREADINFO, *PTHREADINFO;
/* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
......@@ -771,7 +772,7 @@ typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
#ifdef __WINESRC__
LARGE_INTEGER liIdleTime;
DWORD dwSpare[76];
DWORD dwSpare[10];
#else
LARGE_INTEGER IdleTime;
LARGE_INTEGER KernelTime;
......
......@@ -503,6 +503,12 @@ obj_handle_t open_object( const struct namespace *namespace, const WCHAR *name,
return handle;
}
/* return the size of the handle table of a given process */
unsigned int get_handle_table_count( struct process *process )
{
return process->handles->count;
}
/* close a handle */
DECL_HANDLER(close_handle)
{
......
......@@ -47,6 +47,8 @@ extern obj_handle_t open_object( const struct namespace *namespace, const WCHAR
extern obj_handle_t find_inherited_handle( struct process *process, const struct object_ops *ops );
extern struct handle_table *alloc_handle_table( struct process *process, int count );
extern struct handle_table *copy_handle_table( struct process *process, struct process *parent );
extern unsigned int get_handle_table_count( struct process *process);
extern void close_global_handles(void);
#endif /* __WINE_SERVER_HANDLE_H */
......@@ -845,6 +845,7 @@ struct process_snapshot *process_snap( int *count )
ptr->threads = process->running_threads;
ptr->count = process->obj.refcount;
ptr->priority = process->priority;
ptr->handles = get_handle_table_count(process);
grab_object( process );
ptr++;
}
......
......@@ -86,6 +86,7 @@ struct process_snapshot
int count; /* process refcount */
int threads; /* number of threads */
int priority; /* priority class */
int handles; /* number of handles */
};
struct module_snapshot
......
......@@ -1175,6 +1175,7 @@ enum char_info_mode
void* module; /* main module */
int threads; /* number of threads */
int priority; /* process priority */
int handles; /* number of handles */
VARARG(filename,string); /* file name of main exe */
@END
......
......@@ -128,6 +128,7 @@ static int snapshot_next_process( struct snapshot *snapshot, struct next_process
reply->module = 0; /* FIXME */
reply->threads = ptr->threads;
reply->priority = ptr->priority;
reply->handles = ptr->handles;
if (ptr->process->exe.filename)
{
size_t len = min( ptr->process->exe.namelen, get_reply_max_size() );
......
......@@ -1372,6 +1372,7 @@ static void dump_next_process_reply( const struct next_process_reply *req )
fprintf( stderr, " module=%p,", req->module );
fprintf( stderr, " threads=%d,", req->threads );
fprintf( stderr, " priority=%d,", req->priority );
fprintf( stderr, " handles=%d,", req->handles );
fprintf( stderr, " filename=" );
dump_varargs_string( cur_size );
}
......
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