1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
//! FFI bindings to oleaut32.
#![cfg(windows)]
extern crate winapi;
use winapi::*;
extern "system" {
    pub fn SysAllocString(psz: *const OLECHAR) -> BSTR;
    pub fn SysReAllocString(pbstr: *mut BSTR, psz: *const OLECHAR) -> INT;
    pub fn SysAllocStringLen(strIn: *const OLECHAR, ui: UINT) -> BSTR;
    pub fn SysReAllocStringLen(pbstr: *mut BSTR, psz: *const OLECHAR, len: c_uint) -> INT;
    pub fn SysFreeString(bstrString: BSTR);
    pub fn SysStringLen(pbstr: BSTR) -> UINT;
    pub fn SysStringByteLen(bstr: BSTR) -> UINT;
    pub fn SysAllocStringByteLen(psz: LPCSTR, len: UINT) -> BSTR;
    pub fn DosDateTimeToVariantTime(
        wDosDate: USHORT, wDosTime: USHORT, pvtime: *mut DOUBLE
    ) -> INT;
    pub fn VariantTimeToDosDateTime(
        vtime: DOUBLE, pwDosDate: *mut USHORT, pwDosTime: *mut USHORT
    ) -> INT;
    pub fn SystemTimeToVariantTime(lpSystemTime: LPSYSTEMTIME, pvtime: *mut DOUBLE) -> INT;
    pub fn VariantTimeToSystemTime(vtime: DOUBLE, lpSystemTime: LPSYSTEMTIME) -> INT;
    // pub fn SafeArrayAllocDescriptor(cDims: UINT, ppsaOut: *mut SAFEARRAY);
    // pub fn SafeArrayAllocDescriptorEx(vt: VARTYPE, cDims: UINT, ppsaOut: *mut SAFEARRAY);
    // pub fn SafeArrayAllocData(psa: *mut SAFEARRAY);
    // pub fn SafeArrayCreate(
    //     vt: VARTYPE, cDims: UINT, rgsabound: *mut SAFEARRAYBOUND
    // ) -> *mut SAFEARRAY;
    // pub fn SafeArrayCreateEx(
    //     vt: VARTYPE, cDims: UINT, rgsabound: *mut SAFEARRAYBOUND, pvExtra: PVOID
    // ) -> *mut SAFEARRAY;
    // pub fn SafeArrayCopyData(psaSource: *mut SAFEARRAY, psaTarget: *mut SAFEARRAY);
    // pub fn SafeArrayDestroyDescriptor(psa: *mut SAFEARRAY);
    // pub fn SafeArrayDestroyData(psa: *mut SAFEARRAY);
    // pub fn SafeArrayDestroy(psa: *mut SAFEARRAY);
    // pub fn SafeArrayRedim(psa: *mut SAFEARRAY, psaboundNew: *mut SAFEARRAYBOUND);
    // pub fn SafeArrayGetDim(psa: *mut SAFEARRAY) -> UINT;
    // pub fn SafeArrayGetElemsize(psa: *mut SAFEARRAY) ->  UINT;
    // pub fn SafeArrayGetUBound(psa: *mut SAFEARRAY, nDim: UINT, plUbound: *mut LONG);
    // pub fn SafeArrayGetLBound(psa: *mut SAFEARRAY, nDim: UINT, plLbound: *mut LONG);
    // pub fn SafeArrayLock(psa: *mut SAFEARRAY);
    // pub fn SafeArrayUnlock(psa: *mut SAFEARRAY);
    // pub fn SafeArrayAccessData(psa: *mut SAFEARRAY, ppvData: *mut *mut c_void);
    // pub fn SafeArrayUnaccessData(psa: *mut SAFEARRAY);
    // pub fn SafeArrayGetElement(psa: *mut SAFEARRAY, rgIndices: *mut LONG, pv: *mut c_void);
    // pub fn SafeArrayPutElement(psa: *mut SAFEARRAY, rgIndices: *mut LONG, pv: *mut c_void);
    // pub fn SafeArrayCopy(psa: *mut SAFEARRAY, ppsaOut: *mut SAFEARRAY);
    // pub fn SafeArrayPtrOfIndex(
    //     psa: *mut SAFEARRAY, rgIndices: *mut LONG, ppvData: *mut *mut c_void
    // );
    // pub fn SafeArraySetRecordInfo(psa: *mut SAFEARRAY, prinfo: *mut IRecordInfo);
    // pub fn SafeArrayGetRecordInfo(psa: *mut SAFEARRAY, prinfo: *mut IRecordInfo);
    // pub fn SafeArraySetIID(psa: *mut SAFEARRAY, guid: REFGUID);
    // pub fn SafeArrayGetIID(psa: *mut SAFEARRAY, pguid: *mut GUID);
    // pub fn SafeArrayGetVartype(psa: *mut SAFEARRAY, pvt: *mut VARTYPE);
    // pub fn SafeArrayCreateVector(
    //     vt: VARTYPE, lLbound: LONG, cElements: ULONG
    // ) -> *mut SAFEARRAY;
    // pub fn SafeArrayCreateVectorEx(
    //     vt: VARTYPE, lLbound: LONG, cElements: ULONG, pvExtra: PVOID
    // ) -> *mut SAFEARRAY;
    // pub fn VariantInit(pvarg: *mut VARIANTARG);
    // pub fn VariantClear(pvarg: *mut VARIANTARG);
    // pub fn VariantCopy(pvargDest: *mut VARIANTARG,pvargSrc: *const VARIANTARG);
    // pub fn VariantCopyInd(pvarDest: *mut VARIANT,pvargSrc: *const VARIANTARG);
    // pub fn VariantChangeType();
    // pub fn VariantChangeTypeEx();
    // pub fn VectorFromBstr(bstr: BSTR, ppsa: *mut SAFEARRAY);
    // pub fn BstrFromVector(psa: *mut SAFEARRAY, pbstr: *mut BSTR);
    pub fn VarUI1FromI2(sIn: SHORT, pbOut: *mut BYTE);
    pub fn VarUI1FromI4(lIn: LONG, pbOut: *mut BYTE);
    pub fn VarUI1FromI8(i64In: LONG64, pbOut: *mut BYTE);
    pub fn VarUI1FromR4(fltIn: FLOAT, pbOut: *mut BYTE);
    pub fn VarUI1FromR8(dblIn: DOUBLE, pbOut: *mut BYTE);
    //pub fn VarUI1FromCy(cyIn: CY, pbOut: *mut BYTE);
    pub fn VarUI1FromDate(dateIn: DATE, pbOut: *mut BYTE);
    pub fn VarUI1FromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, pbOut: *mut BYTE);
    // pub fn VarUI1FromDisp(pdispIn: *mut IDispatch, lcid: LCID, pbOut: *mut BYTE);
    // pub fn VarUI1FromBool(VARIANT_boolIn: BOOL, pbOut: *mut BYTE);
    pub fn VarUI1FromI1(cIn: CHAR, pbOut: *mut BYTE);
    pub fn VarUI1FromUI2(uiIn: USHORT, pbOut: *mut BYTE);
    pub fn VarUI1FromUI4(ulIn: ULONG, pbOut: *mut BYTE);
    pub fn VarUI1FromUI8(ui64In: ULONG64, pbOut: *mut BYTE);
    pub fn VarUI1FromDec(pdecIn: *const DECIMAL, pbOut: *mut BYTE);
    pub fn VarI2FromUI1(bIn: BYTE, psOut: *mut SHORT);
    pub fn VarI2FromI4(lIn: LONG, psOut: *mut SHORT);
    pub fn VarI2FromI8(i64In: LONG64, psOut: *mut SHORT);
    pub fn VarI2FromR4(fltIn: FLOAT, psOut: *mut SHORT);
    pub fn VarI2FromR8(dblIn: DOUBLE, psOut: *mut SHORT);
    //pub fn VarI2FromCy(cyIn: CY, psOut: *mut SHORT);
    pub fn VarI2FromDate(dateIn: DATE, psOut: *mut SHORT);
    pub fn VarI2FromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, psOut: *mut SHORT);
    // pub fn VarI2FromDisp(pdispIn: *mut IDispatch, lcid: LCID, psOut: *mut SHORT);
    // pub fn VarI2FromBool(VARIANT_boolIn: BOOL, psOut: *mut SHORT);
    pub fn VarI2FromI1(cIn: CHAR, psOut: *mut SHORT);
    pub fn VarI2FromUI2(uiIn: USHORT, psOut: *mut SHORT);
    pub fn VarI2FromUI4(ulIn: ULONG, psOut: *mut SHORT);
    pub fn VarI2FromUI8(ui64In: ULONG64, psOut: *mut SHORT);
    pub fn VarI2FromDec(pdecIn: *const DECIMAL, psOut: *mut SHORT);
    pub fn VarI4FromUI1(bIn: BYTE, plOut: *mut LONG);
    pub fn VarI4FromI2(sIn: SHORT, plOut: *mut LONG);
    pub fn VarI4FromI8(i64In: LONG64, plOut: *mut LONG);
    pub fn VarI4FromR4(fltIn: FLOAT, plOut: *mut LONG);
    pub fn VarI4FromR8(dblIn: DOUBLE, plOut: *mut LONG);
    // pub fn VarI4FromCy(cyIn: CY, plOut: *mut LONG);
    pub fn VarI4FromDate(dateIn: DATE, plOut: *mut LONG);
    pub fn VarI4FromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, plOut: *mut LONG);
    // pub fn VarI4FromDisp(pdispIn: *mut IDispatch, lcid: LCID, plOut: *mut LONG);
    // pub fn VarI4FromBool(VARIANT_boolIn: BOOL, plOut: *mut LONG);
    pub fn VarI4FromI1(cIn: CHAR, plOut: *mut LONG);
    pub fn VarI4FromUI2(uiIn: USHORT, plOut: *mut LONG);
    pub fn VarI4FromUI4(ulIn: ULONG, plOut: *mut LONG);
    pub fn VarI4FromUI8(ui64In: ULONG64, plOut: *mut LONG);
    pub fn VarI4FromDec(pdecIn: *const DECIMAL, plOut: *mut LONG);
    pub fn VarI8FromUI1(bIn: BYTE, pi64Out: *mut LONG64);
    pub fn VarI8FromI2(sIn: SHORT, pi64Out: *mut LONG64);
    pub fn VarI8FromR4(fltIn: FLOAT, pi64Out: *mut LONG64);
    pub fn VarI8FromR8(dblIn: DOUBLE, pi64Out: *mut LONG64);
    // pub fn VarI8FromCy(cyIn: CY, pi64Out: *mut LONG64);
    pub fn VarI8FromDate(dateIn: DATE, pi64Out: *mut LONG64);
    pub fn VarI8FromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, pi64Out: *mut LONG64);
    // pub fn VarI8FromDisp(pdispIn: *mut IDispatch, lcid: LCID, pi64Out: *mut LONG64);
    // pub fn VarI8FromBool(VARIANT_boolIn: BOOL, pi64Out: *mut LONG64);
    pub fn VarI8FromI1(cIn: CHAR, pi64Out: *mut LONG64);
    pub fn VarI8FromUI2(uiIn: USHORT, pi64Out: *mut LONG64);
    pub fn VarI8FromUI4(ulIn: ULONG, pi64Out: *mut LONG64);
    pub fn VarI8FromUI8(ui64In: ULONG64, pi64Out: *mut LONG64);
    pub fn VarI8FromDec(pdecIn: *const DECIMAL, pi64Out: *mut LONG64);
    pub fn VarR4FromUI1(bIn: BYTE, pfltOut: *mut FLOAT);
    pub fn VarR4FromI2(sIn: SHORT, pfltOut: *mut FLOAT);
    pub fn VarR4FromI4(lIn: LONG, pfltOut: *mut FLOAT);
    pub fn VarR4FromI8(i64In: LONG64, pfltOut: *mut FLOAT);
    pub fn VarR4FromR8(dblIn: DOUBLE, pfltOut: *mut FLOAT);
    // pub fn VarR4FromCy(cyIn: CY, pfltOut: *mut FLOAT);
    pub fn VarR4FromDate(dateIn: DATE, pfltOut: *mut FLOAT);
    pub fn VarR4FromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, pfltOut: *mut FLOAT);
    // pub fn VarR4FromDisp(pdispIn: *mut IDispatch, lcid: LCID, pfltOut: *mut FLOAT);
    // pub fn VarR4FromBool(VARIANT_boolIn: BOOL, pfltOut: *mut FLOAT);
    pub fn VarR4FromI1(cIn: CHAR, pfltOut: *mut FLOAT);
    pub fn VarR4FromUI2(uiIn: USHORT, pfltOut: *mut FLOAT);
    pub fn VarR4FromUI4(ulIn: ULONG, pfltOut: *mut FLOAT);
    pub fn VarR4FromUI8(ui64In: ULONG64, pfltOut: *mut FLOAT);
    pub fn VarR4FromDec(pdecIn: *const DECIMAL, pfltOut: *mut FLOAT);
    pub fn VarR8FromUI1(bIn: BYTE, pdblOut: *mut DOUBLE);
    pub fn VarR8FromI2(sIn: SHORT, pdblOut: *mut DOUBLE);
    pub fn VarR8FromI4(lIn: LONG, pdblOut: *mut DOUBLE);
    pub fn VarR8FromI8(i64In: LONG64, pdblOut: *mut DOUBLE);
    pub fn VarR8FromR4(fltIn: FLOAT, pdblOut: *mut DOUBLE);
    // pub fn VarR8FromCy(cyIn: CY, pdblOut: *mut DOUBLE);
    pub fn VarR8FromDate(dateIn: DATE, pdblOut: *mut DOUBLE);
    pub fn VarR8FromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, pdblOut: *mut DOUBLE);
    // pub fn VarR8FromDisp(pdispIn: *mut IDispatch, lcid: LCID, pdblOut: *mut DOUBLE);
    // pub fn VarR8FromBool(VARIANT_boolIn: BOOL, pdblOut: *mut DOUBLE);
    pub fn VarR8FromI1(cIn: CHAR, pdblOut: *mut DOUBLE);
    pub fn VarR8FromUI2(uiIn: USHORT, pdblOut: *mut DOUBLE);
    pub fn VarR8FromUI4(ulIn: ULONG, pdblOut: *mut DOUBLE);
    pub fn VarR8FromUI8(ui64In: ULONG64, pdblOut: *mut DOUBLE);
    pub fn VarR8FromDec(pdecIn: *const DECIMAL, pdblOut: *mut DOUBLE);
    pub fn VarDateFromUI1(bIn: BYTE, pdateOut: *mut DATE);
    pub fn VarDateFromI2(sIn: SHORT, pdateOut: *mut DATE);
    pub fn VarDateFromI4(lIn: LONG, pdateOut: *mut DATE);
    pub fn VarDateFromI8(i64In: LONG64, pdateOut: *mut DATE);
    pub fn VarDateFromR4(fltIn: FLOAT, pdateOut: *mut DATE);
    pub fn VarDateFromR8(dblIn: DOUBLE, pdateOut: *mut DATE);
    // pub fn VarDateFromCy(cyIn: CY, pdateOut: *mut DATE);
    pub fn VarDateFromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, pdateOut: *mut DATE);
    // pub fn VarDateFromDisp(pdispIn: *mut IDispatch, lcid: LCID, pdateOut: *mut DATE);
    // pub fn VarDateFromBool(VARIANT_boolIn: BOOL, pdateOut: *mut DATE);
    pub fn VarDateFromI1(cIn: CHAR, pdateOut: *mut DATE);
    pub fn VarDateFromUI2(uiIn: USHORT, pdateOut: *mut DATE);
    pub fn VarDateFromUI4(ulIn: ULONG, pdateOut: *mut DATE);
    pub fn VarDateFromUI8(ui64In: ULONG64, pdateOut: *mut DATE);
    pub fn VarDateFromDec(pdecIn: *const DECIMAL, pdateOut: *mut DATE);
    // pub fn VarCyFromUI1(bIn: BYTE, pcyOut: *mut CY);
    // pub fn VarCyFromI2(sIn: SHORT, pcyOut: *mut CY);
    // pub fn VarCyFromI4(lIn: LONG, pcyOut: *mut CY);
    // pub fn VarCyFromI8(i64In: LONG64, pcyOut: *mut CY);
    // pub fn VarCyFromR4(fltIn: FLOAT, pcyOut: *mut CY);
    // pub fn VarCyFromR8(dblIn: DOUBLE, pcyOut: *mut CY);
    // pub fn VarCyFromDate(dateIn: DATE, pcyOut: *mut CY);
    // pub fn VarCyFromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, pcyOut: *mut CY);
    // pub fn VarCyFromDisp(pdispIn: *mut IDispatch, lcid: LCID, pcyOut: *mut CY);
    // pub fn VarCyFromBool(VARIANT_boolIn: BOOL, pcyOut: *mut CY);
    // pub fn VarCyFromI1(cIn: CHAR, pcyOut: *mut CY);
    // pub fn VarCyFromUI2(uiIn: USHORT, pcyOut: *mut CY);
    // pub fn VarCyFromUI4(ulIn: ULONG, pcyOut: *mut CY);
    // pub fn VarCyFromUI8(ui64In: ULONG64, pcyOut: *mut CY);
    // pub fn VarCyFromDec(pdecIn: *const DECIMAL, pcyOut: *mut CY);
    pub fn VarBstrFromUI1(bVal: BYTE, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR);
    pub fn VarBstrFromI2(iVal: SHORT, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR);
    pub fn VarBstrFromI4(lIn: LONG, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR);
    pub fn VarBstrFromI8(i64In: LONG64, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR);
    pub fn VarBstrFromR4(fltIn: FLOAT, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR);
    pub fn VarBstrFromR8(dblIn: DOUBLE, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR);
    // pub fn VarBstrFromCy(cyIn: CY, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR);
    pub fn VarBstrFromDate(dateIn: DATE, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR);
    // pub fn VarBstrFromDisp(
    //     pdispIn: *mut IDispatch, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR
    // );
    // pub fn VarBstrFromBool(
    //     VARIANT_boolIn: BOOL, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR
    // );
    pub fn VarBstrFromI1(cIn: CHAR, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR);
    pub fn VarBstrFromUI2(uiIn: USHORT, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR);
    pub fn VarBstrFromUI4(ulIn: ULONG, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR);
    pub fn VarBstrFromUI8(ui64In: ULONG64, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR);
    pub fn VarBstrFromDec(
        pdecIn: *const DECIMAL, lcid: LCID, dwFlags: ULONG, pbstrOut: *mut BSTR
    );
    // pub fn VarBoolFromUI1(bIn: BYTE, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromI2(sIn: SHORT, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromI4(lIn: LONG, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromI8(i64In: LONG64, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromR4(fltIn: FLOAT, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromR8(dblIn: DOUBLE, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromDate(dateIn: DATE, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromCy(cyIn: CY, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromStr(
    //     strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, VARIANT_pboolOut: *mut BOOL
    // );
    // pub fn VarBoolFromDisp(pdispIn: *mut IDispatch, lcid: LCID, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromI1(cIn: CHAR, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromUI2(uiIn: USHORT, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromUI4(ulIn: ULONG, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromUI8(i64In: ULONG64, VARIANT_pboolOut: *mut BOOL);
    // pub fn VarBoolFromDec(pdecIn: *const DECIMAL, VARIANT_pboolOut: *mut BOOL);
    pub fn VarUI2FromUI1(bIn: BYTE, puiOut: *mut USHORT);
    pub fn VarUI2FromI2(uiIn: SHORT, puiOut: *mut USHORT);
    pub fn VarUI2FromI4(lIn: LONG, puiOut: *mut USHORT);
    pub fn VarUI2FromI8(i64In: LONG64, puiOut: *mut USHORT);
    pub fn VarUI2FromR4(fltIn: FLOAT, puiOut: *mut USHORT);
    pub fn VarUI2FromR8(dblIn: DOUBLE, puiOut: *mut USHORT);
    pub fn VarUI2FromDate(dateIn: DATE, puiOut: *mut USHORT);
    // pub fn VarUI2FromCy(cyIn: CY, puiOut: *mut USHORT);
    pub fn VarUI2FromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, puiOut: *mut USHORT);
    // pub fn VarUI2FromDisp(pdispIn: *mut IDispatch, lcid: LCID, puiOut: *mut USHORT);
    // pub fn VarUI2FromBool(VARIANT_boolIn: BOOL, puiOut: *mut USHORT);
    pub fn VarUI2FromI1(cIn: CHAR, puiOut: *mut USHORT);
    pub fn VarUI2FromUI4(ulIn: ULONG, puiOut: *mut USHORT);
    pub fn VarUI2FromUI8(i64In: ULONG64, puiOut: *mut USHORT);
    pub fn VarUI2FromDec(pdecIn: *const DECIMAL, puiOut: *mut USHORT);
    pub fn VarUI4FromUI1(bIn: BYTE, pulOut: *mut ULONG);
    pub fn VarUI4FromI2(uiIn: SHORT, pulOut: *mut ULONG);
    pub fn VarUI4FromI4(lIn: LONG, pulOut: *mut ULONG);
    pub fn VarUI4FromI8(i64In: LONG64, plOut: *mut ULONG);
    pub fn VarUI4FromR4(fltIn: FLOAT, pulOut: *mut ULONG);
    pub fn VarUI4FromR8(dblIn: DOUBLE, pulOut: *mut ULONG);
    pub fn VarUI4FromDate(dateIn: DATE, pulOut: *mut ULONG);
    // pub fn VarUI4FromCy(cyIn: CY, pulOut: *mut ULONG);
    pub fn VarUI4FromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, pulOut: *mut ULONG);
    // pub fn VarUI4FromDisp(pdispIn: *mut IDispatch, lcid: LCID, pulOut: *mut ULONG);
    // pub fn VarUI4FromBool(VARIANT_boolIn: BOOL, pulOut: *mut ULONG);
    pub fn VarUI4FromI1(cIn: CHAR, pulOut: *mut ULONG);
    pub fn VarUI4FromUI2(uiIn: USHORT, pulOut: *mut ULONG);
    pub fn VarUI4FromUI8(ui64In: ULONG64, plOut: *mut ULONG);
    pub fn VarUI4FromDec(pdecIn: *const DECIMAL, pulOut: *mut ULONG);
    pub fn VarUI8FromUI1(bIn: BYTE, pi64Out: *mut ULONG64);
    pub fn VarUI8FromI2(sIn: SHORT, pi64Out: *mut ULONG64);
    pub fn VarUI8FromI4(lIn: LONG, pi64Out: *mut ULONG64);
    pub fn VarUI8FromI8(ui64In: LONG64, pi64Out: *mut ULONG64);
    pub fn VarUI8FromR4(fltIn: FLOAT, pi64Out: *mut ULONG64);
    pub fn VarUI8FromR8(dblIn: DOUBLE, pi64Out: *mut ULONG64);
    // pub fn VarUI8FromCy(cyIn: CY, pi64Out: *mut ULONG64);
    pub fn VarUI8FromDate(dateIn: DATE, pi64Out: *mut ULONG64);
    pub fn VarUI8FromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, pi64Out: *mut ULONG64);
    // pub fn VarUI8FromDisp(pdispIn: *mut IDispatch, lcid: LCID, pi64Out: *mut ULONG64);
    // pub fn VarUI8FromBool(VARIANT_boolIn: BOOL, pi64Out: *mut ULONG64);
    pub fn VarUI8FromI1(cIn: CHAR, pi64Out: *mut ULONG64);
    pub fn VarUI8FromUI2(uiIn: USHORT, pi64Out: *mut ULONG64);
    pub fn VarUI8FromUI4(ulIn: ULONG, pi64Out: *mut ULONG64);
    pub fn VarUI8FromDec(pdecIn: *const DECIMAL, pi64Out: *mut ULONG64);
    pub fn VarDecFromUI1(bIn: BYTE, pdecOut: *mut DECIMAL);
    pub fn VarDecFromI2(uiIn: SHORT, pdecOut: *mut DECIMAL);
    pub fn VarDecFromI4(lIn: LONG, pdecOut: *mut DECIMAL);
    pub fn VarDecFromI8(i64In: LONG64, pdecOut: *mut DECIMAL);
    pub fn VarDecFromR4(fltIn: FLOAT, pdecOut: *mut DECIMAL);
    pub fn VarDecFromR8(dblIn: DOUBLE, pdecOut: *mut DECIMAL);
    pub fn VarDecFromDate(dateIn: DATE, pdecOut: *mut DECIMAL);
    // pub fn VarDecFromCy(cyIn: CY, pdecOut: *mut DECIMAL);
    pub fn VarDecFromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG, pdecOut: *mut DECIMAL);
    // pub fn VarDecFromDisp(pdispIn: *mut IDispatch, lcid: LCID, pdecOut: *mut DECIMAL);
    // pub fn VarDecFromBool(VARIANT_boolIn: BOOL, pdecOut: *mut DECIMAL);
    pub fn VarDecFromI1(cIn: CHAR, pdecOut: *mut DECIMAL);
    pub fn VarDecFromUI2(uiIn: USHORT, pdecOut: *mut DECIMAL);
    pub fn VarDecFromUI4(ulIn: ULONG, pdecOut: *mut DECIMAL);
    pub fn VarDecFromUI8(ui64In: ULONG64, pdecOut: *mut DECIMAL);
    // pub fn VarParseNumFromStr(strIn: LPCOLESTR, lcid: LCID, dwFlags: ULONG,
    // pub fn VarNumFromParseNum(pnumprs: *mut NUMPARSE, rgbDig: *mut BYTE,
    // pub fn VarAdd(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarAnd(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarCat(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarDiv(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarEqv(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarIdiv(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarImp(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarMod(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarMul(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarOr(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarPow(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarSub(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarXor(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarAbs(pvarIn: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarFix(pvarIn: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarInt(pvarIn: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarNeg(pvarIn: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarNot(pvarIn: LPVARIANT, pvarResult: LPVARIANT);
    // pub fn VarRound(pvarIn: LPVARIANT, cDecimals: c_int, pvarResult: LPVARIANT);
    // pub fn VarCmp(pvarLeft: LPVARIANT, pvarRight: LPVARIANT, lcid: LCID, dwFlags: ULONG);

    pub fn VarDecAdd(pdecLeft: LPDECIMAL, pdecRight: LPDECIMAL, pdecResult: LPDECIMAL);
    pub fn VarDecDiv(pdecLeft: LPDECIMAL, pdecRight: LPDECIMAL, pdecResult: LPDECIMAL);
    pub fn VarDecMul(pdecLeft: LPDECIMAL, pdecRight: LPDECIMAL, pdecResult: LPDECIMAL);
    pub fn VarDecSub(pdecLeft: LPDECIMAL, pdecRight: LPDECIMAL, pdecResult: LPDECIMAL);
    pub fn VarDecAbs(pdecIn: LPDECIMAL, pdecResult: LPDECIMAL);
    pub fn VarDecFix(pdecIn: LPDECIMAL, pdecResult: LPDECIMAL);
    pub fn VarDecInt(pdecIn: LPDECIMAL, pdecResult: LPDECIMAL);
    pub fn VarDecNeg(pdecIn: LPDECIMAL, pdecResult: LPDECIMAL);
    pub fn VarDecRound(pdecIn: LPDECIMAL, cDecimals: c_int, pdecResult: LPDECIMAL);
    pub fn VarDecCmp(pdecLeft: LPDECIMAL, pdecRight: LPDECIMAL);
    pub fn VarDecCmpR8(pdecLeft: LPDECIMAL, dblRight: c_double);
    // pub fn VarCyAdd(cyLeft: CY, cyRight: CY, pcyResult: LPCY);
    // pub fn VarCyMul(cyLeft: CY, cyRight: CY, pcyResult: LPCY);
    // pub fn VarCyMulI4(cyLeft: CY, lRight: LONG, pcyResult: LPCY);
    // pub fn VarCyMulI8(cyLeft: CY, lRight: LONG64, pcyResult: LPCY);
    // pub fn VarCySub(cyLeft: CY, cyRight: CY, pcyResult: LPCY);
    // pub fn VarCyAbs(cyIn: CY, pcyResult: LPCY);
    // pub fn VarCyFix(cyIn: CY, pcyResult: LPCY);
    // pub fn VarCyInt(cyIn: CY, pcyResult: LPCY);
    // pub fn VarCyNeg(cyIn: CY, pcyResult: LPCY);
    // pub fn VarCyRound(cyIn: CY, cDecimals: c_int, pcyResult: LPCY);
    // pub fn VarCyCmp(cyLeft: CY, cyRight: CY);
    // pub fn VarCyCmpR8(cyLeft: CY, dblRight: c_double);
    pub fn VarBstrCat(bstrLeft: BSTR, bstrRight: BSTR, pbstrResult: LPBSTR);
    pub fn VarBstrCmp(bstrLeft: BSTR, bstrRight: BSTR, lcid: LCID, dwFlags: ULONG);
    pub fn VarR8Pow(dblLeft: c_double, dblRight: c_double, pdblResult: *mut c_double);
    pub fn VarR4CmpR8(fltLeft: c_float, dblRight: c_double);
    pub fn VarR8Round(dblIn: c_double, cDecimals: c_int, pdblResult: *mut c_double);
    // pub fn VarDateFromUdate(pudateIn: *mut UDATE, dwFlags: ULONG, pdateOut: *mut DATE);
    // pub fn VarDateFromUdateEx(
    //     pudateIn: *mut UDATE, lcid: LCID, dwFlags: ULONG, pdateOut: *mut DATE
    // );
    // pub fn VarUdateFromDate(dateIn: DATE, dwFlags: ULONG, pudateOut: *mut UDATE);
    pub fn GetAltMonthNames(lcid: LCID, prgp: *mut LPOLESTR);
    // pub fn VarFormat();
    // pub fn VarFormatDateTime();
    // pub fn VarFormatNumber();
    // pub fn VarFormatPercent();
    // pub fn VarFormatCurrency();
    // pub fn VarWeekdayName();
    // pub fn VarMonthName();
    // pub fn VarFormatFromTokens();
    // pub fn VarTokenizeFormatString();
    // pub fn LHashValOfNameSysA();
    // pub fn LoadTypeLib(szFile: LPCOLESTR, pptlib: *mut ITypeLib);
    // pub fn LoadTypeLibEx();
    // pub fn LoadRegTypeLib();
    // pub fn QueryPathOfRegTypeLib();
    // pub fn RegisterTypeLib();
    // pub fn UnRegisterTypeLib();
    // pub fn RegisterTypeLibForUser();
    // pub fn UnRegisterTypeLibForUser();
    // pub fn CreateTypeLib();
    // pub fn CreateTypeLib2();
    // pub fn DispGetParam();
    // pub fn DispGetIDsOfNames();
    // pub fn DispInvoke();
    // pub fn CreateDispTypeInfo();
    // pub fn CreateStdDispatch();
    // pub fn DispCallFunc();
    // pub fn RegisterActiveObject();
    pub fn RevokeActiveObject(dwRegister: DWORD, pvReserved: *mut c_void);
    // pub fn GetActiveObject();
    // pub fn SetErrorInfo(dwReserved: ULONG, perrinfo: *mut IErrorInfo);
    // pub fn GetErrorInfo(dwReserved: ULONG, pperrinfo: *mut IErrorInfo);
    // pub fn CreateErrorInfo(pperrinfo: *mut ICreateErrorInfo);
    // pub fn GetRecordInfoFromTypeInfo();
    // pub fn GetRecordInfoFromGuids();
    pub fn OaBuildVersion() -> ULONG;
    // pub fn ClearCustData(pCustData: LPCUSTDATA);
    pub fn OaEnablePerUserTLibRegistration();
}