Commit 15af19c6 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

widl: Add support for strict context handles.

parent f9fc52f6
......@@ -299,6 +299,7 @@ static const struct keyword attr_keywords[] =
{"single", tSINGLE},
{"size_is", tSIZEIS},
{"source", tSOURCE},
{"strict_context_handle", tSTRICTCONTEXTHANDLE},
{"string", tSTRING},
{"switch_is", tSWITCHIS},
{"switch_type", tSWITCHTYPE},
......
......@@ -225,6 +225,7 @@ static void check_all_user_types(ifref_list_t *ifaces);
%token tSMALL
%token tSOURCE
%token tSTDCALL
%token tSTRICTCONTEXTHANDLE
%token tSTRING tSTRUCT
%token tSWITCH tSWITCHIS tSWITCHTYPE
%token tTRANSMITAS
......@@ -497,6 +498,7 @@ attribute: { $$ = NULL; }
| tRETVAL { $$ = make_attr(ATTR_RETVAL); }
| tSIZEIS '(' m_exprs ')' { $$ = make_attrp(ATTR_SIZEIS, $3); }
| tSOURCE { $$ = make_attr(ATTR_SOURCE); }
| tSTRICTCONTEXTHANDLE { $$ = make_attr(ATTR_STRICTCONTEXTHANDLE); }
| tSTRING { $$ = make_attr(ATTR_STRING); }
| tSWITCHIS '(' expr ')' { $$ = make_attrp(ATTR_SWITCHIS, $3); }
| tSWITCHTYPE '(' type ')' { $$ = make_attrp(ATTR_SWITCHTYPE, $3); }
......
......@@ -43,6 +43,7 @@
static const func_t *current_func;
static const type_t *current_structure;
static const ifref_t *current_iface;
static struct list expr_eval_routines = LIST_INIT(expr_eval_routines);
struct expr_eval_routine
......@@ -2057,7 +2058,10 @@ static size_t write_contexthandle_tfs(FILE *file, const type_t *type,
unsigned int *typeformat_offset)
{
size_t start_offset = *typeformat_offset;
unsigned char flags = 0x08 /* strict */;
unsigned char flags = 0;
if (is_attr(current_iface->attrs, ATTR_STRICTCONTEXTHANDLE))
flags |= 0x08 /* strict */;
if (is_ptr(type))
{
......@@ -2280,6 +2284,7 @@ static size_t process_tfs(FILE *file, const ifref_list_t *ifaces, type_pred_t pr
if (iface->iface->funcs)
{
const func_t *func;
current_iface = iface;
LIST_FOR_EACH_ENTRY( func, iface->iface->funcs, const func_t, entry )
{
if (is_local(func->def->attrs)) continue;
......
......@@ -121,6 +121,7 @@ enum attr_type
ATTR_RETVAL,
ATTR_SIZEIS,
ATTR_SOURCE,
ATTR_STRICTCONTEXTHANDLE,
ATTR_STRING,
ATTR_SWITCHIS,
ATTR_SWITCHTYPE,
......
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