ole32: Add on the size of the whole OBJREF structure in the case of custom marshaling.
[wine] / dlls / ole32 / dcom.idl
1 /*
2  * Copyright 2003 Ove Kåven, TransGaming Technologies
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 /* see http://www.microsoft.com/msj/0398/dcom.htm */
20 /* and the official DCOM specification
21  * (there's a copy at http://www.grimes.demon.co.uk/DCOM/DCOMSpec.htm) */
22
23 import "unknwn.idl";
24
25 [
26   uuid(99fcfe60-5260-101b-bbcb-00aa0021347a),
27   pointer_default(unique)
28 ]
29 interface ObjectRpcBaseTypes
30 {
31   typedef unsigned hyper ID;
32   typedef ID MID;
33   typedef ID OXID;
34   typedef ID OID;
35   typedef ID SETID;
36   typedef GUID IPID;
37   typedef GUID CID;
38   typedef REFGUID REFIPID;
39
40   const unsigned short COM_MINOR_VERSION_1 = 1;
41   const unsigned short COM_MINOR_VERSION_2 = 2;
42
43   const unsigned short COM_MAJOR_VERSION = 5;
44   const unsigned short COM_MINOR_VERSION = 3;
45
46   typedef struct tagCOMVERSION {
47     unsigned short MajorVersion;
48     unsigned short MinorVersion;
49   } COMVERSION;
50
51   const unsigned long ORPCF_NULL = 0;
52   const unsigned long ORPCF_LOCAL = 1;
53   const unsigned long ORPCF_RESERVED1 = 2;
54   const unsigned long ORPCF_RESERVED2 = 4;
55   const unsigned long ORPCF_RESERVED3 = 8;
56   const unsigned long ORPCF_RESERVED4 = 16;
57
58   typedef struct tagORPC_EXTENT {
59     GUID id;
60     unsigned long size;
61     [size_is((size+7)&~7)] byte data[];
62   } ORPC_EXTENT;
63
64   typedef struct tagORPC_EXTENT_ARRAY {
65     unsigned long size;
66     unsigned long reserved;
67     [size_is((size+1)&~1,), unique] ORPC_EXTENT **extent;
68   } ORPC_EXTENT_ARRAY;
69
70   typedef struct tagORPCTHIS {
71     COMVERSION version;
72     unsigned long flags;
73     unsigned long reserved1;
74     CID cid;
75     [unique] ORPC_EXTENT_ARRAY *extensions;
76   } ORPCTHIS;
77
78   typedef struct tagORPCTHAT {
79     unsigned long flags;
80     [unique] ORPC_EXTENT_ARRAY *extensions;
81   } ORPCTHAT;
82
83   const unsigned short NCADG_IP_UDP = 0x08;
84   const unsigned short NCACN_IP_TCP = 0x07;
85   const unsigned short NCADG_IPX = 0x0E;
86   const unsigned short NCACN_SPX = 0x0C;
87   const unsigned short NCACN_NB_NB = 0x12;
88   const unsigned short NCACN_NB_IPX = 0x0D;
89   const unsigned short NCACN_DNET_NSP = 0x04;
90   const unsigned short NCACN_HTTP = 0x1F;
91
92   typedef struct tagSTRINGBINDING {
93     unsigned short wTowerId;
94     [string] WCHAR aNetworkAddr[];
95   } STRINGBINDING;
96
97   const unsigned short COM_C_AUTHZ_NONE = 0xffff;
98
99   typedef struct tagSECURITYBINDING {
100     unsigned short wAuthnSvc;
101     unsigned short wAuthzSvc;
102     [string] WCHAR aPrincName[];
103   } SECURITYBINDING;
104
105   typedef struct tagDUALSTRINGARRAY {
106     unsigned short wNumEntries;
107     unsigned short wSecurityOffset;
108     [size_is(wNumEntries)] unsigned short aStringArray[];
109   } DUALSTRINGARRAY;
110
111   const unsigned long OBJREF_SIGNATURE = 0x574f454d; /* "MEOW" */
112   const unsigned long OBJREF_STANDARD = 0x1;
113   const unsigned long OBJREF_HANDLER = 0x2;
114   const unsigned long OBJREF_CUSTOM = 0x4;
115   const unsigned long SORF_OXRES1 = 0x1;
116   const unsigned long SORF_OXRES2 = 0x20;
117   const unsigned long SORF_OXRES3 = 0x40;
118   const unsigned long SORF_OXRES4 = 0x80;
119   const unsigned long SORF_OXRES5 = 0x100;
120   const unsigned long SORF_OXRES6 = 0x200;
121   const unsigned long SORF_OXRES7 = 0x400;
122   const unsigned long SORF_OXRES8 = 0x800;
123   const unsigned long SORF_NULL = 0x0;
124   const unsigned long SORF_NOPING = 0x1000;
125
126   typedef struct tagSTDOBJREF {
127     unsigned long flags;
128     unsigned long cPublicRefs;
129     OXID oxid;
130     OID oid;
131     IPID ipid;
132   } STDOBJREF;
133
134   typedef struct tagOBJREF {
135     unsigned long signature;
136     unsigned long flags;
137     GUID iid;
138     [switch_is(flags)] union {
139     [case(OBJREF_STANDARD)] struct OR_STANDARD {
140         STDOBJREF std;
141         DUALSTRINGARRAY saResAddr;
142       } u_standard;
143     [case(OBJREF_HANDLER)] struct OR_HANDLER {
144         STDOBJREF std;
145         CLSID clsid;
146         DUALSTRINGARRAY saResAddr;
147       } u_handler;
148     [case(OBJREF_CUSTOM)] struct OR_CUSTOM {
149         CLSID clsid;
150         unsigned long cbExtension;
151         unsigned long size;
152         [size_is(size), ref] byte *pData;
153       } u_custom;
154     } u_objref;
155   } OBJREF;
156
157   typedef struct tagMInterfacePointer {
158     ULONG ulCntData;
159     [size_is(ulCntData)] BYTE abData[];
160   } MInterfacePointer;
161
162   typedef [unique] MInterfacePointer *PMInterfacePointer;
163
164 } /* interface ObjectRpcBaseTypes */
165
166 [
167   object,
168   uuid(00000131-0000-0000-C000-000000000046)
169 ]
170 interface IRemUnknown : IUnknown
171 {
172   typedef [unique] IRemUnknown *LPREMUNKNOWN;
173
174   typedef struct tagREMQIRESULT {
175     HRESULT hResult;
176     STDOBJREF std;
177   } REMQIRESULT;
178
179   typedef struct tagREMINTERFACEREF {
180     IPID ipid;
181     unsigned long cPublicRefs;
182     unsigned long cPrivateRefs;
183   } REMINTERFACEREF; 
184
185   HRESULT RemQueryInterface(
186     [in] REFIPID ripid,
187     [in] unsigned long cRefs,
188     [in] unsigned short cIids,
189     [in, size_is(cIids)] IID *iids,
190     [out, size_is(,cIids)] REMQIRESULT **ppQIResults);
191
192   HRESULT RemAddRef(
193     [in] unsigned short cInterfaceRefs,
194     [in, size_is(cInterfaceRefs)] REMINTERFACEREF* InterfaceRefs,
195     [out, size_is(cInterfaceRefs)] HRESULT *pResults);
196
197   HRESULT RemRelease(
198     [in] unsigned short cInterfaceRefs,
199     [in, size_is(cInterfaceRefs)] REMINTERFACEREF* InterfaceRefs);
200 }
201
202 [
203   object,
204   uuid(00000142-0000-0000-C000-000000000046)
205 ]
206 interface IRemUnknown2 : IRemUnknown
207 {
208   typedef [unique] IRemUnknown2 *LPREMUNKNOWN2;
209
210   HRESULT RemQueryInterface2(
211     [in] REFIPID ripid,
212     [in] unsigned short cIids,
213     [in, size_is(cIids)] IID *iids,
214     [out, size_is(cIids)] HRESULT *phr,
215     [out, size_is(cIids)] MInterfacePointer **ppMIF);
216 }
217
218 [
219   uuid(99fcfec4-5260-101b-bbcb-00aa0021347a),
220   pointer_default(unique)
221 ]
222 interface IOXIDResolver
223 {
224   [idempotent] error_status_t ResolveOxid(
225     [in] handle_t hRpc,
226     [in] OXID *pOxid,
227     [in] unsigned short cRequestedProtseqs,
228     [in, ref, size_is(cRequestedProtseqs)] unsigned short arRequestedProtseqs[],
229     [out, ref] DUALSTRINGARRAY **ppdsaOxidBindings,
230     [out, ref] IPID *pipidRemUnknown,
231     [out, ref] DWORD *pAuthnHint);
232
233   [idempotent] error_status_t SimplePing(
234     [in] handle_t hRpc,
235     [in] SETID *pSetId);
236
237   [idempotent] error_status_t ComplexPing(
238     [in] handle_t hRpc,
239     [in, out] SETID *pSetId,
240     [in] unsigned short SequenceNum,
241     [in] unsigned short cAddToSet,
242     [in] unsigned short cDelFromSet,
243     [in, unique, size_is(cAddToSet)] OID AddToSet[],
244     [in, unique, size_is(cDelFromSet)] OID DelFromSet[],
245     [out] unsigned short *pPingBackoffFactor);
246
247   [idempotent] error_status_t ServerAlive(
248     [in] handle_t hRpc);
249
250   [idempotent] error_status_t ResolveOxid2(
251     [in] handle_t hRpc,
252     [in] OXID *pOxid,
253     [in] unsigned short cRequestedProtseqs,
254     [in, ref, size_is(cRequestedProtseqs)] unsigned short arRequestedProtseqs[],
255     [out, ref] DUALSTRINGARRAY **ppdsaOxidBindings,
256     [out, ref] IPID *pipidRemUnknown,
257     [out, ref] DWORD *pAuthnHint,
258     [out, ref] COMVERSION *pComVersion); 
259 }
260
261 [
262   uuid(4d9f4ab8-7d1c-11cf-861e-0020af6e7c57),
263   pointer_default(unique)
264 ]
265 interface IRemoteActivation
266 {
267   const unsigned long MODE_GET_CLASS_OBJECT = 0xffffffff;
268
269   HRESULT RemoteActivation(
270     [in] handle_t hRpc,
271     [in] ORPCTHIS *ORPCthis,
272     [out] ORPCTHAT *ORPCthat,
273     [in] GUID *Clsid,
274     [in, string, unique] WCHAR *pwszObjectName,
275     [in, unique] MInterfacePointer *pObjectStorage,
276     [in] DWORD ClientImpLevel,
277     [in] DWORD Mode,
278     [in] DWORD Interfaces,
279     [in, unique, size_is(Interfaces)] IID *pIIDs,
280     [in] unsigned short cRequestedProtseqs,
281     [in, size_is(cRequestedProtseqs)] unsigned short RequestedProtseqs[],
282     [out] OXID *pOxid,
283     [out] DUALSTRINGARRAY **ppdsaOxidBindings,
284     [out] IPID *pipidRemUnknown,
285     [out] DWORD *pAuthnHint,
286     [out] COMVERSION *pServerVersion,
287     [out] HRESULT *phr,
288     [out,size_is(Interfaces)] MInterfacePointer **ppInterfaceData,
289     [out,size_is(Interfaces)] HRESULT *pResults);
290 }