Commit 0be9d259 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

widl: Fix get_explicit_generic_handle_type and is_context_handle to detect…

widl: Fix get_explicit_generic_handle_type and is_context_handle to detect attributes set on typedefs other than the first. Change get_explicit_handle_var to use accessors for the type structure.
parent 7e08ff27
......@@ -548,8 +548,11 @@ const var_t* get_explicit_handle_var(const var_t *func)
return NULL;
LIST_FOR_EACH_ENTRY( var, type_get_function_args(func->type), const var_t, entry )
if (var->type->type == RPC_FC_BIND_PRIMITIVE)
{
const type_t *type = var->type;
if (type_get_type(type) == TYPE_BASIC && type_basic_get_fc(type) == RPC_FC_BIND_PRIMITIVE)
return var;
}
return NULL;
}
......@@ -557,8 +560,11 @@ const var_t* get_explicit_handle_var(const var_t *func)
const type_t* get_explicit_generic_handle_type(const var_t* var)
{
const type_t *t;
for (t = var->type; is_ptr(t); t = type_pointer_get_ref(t))
if (t->type != RPC_FC_BIND_PRIMITIVE && is_attr(t->attrs, ATTR_HANDLE))
for (t = var->type;
is_ptr(t) || type_is_alias(t);
t = type_is_alias(t) ? type_alias_get_aliasee(t) : type_pointer_get_ref(t))
if ((type_get_type_detect_alias(t) != TYPE_BASIC || type_basic_get_fc(t) != RPC_FC_BIND_PRIMITIVE) &&
is_attr(t->attrs, ATTR_HANDLE))
return t;
return NULL;
}
......
......@@ -75,7 +75,9 @@ static inline int is_string_type(const attr_list_t *attrs, const type_t *type)
static inline int is_context_handle(const type_t *type)
{
const type_t *t;
for (t = type; is_ptr(t); t = type_pointer_get_ref(t))
for (t = type;
is_ptr(t) || type_is_alias(t);
t = type_is_alias(t) ? type_alias_get_aliasee(t) : type_pointer_get_ref(t))
if (is_attr(t->attrs, ATTR_CONTEXTHANDLE))
return 1;
return 0;
......
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