Commit fe7e384e authored by Andrey Turkin's avatar Andrey Turkin Committed by Alexandre Julliard

oleaut32: Add support for const variables.

parent eb039179
......@@ -2026,6 +2026,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddVarDesc(
{
ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
HRESULT status = S_OK;
CyclicList *insert;
INT *typedata;
int var_datawidth;
......@@ -2079,7 +2080,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddVarDesc(
/* fill out the basic type information */
typedata[0] = 0x14 | (index << 16);
typedata[2] = pVarDesc->wVarFlags;
typedata[3] = (sizeof(VARDESC) << 16) | 0;
typedata[3] = (sizeof(VARDESC) << 16) | pVarDesc->varkind;
/* update the index data */
insert->indice = 0x40000000 + index;
......@@ -2091,6 +2092,8 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddVarDesc(
&typedata[1], &var_datawidth, &var_alignment,
&var_type_size);
if (pVarDesc->varkind != VAR_CONST)
{
/* pad out starting position to data width */
This->datawidth += var_alignment - 1;
This->datawidth &= ~(var_alignment - 1);
......@@ -2122,13 +2125,19 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddVarDesc(
if (This->typeinfo->res3 == -1) This->typeinfo->res3 = 0;
This->typeinfo->res3 += 0x2c;
/* increment the number of variable elements */
This->typeinfo->cElement += 0x10000;
/* pad data width to alignment */
This->typeinfo->size = (This->datawidth + (alignment - 1)) & ~(alignment - 1);
} else {
VARIANT *value = pVarDesc->DUMMYUNIONNAME.lpvarValue;
status = ctl2_encode_variant(This->typelib, typedata+4, value, V_VT(value));
/* ??? native sets size 0x34 */
typedata[3] += 0x10 << 16;
}
return S_OK;
/* increment the number of variable elements */
This->typeinfo->cElement += 0x10000;
return status;
}
/******************************************************************************
......
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