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