oleaut: Implement processing of modules for SLTG typelibs.

Set funckind when processing SLTG functions.
This commit is contained in:
Robert Shearman 2006-07-03 13:54:50 +01:00 committed by Alexandre Julliard
parent 3f97460c2b
commit 65639ab722
2 changed files with 42 additions and 10 deletions

View File

@ -2906,14 +2906,25 @@ static void SLTG_DoFuncs(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, unsig
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, char *pFirstItem, ITypeInfoImpl *pTI, unsig
(*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, ITypeInfoImpl *pTI,
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_SLTG(LPVOID pLib, DWORD dwTLBLength)
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;

View File

@ -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 @@ typedef struct {
#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 */