MIDLC IDL Compiler

Michael B Allen mba2000 at ioplex.com
Sun Jan 16 03:14:49 GMT 2005

On Sun, 16 Jan 2005 13:15:50 +1100
Andrew Tridgell <tridge at osdl.org> wrote:

>  > That's not possible as MIDLC uses MIDL formatted IDL.
> Do they? I thought you supported doing strings in unix style "char *"?
> That's just not possible with MIDL style IDL. You can't just key off
> [string] as the [string] attribute in MIDL doesn't mean its a string
> at all (it means it is a zero element terminated array, which is quite
> different). 

Arrays attributed with [string] are treated specially by MIDLC as they are
with MIDL. They *are* considered to be strings. When a [string] object
is encountered it is passed to the {enc,dec}_ndr_string function to be
converted between the server's encoding (e.g. UTF-16LE) and the locale
dependant character encoding (e.g. UTF-8) of the calling process. I
believe this is consistent with MIDL.

If the object in question is NOT really a string then the user would
just have to decode it as a [size_is(size),length_is(length)] array
explicitly and NOT use [string].

>  > You would have to convert all of your interfaces to use MIDLC!
> If we lost the extensions then that would hugely increase the amount
> of hand written code we would have to write. 

Ok, I originally didn't know how important the extensions were.

I'm not saying I'll *never* implement extensions. I just don't
want to go diving into all sorts of non-standard stuff right now. Maybe
when the code matures and it's been determined that the base stuff is
working well I'll go back and think about that stuff (provided it
doesn't break MIDL compatibility).

On the other hand, there are some things that I will never support. For
example, PIDL just ignores the conformance DWORD before a structure with
an embedded conformat array. This would require that all Samba code
that operates on dom_sid2 be converted together. Not sure if that's a
big deal for you but we might as well get this stuff on the table now.

At the moment it's very important (to me) that MIDLC be totally compatible
with MIDL wherever possible [1]. I want people to be able to use their
existing IDL and knowledge. I'm thinking way beyond Samba or Java or CIFS.

> The number of extensions needed is quite small, but it allows us to
> handle everthing as IDL all the way from the raw PDUs to the user
> functions.

I'm sure some are quite easy to implement too. I just want to get the
core working and tested.


[1] MIDLC does not support many features of MIDL but any IDL that
is correctly handled by MIDLC should be handled correctly by MIDL (I
sometimes run my IDL through MIDL just to validate it as MIDLC validation
is horrible).

Greedo shoots first? Not in my Star Wars.

More information about the samba-technical mailing list