Robert Shearman : oleaut32: MSFT_DoFuncs: "reclength" of the function information record is stored

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 10 07:12:14 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 688c6a78f1d14055917b6eef634891cdbfb21829
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=688c6a78f1d14055917b6eef634891cdbfb21829

Author: Robert Shearman <rob at codeweavers.com>
Date:   Sat Jul  8 11:54:40 2006 +0100

oleaut32: MSFT_DoFuncs: "reclength" of the function information record is stored

in a 16 bit int and not in a 8 bit int as previously supposed, using a 0x1ff
mask. Upper 16 bits contains the ordinal number of the function. 
Allocation of the "recbuf" must be modified, to support larger data
(based on a patch by White Snake <whitesnake78 at mail.com>).

---

 dlls/oleaut32/typelib.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 080e25b..ce3a1dc 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -1721,7 +1721,7 @@ MSFT_DoFuncs(TLBContext*     pcx,
     int infolen, nameoffset, reclength, nrattributes, i;
     int recoffset = offset + sizeof(INT);
 
-    char recbuf[512];
+    char *recbuf = HeapAlloc(GetProcessHeap(), 0, 0xffff);
     MSFT_FuncRecord * pFuncRec=(MSFT_FuncRecord *) recbuf;
     TLBFuncDesc *ptfd_prev = NULL;
 
@@ -1747,7 +1747,7 @@ MSFT_DoFuncs(TLBContext*     pcx,
         /* read the function information record */
         MSFT_ReadLEDWords(&reclength, sizeof(INT), pcx, recoffset);
 
-        reclength &= 0x1ff;
+        reclength &= 0xffff;
 
         MSFT_ReadLEDWords(pFuncRec, reclength - sizeof(INT), pcx, DO_NOT_SEEK);
 
@@ -1892,6 +1892,7 @@ MSFT_DoFuncs(TLBContext*     pcx,
         pptfd      = & ((*pptfd)->next);
         recoffset += reclength;
     }
+    HeapFree(GetProcessHeap(), 0, recbuf);
 }
 
 static void MSFT_DoVars(TLBContext *pcx, ITypeInfoImpl *pTI, int cFuncs,




More information about the wine-cvs mailing list