Alexandre Julliard : server: Also return CPU type in the mapping image information.

Alexandre Julliard julliard at winehq.org
Thu Oct 11 17:26:36 CDT 2018


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Oct 11 15:12:29 2018 +0200

server: Also return CPU type in the mapping image information.

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

---

 include/wine/server_protocol.h | 3 ++-
 server/mapping.c               | 5 +++++
 server/protocol.def            | 1 +
 server/trace.c                 | 4 +++-
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index e8611ce..3114c1c 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -700,6 +700,7 @@ typedef struct
     unsigned int   header_size;
     unsigned int   file_size;
     unsigned int   checksum;
+    cpu_type_t     cpu;
 } pe_image_info_t;
 #define IMAGE_FLAGS_ComPlusNativeReady        0x01
 #define IMAGE_FLAGS_ComPlusILOnly             0x02
@@ -6531,6 +6532,6 @@ union generic_reply
     struct terminate_job_reply terminate_job_reply;
 };
 
-#define SERVER_PROTOCOL_VERSION 565
+#define SERVER_PROTOCOL_VERSION 566
 
 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */
diff --git a/server/mapping.c b/server/mapping.c
index 2955766..affe8fc 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -600,14 +600,17 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
         switch (nt.FileHeader.Machine)
         {
         case IMAGE_FILE_MACHINE_I386:
+            mapping->image.cpu = CPU_x86;
             if (cpu_mask & (CPU_FLAG(CPU_x86) | CPU_FLAG(CPU_x86_64))) break;
             return STATUS_INVALID_IMAGE_FORMAT;
         case IMAGE_FILE_MACHINE_ARM:
         case IMAGE_FILE_MACHINE_THUMB:
         case IMAGE_FILE_MACHINE_ARMNT:
+            mapping->image.cpu = CPU_ARM;
             if (cpu_mask & (CPU_FLAG(CPU_ARM) | CPU_FLAG(CPU_ARM64))) break;
             return STATUS_INVALID_IMAGE_FORMAT;
         case IMAGE_FILE_MACHINE_POWERPC:
+            mapping->image.cpu = CPU_POWERPC;
             if (cpu_mask & CPU_FLAG(CPU_POWERPC)) break;
             return STATUS_INVALID_IMAGE_FORMAT;
         default:
@@ -643,9 +646,11 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
         switch (nt.FileHeader.Machine)
         {
         case IMAGE_FILE_MACHINE_AMD64:
+            mapping->image.cpu = CPU_x86_64;
             if (cpu_mask & (CPU_FLAG(CPU_x86) | CPU_FLAG(CPU_x86_64))) break;
             return STATUS_INVALID_IMAGE_FORMAT;
         case IMAGE_FILE_MACHINE_ARM64:
+            mapping->image.cpu = CPU_ARM64;
             if (cpu_mask & (CPU_FLAG(CPU_ARM) | CPU_FLAG(CPU_ARM64))) break;
             return STATUS_INVALID_IMAGE_FORMAT;
         default:
diff --git a/server/protocol.def b/server/protocol.def
index 1a76f22..e72dea6 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -716,6 +716,7 @@ typedef struct
     unsigned int   header_size;
     unsigned int   file_size;
     unsigned int   checksum;
+    cpu_type_t     cpu;
 } pe_image_info_t;
 #define IMAGE_FLAGS_ComPlusNativeReady        0x01
 #define IMAGE_FLAGS_ComPlusILOnly             0x02
diff --git a/server/trace.c b/server/trace.c
index 5140ab1..6ccc777 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -1177,10 +1177,12 @@ static void dump_varargs_pe_image_info( const char *prefix, data_size_t size )
     dump_uint64( ",stack_commit=", &info.stack_commit );
     fprintf( stderr, ",zerobits=%08x,subsystem=%08x,subsystem_low=%04x,subsystem_high=%04x,gp=%08x"
              ",image_charact=%04x,dll_charact=%04x,machine=%04x,contains_code=%u,image_flags=%02x"
-             ",loader_flags=%08x,header_size=%08x,file_size=%08x,checksum=%08x}",
+             ",loader_flags=%08x,header_size=%08x,file_size=%08x,checksum=%08x",
              info.zerobits, info.subsystem, info.subsystem_low, info.subsystem_high, info.gp,
              info.image_charact, info.dll_charact, info.machine, info.contains_code, info.image_flags,
              info.loader_flags, info.header_size, info.file_size, info.checksum );
+    dump_cpu_type( ",cpu=", &info.cpu );
+    fputc( '}', stderr );
     remove_data( size );
 }
 




More information about the wine-cvs mailing list