From: Wolfgang Hartl <wolfo.dev@wolke7.net> --- dlls/oleaut32/typelib.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index e9997a86d24..eb303acf2f9 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -4234,21 +4234,26 @@ static void SLTG_DoFuncs(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, pFuncDesc->funcdesc.callconv = pFunc->nacc & 0x7; pFuncDesc->funcdesc.cParams = pFunc->nacc >> 3; pFuncDesc->funcdesc.cParamsOpt = (pFunc->retnextopt & 0x7e) >> 1; - if (pFuncDesc->funcdesc.funckind == FUNC_DISPATCH) - pFuncDesc->funcdesc.oVft = 0; + + /* SLTG encodes vararg as 63 (max 6-bit value); normalize to -1 (MSFT convention) */ + if (pFuncDesc->funcdesc.cParamsOpt == 0x3f) + pFuncDesc->funcdesc.cParamsOpt = -1; + + if (pFuncDesc->funcdesc.funckind == FUNC_DISPATCH) + pFuncDesc->funcdesc.oVft = 0; else - pFuncDesc->funcdesc.oVft = (unsigned short)(pFunc->vtblpos & ~1) * sizeof(void *) / pTI->pTypeLib->ptr_size; + pFuncDesc->funcdesc.oVft = (unsigned short)(pFunc->vtblpos & ~1) * sizeof(void *) / pTI->pTypeLib->ptr_size; - if (pFunc->helpstring != 0xffff) - pFuncDesc->HelpString = decode_string(hlp_strings, pBlk + pFunc->helpstring, pNameTable - pBlk, pTI->pTypeLib); + if (pFunc->helpstring != 0xffff) + pFuncDesc->HelpString = decode_string(hlp_strings, pBlk + pFunc->helpstring, pNameTable - pBlk, pTI->pTypeLib); - if(pFunc->magic & SLTG_FUNCTION_FLAGS_PRESENT) - pFuncDesc->funcdesc.wFuncFlags = pFunc->funcflags; + if(pFunc->magic & SLTG_FUNCTION_FLAGS_PRESENT) + pFuncDesc->funcdesc.wFuncFlags = pFunc->funcflags; - if(pFunc->retnextopt & 0x80) - pType = &pFunc->rettype; - else - pType = (WORD*)(pBlk + pFunc->rettype); + if(pFunc->retnextopt & 0x80) + pType = &pFunc->rettype; + else + pType = (WORD*)(pBlk + pFunc->rettype); SLTG_DoElem(pType, pBlk, &pFuncDesc->funcdesc.elemdescFunc, ref_lookup); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10923