Huw Davies : widl: Don't dereference if the referenced type is a user type.

Alexandre Julliard julliard at winehq.org
Thu Apr 7 07:36:50 CDT 2011


Module: wine
Branch: stable
Commit: 2238058eda8c85d5240cc51b6abbd492f6e8fc60
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2238058eda8c85d5240cc51b6abbd492f6e8fc60

Author: Huw Davies <huw at codeweavers.com>
Date:   Thu Feb  3 11:53:30 2011 +0000

widl: Don't dereference if the referenced type is a user type.
(cherry picked from commit d8d963a9c3701a6a899f4f1f6fd2f8fe3fca63da)

---

 tools/widl/typegen.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index e3ea458..c4e51cd 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -1485,8 +1485,12 @@ static unsigned int write_nonsimple_pointer(FILE *file, const attr_list_t *attrs
     if (out_attr && !in_attr && pointer_type == RPC_FC_RP)
         flags |= RPC_FC_P_ONSTACK;
 
-    if (is_ptr(type) && is_declptr(type_pointer_get_ref(type)))
-        flags |= RPC_FC_P_DEREF;
+    if (is_ptr(type))
+    {
+        type_t *ref = type_pointer_get_ref(type);
+        if(is_declptr(ref) && !is_user_type(ref))
+            flags |= RPC_FC_P_DEREF;
+    }
 
     print_file(file, 2, "0x%x, 0x%x,\t\t/* %s",
                pointer_type,




More information about the wine-cvs mailing list