r5674: - Re-enable DCOM support.
[ab/samba.git/.git] / source / librpc / idl / orpc.idl
1 #include "idl_types.h"
2
3 /**
4   DCOM interfaces
5   http://www.grimes.demon.co.uk/DCOM/DCOMSpec.htm
6  */
7
8 [
9         pointer_default(unique)
10 ]
11 interface ObjectRpcBaseTypes
12 {
13         /* COM_MINOR_VERSION = 1 (NT4.0, SP1, SP2, DCOM95). */
14         /* - Initial Release */
15         /* - Must be used when talking to downlevel machines, including */
16         /* on Remote Activation calls. */
17         /* COM_MINOR_VERSION = 2 (NT4.0 SP3 and beyond). */
18         /* - Added ResolveOxid2 to IObjectExporter to retrieve the */
19         /* COM version number of the server. Passed to the NDR engine */
20         /* to fix fatal endian-ness flaw in the way OLEAUTOMATION marshals */
21         /* BSTRS. Previous way used trailing padding, which is not NDR */
22         /* compatible. See Bug# 69189. */
23         /* COM_MINOR_VERSION = 3 (NT4.0 SP4 and DCOM95 builds 1018 and beyond) */
24         /* - OLEAUT32 added two new types to the SAFEARRAY, but SAFEARRAY */
25         /* previously included the "default" keyword, which prevented */
26         /* downlevel NDR engines from correctly handling any extensions. */
27         /* Machines with version >=5.3 don't use "default" and will */
28         /* gracefully handle future extensions to SAFEARRAY. */
29         /* old constants (for convenience) */
30
31         /* current version */
32         const uint16 COM_MAJOR_VERSION = 5;
33         const uint16 COM_MINOR_VERSION = 1;
34
35         /* Body Extensions */
36         const string dcom_ext_debugging = "f1f19680-4d2a-11ce-a66a-0020af6e72f4";
37         const string dcom_ext_extended_error = "f1f19681-4d2a-11ce-a66a-0020af6e72f4";
38
39         /* Component Object Model version number */
40
41         typedef [public] struct 
42         {
43                 uint16 MajorVersion; /* Major version number */
44                 uint16 MinorVersion; /* Minor version number */
45         } COMVERSION;
46
47         /* enumeration of additional information present in the call packet. */
48         typedef bitmap {
49                 ORPCF_NULL =                    0x00, /* no additional info in packet */
50                 ORPCF_LOCAL =                   0x01, /* call is local to this machine */
51                 ORPCF_RESERVED1 =               0x02, /* reserved for local use */
52                 ORPCF_RESERVED2 =               0x04, /* reserved for local use */
53                 ORPCF_RESERVED3 =               0x08, /* reserved for local use */
54                 ORPCF_RESERVED4 =           0x10  /* reserved for local use */
55         } ORPC_FLAGS;
56
57         /* Extension to implicit parameters. */
58         typedef [public] struct 
59         {       
60                 GUID id; /* Extension identifier. */
61                 uint32 size; /* Extension size. */
62                 /*FIXME[size_is((size+7)&~7)] uint8 data[]; Extension data. */
63                 [size_is(size)] uint8 data[];
64         }       ORPC_EXTENT;
65
66
67         /* Array of extensions. */
68         typedef struct 
69         {
70                 uint32 size; /* Num extents. */
71                 uint32 reserved; /* Must be zero. */
72                 /*FIXME[size_is((size+1)&~1,), unique] ORPC_EXTENT **extent; extents */
73                 [size_is(size)] ORPC_EXTENT extent[];
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] struct 
103         {
104                 uint16 wTowerId; /* Cannot be zero. */
105                 nstring NetworkAddr; 
106         }       STRINGBINDING;
107
108
109         const uint16 COM_C_AUTHZ_NONE = 0xffff;
110         typedef [public] struct 
111         {
112                 uint16 wAuthnSvc; /* Cannot be zero. */
113                 nstring PrincName; 
114         }       SECURITYBINDING;
115
116         /* signature value for OBJREF (object reference, actually the */
117         /* marshaled form of a COM interface). 
118          * MEOW apparently stands for "Microsoft Extended Object Wireformat"
119          */
120         const uint32 OBJREF_SIGNATURE = 0x574f454d; /* 'MEOW' */
121
122         /* flag values for OBJREF */
123         typedef enum {
124                 OBJREF_NULL = 0x0, /* NULL pointer */
125                 OBJREF_STANDARD = 0x1, /* standard marshaled objref */
126                 OBJREF_HANDLER = 0x2, /* handler marshaled objref */
127                 OBJREF_CUSTOM = 0x4 /* custom marshaled objref */
128         } OBJREF_FLAGS;
129
130         /* Flag values for a STDOBJREF (standard part of an OBJREF). */
131         /* SORF_OXRES1 - SORF_OXRES8 are reserved for the object exporters */
132         /* use only, object importers must ignore them and must not enforce MBZ. */
133         typedef bitmap {
134                 SORF_NULL   = 0x0000, /* convenient for initializing SORF */
135                 SORF_OXRES1 = 0x0001, /* reserved for exporter */
136                 SORF_OXRES2 = 0x0020, /* reserved for exporter */
137                 SORF_OXRES3 = 0x0040, /* reserved for exporter */
138                 SORF_OXRES4 = 0x0080, /* reserved for exporter */
139                 SORF_OXRES5 = 0x0100, /* reserved for exporter */
140                 SORF_OXRES6 = 0x0200, /* reserved for exporter */
141                 SORF_OXRES7 = 0x0400, /* reserved for exporter */
142                 SORF_OXRES8 = 0x0800, /* reserved for exporter */
143                 SORF_NOPING = 0x1000  /* Pinging is not required  */
144         } STDOBJREF_FLAGS;
145
146         /* standard object reference */
147         typedef [public] struct 
148         {
149                 uint32 flags; /* STDOBJREF flags (see above) */
150                 uint32 cPublicRefs; /* count of references passed */
151                 hyper oxid; /* oxid of server with this oid */
152                 hyper oid; /* oid of object with this ipid */
153                 GUID ipid; /* ipid of interface pointer to this object */
154         }       STDOBJREF;
155
156         typedef struct
157         {
158                 STDOBJREF std; /* standard objref */
159                 STRINGARRAY saResAddr; /* resolver address */
160         } u_standard;
161
162         typedef struct
163         {
164                 STDOBJREF std; /* standard objref */
165                 GUID clsid; /* Clsid of handler code */
166                 STRINGARRAY saResAddr; /* resolver address */
167         } u_handler;
168
169         typedef struct
170         {
171                 GUID clsid; /* Clsid of unmarshaling code */
172                 uint32 cbExtension; /* size of extension data */
173                 uint32 size; /* size of data that follows */
174                 uint8 pData[size]; /* extension + class specific data */
175         } u_custom;
176
177         typedef struct
178         {
179         } u_null;
180
181         typedef [nodiscriminant] union 
182         {
183                 [case(OBJREF_NULL)] u_null u_null;
184                 [case(OBJREF_STANDARD)] u_standard u_standard;
185                 [case(OBJREF_HANDLER)] u_handler u_handler;
186                 [case(OBJREF_CUSTOM)] u_custom u_custom;
187         } OBJREF_Types;
188
189         /* OBJREF is the format of a marshaled interface pointer. */
190         typedef [public,flag(NDR_LITTLE_ENDIAN)] struct 
191         {
192                 uint32 signature;
193                 uint32 flags; /* OBJREF flags (see above) */
194                 GUID iid; /* interface identifier */
195                 [switch_is(flags), switch_type(uint32)] OBJREF_Types u_objref;
196         } OBJREF;
197
198         /* wire representation of a marshalled interface pointer */
199         typedef [public] struct 
200         {
201                 uint32 size;
202                 [subcontext(4)] OBJREF obj;
203         } MInterfacePointer;
204 }