Commit 33da66d6 authored by Dan Hipschman's avatar Dan Hipschman Committed by Alexandre Julliard

widl: Set the pointer description offset to zero if there are no pointers.

parent 1bbfd72a
...@@ -1677,9 +1677,10 @@ static size_t write_struct_tfs(FILE *file, type_t *type, ...@@ -1677,9 +1677,10 @@ static size_t write_struct_tfs(FILE *file, type_t *type,
/* On the sizing pass, type->ptrdesc may be zero, but it's ok as /* On the sizing pass, type->ptrdesc may be zero, but it's ok as
nothing is written to file yet. On the actual writing pass, nothing is written to file yet. On the actual writing pass,
this will have been updated. */ this will have been updated. */
short reloff = type->ptrdesc - *tfsoff; unsigned int absoff = type->ptrdesc ? type->ptrdesc : *tfsoff;
short reloff = absoff - *tfsoff;
print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n", print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n",
reloff, reloff, type->ptrdesc); reloff, reloff, absoff);
*tfsoff += 2; *tfsoff += 2;
} }
else if ((type->type == RPC_FC_PSTRUCT) || else if ((type->type == RPC_FC_PSTRUCT) ||
...@@ -1708,6 +1709,8 @@ static size_t write_struct_tfs(FILE *file, type_t *type, ...@@ -1708,6 +1709,8 @@ static size_t write_struct_tfs(FILE *file, type_t *type,
if (is_ptr(ft)) if (is_ptr(ft))
write_pointer_tfs(file, ft, tfsoff); write_pointer_tfs(file, ft, tfsoff);
} }
if (type->ptrdesc == *tfsoff)
type->ptrdesc = 0;
} }
current_structure = save_current_structure; current_structure = save_current_structure;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment