The OSF-DCE specification for marshaling embedded pointer types requires that you observe the following restrictions when you implement the <type>_UserSize, <type>_UserMarshal, and <type>_UserUnMarshal functions. (The rules and examples given here are for marshaling. However, your sizing and unmarshaling routines must follow the same restrictions):
typedef [wire_marshal (long)] void * HANDLE_HANDLE
Note that the wire type, long, is a flat type. Your HANDLE_HANDLE_UserMarshal function marshals a long whenever a HANDLE_HANDLE object is passed to it.
typedef struct HDATA{
long size;
[size_is(size) long * pData;
} HDATA;
typedef HDATA * WIRE_TYPE;
typedef [wire_marshal(WIRE_TYPE)] void * HANDLE_DATA
Note that the wire type, WIRE_TYPE, is a pointer type. Your HANDLE_DATA_UserMarshal function marshals the data related to the handle, using the HDATA layout, rather than the HDATA * layout.
The effect of these restrictions is that the types defined with the wire_marshal or user_marshal attributes can be freely embedded in other types.
wire_marshal, user_marshal, The type_UserSize Function, The type_UserMarshal Function, The type_UserUnMarshal Function, The type_UserFree Function