Robert Shearman : widl: Fix the type offset used in marshaling/unmarshaling.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 31 11:23:26 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 35d1347cfacdc64499ee59877bf25ec4507dd4f5
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=35d1347cfacdc64499ee59877bf25ec4507dd4f5

Author: Robert Shearman <rob at codeweavers.com>
Date:   Tue Jan 31 18:05:33 2006 +0100

widl: Fix the type offset used in marshaling/unmarshaling.
Make a copy of type_offset so that it only gets incremented once per
function, instead of twice.

---

 tools/widl/client.c |    6 +++++-
 tools/widl/server.c |    6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/widl/client.c b/tools/widl/client.c
index bc997f0..1c3d187 100644
--- a/tools/widl/client.c
+++ b/tools/widl/client.c
@@ -103,6 +103,7 @@ static void write_function_stubs(type_t 
     {
         var_t *def = func->def;
         var_t* explicit_handle_var;
+        unsigned int type_offset_func;
 
         /* check for a defined binding handle */
         explicit_handle_var = get_explicit_handle_var(func);
@@ -194,8 +195,11 @@ static void write_function_stubs(type_t 
         fprintf(client, "\n");
 
 
+        /* make a copy so we don't increment the type offset twice */
+        type_offset_func = type_offset;
+
         /* marshal arguments */
-        marshall_arguments(client, indent, func, &type_offset, PASS_IN);
+        marshall_arguments(client, indent, func, &type_offset_func, PASS_IN);
 
         /* send/receive message */
         /* print_client("NdrNsSendReceive(\n"); */
diff --git a/tools/widl/server.c b/tools/widl/server.c
index 6d6d0cc..8bac800 100644
--- a/tools/widl/server.c
+++ b/tools/widl/server.c
@@ -102,6 +102,7 @@ static void write_function_stubs(type_t 
     {
         var_t *def = func->def;
         unsigned long buffer_size = 0;
+        unsigned int type_offset_func;
 
         /* check for a defined binding handle */
         explicit_handle_var = get_explicit_handle_var(func);
@@ -200,7 +201,10 @@ static void write_function_stubs(type_t 
             indent -= 2;
             fprintf(server, "\n");
 
-            unmarshall_arguments(server, indent, func, &type_offset, PASS_IN);
+            /* make a copy so we don't increment the type offset twice */
+            type_offset_func = type_offset;
+
+            unmarshall_arguments(server, indent, func, &type_offset_func, PASS_IN);
         }
 
         print_server("if (_StubMsg.Buffer > _StubMsg.BufferEnd)\n");




More information about the wine-cvs mailing list