widl: Add support for the lcid parameter attribute.

This commit is contained in:
Huw Davies 2009-06-05 15:48:24 +01:00 committed by Alexandre Julliard
parent c89c2dd4c5
commit 81b2c9eb85
3 changed files with 15 additions and 1 deletions

View file

@ -509,6 +509,7 @@ attribute: { $$ = NULL; }
| tINPUTSYNC { $$ = make_attr(ATTR_INPUTSYNC); } | tINPUTSYNC { $$ = make_attr(ATTR_INPUTSYNC); }
| tLENGTHIS '(' m_exprs ')' { $$ = make_attrp(ATTR_LENGTHIS, $3); } | tLENGTHIS '(' m_exprs ')' { $$ = make_attrp(ATTR_LENGTHIS, $3); }
| tLCID '(' expr_int_const ')' { $$ = make_attrp(ATTR_LIBLCID, $3); } | tLCID '(' expr_int_const ')' { $$ = make_attrp(ATTR_LIBLCID, $3); }
| tLCID { $$ = make_attr(ATTR_PARAMLCID); }
| tLOCAL { $$ = make_attr(ATTR_LOCAL); } | tLOCAL { $$ = make_attr(ATTR_LOCAL); }
| tNONBROWSABLE { $$ = make_attr(ATTR_NONBROWSABLE); } | tNONBROWSABLE { $$ = make_attr(ATTR_NONBROWSABLE); }
| tNONCREATABLE { $$ = make_attr(ATTR_NONCREATABLE); } | tNONCREATABLE { $$ = make_attr(ATTR_NONCREATABLE); }
@ -1919,6 +1920,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_OLEAUTOMATION */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" }, /* ATTR_OLEAUTOMATION */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" },
/* ATTR_OPTIONAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optional" }, /* ATTR_OPTIONAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optional" },
/* ATTR_OUT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "out" }, /* ATTR_OUT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "out" },
/* ATTR_PARAMLCID */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "lcid" },
/* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" }, /* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" },
/* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "ref, unique or ptr" }, /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "ref, unique or ptr" },
/* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propget" }, /* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propget" },

View file

@ -120,6 +120,7 @@ enum attr_type
ATTR_OLEAUTOMATION, ATTR_OLEAUTOMATION,
ATTR_OPTIONAL, ATTR_OPTIONAL,
ATTR_OUT, ATTR_OUT,
ATTR_PARAMLCID,
ATTR_POINTERDEFAULT, ATTR_POINTERDEFAULT,
ATTR_POINTERTYPE, ATTR_POINTERTYPE,
ATTR_PROPGET, ATTR_PROPGET,

View file

@ -1267,6 +1267,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index)
unsigned int funckind, invokekind = 1 /* INVOKE_FUNC */; unsigned int funckind, invokekind = 1 /* INVOKE_FUNC */;
int help_context = 0, help_string_context = 0, help_string_offset = -1; int help_context = 0, help_string_context = 0, help_string_offset = -1;
int entry = -1, entry_is_ord = 0; int entry = -1, entry_is_ord = 0;
int lcid_retval_count = 0;
chat("add_func_desc(%p,%d)\n", typeinfo, index); chat("add_func_desc(%p,%d)\n", typeinfo, index);
@ -1497,9 +1498,13 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index)
case ATTR_OUT: case ATTR_OUT:
paramflags |= 0x02; /* PARAMFLAG_FOUT */ paramflags |= 0x02; /* PARAMFLAG_FOUT */
break; break;
case ATTR_PARAMLCID:
paramflags |= 0x04; /* PARAMFLAG_LCID */
lcid_retval_count++;
break;
case ATTR_RETVAL: case ATTR_RETVAL:
paramflags |= 0x08; /* PARAMFLAG_FRETVAL */ paramflags |= 0x08; /* PARAMFLAG_FRETVAL */
typedata[4] |= 0x4000; lcid_retval_count++;
break; break;
default: default:
chat("unhandled param attr %d\n", attr->type); chat("unhandled param attr %d\n", attr->type);
@ -1509,6 +1514,12 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index)
paramdata[1] = -1; paramdata[1] = -1;
paramdata[2] = paramflags; paramdata[2] = paramflags;
typedata[3] += decoded_size << 16; typedata[3] += decoded_size << 16;
if(lcid_retval_count == 1)
typedata[4] |= 0x4000;
else if(lcid_retval_count == 2)
typedata[4] |= 0x8000;
i++; i++;
} }
} }