Commit 8c8b5da9 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

oleaut32: Update variable description and typeinfo size in ICreateTypeInfo2::SetVarHelpContext().

parent 59cc0d5c
......@@ -2108,8 +2108,8 @@ static void MSFT_DoVars(TLBContext *pcx, ITypeInfoImpl *pTI, int cFuncs,
if(reclength > FIELD_OFFSET(MSFT_VarRecord, HelpContext))
(*pptvd)->HelpContext = pVarRec->HelpContext;
if(reclength > FIELD_OFFSET(MSFT_VarRecord, oHelpString))
(*pptvd)->HelpString = MSFT_ReadString(pcx, pVarRec->oHelpString);
if(reclength > FIELD_OFFSET(MSFT_VarRecord, HelpString))
(*pptvd)->HelpString = MSFT_ReadString(pcx, pVarRec->HelpString);
if(reclength > FIELD_OFFSET(MSFT_VarRecord, HelpStringContext))
(*pptvd)->HelpStringContext = pVarRec->HelpStringContext;
......
......@@ -244,7 +244,7 @@ typedef struct {
/* optional attribute fields, the number of them is variable */
/* controlled by record length */
INT HelpContext;
INT oHelpString;
INT HelpString;
INT res9; /* unknown (-1) */
INT oCustData; /* custom data for variable */
INT HelpStringContext;
......
......@@ -245,6 +245,23 @@ static inline INT ctl2_get_record_size(const CyclicList *iter)
return iter->u.data[0] & 0xFFFF;
}
static void ctl2_update_var_size(const ICreateTypeInfo2Impl *This, CyclicList *var, int size)
{
int old = ctl2_get_record_size(var), i;
if (old >= size) return;
/* initialize fields included in size but currently unused */
for (i = old/sizeof(int); i < (size/sizeof(int) - 1); i++)
{
/* HelpContext/HelpStringContext being 0 means it's not set */
var->u.data[i] = (i == 5 || i == 9) ? 0 : -1;
}
var->u.data[0] += size - old;
This->typedata->next->u.val += size - old;
}
/* NOTE: entry always assumed to be a function */
static inline INVOKEKIND ctl2_get_invokekind(const CyclicList *func)
{
......@@ -2543,6 +2560,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetVarHelpContext(
{
if (index-- == 0)
{
ctl2_update_var_size(This, iter, FIELD_OFFSET(MSFT_VarRecord, HelpString));
iter->u.data[5] = context;
return S_OK;
}
......
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