Module: wine
Branch: master
Commit: 36c03f6a940bacfc92202e846fa9e34b901eb1ad
URL: http://source.winehq.org/git/wine.git/?a=commit;h=36c03f6a940bacfc92202e846…
Author: Rob Shearman <robertshearman(a)gmail.com>
Date: Tue Dec 30 18:49:48 2008 +0000
widl: Remove duplicate pointer handling code in get_struct_type.
Only make the structure complex if there is an interface pointer, not
if there is a pointer to a union or complex struct since these are
handled perfectly well by the pointer marshalling code.
Fix the detection of structures with ref-pointers or pointers in 64-bit code.
---
tools/widl/typegen.c | 23 ++++-------------------
1 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index daabbd6..8852ca0 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -142,25 +142,6 @@ static int get_struct_type(const type_t *type)
if (is_user_type(t))
return RPC_FC_BOGUS_STRUCT;
- if (is_ptr(t))
- {
- do
- t = t->ref;
- while (is_ptr(t));
-
- switch (get_struct_type(t))
- {
- case RPC_FC_IP:
- case RPC_FC_ENCAPSULATED_UNION:
- case RPC_FC_NON_ENCAPSULATED_UNION:
- case RPC_FC_BOGUS_STRUCT:
- return RPC_FC_BOGUS_STRUCT;
- }
-
- has_pointer = 1;
- continue;
- }
-
if (field->type->declarray)
{
if (is_string_type(field->attrs, field->type))
@@ -222,6 +203,10 @@ static int get_struct_type(const type_t *type)
case RPC_FC_OP:
if (pointer_size != 4)
return RPC_FC_BOGUS_STRUCT;
+ /* pointers to interfaces aren't really pointers and have to be
+ * marshalled specially so they make the structure complex */
+ if (t->ref->type == RPC_FC_IP)
+ return RPC_FC_BOGUS_STRUCT;
has_pointer = 1;
break;