mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 04:39:45 +00:00
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.
This commit is contained in:
parent
7e08ff27c2
commit
0be9d2595d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user