Hans Leidekker : server: Include the Unix pid in the snapshot_next_process reply.

Alexandre Julliard julliard at winehq.org
Mon Apr 16 13:35:47 CDT 2012


Module: wine
Branch: master
Commit: d1b6cf93795adf96519d48343b6ff5d3fbe86324
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d1b6cf93795adf96519d48343b6ff5d3fbe86324

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Mon Apr 16 12:35:17 2012 +0200

server: Include the Unix pid in the snapshot_next_process reply.

---

 include/wine/server_protocol.h |    4 +++-
 server/process.c               |    1 +
 server/process.h               |    1 +
 server/protocol.def            |    1 +
 server/request.h               |    3 ++-
 server/snapshot.c              |    1 +
 server/trace.c                 |    1 +
 7 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index 0e989da..41e8e28 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -2052,7 +2052,9 @@ struct next_process_reply
     int          threads;
     int          priority;
     int          handles;
+    int          unix_pid;
     /* VARARG(filename,unicode_str); */
+    char __pad_36[4];
 };
 
 
@@ -5646,6 +5648,6 @@ union generic_reply
     struct set_suspend_context_reply set_suspend_context_reply;
 };
 
-#define SERVER_PROTOCOL_VERSION 431
+#define SERVER_PROTOCOL_VERSION 432
 
 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */
diff --git a/server/process.c b/server/process.c
index de3b594..6a5f4b1 100644
--- a/server/process.c
+++ b/server/process.c
@@ -847,6 +847,7 @@ struct process_snapshot *process_snap( int *count )
         ptr->count    = process->obj.refcount;
         ptr->priority = process->priority;
         ptr->handles  = get_handle_table_count(process);
+        ptr->unix_pid = process->unix_pid;
         grab_object( process );
         ptr++;
     }
diff --git a/server/process.h b/server/process.h
index 93ec6c7..976dd38 100644
--- a/server/process.h
+++ b/server/process.h
@@ -90,6 +90,7 @@ struct process_snapshot
     int             threads;  /* number of threads */
     int             priority; /* priority class */
     int             handles;  /* number of handles */
+    int             unix_pid; /* Unix pid */
 };
 
 #define CPU_FLAG(cpu) (1 << (cpu))
diff --git a/server/protocol.def b/server/protocol.def
index 80c0cd3..31a3b0d 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -1577,6 +1577,7 @@ enum char_info_mode
     int          threads;       /* number of threads */
     int          priority;      /* process priority */
     int          handles;       /* number of handles */
+    int          unix_pid;      /* Unix pid */
     VARARG(filename,unicode_str); /* file name of main exe */
 @END
 
diff --git a/server/request.h b/server/request.h
index 5b45cf9..8f93085 100644
--- a/server/request.h
+++ b/server/request.h
@@ -1161,7 +1161,8 @@ C_ASSERT( FIELD_OFFSET(struct next_process_reply, ppid) == 16 );
 C_ASSERT( FIELD_OFFSET(struct next_process_reply, threads) == 20 );
 C_ASSERT( FIELD_OFFSET(struct next_process_reply, priority) == 24 );
 C_ASSERT( FIELD_OFFSET(struct next_process_reply, handles) == 28 );
-C_ASSERT( sizeof(struct next_process_reply) == 32 );
+C_ASSERT( FIELD_OFFSET(struct next_process_reply, unix_pid) == 32 );
+C_ASSERT( sizeof(struct next_process_reply) == 40 );
 C_ASSERT( FIELD_OFFSET(struct next_thread_request, handle) == 12 );
 C_ASSERT( FIELD_OFFSET(struct next_thread_request, reset) == 16 );
 C_ASSERT( sizeof(struct next_thread_request) == 24 );
diff --git a/server/snapshot.c b/server/snapshot.c
index bc48922..dd00bd1 100644
--- a/server/snapshot.c
+++ b/server/snapshot.c
@@ -117,6 +117,7 @@ static int snapshot_next_process( struct snapshot *snapshot, struct next_process
     reply->threads  = ptr->threads;
     reply->priority = ptr->priority;
     reply->handles  = ptr->handles;
+    reply->unix_pid = ptr->process->unix_pid;
     if ((exe_module = get_process_exe_module( ptr->process )) && exe_module->filename)
     {
         data_size_t len = min( exe_module->namelen, get_reply_max_size() );
diff --git a/server/trace.c b/server/trace.c
index cfef963..4318a34 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -1969,6 +1969,7 @@ static void dump_next_process_reply( const struct next_process_reply *req )
     fprintf( stderr, ", threads=%d", req->threads );
     fprintf( stderr, ", priority=%d", req->priority );
     fprintf( stderr, ", handles=%d", req->handles );
+    fprintf( stderr, ", unix_pid=%d", req->unix_pid );
     dump_varargs_unicode_str( ", filename=", cur_size );
 }
 




More information about the wine-cvs mailing list