Nikolay Sivov (@nsivov) commented about dlls/combase/usrmarshal.c:
+}; + +/****************************************************************************** + * HSTRING_UserSize (combase.@) + */ +ULONG __RPC_USER HSTRING_UserSize(ULONG *flags, ULONG size, HSTRING *str) +{ + TRACE("%s, %lu, %s.\n", debugstr_user_flags(flags), size, debugstr_hstring(*str)); + + ALIGN_LENGTH(size, 7); + if (LOWORD(*flags) == MSHCTX_INPROC) + size += sizeof(((union hstring_wire *)NULL)->hstring); + else + size += offsetof(union hstring_wire, buf.data[WindowsGetStringLen(*str)]); + return size; +} Definition is still too complicated for no reason I think. Maybe let's have two plane structures instead?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/8703#note_112376