1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! Mappings for the contents of OAIdl.h
7 use shared::basetsd::ULONG_PTR;
8 use shared::guiddef::{GUID, IID, REFGUID, REFIID};
9 use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT, INT, UINT, ULONG, USHORT, WORD};
10 use shared::rpcndr::byte;
11 use shared::wtypes::{
12     BSTR, CY, DATE, DECIMAL, VARIANT_BOOL, VARTYPE, VT_BSTR, VT_DISPATCH, VT_ERROR,
13     VT_I1, VT_I2, VT_I4, VT_I8, VT_RECORD, VT_RESERVED, VT_UNKNOWN, VT_VARIANT,
14     wireBSTR
15 };
16 use shared::wtypesbase::{
17     BYTE_SIZEDARR, DOUBLE, DWORD_SIZEDARR, HYPER_SIZEDARR, LPCOLESTR, LPOLESTR, SCODE,
18     WORD_SIZEDARR
19 };
20 use um::unknwnbase::{IUnknown, IUnknownVtbl};
21 use um::winnt::{CHAR, HRESULT, LCID, LONG, LONGLONG, PVOID, SHORT, ULONGLONG};
22 pub type CURRENCY = CY;
23 STRUCT!{struct SAFEARRAYBOUND {
24     cElements: ULONG,
25     lLbound: LONG,
26 }}
27 pub type LPSAFEARRAYBOUND = *mut SAFEARRAYBOUND;
28 pub type wireBRECORD = *mut _wireBRECORD;
29 pub type wireVARIANT = *mut _wireVARIANT;
30 STRUCT!{struct SAFEARR_BSTR {
31     Size: ULONG,
32     aBstr: *mut wireBSTR,
33 }}
34 STRUCT!{struct SAFEARR_UNKNOWN {
35     Size: ULONG,
36     apUnknown: *mut *mut IUnknown,
37 }}
38 STRUCT!{struct SAFEARR_DISPATCH {
39     Size: ULONG,
40     apDispatch: *mut *mut IDispatch,
41 }}
42 STRUCT!{struct SAFEARR_VARIANT {
43     Size: ULONG,
44     aVariant: *mut wireVARIANT,
45 }}
46 STRUCT!{struct SAFEARR_BRECORD {
47     Size: ULONG,
48     aRecord: *mut wireBRECORD,
49 }}
50 STRUCT!{struct SAFEARR_HAVEIID {
51     Size: ULONG,
52     apUnknown: *mut *mut IUnknown,
53     iid: IID,
54 }}
55 ENUM!{enum SF_TYPE {
56     SF_ERROR = VT_ERROR,
57     SF_I1 = VT_I1,
58     SF_I2 = VT_I2,
59     SF_I4 = VT_I4,
60     SF_I8 = VT_I8,
61     SF_BSTR = VT_BSTR,
62     SF_UNKNOWN = VT_UNKNOWN,
63     SF_DISPATCH = VT_DISPATCH,
64     SF_VARIANT = VT_VARIANT,
65     SF_RECORD = VT_RECORD,
66     SF_HAVEIID = VT_UNKNOWN | VT_RESERVED,
67 }}
68 #[cfg(target_pointer_width = "32")]
69 UNION!{union __MIDL_IOleAutomationTypes_0001 {
70     [u32; 6],
71     BstrStr BstrStr_mut: SAFEARR_BSTR,
72     UnknownStr UnknownStr_mut: SAFEARR_UNKNOWN,
73     DispatchStr DispatchStr_mut: SAFEARR_DISPATCH,
74     VariantStr VariantStr_mut: SAFEARR_VARIANT,
75     RecordStr RecordStr_mut: SAFEARR_BRECORD,
76     HaveIidStr HaveIidStr_mut: SAFEARR_HAVEIID,
77     ByteStr ByteStr_mut: BYTE_SIZEDARR,
78     WordStr WordStr_mut: WORD_SIZEDARR,
79     LongStr LongStr_mut: DWORD_SIZEDARR,
80     HyperStr HyperStr_mut: HYPER_SIZEDARR,
81 }}
82 #[cfg(target_pointer_width = "64")]
83 UNION!{union __MIDL_IOleAutomationTypes_0001 {
84     [u64; 4],
85     BstrStr BstrStr_mut: SAFEARR_BSTR,
86     UnknownStr UnknownStr_mut: SAFEARR_UNKNOWN,
87     DispatchStr DispatchStr_mut: SAFEARR_DISPATCH,
88     VariantStr VariantStr_mut: SAFEARR_VARIANT,
89     RecordStr RecordStr_mut: SAFEARR_BRECORD,
90     HaveIidStr HaveIidStr_mut: SAFEARR_HAVEIID,
91     ByteStr ByteStr_mut: BYTE_SIZEDARR,
92     WordStr WordStr_mut: WORD_SIZEDARR,
93     LongStr LongStr_mut: DWORD_SIZEDARR,
94     HyperStr HyperStr_mut: HYPER_SIZEDARR,
95 }}
96 STRUCT!{struct SAFEARRAYUNION {
97     sfType: ULONG,
98     u: __MIDL_IOleAutomationTypes_0001,
99 }}
100 STRUCT!{struct _wireSAFEARRAY {
101     cDims: USHORT,
102     fFeatures: USHORT,
103     cbElements: ULONG,
104     cLocks: ULONG,
105     uArrayStructs: SAFEARRAYUNION,
106     rgsaBound: [SAFEARRAYBOUND; 1],
107 }}
108 pub type wireSAFEARRAY = *mut _wireSAFEARRAY;
109 pub type wirePSAFEARRAY = *mut wireSAFEARRAY;
110 STRUCT!{struct SAFEARRAY {
111     cDims: USHORT,
112     fFeatures: USHORT,
113     cbElements: ULONG,
114     cLocks: ULONG,
115     pvData: PVOID,
116     rgsabound: [SAFEARRAYBOUND; 1],
117 }}
118 pub type LPSAFEARRAY = *mut SAFEARRAY;
119 pub const FADF_AUTO: DWORD = 0x1;
120 pub const FADF_STATIC: DWORD = 0x2;
121 pub const FADF_EMBEDDED: DWORD = 0x4;
122 pub const FADF_FIXEDSIZE: DWORD = 0x10;
123 pub const FADF_RECORD: DWORD = 0x20;
124 pub const FADF_HAVEIID: DWORD = 0x40;
125 pub const FADF_HAVEVARTYPE: DWORD = 0x80;
126 pub const FADF_BSTR: DWORD = 0x100;
127 pub const FADF_UNKNOWN: DWORD = 0x200;
128 pub const FADF_DISPATCH: DWORD = 0x400;
129 pub const FADF_VARIANT: DWORD = 0x800;
130 pub const FADF_RESERVED: DWORD = 0xf008;
131 STRUCT!{struct __tagBRECORD {
132     pvRecord: PVOID,
133     pRecInfo: *mut IRecordInfo,
134 }}
135 UNION!{union VARIANT_n3 {
136     [u64; 1] [u64; 2],
137     llVal llVal_mut: LONGLONG,
138     lVal lVal_mut: LONG,
139     bVal bVal_mut: BYTE,
140     iVal iVal_mut: SHORT,
141     fltVal fltVal_mut: FLOAT,
142     dblVal dblVal_mut: DOUBLE,
143     boolVal boolVal_mut: VARIANT_BOOL,
144     scode scode_mut: SCODE,
145     cyVal cyVal_mut: CY,
146     date date_mut: DATE,
147     bstrVal bstrVal_mut: BSTR,
148     punkVal punkVal_mut: *mut IUnknown,
149     pdispVal pdispVal_mut: *mut IDispatch,
150     parray parray_mut: *mut SAFEARRAY,
151     pbVal pbVal_mut: *mut BYTE,
152     piVal piVal_mut: *mut SHORT,
153     plVal plVal_mut: *mut LONG,
154     pllVal pllVal_mut: *mut LONGLONG,
155     pfltVal pfltVal_mut: *mut FLOAT,
156     pdblVal pdblVal_mut: *mut DOUBLE,
157     pboolVal pboolVal_mut: *mut VARIANT_BOOL,
158     pscode pscode_mut: *mut SCODE,
159     pcyVal pcyVal_mut: *mut CY,
160     pdate pdate_mut: *mut DATE,
161     pbstrVal pbstrVal_mut: *mut BSTR,
162     ppunkVal ppunkVal_mut: *mut *mut IUnknown,
163     ppdispVal ppdispVal_mut: *mut *mut IDispatch,
164     pparray pparray_mut: *mut *mut SAFEARRAY,
165     pvarVal pvarVal_mut: *mut VARIANT,
166     byref byref_mut: PVOID,
167     cVal cVal_mut: CHAR,
168     uiVal uiVal_mut: USHORT,
169     ulVal ulVal_mut: ULONG,
170     ullVal ullVal_mut: ULONGLONG,
171     intVal intVal_mut: INT,
172     uintVal uintVal_mut: UINT,
173     pdecVal pdecVal_mut: *mut DECIMAL,
174     pcVal pcVal_mut: *mut CHAR,
175     puiVal puiVal_mut: *mut USHORT,
176     pulVal pulVal_mut: *mut ULONG,
177     pullVal pullVal_mut: *mut ULONGLONG,
178     pintVal pintVal_mut: *mut INT,
179     puintVal puintVal_mut: *mut UINT,
180     n4 n4_mut: __tagBRECORD,
181 }}
182 STRUCT!{struct __tagVARIANT {
183     vt: VARTYPE,
184     wReserved1: WORD,
185     wReserved2: WORD,
186     wReserved3: WORD,
187     n3: VARIANT_n3,
188 }}
189 UNION!{union VARIANT_n1 {
190     [u64; 2] [u64; 3],
191     n2 n2_mut: __tagVARIANT,
192     decVal decVal_mut: DECIMAL,
193 }}
194 STRUCT!{struct VARIANT {
195     n1: VARIANT_n1,
196 }}
197 pub type LPVARIANT = *mut VARIANT;
198 pub type VARIANTARG = VARIANT;
199 pub type LPVARIANTARG = *mut VARIANT;
200 pub type REFVARIANT = *const VARIANT;
201 STRUCT!{struct _wireBRECORD {
202     fFlags: ULONG,
203     clSize: ULONG,
204     pRecInfo: *mut IRecordInfo,
205     pRecord: *mut byte,
206 }}
207 UNION!{union _wireVARIANT_u {
208     [u64; 2],
209     llVal llVal_mut: LONGLONG,
210     lVal lVal_mut: LONG,
211     bVal bVal_mut: BYTE,
212     iVal iVal_mut: SHORT,
213     fltVal fltVal_mut: FLOAT,
214     dblVal dblVal_mut: DOUBLE,
215     boolVal boolVal_mut: VARIANT_BOOL,
216     scode scode_mut: SCODE,
217     cyVal cyVal_mut: CY,
218     date date_mut: DATE,
219     bstrVal bstrVal_mut: wireBSTR,
220     punkVal punkVal_mut: *mut IUnknown,
221     pdispVal pdispVal_mut: *mut IDispatch,
222     parray parray_mut: wirePSAFEARRAY,
223     brecVal brecVal_mut: wireBRECORD,
224     pbVal pbVal_mut: *mut BYTE,
225     piVal piVal_mut: *mut SHORT,
226     plVal plVal_mut: *mut LONG,
227     pllVal pllVal_mut: *mut LONGLONG,
228     pfltVal pfltVal_mut: *mut FLOAT,
229     pdblVal pdblVal_mut: *mut DOUBLE,
230     pboolVal pboolVal_mut: *mut VARIANT_BOOL,
231     pscode pscode_mut: *mut SCODE,
232     pcyVal pcyVal_mut: *mut CY,
233     pdate pdate_mut: *mut DATE,
234     pbstrVal pbstrVal_mut: *mut wireBSTR,
235     ppunkVal ppunkVal_mut: *mut *mut IUnknown,
236     ppdispVal ppdispVal_mut: *mut *mut IDispatch,
237     pparray pparray_mut: *mut wirePSAFEARRAY,
238     pvarVal pvarVal_mut: *mut wireVARIANT,
239     cVal cVal_mut: CHAR,
240     uiVal uiVal_mut: USHORT,
241     ulVal ulVal_mut: ULONG,
242     ullVal ullVal_mut: ULONGLONG,
243     intVal intVal_mut: INT,
244     uintVal uintVal_mut: UINT,
245     decVal decVal_mut: DECIMAL,
246     pdecVal pdecVal_mut: *mut DECIMAL,
247     pcVal pcVal_mut: *mut CHAR,
248     puiVal puiVal_mut: *mut USHORT,
249     pulVal pulVal_mut: *mut ULONG,
250     pullVal pullVal_mut: *mut ULONGLONG,
251     pintVal pintVal_mut: *mut INT,
252     puintVal puintVal_mut: *mut UINT,
253 }}
254 STRUCT!{struct _wireVARIANT {
255     clSize: DWORD,
256     rpcReserved: DWORD,
257     vt: USHORT,
258     wReserved1: USHORT,
259     wReserved2: USHORT,
260     wReserved3: USHORT,
261     u: _wireVARIANT_u,
262 }}
263 pub type DISPID = LONG;
264 pub type MEMBERID = DISPID;
265 pub type HREFTYPE = DWORD;
266 ENUM!{enum TYPEKIND {
267     TKIND_ENUM = 0,
268     TKIND_RECORD,
269     TKIND_MODULE,
270     TKIND_INTERFACE,
271     TKIND_DISPATCH,
272     TKIND_COCLASS,
273     TKIND_ALIAS,
274     TKIND_UNION,
275     TKIND_MAX,
276 }}
277 UNION!{union TYPEDESC_u {
278     [usize; 1],
279     lptdesc lptdesc_mut: *mut TYPEDESC,
280     lpadesc lpadesc_mut: *mut ARRAYDESC,
281     hreftype hreftype_mut: HREFTYPE,
282 }}
283 STRUCT!{struct TYPEDESC {
284     u: TYPEDESC_u,
285     vt: VARTYPE,
286 }}
287 STRUCT!{struct ARRAYDESC {
288     tdescElem: TYPEDESC,
289     cDims: USHORT,
290     rgbounds: [SAFEARRAYBOUND; 1],
291 }}
292 STRUCT!{struct PARAMDESCEX {
293     cBytes: ULONG,
294     varDefaultValue: VARIANTARG,
295 }}
296 pub type LPPARAMDESCEX = *mut PARAMDESCEX;
297 STRUCT!{struct PARAMDESC {
298     pparamdescex: LPPARAMDESCEX,
299     wParamFlags: USHORT,
300 }}
301 pub type LPPARAMDESC = *mut PARAMDESC;
302 pub const PARAMFLAG_NONE: DWORD = 0;
303 pub const PARAMFLAG_FIN: DWORD = 0x1;
304 pub const PARAMFLAG_FOUT: DWORD = 0x2;
305 pub const PARAMFLAG_FLCID: DWORD = 0x4;
306 pub const PARAMFLAG_FRETVAL: DWORD = 0x8;
307 pub const PARAMFLAG_FOPT: DWORD = 0x10;
308 pub const PARAMFLAG_FHASDEFAULT: DWORD = 0x20;
309 pub const PARAMFLAG_FHASCUSTDATA: DWORD = 0x40;
310 STRUCT!{struct IDLDESC {
311     dwReserved: ULONG_PTR,
312     wIDLFlags: USHORT,
313 }}
314 pub type LPIDLDESC = *mut IDLDESC;
315 pub const IDLFLAG_NONE: DWORD = PARAMFLAG_NONE;
316 pub const IDLFLAG_FIN: DWORD = PARAMFLAG_FIN;
317 pub const IDLFLAG_FOUT: DWORD = PARAMFLAG_FOUT;
318 pub const IDLFLAG_FLCID: DWORD = PARAMFLAG_FLCID;
319 pub const IDLFLAG_FRETVAL: DWORD = PARAMFLAG_FRETVAL;
320 UNION!{union ELEMDESC_u {
321     [usize; 2],
322     idldesc idldesc_mut: IDLDESC,
323     paramdesc paramdesc_mut: PARAMDESC,
324 }}
325 STRUCT!{struct ELEMDESC {
326     tdesc: TYPEDESC,
327     u: ELEMDESC_u,
328 }}
329 pub type LPELEMDESC = *mut ELEMDESC;
330 STRUCT!{struct TYPEATTR {
331     guid: GUID,
332     lcid: LCID,
333     dwReserved: DWORD,
334     memidConstructor: MEMBERID,
335     memidDestructor: MEMBERID,
336     lpstrSchema: LPOLESTR,
337     cbSizeInstance: ULONG,
338     typekind: TYPEKIND,
339     cFuncs: WORD,
340     cVars: WORD,
341     cImplTypes: WORD,
342     cbSizeVft: WORD,
343     cbAlignment: WORD,
344     wTypeFlags: WORD,
345     wMajorVerNum: WORD,
346     wMinorVerNum: WORD,
347     tdescAlias: TYPEDESC,
348     idldescType: IDLDESC,
349 }}
350 pub type LPTYPEATTR = *mut TYPEATTR;
351 STRUCT!{struct DISPPARAMS {
352     rgvarg: *mut VARIANTARG,
353     rgdispidNamedArgs: *mut DISPID,
354     cArgs: UINT,
355     cNamedArgs: UINT,
356 }}
357 STRUCT!{struct EXCEPINFO {
358     wCode: WORD,
359     wReserved: WORD,
360     bstrSource: BSTR,
361     bstrDescription: BSTR,
362     bstrHelpFile: BSTR,
363     dwHelpContext: DWORD,
364     pvReserved: PVOID,
365     pfnDeferredFillIn: Option<unsafe extern "system" fn(
366         einfo: *mut EXCEPINFO,
367     ) -> HRESULT>,
368     scode: SCODE,
369 }}
370 ENUM!{enum CALLCONV {
371     CC_FASTCALL = 0,
372     CC_CDECL = 1,
373     CC_MSCPASCAL,
374     CC_PASCAL,
375     CC_MACPASCAL,
376     CC_STDCALL,
377     CC_FPFASTCALL,
378     CC_SYSCALL,
379     CC_MPWCDECL,
380     CC_MPWPASCAL,
381     CC_MAX,
382 }}
383 ENUM!{enum FUNCKIND {
384     FUNC_VIRTUAL = 0,
385     FUNC_PUREVIRTUAL,
386     FUNC_NONVIRTUAL,
387     FUNC_STATIC,
388     FUNC_DISPATCH,
389 }}
390 ENUM!{enum INVOKEKIND {
391     INVOKE_FUNC = 1,
392     INVOKE_PROPERTYGET = 2,
393     INVOKE_PROPERTYPUT = 4,
394     INVOKE_PROPERTYPUTREF = 8,
395 }}
396 STRUCT!{struct FUNCDESC {
397     memid: MEMBERID,
398     lprgscode: *mut SCODE,
399     lprgelemdescParam: *mut ELEMDESC,
400     funckind: FUNCKIND,
401     invkind: INVOKEKIND,
402     callconv: CALLCONV,
403     cParams: SHORT,
404     cParamsOpt: SHORT,
405     oVft: SHORT,
406     cScodes: SHORT,
407     elemdescFunc: ELEMDESC,
408     wFuncFlags: WORD,
409 }}
410 pub type LPFUNCDESC = *mut FUNCDESC;
411 ENUM!{enum VARKIND {
412     VAR_PERINSTANCE = 0,
413     VAR_STATIC,
414     VAR_CONST,
415     VAR_DISPATCH,
416 }}
417 pub const IMPLTYPEFLAG_FDEFAULT: DWORD = 0x1;
418 pub const IMPLTYPEFLAG_FSOURCE: DWORD = 0x2;
419 pub const IMPLTYPEFLAG_FRESTRICTED: DWORD = 0x4;
420 pub const IMPLTYPEFLAG_FDEFAULTVTABLE: DWORD = 0x8;
421 UNION!{union VARDESC_u {
422     [usize; 1],
423     oInst oInst_mut: ULONG,
424     lpvarValue lpvarValue_mut: *mut VARIANT,
425 }}
426 STRUCT!{struct VARDESC {
427     memid: MEMBERID,
428     lpstrSchema: LPOLESTR,
429     u: VARDESC_u,
430     elemdescVar: ELEMDESC,
431     wVarFlags: WORD,
432     varkind: VARKIND,
433 }}
434 pub type LPVARDESC = *mut VARDESC;
435 ENUM!{enum TYPEFLAGS {
436     TYPEFLAG_FAPPOBJECT = 0x1,
437     TYPEFLAG_FCANCREATE = 0x2,
438     TYPEFLAG_FLICENSED = 0x4,
439     TYPEFLAG_FPREDECLID = 0x8,
440     TYPEFLAG_FHIDDEN = 0x10,
441     TYPEFLAG_FCONTROL = 0x20,
442     TYPEFLAG_FDUAL = 0x40,
443     TYPEFLAG_FNONEXTENSIBLE = 0x80,
444     TYPEFLAG_FOLEAUTOMATION = 0x100,
445     TYPEFLAG_FRESTRICTED = 0x200,
446     TYPEFLAG_FAGGREGATABLE = 0x400,
447     TYPEFLAG_FREPLACEABLE = 0x800,
448     TYPEFLAG_FDISPATCHABLE = 0x1000,
449     TYPEFLAG_FREVERSEBIND = 0x2000,
450     TYPEFLAG_FPROXY = 0x4000,
451 }}
452 ENUM!{enum FUNCFLAGS {
453     FUNCFLAG_FRESTRICTED = 0x1,
454     FUNCFLAG_FSOURCE = 0x2,
455     FUNCFLAG_FBINDABLE = 0x4,
456     FUNCFLAG_FREQUESTEDIT = 0x8,
457     FUNCFLAG_FDISPLAYBIND = 0x10,
458     FUNCFLAG_FDEFAULTBIND = 0x20,
459     FUNCFLAG_FHIDDEN = 0x40,
460     FUNCFLAG_FUSESGETLASTERROR = 0x80,
461     FUNCFLAG_FDEFAULTCOLLELEM = 0x100,
462     FUNCFLAG_FUIDEFAULT = 0x200,
463     FUNCFLAG_FNONBROWSABLE = 0x400,
464     FUNCFLAG_FREPLACEABLE = 0x800,
465     FUNCFLAG_FIMMEDIATEBIND = 0x1000,
466 }}
467 ENUM!{enum VARFLAGS {
468     VARFLAG_FREADONLY = 0x1,
469     VARFLAG_FSOURCE = 0x2,
470     VARFLAG_FBINDABLE = 0x4,
471     VARFLAG_FREQUESTEDIT = 0x8,
472     VARFLAG_FDISPLAYBIND = 0x10,
473     VARFLAG_FDEFAULTBIND = 0x20,
474     VARFLAG_FHIDDEN = 0x40,
475     VARFLAG_FRESTRICTED = 0x80,
476     VARFLAG_FDEFAULTCOLLELEM = 0x100,
477     VARFLAG_FUIDEFAULT = 0x200,
478     VARFLAG_FNONBROWSABLE = 0x400,
479     VARFLAG_FREPLACEABLE = 0x800,
480     VARFLAG_FIMMEDIATEBIND = 0x1000,
481 }}
482 STRUCT!{struct CLEANLOCALSTORAGE {
483     pInterface: *mut IUnknown,
484     pStorage: PVOID,
485     flags: DWORD,
486 }}
487 STRUCT!{struct CUSTDATAITEM {
488     guid: GUID,
489     varValue: VARIANTARG,
490 }}
491 pub type LPCUSTDATAITEM = *mut CUSTDATAITEM;
492 STRUCT!{struct CUSTDATA {
493     cCustData: DWORD,
494     prgCustData: LPCUSTDATAITEM,
495 }}
496 pub type LPCUSTDATA = *mut CUSTDATA;
497 pub type LPCREATETYPEINFO = *mut ICreateTypeInfo;
498 RIDL!{#[uuid(0x00020405, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)]
499 interface ICreateTypeInfo(ICreateTypeInfoVtbl): IUnknown(IUnknownVtbl) {
500     fn SetGuid(
501         guid: REFGUID,
502     ) -> HRESULT,
503     fn SetTypeFlags(
504         uTypeFlags: UINT,
505     ) -> HRESULT,
506     fn SetDocString(
507         pStrDoc: LPOLESTR,
508     ) -> HRESULT,
509     fn SetHelpContext(
510         dwHelpContext: DWORD,
511     ) -> HRESULT,
512     fn SetVersion(
513         wMajorVerNum: WORD,
514         wMinorVerNum: WORD,
515     ) -> HRESULT,
516     fn AddRefTypeInfo(
517         pTInfo: *mut ITypeInfo,
518     ) -> HRESULT,
519     fn AddFuncDesc(
520         index: UINT,
521         pFuncDesc: *mut FUNCDESC,
522     ) -> HRESULT,
523     fn SetImplTypeFlags(
524         index: UINT,
525         implTypeFlags: INT,
526     ) -> HRESULT,
527     fn SetAlignment(
528         cbAlignment: WORD,
529     ) -> HRESULT,
530     fn SetSchema(
531         pStrSchema: LPOLESTR,
532     ) -> HRESULT,
533     fn AddVarDesc(
534         index: UINT,
535         pVarDesc: *mut VARDESC,
536     ) -> HRESULT,
537     fn SetFuncAndParamNames(
538         index: UINT,
539         rgszNames: *mut LPOLESTR,
540         cNames: UINT,
541     ) -> HRESULT,
542     fn SetVarName(
543         index: UINT,
544         szName: LPOLESTR,
545     ) -> HRESULT,
546     fn SetTypeDescAlias(
547         pTDescAlias: *mut TYPEDESC,
548     ) -> HRESULT,
549     fn DefineFuncAsDllEntry(
550         index: UINT,
551         szDllName: LPOLESTR,
552         szProcName: LPOLESTR,
553     ) -> HRESULT,
554     fn SetFuncDocString(
555         index: UINT,
556         szDocString: LPOLESTR,
557     ) -> HRESULT,
558     fn SetVarDocString(
559         index: UINT,
560         szDocString: LPOLESTR,
561     ) -> HRESULT,
562     fn SetFuncHelpContext(
563         index: UINT,
564         dwHelpContext: DWORD,
565     ) -> HRESULT,
566     fn SetVarHelpContext(
567         index: UINT,
568         dwHelpContext: DWORD,
569     ) -> HRESULT,
570     fn SetMops(
571         index: UINT,
572         bstrMops: BSTR,
573     ) -> HRESULT,
574     fn SetTypeIdldesc(
575         pIdlDesc: *mut IDLDESC,
576     ) -> HRESULT,
577     fn LayOut() -> HRESULT,
578 }}
579 // LPCREATETYPEINFO2
580 // ICreateTypeInfo2
581 // LPCREATETYPELIB
582 // ICreateTypeLib
583 // LPCREATETYPELIB2
584 // ICreateTypeLib2
585 pub type LPDISPATCH = *mut IDispatch;
586 pub const DISPID_UNKNOWN: INT = -1;
587 pub const DISPID_VALUE: INT = 0;
588 pub const DISPID_PROPERTYPUT: INT = -3;
589 pub const DISPID_NEWENUM: INT = -4;
590 pub const DISPID_EVALUATE: INT = -5;
591 pub const DISPID_CONSTRUCTOR: INT = -6;
592 pub const DISPID_DESTRUCTOR: INT = -7;
593 pub const DISPID_COLLECT: INT = -8;
594 RIDL!{#[uuid(0x00020400, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)]
595 interface IDispatch(IDispatchVtbl): IUnknown(IUnknownVtbl) {
596     fn GetTypeInfoCount(
597         pctinfo: *mut UINT,
598     ) -> HRESULT,
599     fn GetTypeInfo(
600         iTInfo: UINT,
601         lcid: LCID,
602         ppTInfo: *mut *mut ITypeInfo,
603     ) -> HRESULT,
604     fn GetIDsOfNames(
605         riid: REFIID,
606         rgszNames: *mut LPOLESTR,
607         cNames: UINT,
608         lcid: LCID,
609         rgDispId: *mut DISPID,
610     ) -> HRESULT,
611     fn Invoke(
612         dispIdMember: DISPID,
613         riid: REFIID,
614         lcid: LCID,
615         wFlags: WORD,
616         pDispParams: *mut DISPPARAMS,
617         pVarResult: *mut VARIANT,
618         pExcepInfo: *mut EXCEPINFO,
619         puArgErr: *mut UINT,
620     ) -> HRESULT,
621 }}
622 // IDispatch_RemoteInvoke_Proxy
623 // IDispatch_RemoteInvoke_Stub
624 // LPENUMVARIANT
625 // IEnumVARIANT
626 // IEnumVARIANT_RemoteNext_Proxy
627 // IEnumVARIANT_RemoteNext_Stub
628 RIDL!{#[uuid(0x0000002F, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)]
629 interface IRecordInfo(IRecordInfoVtbl): IUnknown(IUnknownVtbl) {
630     fn RecordInit(
631         pvNew: PVOID,
632     ) -> HRESULT,
633     fn RecordClear(
634         pvExisting: PVOID,
635     ) -> HRESULT,
636     fn RecordCopy(
637         pvExisting: PVOID,
638         pvNew: PVOID,
639     ) -> HRESULT,
640     fn GetGuid(
641         pguid: *mut GUID,
642     ) -> HRESULT,
643     fn GetName(
644         pbstrName: *mut BSTR,
645     ) -> HRESULT,
646     fn GetSize(
647         pcbSize: *mut ULONG,
648     ) -> HRESULT,
649     fn GetTypeInfo(
650         ppTypeInfo: *mut *mut ITypeInfo,
651     ) -> HRESULT,
652     fn GetField(
653         pvData: PVOID,
654         szFieldName: LPCOLESTR,
655         pvarField: *mut VARIANT,
656     ) -> HRESULT,
657     fn GetFieldNoCopy(
658         pvData: PVOID,
659         szFieldName: LPCOLESTR,
660         pvarField: *mut VARIANT,
661         ppvDataCArray: *mut PVOID,
662     ) -> HRESULT,
663     fn PutField(
664         wFlags: ULONG,
665         pvData: PVOID,
666         szFieldName: LPCOLESTR,
667         pvarField: *mut VARIANT,
668     ) -> HRESULT,
669     fn PutFieldNoCopy(
670         wFlags: ULONG,
671         pvData: PVOID,
672         szFieldName: LPCOLESTR,
673         pvarField: *mut VARIANT,
674     ) -> HRESULT,
675     fn GetFieldNames(
676         pcNames: *mut ULONG,
677         rgBstrNames: *mut BSTR,
678     ) -> HRESULT,
679     fn IsMatchingType(
680         pRecordInfo: *mut IRecordInfo,
681     ) -> BOOL,
682     fn RecordCreate() -> PVOID,
683     fn RecordCreateCopy(
684         pvSource: PVOID,
685         ppvDest: *mut PVOID,
686     ) -> HRESULT,
687     fn RecordDestroy(
688         pvRecord: PVOID,
689     ) -> HRESULT,
690 }}
691 pub type LPTYPECOMP = *mut ITypeComp;
692 ENUM!{enum DESCKIND {
693     DESCKIND_NONE = 0,
694     DESCKIND_FUNCDESC = DESCKIND_NONE + 1,
695     DESCKIND_VARDESC = DESCKIND_FUNCDESC + 1,
696     DESCKIND_TYPECOMP = DESCKIND_VARDESC + 1,
697     DESCKIND_IMPLICITAPPOBJ = DESCKIND_TYPECOMP + 1,
698     DESCKIND_MAX = DESCKIND_IMPLICITAPPOBJ + 1,
699 }}
700 UNION!{union BINDPTR {
701     [usize; 1],
702     lpfuncdesc lpfuncdesc_mut: *mut FUNCDESC,
703     lpvardesc lpvardesc_mut: *mut VARDESC,
704     lptcomp lptcomp_mut: *mut ITypeComp,
705 }}
706 pub type LPBINDPTR = *mut BINDPTR;
707 RIDL!{#[uuid(0x00020403, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)]
708 interface ITypeComp(ITypeCompVtbl): IUnknown(IUnknownVtbl) {
709     fn Bind(
710         szName: LPOLESTR,
711         lHashVal: ULONG,
712         wFlags: WORD,
713         ppTInfo: *mut *mut ITypeInfo,
714         pDescKind: *mut DESCKIND,
715         pBindPtr: *mut BINDPTR,
716     ) -> HRESULT,
717     fn BindType(
718         szName: LPOLESTR,
719         lHashVal: ULONG,
720         ppTInfo: *mut *mut ITypeInfo,
721         ppTComp: *mut *mut ITypeComp,
722     ) -> HRESULT,
723 }}
724 ENUM!{enum SYSKIND {
725     SYS_WIN16 = 0,
726     SYS_WIN32,
727     SYS_MAC,
728     SYS_WIN64,
729 }}
730 STRUCT!{struct TLIBATTR {
731     guid: GUID,
732     lcid: LCID,
733     syskind: SYSKIND,
734     wMajorVerNum: WORD,
735     wMinorVerNum: WORD,
736     wLibFlags: WORD,
737 }}
738 RIDL!{#[uuid(0x00020402, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)]
739 interface ITypeLib(ITypeLibVtbl): IUnknown(IUnknownVtbl) {
740     fn GetTypeInfoCount() -> UINT,
741     fn GetTypeInfo(
742         index: UINT,
743         ppTInfo: *mut *mut ITypeInfo,
744     ) -> HRESULT,
745     fn GetTypeInfoType(
746         index: UINT,
747         pTKind: *mut TYPEKIND,
748     ) -> HRESULT,
749     fn GetTypeInfoOfGuid(
750         guid: REFGUID,
751         ppTInfo: *mut *mut ITypeInfo,
752     ) -> HRESULT,
753     fn GetLibAttr(
754         ppTLibAttr: *mut *mut TLIBATTR,
755     ) -> HRESULT,
756     fn GetTypeComp(
757         ppTComp: *mut *mut ITypeComp,
758     ) -> HRESULT,
759     fn GetDocumentation(
760         index: INT,
761         pbstrName: *mut BSTR,
762         pBstrDocString: *mut BSTR,
763         pdwHelpContext: *mut DWORD,
764         pBstrHelpFile: *mut BSTR,
765     ) -> HRESULT,
766     fn IsName(
767         szNameBuf: LPOLESTR,
768         lHashVal: ULONG,
769         pfName: *mut BOOL,
770     ) -> HRESULT,
771     fn FindName(
772         szNameBuf: LPOLESTR,
773         lHashVal: ULONG,
774         ppTInfo: *mut *mut ITypeInfo,
775         rgMemId: *mut MEMBERID,
776         pcFound: *mut USHORT,
777     ) -> HRESULT,
778     fn ReleaseTLibAttr(
779         pTLibAttr: *const TLIBATTR,
780     ) -> HRESULT,
781 }}
782 RIDL!{#[uuid(0x00020401, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)]
783 interface ITypeInfo(ITypeInfoVtbl): IUnknown(IUnknownVtbl) {
784     fn GetTypeAttr(
785         ppTypeAttr: *mut *mut TYPEATTR,
786     ) -> HRESULT,
787     fn GetTypeComp(
788         ppTComp: *mut *mut ITypeComp,
789     ) -> HRESULT,
790     fn GetFuncDesc(
791         index: UINT,
792         ppFunDesc: *mut *mut FUNCDESC,
793     ) -> HRESULT,
794     fn GetVarDesc(
795         index: UINT,
796         pPVarDesc: *mut *mut VARDESC,
797     ) -> HRESULT,
798     fn GetNames(
799         memid: MEMBERID,
800         rgBstrNames: *mut BSTR,
801         cMaxNames: UINT,
802         pcNames: *mut UINT,
803     ) -> HRESULT,
804     fn GetRefTypeOfImplType(
805         index: UINT,
806         pRefType: *mut HREFTYPE,
807     ) -> HRESULT,
808     fn GetImplTypeFlags(
809         index: UINT,
810         pImplTypeFlags: *mut INT,
811     ) -> HRESULT,
812     fn GetIDsOfNames(
813         rgszNames: *mut LPOLESTR,
814         cNames: UINT,
815         pMemId: *mut MEMBERID,
816     ) -> HRESULT,
817     fn Invoke(
818         pvInstance: PVOID,
819         memid: MEMBERID,
820         wFlags: WORD,
821         pDispParams: *mut DISPPARAMS,
822         pVarResult: *mut VARIANT,
823         pExcepInfo: *mut EXCEPINFO,
824         puArgErr: *mut UINT,
825     ) -> HRESULT,
826     fn GetDocumentation(
827         memid: MEMBERID,
828         pBstrName: *mut BSTR,
829         pBstrDocString: *mut BSTR,
830         pdwHelpContext: *mut DWORD,
831         pBstrHelpFile: *mut BSTR,
832     ) -> HRESULT,
833     fn GetDllEntry(
834         memid: MEMBERID,
835         invKind: INVOKEKIND,
836         pBstrDllName: *mut BSTR,
837         pBstrName: *mut BSTR,
838         pwOrdinal: *mut WORD,
839     ) -> HRESULT,
840     fn GetRefTypeInfo(
841         hRefType: HREFTYPE,
842         ppTInfo: *mut *mut ITypeInfo,
843     ) -> HRESULT,
844     fn AddressOfMember(
845         memid: MEMBERID,
846         invKind: INVOKEKIND,
847         ppv: *mut PVOID,
848     ) -> HRESULT,
849     fn CreateInstance(
850         pUnkOuter: *mut IUnknown,
851         riid: REFIID,
852         ppvObj: *mut PVOID,
853     ) -> HRESULT,
854     fn GetMops(
855         memid: MEMBERID,
856         pBstrMops: *mut BSTR,
857     ) -> HRESULT,
858     fn GetContainingTypeLib(
859         ppTLib: *mut *mut ITypeLib,
860         pIndex: *mut UINT,
861     ) -> HRESULT,
862     fn ReleaseTypeAttr(
863         pTypeAttr: *mut TYPEATTR,
864     ) -> (),
865     fn ReleaseFuncDesc(
866         pFuncDesc: *mut FUNCDESC,
867     ) -> (),
868     fn ReleaseVarDesc(
869         pVarDesc: *mut VARDESC,
870     ) -> (),
871 }}
872 RIDL!{#[uuid(0x1cf2b120, 0x547d, 0x101b, 0x8e, 0x65, 0x08, 0x00, 0x2b, 0x2b, 0xd1, 0x19)]
873 interface IErrorInfo(IErrorInfoVtbl): IUnknown(IUnknownVtbl) {
874     fn GetGUID(
875         pGUID: *mut GUID,
876     ) -> HRESULT,
877     fn GetSource(
878         pBstrSource: *mut BSTR,
879     ) -> HRESULT,
880     fn GetDescription(
881         pBstrDescription: *mut BSTR,
882     ) -> HRESULT,
883     fn GetHelpFile(
884         pBstrHelpFile: *mut BSTR,
885     ) -> HRESULT,
886     fn GetHelpContext(
887         pdwHelpContext: *mut DWORD,
888     ) -> HRESULT,
889 }}
890 RIDL!{#[uuid(0x22f03340, 0x547d, 0x101b, 0x8e, 0x65, 0x08, 0x00, 0x2b, 0x2b, 0xd1, 0x19)]
891 interface ICreateErrorInfo(ICreateErrorInfoVtbl): IUnknown(IUnknownVtbl) {
892     fn SetGUID(
893         rguid: REFGUID,
894     ) -> HRESULT,
895     fn SetSource(
896         szSource: LPOLESTR,
897     ) -> HRESULT,
898     fn SetDescription(
899         szDescription: LPOLESTR,
900     ) -> HRESULT,
901     fn SetHelpFile(
902         szHelpFile: LPOLESTR,
903     ) -> HRESULT,
904     fn SetHelpContext(
905         dwHelpContext: DWORD,
906     ) -> HRESULT,
907 }}
908 RIDL!{#[uuid(0x3127ca40, 0x446e, 0x11ce, 0x81, 0x35, 0x00, 0xaa, 0x00, 0x4b, 0xb8, 0x51)]
909 interface IErrorLog(IErrorLogVtbl): IUnknown(IUnknownVtbl) {
910     fn AddError(
911         pszPropName: LPCOLESTR,
912         pExcepInfo: *const EXCEPINFO,
913     ) -> HRESULT,
914 }}
915 pub type LPERRORLOG = *mut IErrorLog;
916