[2/7] widl: check for user types when calculating buffer size

Dan Hipschman dsh at linux.ucla.edu
Mon Jun 25 20:23:33 CDT 2007


This makes the code that calculates the buffer size aware of user types.

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

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index bb998fc..8dedd8d 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -2101,7 +2101,13 @@ static unsigned int get_required_buffer_size_type(
     size_t size = 0;
 
     *alignment = 0;
-    if (!is_ptr(type))
+    if (is_user_type(type))
+    {
+        const char *uname;
+        const type_t *utype = get_user_type(type, &uname);
+        size = get_required_buffer_size_type(utype, uname, alignment);
+    }
+    else if (!is_ptr(type))
     {
         switch (type->type)
         {



More information about the wine-patches mailing list