widl: Don't restrict the number of params of [prop*] functions.

This commit is contained in:
Huw Davies 2007-01-25 13:40:40 +00:00 committed by Alexandre Julliard
parent f994c35a3e
commit 305e4949ee
1 changed files with 11 additions and 29 deletions

View File

@ -1345,25 +1345,6 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, const func_t *func, int
}
}
switch(invokekind) {
case 0x2: /* INVOKE_PROPERTYGET */
if((num_params != 0 && typeinfo->typekind == TKIND_DISPATCH)
|| (num_params != 1 && typeinfo->typekind == TKIND_INTERFACE)) {
error("expecting no args on a propget func\n");
return S_FALSE;
}
break;
case 0x4: /* INVOKE_PROPERTYPUT */
case 0x8: /* INVOKE_PROPERTYPUTREF */
if(num_params != 1) {
error("expecting one arg on a propput func\n");
return S_FALSE;
}
break;
default:
break;
}
/* allocate type data space for us */
typedata_size = 0x18 + extra_attr * sizeof(int) + (num_params * (num_defaults ? 16 : 12));
@ -1543,18 +1524,19 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, const func_t *func, int
if(typeinfo->typekind == TKIND_MODULE)
namedata[9] |= 0x20;
if(invokekind != 0x4 /* INVOKE_PROPERTYPUT */ && invokekind != 0x8 /* INVOKE_PROPERTYPUTREF */) {
/* don't give the arg of a [propput*] func a name */
if (func->args)
if (func->args)
{
i = 0;
LIST_FOR_EACH_ENTRY( arg, func->args, var_t, entry )
{
i = 0;
LIST_FOR_EACH_ENTRY( arg, func->args, var_t, entry )
{
int *paramdata = typedata + 6 + extra_attr + (num_defaults ? num_params : 0) + i * 3;
offset = ctl2_alloc_name(typeinfo->typelib, arg->name);
paramdata[1] = offset;
/* don't give the last arg of a [propput*] func a name */
if(i != num_params - 1 || (invokekind != 0x4 /* INVOKE_PROPERTYPUT */ && invokekind != 0x8 /* INVOKE_PROPERTYPUTREF */))
{
int *paramdata = typedata + 6 + extra_attr + (num_defaults ? num_params : 0) + i * 3;
offset = ctl2_alloc_name(typeinfo->typelib, arg->name);
paramdata[1] = offset;
}
i++;
}
}
}
return S_OK;