mscoree: Preserve %ecx when calling ReallyFixupVTable.

Vincent Povirk madewokherd at gmail.com
Wed Sep 5 15:29:18 CDT 2012


-------------- next part --------------
From e4c37cd7b1acd4648638d4a5796e086287ab6bd8 Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Wed, 5 Sep 2012 15:25:59 -0500
Subject: [PATCH] mscoree: Preserve %ecx when calling ReallyFixupVTable.

This is needed to properly call thiscall functions.
---
 dlls/mscoree/corruntimehost.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/mscoree/corruntimehost.c b/dlls/mscoree/corruntimehost.c
index ecefe75..da46d61 100644
--- a/dlls/mscoree/corruntimehost.c
+++ b/dlls/mscoree/corruntimehost.c
@@ -827,6 +827,8 @@ static void get_utf8_args(int *argc, char ***argv)
 
 struct vtable_fixup_thunk
 {
+    /* push %ecx */
+    BYTE i7;
     /* sub $0x4,%esp */
     BYTE i1[3];
     /* mov fixup,(%esp) */
@@ -839,12 +841,15 @@ struct vtable_fixup_thunk
     BYTE i4[2];
     /* pop %eax */
     BYTE i5;
+    /* pop %ecx */
+    BYTE i8;
     /* jmp *vtable_entry */
     BYTE i6[2];
     void *vtable_entry;
 };
 
 static const struct vtable_fixup_thunk thunk_template = {
+    0x51,
     {0x83,0xec,0x04},
     {0xc7,0x04,0x24},
     NULL,
@@ -852,6 +857,7 @@ static const struct vtable_fixup_thunk thunk_template = {
     NULL,
     {0xff,0xd0},
     0x58,
+    0x59,
     {0xff,0x25},
     NULL
 };
-- 
1.7.9.5


More information about the wine-patches mailing list