Robert Shearman : widl: Generate NdrNonConformatString* calls for non-conformant string types.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 24 06:45:07 CST 2006


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

Author: Robert Shearman <rob at codeweavers.com>
Date:   Tue Jan 24 11:10:08 2006 +0100

widl: Generate NdrNonConformatString* calls for non-conformant string types.

---

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

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 1cef936..97aaa2d 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -833,9 +833,14 @@ void marshall_arguments(FILE *file, int 
 
         if (is_string_type(var->attrs, var->ptr_level, var->array))
         {
-            print_file(file, indent,
-                       "NdrConformantStringMarshall(&_StubMsg, (unsigned char *)%s, &__MIDL_TypeFormatString.Format[%d]);\n",
-                       var->name, *type_offset);
+            if (var->array && var->array->is_const)
+                print_file(file, indent,
+                           "NdrNonConformantStringMarshall(&_StubMsg, (unsigned char *)%s, &__MIDL_TypeFormatString.Format[%d]);\n",
+                           var->name, *type_offset);
+            else
+                print_file(file, indent,
+                           "NdrConformantStringMarshall(&_StubMsg, (unsigned char *)%s, &__MIDL_TypeFormatString.Format[%d]);\n",
+                           var->name, *type_offset);
             last_size = 1;
         }
         else if (is_array_type(var->attrs, var->ptr_level, var->array))
@@ -1018,9 +1023,14 @@ void unmarshall_arguments(FILE *file, in
 
         if (is_string_type(var->attrs, var->ptr_level, var->array))
         {
-            print_file(file, indent,
-                       "NdrConformantStringUnmarshall(&_StubMsg, (unsigned char *)%s, &__MIDL_TypeFormatString.Format[%d], 0);\n",
-                       var->name, *type_offset);
+            if (var->array && var->array->is_const)
+                print_file(file, indent,
+                           "NdrNonConformantStringUnmarshall(&_StubMsg, (unsigned char *)%s, &__MIDL_TypeFormatString.Format[%d], 0);\n",
+                           var->name, *type_offset);
+            else
+                print_file(file, indent,
+                           "NdrConformantStringUnmarshall(&_StubMsg, (unsigned char *)%s, &__MIDL_TypeFormatString.Format[%d], 0);\n",
+                           var->name, *type_offset);
             last_size = 1;
         }
         else if (is_array_type(var->attrs, var->ptr_level, var->array))




More information about the wine-cvs mailing list