mscoree: Add FixupVTable_Assembly function which takes preloaded assembly headers.
authorPaul Gofman <gofmanp@gmail.com>
Sat, 30 Jan 2016 01:36:48 +0000 (04:36 +0300)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 4 Feb 2016 05:40:49 +0000 (14:40 +0900)
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/mscoree/corruntimehost.c

index c790c441b61273697638eb9bfc8fc2abb6396457..7998da91e75bebd18e730bf16468e28521238a91 100644 (file)
@@ -1135,23 +1135,28 @@ static void FixupVTableEntry(HMODULE hmodule, VTableFixup *vtable_fixup)
     list_add_tail(&dll_fixups, &fixup->entry);
 }
 
+static void FixupVTable_Assembly(HMODULE hmodule, ASSEMBLY *assembly)
+{
+    VTableFixup *vtable_fixups;
+    ULONG vtable_fixup_count, i;
+
+    assembly_get_vtable_fixups(assembly, &vtable_fixups, &vtable_fixup_count);
+    if (CAN_FIXUP_VTABLE)
+        for (i=0; i<vtable_fixup_count; i++)
+            FixupVTableEntry(hmodule, &vtable_fixups[i]);
+    else if (vtable_fixup_count)
+        FIXME("cannot fixup vtable; expect a crash\n");
+}
+
 static void FixupVTable(HMODULE hmodule)
 {
     ASSEMBLY *assembly;
     HRESULT hr;
-    VTableFixup *vtable_fixups;
-    ULONG vtable_fixup_count, i;
 
     hr = assembly_from_hmodule(&assembly, hmodule);
     if (SUCCEEDED(hr))
     {
-        hr = assembly_get_vtable_fixups(assembly, &vtable_fixups, &vtable_fixup_count);
-        if (CAN_FIXUP_VTABLE)
-            for (i=0; i<vtable_fixup_count; i++)
-                FixupVTableEntry(hmodule, &vtable_fixups[i]);
-        else if (vtable_fixup_count)
-            FIXME("cannot fixup vtable; expect a crash\n");
-
+        FixupVTable_Assembly(hmodule, assembly);
         assembly_release(assembly);
     }
     else