Commit 65639ab7 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

oleaut: Implement processing of modules for SLTG typelibs.

Set funckind when processing SLTG functions.
parent 3f97460c
......@@ -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;
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment