Module: wine Branch: refs/heads/master Commit: 65639ab7221637a01e2d0b88ecdebc5f1c92284b URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=65639ab7221637a01e2d0b88...
Author: Robert Shearman rob@codeweavers.com Date: Mon Jul 3 13:54:50 2006 +0100
oleaut: Implement processing of modules for SLTG typelibs.
Set funckind when processing SLTG functions.
---
dlls/oleaut32/typelib.c | 45 ++++++++++++++++++++++++++++++++++++++------- dlls/oleaut32/typelib.h | 7 ++++--- 2 files changed, 42 insertions(+), 10 deletions(-)
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 5554205..8483aa9 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -2906,14 +2906,25 @@ static void SLTG_DoFuncs(char *pBlk, cha int param; WORD *pType, *pArg;
- if(pFunc->magic != SLTG_FUNCTION_MAGIC && - pFunc->magic != SLTG_FUNCTION_WITH_FLAGS_MAGIC && - pFunc->magic != SLTG_DISPATCH_FUNCTION_MAGIC) { - FIXME("func magic = %02x\n", pFunc->magic); - return; - } *ppFuncDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(**ppFuncDesc)); + + switch (pFunc->magic & ~SLTG_FUNCTION_FLAGS_PRESENT) { + case SLTG_FUNCTION_MAGIC: + (*ppFuncDesc)->funcdesc.funckind = FUNC_PUREVIRTUAL; + break; + case SLTG_DISPATCH_FUNCTION_MAGIC: + (*ppFuncDesc)->funcdesc.funckind = FUNC_DISPATCH; + break; + case SLTG_STATIC_FUNCTION_MAGIC: + (*ppFuncDesc)->funcdesc.funckind = FUNC_STATIC; + break; + default: + FIXME("unimplemented func magic = %02x\n", pFunc->magic & ~SLTG_FUNCTION_FLAGS_PRESENT); + HeapFree(GetProcessHeap(), 0, *ppFuncDesc); + *ppFuncDesc = NULL; + return; + } (*ppFuncDesc)->Name = TLB_MultiByteToBSTR(pFunc->name + pNameTable);
(*ppFuncDesc)->funcdesc.memid = pFunc->dispid; @@ -2923,7 +2934,7 @@ static void SLTG_DoFuncs(char *pBlk, cha (*ppFuncDesc)->funcdesc.cParamsOpt = (pFunc->retnextopt & 0x7e) >> 1; (*ppFuncDesc)->funcdesc.oVft = pFunc->vtblpos;
- if(pFunc->magic == SLTG_FUNCTION_WITH_FLAGS_MAGIC) + if(pFunc->magic & SLTG_FUNCTION_FLAGS_PRESENT) (*ppFuncDesc)->funcdesc.wFuncFlags = pFunc->funcflags;
if(pFunc->retnextopt & 0x80) @@ -3098,6 +3109,21 @@ static void SLTG_ProcessEnum(char *pBlk, SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable); }
+static void SLTG_ProcessModule(char *pBlk, ITypeInfoImpl *pTI, + char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, + SLTG_TypeInfoTail *pTITail) +{ + if (pTIHeader->href_table != 0xffffffff) + SLTG_DoRefs((SLTG_RefInfo*)((char *)pTIHeader + pTIHeader->href_table), pTI, + pNameTable); + + if (pTITail->vars_off != 0xffff) + SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable); + + if (pTITail->funcs_off != 0xffff) + SLTG_DoFuncs(pBlk, pBlk + pTITail->funcs_off, pTI, pTITail->cFuncs, pNameTable); +} + /* Because SLTG_OtherTypeInfo is such a painful struct, we make a more managable copy of it into this */ typedef struct { @@ -3371,6 +3397,11 @@ static ITypeLib2* ITypeLib2_Constructor_ pTIHeader, pTITail); break;
+ case TKIND_MODULE: + SLTG_ProcessModule((char *)(pMemHeader + 1), *ppTypeInfoImpl, pNameTable, + pTIHeader, pTITail); + break; + default: FIXME("Not processing typekind %d\n", pTIHeader->typekind); break; diff --git a/dlls/oleaut32/typelib.h b/dlls/oleaut32/typelib.h index e774800..be2e3eb 100644 --- a/dlls/oleaut32/typelib.h +++ b/dlls/oleaut32/typelib.h @@ -477,7 +477,7 @@ typedef struct { #define SLTG_ENUMITEM_MAGIC 0x120a
typedef struct { - BYTE magic; /* 0x4c or 0x6c */ + BYTE magic; /* 0x4c, 0xcb or 0x8b with optional SLTG_FUNCTION_FLAGS_PRESENT flag */ BYTE inv; /* high nibble is INVOKE_KIND, low nibble = 2 */ WORD next; /* byte offset from beginning of group to next fn */ WORD name; /* Offset within name table to name */ @@ -491,7 +491,7 @@ typedef struct { middle 6 bits */ WORD rettype; /* return type VT_?? or offset to ret type */ WORD vtblpos; /* position in vtbl? */ - WORD funcflags; /* present if magic == 0x6c */ + WORD funcflags; /* present if magic & 0x20 */ /* Param list starts, repeat next two as required */ #if 0 WORD name; /* offset to 2nd letter of name */ @@ -499,9 +499,10 @@ #if 0 #endif } SLTG_Function;
+#define SLTG_FUNCTION_FLAGS_PRESENT 0x20 #define SLTG_FUNCTION_MAGIC 0x4c -#define SLTG_FUNCTION_WITH_FLAGS_MAGIC 0x6c #define SLTG_DISPATCH_FUNCTION_MAGIC 0xcb +#define SLTG_STATIC_FUNCTION_MAGIC 0x8b
typedef struct { /*00*/ BYTE magic; /* 0xdf */