Alexandre Julliard : server: Return the process machine from the main exe instead of a CPU flag.

Alexandre Julliard julliard at winehq.org
Fri Apr 23 15:20:17 CDT 2021


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Apr 23 12:14:04 2021 +0200

server: Return the process machine from the main exe instead of a CPU flag.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/unix/process.c      | 3 ++-
 include/wine/server_protocol.h | 6 +++---
 server/mapping.c               | 1 +
 server/process.c               | 2 +-
 server/process.h               | 3 ++-
 server/protocol.def            | 2 +-
 server/request.h               | 2 +-
 server/trace.c                 | 2 +-
 8 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c
index 6112dd74c4a..6347d9d7c27 100644
--- a/dlls/ntdll/unix/process.c
+++ b/dlls/ntdll/unix/process.c
@@ -1259,7 +1259,8 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
                 {
                     req->handle = wine_server_obj_handle( handle );
                     if (!(ret = wine_server_call( req )))
-                        val = (reply->cpu != CPU_x86_64 && reply->cpu != CPU_ARM64);
+                        val = (reply->machine != IMAGE_FILE_MACHINE_AMD64 &&
+                               reply->machine != IMAGE_FILE_MACHINE_ARM64);
                 }
                 SERVER_END_REQ;
             }
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index a0300dc0d31..e9fbc2cca24 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -1010,9 +1010,9 @@ struct get_process_info_reply
     timeout_t    end_time;
     int          exit_code;
     int          priority;
-    client_cpu_t cpu;
+    unsigned short machine;
     /* VARARG(image,pe_image_info); */
-    char __pad_60[4];
+    char __pad_58[6];
 };
 
 
@@ -6219,7 +6219,7 @@ union generic_reply
 
 /* ### protocol_version begin ### */
 
-#define SERVER_PROTOCOL_VERSION 693
+#define SERVER_PROTOCOL_VERSION 694
 
 /* ### protocol_version end ### */
 
diff --git a/server/mapping.c b/server/mapping.c
index 8ac3189f9a4..3c4b707f282 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -362,6 +362,7 @@ static void add_process_view( struct thread *thread, struct memory_view *view )
         else if (!(view->image.image_charact & IMAGE_FILE_DLL))
         {
             /* main exe */
+            process->machine = view->image.machine;
             list_add_head( &process->views, &view->entry );
             if (get_view_nt_name( view, &name ) && (process->image = memdup( name.str, name.len )))
                 process->imagelen = name.len;
diff --git a/server/process.c b/server/process.c
index d819f03a615..780a2076a71 100644
--- a/server/process.c
+++ b/server/process.c
@@ -1317,7 +1317,7 @@ DECL_HANDLER(get_process_info)
         reply->peb              = process->peb;
         reply->start_time       = process->start_time;
         reply->end_time         = process->end_time;
-        reply->cpu              = process->cpu;
+        reply->machine          = process->machine;
         if (get_reply_max_size())
         {
             client_ptr_t base;
diff --git a/server/process.h b/server/process.h
index 58a211f2d0c..b49b8c9b919 100644
--- a/server/process.h
+++ b/server/process.h
@@ -53,6 +53,7 @@ struct process
     process_id_t         group_id;        /* group id of the process */
     struct timeout_user *sigkill_timeout; /* timeout for final SIGKILL */
     enum cpu_type        cpu;             /* client CPU type */
+    unsigned short       machine;         /* client machine type */
     int                  unix_pid;        /* Unix pid for final SIGKILL */
     int                  exit_code;       /* process exit code */
     int                  running_threads; /* number of threads running in this process */
@@ -66,7 +67,7 @@ struct process
     unsigned int         is_terminating:1;/* is process terminating? */
     data_size_t          imagelen;        /* length of image path in bytes */
     WCHAR               *image;           /* main exe image full path */
-    struct job          *job;             /* job object ascoicated with this process */
+    struct job          *job;             /* job object associated with this process */
     struct list          job_entry;       /* list entry for job object */
     struct list          asyncs;          /* list of async object owned by the process */
     struct list          locks;           /* list of file locks owned by the process */
diff --git a/server/protocol.def b/server/protocol.def
index e9d7d1b0b5e..7c22faef794 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -963,7 +963,7 @@ typedef struct
     timeout_t    end_time;         /* process end time */
     int          exit_code;        /* process exit code */
     int          priority;         /* priority class */
-    client_cpu_t cpu;              /* CPU that this process is running on */
+    unsigned short machine;        /* process architecture */
     VARARG(image,pe_image_info);   /* image info for main exe */
 @END
 
diff --git a/server/request.h b/server/request.h
index 063065a49c2..b8424b675c7 100644
--- a/server/request.h
+++ b/server/request.h
@@ -783,7 +783,7 @@ C_ASSERT( FIELD_OFFSET(struct get_process_info_reply, start_time) == 32 );
 C_ASSERT( FIELD_OFFSET(struct get_process_info_reply, end_time) == 40 );
 C_ASSERT( FIELD_OFFSET(struct get_process_info_reply, exit_code) == 48 );
 C_ASSERT( FIELD_OFFSET(struct get_process_info_reply, priority) == 52 );
-C_ASSERT( FIELD_OFFSET(struct get_process_info_reply, cpu) == 56 );
+C_ASSERT( FIELD_OFFSET(struct get_process_info_reply, machine) == 56 );
 C_ASSERT( sizeof(struct get_process_info_reply) == 64 );
 C_ASSERT( FIELD_OFFSET(struct get_process_debug_info_request, handle) == 12 );
 C_ASSERT( sizeof(struct get_process_debug_info_request) == 16 );
diff --git a/server/trace.c b/server/trace.c
index 6feacc48af1..96747333971 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -1503,7 +1503,7 @@ static void dump_get_process_info_reply( const struct get_process_info_reply *re
     dump_timeout( ", end_time=", &req->end_time );
     fprintf( stderr, ", exit_code=%d", req->exit_code );
     fprintf( stderr, ", priority=%d", req->priority );
-    dump_client_cpu( ", cpu=", &req->cpu );
+    fprintf( stderr, ", machine=%04x", req->machine );
     dump_varargs_pe_image_info( ", image=", cur_size );
 }
 




More information about the wine-cvs mailing list