Paul Gofman : mscoree: Make vtable and tokens local declarations arch independent.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 26 10:32:50 CST 2016


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

Author: Paul Gofman <gofmanp at gmail.com>
Date:   Sun Jan 24 21:37:02 2016 +0300

mscoree: Make vtable and tokens local declarations arch independent.

Signed-off-by: Paul Gofman <gofmanp at gmail.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mscoree/corruntimehost.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/dlls/mscoree/corruntimehost.c b/dlls/mscoree/corruntimehost.c
index e437cc2..037ae28 100644
--- a/dlls/mscoree/corruntimehost.c
+++ b/dlls/mscoree/corruntimehost.c
@@ -984,13 +984,13 @@ static void CDECL ReallyFixupVTable(struct dll_fixup *fixup)
 
         if (fixup->fixup->type & COR_VTABLE_32BIT)
         {
-            DWORD *vtable = fixup->vtable;
-            DWORD *tokens = fixup->tokens;
+            void **vtable = fixup->vtable;
+            ULONG_PTR *tokens = fixup->tokens;
             for (i=0; i<fixup->fixup->count; i++)
             {
-                TRACE("%x\n", tokens[i]);
-                vtable[i] = PtrToUint(mono_marshal_get_vtfixup_ftnptr(
-                    image, tokens[i], fixup->fixup->type));
+                TRACE("%#lx\n", tokens[i]);
+                vtable[i] = mono_marshal_get_vtfixup_ftnptr(
+                    image, tokens[i], fixup->fixup->type);
             }
         }
 
@@ -1029,10 +1029,11 @@ static void FixupVTableEntry(HMODULE hmodule, VTableFixup *vtable_fixup)
     fixup->vtable = (BYTE*)hmodule + vtable_fixup->rva;
     fixup->done = FALSE;
 
+    TRACE("vtable_fixup->type=0x%x\n",vtable_fixup->type);
     if (vtable_fixup->type & COR_VTABLE_32BIT)
     {
-        DWORD *vtable = fixup->vtable;
-        DWORD *tokens;
+        void **vtable = fixup->vtable;
+        ULONG_PTR *tokens;
         int i;
         struct vtable_fixup_thunk *thunks = fixup->thunk_code;
 
@@ -1047,7 +1048,7 @@ static void FixupVTableEntry(HMODULE hmodule, VTableFixup *vtable_fixup)
             thunks[i].fixup = fixup;
             thunks[i].function = ReallyFixupVTable;
             thunks[i].vtable_entry = &vtable[i];
-            vtable[i] = PtrToUint(&thunks[i]);
+            vtable[i] = &thunks[i];
         }
     }
     else




More information about the wine-cvs mailing list