James Hawkins : fusion: Load the table row numbers before calculating the table offsets.

Alexandre Julliard julliard at winehq.org
Wed Jul 16 13:33:04 CDT 2008


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

Author: James Hawkins <jhawkins at codeweavers.com>
Date:   Wed Jul 16 10:51:06 2008 -0500

fusion: Load the table row numbers before calculating the table offsets.

---

 dlls/fusion/assembly.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/dlls/fusion/assembly.c b/dlls/fusion/assembly.c
index bbe8a76..5bc8725 100644
--- a/dlls/fusion/assembly.c
+++ b/dlls/fusion/assembly.c
@@ -241,9 +241,17 @@ static HRESULT parse_clr_tables(ASSEMBLY *assembly, ULONG offset)
     memset(assembly->tables, -1, MAX_CLR_TABLES * sizeof(CLRTABLE));
 
     if (assembly->tableshdr->MaskValid.u.LowPart & 1)
-    {
         assembly->tables[0].offset = currofs;
-        assembly->tables[0].rows = assembly->numrows[0];
+
+    offidx = 0;
+    for (i = 0; i < MAX_CLR_TABLES; i++)
+    {
+        if ((i < 32 && (assembly->tableshdr->MaskValid.u.LowPart >> i) & 1) ||
+            (i >= 32 && (assembly->tableshdr->MaskValid.u.HighPart >> i) & 1))
+        {
+            assembly->tables[i].rows = assembly->numrows[offidx];
+            offidx++;
+        }
     }
 
     previ = 0;
@@ -255,7 +263,6 @@ static HRESULT parse_clr_tables(ASSEMBLY *assembly, ULONG offset)
         {
             currofs += COR_TABLE_SIZES[previ] * assembly->numrows[offidx - 1];
             assembly->tables[i].offset = currofs;
-            assembly->tables[i].rows = assembly->numrows[offidx];
             offidx++;
             previ = i;
         }




More information about the wine-cvs mailing list