Author: ekohl Date: Wed Nov 19 15:01:47 2008 New Revision: 37467
URL: http://svn.reactos.org/svn/reactos?rev=37467&view=rev Log: Sync to wine-1.1.1 (Patch 2 of 10): - Rob Shearman robertshearman@gmail.com Tue, 1 Jul 2008 widl: Increment the buffer offset by 8 for embedded pointers inside varying arrays in varying structures.
The 8 bytes are for the variance and offset and are added just before the array, as seen in the marshalling code in rpcrt4. No offset needs to be added for non-varying structures since the buffer mark is set after the conformance in marshalled or unmarshalled.
Modified: trunk/reactos/tools/widl/typegen.c
Modified: trunk/reactos/tools/widl/typegen.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/typegen.c?rev=37... ============================================================================== --- trunk/reactos/tools/widl/typegen.c [iso-8859-1] (original) +++ trunk/reactos/tools/widl/typegen.c [iso-8859-1] Wed Nov 19 15:01:47 2008 @@ -1437,6 +1437,14 @@ if (offset_in_memory && offset_in_buffer) { size_t padding; + + if (is_array(v->type) && v->type->length_is) + { + *offset_in_buffer = ROUND_SIZE(*offset_in_buffer, 4); + /* skip over variance and offset in buffer */ + *offset_in_buffer += 8; + } + align = 0; type_memsize(v->type, &align); padding = ROUNDING(*offset_in_memory, align); @@ -1470,19 +1478,13 @@ { size_t offset_in_buffer; size_t offset_in_memory; - size_t conformance = 0; - - if (type->type == RPC_FC_CVSTRUCT) - conformance = 8; - else if (type->type == RPC_FC_CSTRUCT || type->type == RPC_FC_CPSTRUCT) - conformance = 4;
/* pass 1: search for single instance of a pointer (i.e. don't descend * into arrays) */ if (!is_array(type)) { offset_in_memory = 0; - offset_in_buffer = conformance; + offset_in_buffer = 0; write_no_repeat_pointer_descriptions( file, type, &offset_in_memory, &offset_in_buffer, typestring_offset); @@ -1490,7 +1492,7 @@
/* pass 2: search for pointers in fixed arrays */ offset_in_memory = 0; - offset_in_buffer = conformance; + offset_in_buffer = 0; write_fixed_array_pointer_descriptions( file, NULL, type, &offset_in_memory, &offset_in_buffer, typestring_offset); @@ -1512,7 +1514,7 @@
/* pass 4: search for pointers in varying arrays */ offset_in_memory = 0; - offset_in_buffer = conformance; + offset_in_buffer = 0; write_varying_array_pointer_descriptions( file, NULL, type, &offset_in_memory, &offset_in_buffer, typestring_offset);