Huw Davies : widl: The alignment written for USER_MARSHAL types is the wire-type alignment.
Alexandre Julliard
julliard at winehq.org
Fri Aug 21 09:33:06 CDT 2009
Module: wine
Branch: master
Commit: a376b86dfefaf18580cadb931d0e60346c182f54
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a376b86dfefaf18580cadb931d0e60346c182f54
Author: Huw Davies <huw at codeweavers.com>
Date: Fri Aug 21 13:20:16 2009 +0100
widl: The alignment written for USER_MARSHAL types is the wire-type alignment.
---
tools/widl/typegen.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 3bcce37..d9a2c0d 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -1476,13 +1476,15 @@ static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
unsigned int align = 0, ualign = 0;
const char *name = NULL;
type_t *utype = get_user_type(type, &name);
- unsigned int usize = user_type_has_variable_size(utype) ? 0 : type_memsize(utype, &ualign);
+ unsigned int usize = type_memsize(utype, &ualign);
unsigned int size = type_memsize(type, &align);
unsigned short funoff = user_type_offset(name);
short reloff;
guard_rec(type);
+ if(user_type_has_variable_size(utype)) usize = 0;
+
if (type_get_type(utype) == TYPE_BASIC ||
type_get_type(utype) == TYPE_ENUM)
{
@@ -1518,7 +1520,7 @@ static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
print_start_tfs_comment(file, type, start);
print_file(file, 2, "0x%x,\t/* FC_USER_MARSHAL */\n", RPC_FC_USER_MARSHAL);
print_file(file, 2, "0x%x,\t/* Alignment= %d, Flags= %02x */\n",
- flags | (align - 1), align - 1, flags);
+ flags | (ualign - 1), ualign - 1, flags);
print_file(file, 2, "NdrFcShort(0x%hx),\t/* Function offset= %hu */\n", funoff, funoff);
print_file(file, 2, "NdrFcShort(0x%hx),\t/* %u */\n", size, size);
print_file(file, 2, "NdrFcShort(0x%hx),\t/* %u */\n", usize, usize);
More information about the wine-cvs
mailing list