Rob Shearman : widl: Structures and arrays with pointers should be complex when generating code for 64-bit platforms .

Alexandre Julliard julliard at winehq.org
Sat Dec 27 13:45:28 CST 2008


Module: wine
Branch: master
Commit: 2e0aefc1fd60e0e9f800e68eaaa905f031e3b544
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2e0aefc1fd60e0e9f800e68eaaa905f031e3b544

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Sat Dec 27 17:35:50 2008 +0000

widl: Structures and arrays with pointers should be complex when generating code for 64-bit platforms.

The non-complex variants depend on the wire size of the
structure/array matching the buffer size, but this no longer applies
when pointers are 8 bytes instead of 4.

---

 tools/widl/typegen.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index ed9430c..0406eb9 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -212,14 +212,28 @@ static int get_struct_type(const type_t *type)
       break;
 
     case RPC_FC_RP:
+      return RPC_FC_BOGUS_STRUCT;
+
     case RPC_FC_UP:
     case RPC_FC_FP:
     case RPC_FC_OP:
+      if (pointer_size != 4)
+        return RPC_FC_BOGUS_STRUCT;
+      has_pointer = 1;
+      break;
+
     case RPC_FC_CARRAY:
     case RPC_FC_CVARRAY:
     case RPC_FC_BOGUS_ARRAY:
+    {
+      unsigned int ptr_type = get_attrv(field->attrs, ATTR_POINTERTYPE);
+      if (!ptr_type || ptr_type == RPC_FC_RP)
+        return RPC_FC_BOGUS_STRUCT;
+      else if (pointer_size != 4)
+        return RPC_FC_BOGUS_STRUCT;
       has_pointer = 1;
       break;
+    }
 
     /*
      * Propagate member attributes




More information about the wine-cvs mailing list