In dssetup.idl, the string pointers inside DSROLER_PRIMARY_DOMAIN_INFO_BASIC are marked with the [unique] attribute. This means the server has to allocate them using separate MIDL_user_allocate calls.
However the client side requires the data to be in one buffer that requires only a single free. Windows accomplishes that by setting the FC_ALLOCATE_ALL_NODES attribute on these pointer types (using the allocate(all_nodes) ACF attribute), and rpcrt4 does the rest.
Neither widl nor our rpcrt4 support this attribute, so we have to remove the [unique] attribute and have the server perform only a single allocation until we have a better way to achieve this..
Stub-Allocated Buffers: https://msdn.microsoft.com/en-us/library/windows/desktop/aa378696%28v=vs.85%29.aspx
allocate attribute: https://msdn.microsoft.com/en-us/library/windows/desktop/aa366724%28v=vs.85%29.aspx