https://git.reactos.org/?p=reactos.git;a=commitdiff;h=92dc946e863a8b8c3638e6c17350cb1e5111aa65

commit 92dc946e863a8b8c3638e6c17350cb1e5111aa65
Author:     winesync <[email protected]>
AuthorDate: Fri Sep 11 19:00:41 2020 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Wed Sep 16 10:35:54 2020 +0200

    [WINESYNC] dbghelp: Use local symtab and segment commands declarations.
    
    Signed-off-by: Jacek Caban <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 7b2e53f5b550e8a4d844c5e74941b02d1c770b0b by Jacek Caban 
<[email protected]>
---
 dll/win32/dbghelp/macho_module.c | 50 ++++++++++++++++++++++++++++++++++++----
 sdk/tools/winesync/dbghelp.cfg   |  2 +-
 2 files changed, 46 insertions(+), 6 deletions(-)

diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c
index 6710385a88c..4ca9bee48ec 100644
--- a/dll/win32/dbghelp/macho_module.c
+++ b/dll/win32/dbghelp/macho_module.c
@@ -92,6 +92,46 @@ union wine_all_image_infos {
     struct dyld_all_image_infos64 infos64;
 };
 
+struct macho_segment_command
+{
+    UINT32  cmd;          /* LC_SEGMENT_64 */
+    UINT32  cmdsize;      /* includes sizeof section_64 structs */
+    char    segname[16];  /* segment name */
+    UINT64  vmaddr;       /* memory address of this segment */
+    UINT64  vmsize;       /* memory size of this segment */
+    UINT64  fileoff;      /* file offset of this segment */
+    UINT64  filesize;     /* amount to map from the file */
+    UINT32  maxprot;      /* maximum VM protection */
+    UINT32  initprot;     /* initial VM protection */
+    UINT32  nsects;       /* number of sections in segment */
+    UINT32  flags;        /* flags */
+};
+
+struct macho_segment_command32
+{
+    UINT32  cmd;          /* LC_SEGMENT */
+    UINT32  cmdsize;      /* includes sizeof section structs */
+    char    segname[16];  /* segment name */
+    UINT32  vmaddr;       /* memory address of this segment */
+    UINT32  vmsize;       /* memory size of this segment */
+    UINT32  fileoff;      /* file offset of this segment */
+    UINT32  filesize;     /* amount to map from the file */
+    UINT32  maxprot;      /* maximum VM protection */
+    UINT32  initprot;     /* initial VM protection */
+    UINT32  nsects;       /* number of sections in segment */
+    UINT32  flags;        /* flags */
+};
+
+struct macho_symtab_command
+{
+    UINT32  cmd;          /* LC_SYMTAB */
+    UINT32  cmdsize;      /* sizeof(struct symtab_command) */
+    UINT32  symoff;       /* symbol table offset */
+    UINT32  nsyms;        /* number of symbol table entries */
+    UINT32  stroff;       /* string table offset */
+    UINT32  strsize;      /* string table size in bytes */
+};
+
 #ifdef WORDS_BIGENDIAN
 #define swap_ulong_be_to_host(n) (n)
 #else
@@ -535,13 +575,13 @@ static int macho_count_sections(struct image_file_map* 
ifm, const struct macho_l
 
     if (ifm->addr_size == 32)
     {
-        const struct segment_command *sc = (const struct segment_command *)lc;
+        const struct macho_segment_command32 *sc = (const struct 
macho_segment_command32 *)lc;
         memcpy(segname, sc->segname, sizeof(segname));
         nsects = sc->nsects;
     }
     else
     {
-        const struct segment_command_64 *sc = (const struct segment_command_64 
*)lc;
+        const struct macho_segment_command *sc = (const struct 
macho_segment_command *)lc;
         memcpy(segname, sc->segname, sizeof(segname));
         nsects = sc->nsects;
     }
@@ -574,7 +614,7 @@ static int macho_load_section_info(struct image_file_map* 
ifm, const struct mach
 
     if (ifm->addr_size == 32)
     {
-        const struct segment_command *sc = (const struct segment_command *)lc;
+        const struct macho_segment_command32 *sc = (const struct 
macho_segment_command32 *)lc;
         vmaddr = sc->vmaddr;
         vmsize = sc->vmsize;
         memcpy(segname, sc->segname, sizeof(segname));
@@ -583,7 +623,7 @@ static int macho_load_section_info(struct image_file_map* 
ifm, const struct mach
     }
     else
     {
-        const struct segment_command_64 *sc = (const struct segment_command_64 
*)lc;
+        const struct macho_segment_command *sc = (const struct 
macho_segment_command *)lc;
         vmaddr = sc->vmaddr;
         vmsize = sc->vmsize;
         memcpy(segname, sc->segname, sizeof(segname));
@@ -943,7 +983,7 @@ static int macho_parse_symtab(struct image_file_map* ifm,
                               const struct macho_load_command* lc, void* user)
 {
     struct macho_file_map* fmap = &ifm->u.macho;
-    const struct symtab_command*    sc = (const struct symtab_command*)lc;
+    const struct macho_symtab_command* sc = (const struct 
macho_symtab_command*)lc;
     struct macho_debug_info*        mdi = user;
     const char*                     stabstr;
     int                             ret = 0;
diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg
index 7bb2f98904c..1b194b5e913 100644
--- a/sdk/tools/winesync/dbghelp.cfg
+++ b/sdk/tools/winesync/dbghelp.cfg
@@ -4,4 +4,4 @@ files:
   include/dbghelp.h: sdk/include/psdk/dbghelp.h
   include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
 tags:
-  wine: 8230889f1f2e545222f3a51ba9b47fa02196eb98
+  wine: 7b2e53f5b550e8a4d844c5e74941b02d1c770b0b

Reply via email to