Huw Davies : widl: Add support for the lcid parameter attribute.
Alexandre Julliard
julliard at winehq.org
Mon Jun 8 09:44:50 CDT 2009
Module: wine
Branch: master
Commit: 81b2c9eb85464bcdb77d333cfe224ac7b3e62378
URL: http://source.winehq.org/git/wine.git/?a=commit;h=81b2c9eb85464bcdb77d333cfe224ac7b3e62378
Author: Huw Davies <huw at codeweavers.com>
Date: Fri Jun 5 15:48:24 2009 +0100
widl: Add support for the lcid parameter attribute.
---
tools/widl/parser.y | 2 ++
tools/widl/widltypes.h | 1 +
tools/widl/write_msft.c | 13 ++++++++++++-
3 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 7fe373c..c2f1abc 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -509,6 +509,7 @@ attribute: { $$ = NULL; }
| tINPUTSYNC { $$ = make_attr(ATTR_INPUTSYNC); }
| tLENGTHIS '(' m_exprs ')' { $$ = make_attrp(ATTR_LENGTHIS, $3); }
| tLCID '(' expr_int_const ')' { $$ = make_attrp(ATTR_LIBLCID, $3); }
+ | tLCID { $$ = make_attr(ATTR_PARAMLCID); }
| tLOCAL { $$ = make_attr(ATTR_LOCAL); }
| tNONBROWSABLE { $$ = make_attr(ATTR_NONBROWSABLE); }
| 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_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_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_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" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index f5466bf..c1c07ea 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -120,6 +120,7 @@ enum attr_type
ATTR_OLEAUTOMATION,
ATTR_OPTIONAL,
ATTR_OUT,
+ ATTR_PARAMLCID,
ATTR_POINTERDEFAULT,
ATTR_POINTERTYPE,
ATTR_PROPGET,
diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c
index bff61fd..a22b8b3 100644
--- a/tools/widl/write_msft.c
+++ b/tools/widl/write_msft.c
@@ -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 */;
int help_context = 0, help_string_context = 0, help_string_offset = -1;
int entry = -1, entry_is_ord = 0;
+ int lcid_retval_count = 0;
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:
paramflags |= 0x02; /* PARAMFLAG_FOUT */
break;
+ case ATTR_PARAMLCID:
+ paramflags |= 0x04; /* PARAMFLAG_LCID */
+ lcid_retval_count++;
+ break;
case ATTR_RETVAL:
paramflags |= 0x08; /* PARAMFLAG_FRETVAL */
- typedata[4] |= 0x4000;
+ lcid_retval_count++;
break;
default:
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[2] = paramflags;
typedata[3] += decoded_size << 16;
+
+ if(lcid_retval_count == 1)
+ typedata[4] |= 0x4000;
+ else if(lcid_retval_count == 2)
+ typedata[4] |= 0x8000;
+
i++;
}
}
More information about the wine-cvs
mailing list