From 1e39b5fb165d1f271e881915924181ec0f79750d Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 26 Oct 2008 12:17:36 +0000 Subject: [PATCH] WIDL: Enable the use of scalar types (non-pointer types) as custom binding handles. svn path=/trunk/; revision=36982 --- reactos/tools/widl/header.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/reactos/tools/widl/header.c b/reactos/tools/widl/header.c index 89fa2dfc554..d3a31e6c5bf 100644 --- a/reactos/tools/widl/header.c +++ b/reactos/tools/widl/header.c @@ -597,10 +597,18 @@ const var_t* get_explicit_handle_var(const func_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 = t->ref) - if (t->type != RPC_FC_BIND_PRIMITIVE && is_attr(t->attrs, ATTR_HANDLE)) - return t; + const type_t *t = var->type; + + if (t->type == RPC_FC_BIND_PRIMITIVE) + return NULL; + + if (!is_ptr(t) && is_attr(t->attrs, ATTR_HANDLE)) + return t; + else + for (; is_ptr(t); t = t->ref) + if (t->type != RPC_FC_BIND_PRIMITIVE && is_attr(t->attrs, ATTR_HANDLE)) + return t; + return NULL; }