pidl facillitates illicit data sharing between idl files
Sam Liddicott
sam at liddicott.com
Wed Sep 30 01:29:49 MDT 2009
* tridge wrote, On 29/09/09 22:13:
> Hi Sam,
>
> > If I add a definition such as this, to my pidl file:
> >
> > typedef struct DATA_BLOB {
> > uint8 *data;
> > uint32 length;
> > } DATA_BLOB;
>
> There are two problems with this:
>
> 1) DATA_BLOB is a base type in pidl. It is not defined in any idl
> file, but instead is a built-in type like uint32 and other base
> types. Trying to re-define it is a bad idea.
good tip. I'm also working with MIDL where it isn't a base type, but I
can #ifdef that
> 2) the normal form for structure typedefs in pidl is:
>
> typedef struct {
> el1type el1;
> el2type el2;
> } NAME;
>
> Notice that the first line does not contain the structure name.
Aye, but:
http://blogs.msdn.com/oldnewthing/archive/2008/03/27/8338530.aspx
(MIDL again) but I can have a macro to nullify the struct name when not
running under midl.
> > For my own benefit I just renamed by struct to avoid the collision, but
> > I believe it is not intentional that one IDL file should cross-infect
> > another in this way - or have I mis-understood?
>
> you've re-defined a base type. All bets are off after that :-)
No doubt - and thanks for the tips.
I wonder if, if I had also re-defined one of the private types used in
winsrepl.idl if it would have had a similar effect.
It was the cross-infection that only occurs if all the IDL need
compiling that I was thinking about...
anwyay, thanks for the tips.
Sam
More information about the samba-technical
mailing list