[jcifs] midlc parse error

Michael B Allen ioplex at gmail.com
Tue Sep 13 10:53:17 MDT 2011

On Sun, Sep 11, 2011 at 3:00 AM, Robert Doerr <samba at robertdoerr.de> wrote:
> Hello,
> I get some parse error when trying to compile the idl for the net
> shutdown command and am not sure if I did right.
> Here are my steps so far:
> - compiled midlc under cygwin
> - extracted three IDL-Files from [MS-RSP].pdf (download from microsoft):
> initshutdown.idl, windowsshutdown.idl winreg.idl
> - executed ./midlc<filename>  for all three files
> For each file I get a parse failure from midlc for line 4. This line
> looks like (example from windowsshutdown.idl):
>  [size_is(MaximumLength / 2), length_is((Length) / 2) ] unsigned short*
> Buffer;
> The corresponding lines in the other files look similar.
> midlc stops in parse.c on line 69 with the message "invalid attribute".
> What am I doing wrong?

Hi Robert,

Midlc only supports a subset of Microsoft IDL so copying and pasting
from Microsoft literature is almost certainly not going to work. You
will need to narrow down and isolate things a little. However in this
particular case I know for a fact midlc can handle that input. That
whole line is actually part of the definition for UNICODE_STRING which
is very common in JCIFS RPCs compiled with midlc. Look at
src/jcifs/dcerpc/rpc.idl and you will see a definition for
unicode_string with the same IDL in it.  Try copying that typedef and
replace the corresponding chunk of IDL with that unicode_string
definition. Study the various idl included with JCIFS in
src/jcifs/dcerpc/msrpc/*.idl to get a better idea of what midlc wants.
With a little work you should be able to get it to work no problem.


Michael B Allen
Java Active Directory Integration

More information about the jCIFS mailing list