r15776: Don't generate ref pointers in Samba4-generated code. There is no point
[abartlet/samba.git/.git] / source4 / librpc / idl / orpc.idl
1 #include "idl_types.h"
2
3 /**
4   DCOM interfaces
5   http://www.ietf.org/internet-drafts/draft-brown-dcom-v1-spec-04.txt
6  */
7
8 [
9         pointer_default(unique),
10         keepref
11 ]
12 interface ObjectRpcBaseTypes
13 {
14         /* COM_MINOR_VERSION = 1 (NT4.0, SP1, SP2, DCOM95). */
15         /* - Initial Release */
16         /* - Must be used when talking to downlevel machines, including */
17         /* on Remote Activation calls. */
18         /* COM_MINOR_VERSION = 2 (NT4.0 SP3 and beyond). */
19         /* - Added ResolveOxid2 to IObjectExporter to retrieve the */
20         /* COM version number of the server. Passed to the NDR engine */
21         /* to fix fatal endian-ness flaw in the way OLEAUTOMATION marshals */
22         /* BSTRS. Previous way used trailing padding, which is not NDR */
23         /* compatible. See Bug# 69189. */
24         /* COM_MINOR_VERSION = 3 (NT4.0 SP4 and DCOM95 builds 1018 and beyond) */
25         /* - OLEAUT32 added two new types to the SAFEARRAY, but SAFEARRAY */
26         /* previously included the "default" keyword, which prevented */
27         /* downlevel NDR engines from correctly handling any extensions. */
28         /* Machines with version >=5.3 don't use "default" and will */
29         /* gracefully handle future extensions to SAFEARRAY. */
30         /* old constants (for convenience) */
31
32         /* current version */
33         const uint16 COM_MAJOR_VERSION = 5;
34         const uint16 COM_MINOR_VERSION = 1;
35
36         /* Body Extensions */
37         const string dcom_ext_debugging = "f1f19680-4d2a-11ce-a66a-0020af6e72f4";
38         const string dcom_ext_extended_error = "f1f19681-4d2a-11ce-a66a-0020af6e72f4";
39
40         /* Component Object Model version number */
41
42
43         typedef [public] struct 
44         {
45                 uint16 MajorVersion; /* Major version number */
46                 uint16 MinorVersion; /* Minor version number */
47         } COMVERSION;
48
49         /* enumeration of additional information present in the call packet. */
50         typedef bitmap {
51                 ORPCF_NULL =                    0x00, /* no additional info in packet */
52                 ORPCF_LOCAL =                   0x01, /* call is local to this machine */
53                 ORPCF_RESERVED1 =               0x02, /* reserved for local use */
54                 ORPCF_RESERVED2 =               0x04, /* reserved for local use */
55                 ORPCF_RESERVED3 =               0x08, /* reserved for local use */
56                 ORPCF_RESERVED4 =           0x10  /* reserved for local use */
57         } ORPC_FLAGS;
58
59         /* Extension to implicit parameters. */
60         typedef [public] struct 
61         {       
62                 GUID id; /* Extension identifier. */
63                 uint32 size; /* Extension size. */
64                 [size_is(((size+7)&~7))] uint8 data[]; /* Extension data. */
65         }       ORPC_EXTENT;
66
67
68         /* Array of extensions. */
69         typedef struct 
70         {
71                 uint32 size; /* Num extents. */
72                 uint32 reserved; /* Must be zero. */
73                 [size_is(((size+1)&~1))] ORPC_EXTENT **extent; /* extents */
74         } ORPC_EXTENT_ARRAY;
75
76
77         /* implicit 'this' pointer which is the first [in] parameter on */
78         /* every ORPC call. */
79         typedef [public] struct 
80         {
81                 COMVERSION version; /* COM version number */
82                 uint32 flags; /* ORPCF flags for presence of other data */
83                 uint32 reserved1; /* set to zero */
84                 GUID cid; /* causality id of caller */
85                 /* Extensions. */
86                 [unique] ORPC_EXTENT_ARRAY *extensions;
87         }       ORPCTHIS;
88
89
90         /* implicit 'that' pointer which is the first [out] parameter on */
91         /* every ORPC call. */
92         typedef [public] struct 
93         {
94                 uint32 flags; /* ORPCF flags for presence of other data */
95                 /* Extensions. */
96                 [unique] ORPC_EXTENT_ARRAY *extensions;
97         }       ORPCTHAT;
98
99
100         /* DUALSTRINGARRAYS are the return type for arrays of network addresses, */
101         /* arrays of endpoints and arrays of both used in many ORPC interfaces */
102         typedef [public,flag(NDR_NOALIGN)] struct 
103         {
104                 uint16 wTowerId; /* Cannot be zero. */
105                 nstring NetworkAddr; 
106         }       STRINGBINDING;
107
108         typedef [public,nopush,nopull,noprint] struct 
109         {
110                 STRINGBINDING **stringbindings;
111         } STRINGARRAY;
112
113         typedef [public,nopush,nopull,noprint] struct 
114         {
115                 STRINGBINDING **stringbindings;
116                 SECURITYBINDING **securitybindings;
117         } DUALSTRINGARRAY;
118
119         const uint16 COM_C_AUTHZ_NONE = 0xffff;
120         typedef [public,flag(NDR_NOALIGN)] struct 
121         {
122                 uint16 wAuthnSvc; /* Cannot be zero. */
123                 uint16 wAuthzSvc;
124                 nstring PrincName; 
125         }       SECURITYBINDING;
126
127         /* signature value for OBJREF (object reference, actually the */
128         /* marshaled form of a COM interface). 
129          * MEOW apparently stands for "Microsoft Extended Object Wireformat"
130          */
131         const uint32 OBJREF_SIGNATURE = 0x574f454d; /* 'MEOW' */
132
133         /* flag values for OBJREF */
134         typedef enum {
135                 OBJREF_NULL = 0x0, /* NULL pointer */
136                 OBJREF_STANDARD = 0x1, /* standard marshaled objref */
137                 OBJREF_HANDLER = 0x2, /* handler marshaled objref */
138                 OBJREF_CUSTOM = 0x4 /* custom marshaled objref */
139         } OBJREF_FLAGS;
140
141         /* Flag values for a STDOBJREF (standard part of an OBJREF). */
142         /* SORF_OXRES1 - SORF_OXRES8 are reserved for the object exporters */
143         /* use only, object importers must ignore them and must not enforce MBZ. */
144         typedef bitmap {
145                 SORF_NULL   = 0x0000, /* convenient for initializing SORF */
146                 SORF_OXRES1 = 0x0001, /* reserved for exporter */
147                 SORF_OXRES2 = 0x0020, /* reserved for exporter */
148                 SORF_OXRES3 = 0x0040, /* reserved for exporter */
149                 SORF_OXRES4 = 0x0080, /* reserved for exporter */
150                 SORF_OXRES5 = 0x0100, /* reserved for exporter */
151                 SORF_OXRES6 = 0x0200, /* reserved for exporter */
152                 SORF_OXRES7 = 0x0400, /* reserved for exporter */
153                 SORF_OXRES8 = 0x0800, /* reserved for exporter */
154                 SORF_NOPING = 0x1000  /* Pinging is not required  */
155         } STDOBJREF_FLAGS;
156
157         /* standard object reference */
158         typedef [public] struct 
159         {
160                 uint32 flags; /* STDOBJREF flags (see above) */
161                 uint32 cPublicRefs; /* count of references passed */
162                 hyper oxid; /* oxid of server with this oid */
163                 hyper oid; /* oid of object with this ipid */
164                 GUID ipid; /* ipid of interface pointer to this object */
165         }       STDOBJREF;
166
167         typedef struct
168         {
169                 STDOBJREF std; /* standard objref */
170                 STRINGARRAY saResAddr; /* resolver address */
171         } u_standard;
172
173         typedef struct
174         {
175                 STDOBJREF std; /* standard objref */
176                 GUID clsid; /* Clsid of handler code */
177                 STRINGARRAY saResAddr; /* resolver address */
178         } u_handler;
179
180         typedef struct
181         {
182                 GUID clsid; /* Clsid of unmarshaling code */
183                 uint32 cbExtension; /* size of extension data */
184                 uint32 size; /* size of data that follows */
185                 uint8 pData[size]; /* extension + class specific data */
186         } u_custom;
187
188         typedef struct
189         {
190         } u_null;
191
192         typedef [nodiscriminant] union 
193         {
194                 [case(OBJREF_NULL)] u_null u_null;
195                 [case(OBJREF_STANDARD)] u_standard u_standard;
196                 [case(OBJREF_HANDLER)] u_handler u_handler;
197                 [case(OBJREF_CUSTOM)] u_custom u_custom;
198         } OBJREF_Types;
199
200         /* OBJREF is the format of a marshaled interface pointer. */
201         typedef [public,flag(NDR_LITTLE_ENDIAN)] struct 
202         {
203                 uint32 signature;
204                 uint32 flags; /* OBJREF flags (see above) */
205                 GUID iid; /* interface identifier */
206                 [switch_is(flags), switch_type(uint32)] OBJREF_Types u_objref;
207         } OBJREF;
208
209         /* wire representation of a marshalled interface pointer */
210         typedef [public] struct 
211         {
212                 uint32 size;
213                 [subcontext(4)] OBJREF obj;
214         } MInterfacePointer;
215
216         typedef [v1_enum,public] enum 
217         {
218                 COM_OK                          = 0x00000000,
219                 COM_OUTOFMEMORY         = 0x80000002,
220                 COM_INVALIDARG          = 0x80000003,
221                 COM_NOINTERFACE         = 0x80000004,
222                 COM_ACCESSDENIED        = 0x80070005,
223                 COM_INVALID_OXID        = 0x80070776,
224                 COM_INVALID_OID         = 0x80070777,
225                 COM_INVALID_SET         = 0x80070778,
226                 COM_UNEXPECTED          = 0x8000FFFF,
227                 COM_CLSNOTFOUND         = 0x80040154
228         } COMRESULT;
229 }