MS IDL/DCE IDL compatibility

MS IDL/DCE IDL compatibility

Post by Leonid Gorki » Wed, 07 Jun 2000 04:00:00

Hi all,
I am working on a project that involves RPC link between UNIX server and
Windows client.
Now, we have a Windows server that does the same work. One RPC function
looks like this:

error_status_t GetList([in] handle_t binding,
                       [in, out] long *n,
                       [out, size_is(,*n)] str **list);

and str is defined as:

typedef [string, unique] char * str;

This function returns a pointer to an array of strings, memory for all
strings and array itself is
dynamically allocated by the server.

This code was compiled by Microsoft IDL compiler (midl), and everything
worked fine. Now, I need
to compile it for Solaris using IBM DCE IDL compiler. It gives an error
message, saying that
size attributes do not match array dimensions.

If I remove comma from size_is(), it compiles, but works incorrectly,
because it treats list as
an array of pointers, instead of treating it as pointer to an array.
Experimenting with IBM DCE IDL compiler, I found that it always accepts
only one dimension in
size_is attribute regardless of number of stars you have before an
identifier, i.e. it treats both long *x
and long ****x as one-dimensional arrays.

If I use a multi-dimensional array [][] instead of pointers, I cannot
allocate memory for each string
and I have to make all the string of a same fixed size. I can change the
IDL interface to return one
string at a time, but the challenge is to make it work with old Windows

So, the question: is it possible to change the code above to make it
compile with IBM DCE IDL compiler so
that it remains logically the same and allows communications between MS

Any help is much appreciated.

Sent via
Before you buy.