[PATCH 2/5] oleaut32: 64-bit typelib fixes

Andrew Eikum aeikum at codeweavers.com
Mon Aug 12 15:24:14 CDT 2013


---
 dlls/oleaut32/typelib.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index d8e9840..031f2b1 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -2537,10 +2537,18 @@ static ITypeInfoImpl * MSFT_DoTypeInfo(
     ptiRet->lcid=pLibInfo->set_lcid;   /* FIXME: correct? */
     ptiRet->lpstrSchema=NULL;              /* reserved */
     ptiRet->cbSizeInstance=tiBase.size;
+#ifdef _WIN64
+    if(pLibInfo->syskind == SYS_WIN32)
+        ptiRet->cbSizeInstance=sizeof(void*);
+#endif
     ptiRet->typekind=tiBase.typekind & 0xF;
     ptiRet->cFuncs=LOWORD(tiBase.cElement);
     ptiRet->cVars=HIWORD(tiBase.cElement);
     ptiRet->cbAlignment=(tiBase.typekind >> 11 )& 0x1F; /* there are more flags there */
+#ifdef _WIN64
+    if(pLibInfo->syskind == SYS_WIN32)
+        ptiRet->cbAlignment = 8;
+#endif
     ptiRet->wTypeFlags=tiBase.flags;
     ptiRet->wMajorVerNum=LOWORD(tiBase.version);
     ptiRet->wMinorVerNum=HIWORD(tiBase.version);
@@ -8484,7 +8492,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnCreateTypeInfo(ICreateTypeLib2 *iface,
     case TKIND_INTERFACE:
     case TKIND_DISPATCH:
     case TKIND_COCLASS:
-        info->cbSizeInstance = 4;
+        info->cbSizeInstance = This->ptr_size;
         break;
     case TKIND_RECORD:
     case TKIND_UNION:
@@ -10199,6 +10207,12 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddFuncDesc(ICreateTypeInfo2 *iface,
             !funcDesc->cParams)
         return TYPE_E_INCONSISTENTPROPFUNCS;
 
+#ifdef _WIN64
+    if(This->pTypeLib->syskind == SYS_WIN64 &&
+            funcDesc->oVft % 8 != 0)
+        return E_INVALIDARG;
+#endif
+
     memset(&tmp_func_desc, 0, sizeof(tmp_func_desc));
     TLBFuncDesc_Constructor(&tmp_func_desc);
 
-- 
1.8.3.4





More information about the wine-patches mailing list