1 /***********************************************************************\
2 *                               oleauto.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                                                                       *
8 *                       Placed into public domain                       *
9 \***********************************************************************/
10 module win32.oleauto;
11 pragma(lib, "oleaut32.lib");
12 
13 import win32.oaidl;
14 private import win32.basetyps, win32.unknwn, win32.windef, win32.wtypes;
15 private import win32.winbase; // for SYSTEMTIME
16 
17 align(8):
18 const STDOLE_MAJORVERNUM = 1;
19 const STDOLE_MINORVERNUM = 0;
20 const STDOLE_LCID = 0;
21 
22 const VARIANT_NOVALUEPROP = 0x01;
23 const VARIANT_ALPHABOOL = 0x02;
24 const VARIANT_NOUSEOVERRIDE = 0x04;
25 const VARIANT_LOCALBOOL = 0x08;
26 
27 const VAR_TIMEVALUEONLY = 0x0001;
28 const VAR_DATEVALUEONLY = 0x0002;
29 const VAR_VALIDDATE = 0x0004;
30 const VAR_CALENDAR_HIJRI = 0x0008;
31 const VAR_LOCALBOOL = 0x0010;
32 const VAR_FORMAT_NOSUBSTITUTE = 0x0020;
33 const VAR_FOURDIGITYEARS = 0x0040;
34 const VAR_CALENDAR_THAI = 0x0080;
35 const VAR_CALENDAR_GREGORIAN = 0x0100;
36 
37 const MEMBERID_NIL = DISPID_UNKNOWN;
38 const ID_DEFAULTINST =  -2;
39 const DISPATCH_METHOD = 1;
40 const DISPATCH_PROPERTYGET = 2;
41 const DISPATCH_PROPERTYPUT = 4;
42 const DISPATCH_PROPERTYPUTREF = 8;
43 
44 //ULONG LHashValOfName(LCID l, OLECHAR* n) { return LHashValOfNameSys(SYSKIND.SYS_WIN32, l, n); }
45 
46 // DAC: These aren't in the 2003 SDK.
47 //MACRO #define WHashValOfLHashVal(h) ((unsigned short)(0x0000ffff&(h)))
48 //MACRO #define IsHashValCompatible(h1, h2) ((BOOL)((0x00ff0000&(h1))==(0x00ff0000&(h2))))
49 
50 enum {
51 	ACTIVEOBJECT_STRONG = 0,
52 	ACTIVEOBJECT_WEAK   = 1
53 }
54 
55 // DAC: These seem to be irrelevant for D.
56 //#define V_UNION(X, Y) ((X)->Y)
57 //#define V_VT(X) ((X)->vt)
58 //#define V_BOOL(X) V_UNION(X, boolVal)
59 //#define V_ISBYREF(X) (V_VT(X)&VT_BYREF)
60 //#define V_ISARRAY(X) (V_VT(X)&VT_ARRAY)
61 //#define V_ISVECTOR(X) (V_VT(X)&VT_VECTOR)
62 //#define V_NONE(X) V_I2(X)
63 //#define V_UI1(X) V_UNION(X, bVal)
64 //#define V_UI1REF(X) V_UNION(X, pbVal)
65 //#define V_I2(X) V_UNION(X, iVal)
66 //#define V_UI2(X) V_UNION(X, uiVal)
67 //#define V_I2REF(X) V_UNION(X, piVal)
68 //#define V_I4(X) V_UNION(X, lVal)
69 //#define V_UI4(X) V_UNION(X, ulVal)
70 //#define V_I4REF(X) V_UNION(X, plVal)
71 //#define V_UI4REF(X) V_UNION(X, pulVal)
72 //#define V_I8(X) V_UNION(X, llVal)
73 //#define V_UI8(X) V_UNION(X, ullVal)
74 //#define V_I8REF(X) V_UNION(X, pllVal)
75 //#define V_UI8REF(X) V_UNION(X, pullVal)
76 //#define V_R4(X) V_UNION(X, fltVal)
77 //#define V_R4REF(X) V_UNION(X, pfltVal)
78 //#define V_R8(X) V_UNION(X, dblVal)
79 //#define V_R8REF(X) V_UNION(X, pdblVal)
80 //#define V_CY(X) V_UNION(X, cyVal)
81 //#define V_CYREF(X) V_UNION(X, pcyVal)
82 //#define V_DATE(X) V_UNION(X, date)
83 //#define V_DATEREF(X) V_UNION(X, pdate)
84 //#define V_BSTR(X) V_UNION(X, bstrVal)
85 //#define V_BSTRREF(X) V_UNION(X, pbstrVal)
86 //#define V_DISPATCH(X) V_UNION(X, pdispVal)
87 //#define V_DISPATCHREF(X) V_UNION(X, ppdispVal)
88 //#define V_ERROR(X) V_UNION(X, scode)
89 //#define V_ERRORREF(X) V_UNION(X, pscode)
90 //#define V_BOOLREF(X) V_UNION(X, pboolVal)
91 //#define V_UNKNOWN(X) V_UNION(X, punkVal)
92 //#define V_UNKNOWNREF(X) V_UNION(X, ppunkVal)
93 //#define V_VARIANTREF(X) V_UNION(X, pvarVal)
94 //#define V_LPSTR(X) V_UNION(X, pszVal)
95 //#define V_LPSTRREF(X) V_UNION(X, ppszVal)
96 //#define V_LPWSTR(X) V_UNION(X, pwszVal)
97 //#define V_LPWSTRREF(X) V_UNION(X, ppwszVal)
98 //#define V_FILETIME(X) V_UNION(X, filetime)
99 //#define V_FILETIMEREF(X) V_UNION(X, pfiletime)
100 //#define V_BLOB(X) V_UNION(X, blob)
101 //#define V_UUID(X) V_UNION(X, puuid)
102 //#define V_CLSID(X) V_UNION(X, puuid)
103 //#define V_ARRAY(X) V_UNION(X, parray)
104 //#define V_ARRAYREF(X) V_UNION(X, pparray)
105 //#define V_BYREF(X) V_UNION(X, byref)
106 //#define V_DECIMAL(X) ((X)->decVal)
107 //#define V_DECIMALREF(X) V_UNION(X, pdecVal)
108 //#define V_I1(X) V_UNION(X, cVal)
109 
110 //#ifdef _WIN64
111 //#define V_INT_PTR(X) V_I8(X)
112 //#define V_UINT_PTR(X) V_UI8(X)
113 //#define V_INT_PTRREF(X) V_I8REF(X)
114 //#define V_UINT_PTRREF(X) V_UI8REF(X)
115 //#else
116 //#define V_INT_PTR(X) V_I4(X)
117 //#define V_UINT_PTR(X) V_UI4(X)
118 //#define V_INT_PTRREF(X) V_I4REF(X)
119 //#define V_UINT_PTRREF(X) V_UI4REF(X)
120 //#endif
121 
122 enum {
123 	VARCMP_LT = 0,
124 	VARCMP_EQ,
125 	VARCMP_GT,
126 	VARCMP_NULL // = 3
127 }
128 
129 const LOCALE_USE_NLS = 0x10000000;
130 
131 const VARIANT_NOUSEROVERRIDE     = 0x04;
132 const VARIANT_CALENDAR_HIJRI     = 0x08;
133 const VARIANT_CALENDAR_THAI      = 0x20;
134 const VARIANT_CALENDAR_GREGORIAN = 0x40;
135 const VARIANT_USE_NLS            = 0x80;
136 
137 const NUMPRS_LEADING_WHITE  = 0x00001;
138 const NUMPRS_TRAILING_WHITE = 0x00002;
139 const NUMPRS_LEADING_PLUS   = 0x00004;
140 const NUMPRS_TRAILING_PLUS  = 0x00008;
141 const NUMPRS_LEADING_MINUS  = 0x00010;
142 const NUMPRS_TRAILING_MINUS = 0x00020;
143 const NUMPRS_HEX_OCT        = 0x00040;
144 const NUMPRS_PARENS         = 0x00080;
145 const NUMPRS_DECIMAL        = 0x00100;
146 const NUMPRS_THOUSANDS      = 0x00200;
147 const NUMPRS_CURRENCY       = 0x00400;
148 const NUMPRS_EXPONENT       = 0x00800;
149 const NUMPRS_USE_ALL        = 0x01000;
150 const NUMPRS_STD            = 0x01FFF;
151 const NUMPRS_NEG            = 0x10000;
152 const NUMPRS_INEXACT        = 0x20000;
153 
154 const VTBIT_I1 = 1 << VARENUM.VT_I1;
155 const VTBIT_UI1 = 1 << VARENUM.VT_UI1;
156 const VTBIT_I2 = 1 << VARENUM.VT_I2;
157 const VTBIT_UI2 = 1 << VARENUM.VT_UI2;
158 const VTBIT_I4 = 1 << VARENUM.VT_I4;
159 const VTBIT_UI4 = 1 << VARENUM.VT_UI4;
160 const VTBIT_I8 = 1 << VARENUM.VT_I8;
161 const VTBIT_UI8 = 1 << VARENUM.VT_UI8;
162 const VTBIT_R4 = 1 << VARENUM.VT_R4;
163 const VTBIT_R8 = 1 << VARENUM.VT_R8;
164 const VTBIT_CY = 1 << VARENUM.VT_CY;
165 const VTBIT_DECIMAL = 1 << VARENUM.VT_DECIMAL;
166 
167 
168 enum REGKIND{
169 	REGKIND_DEFAULT,
170 	REGKIND_REGISTER,
171 	REGKIND_NONE
172 }
173 
174 struct PARAMDATA{
175 	OLECHAR* szName;
176 	VARTYPE vt;
177 }
178 alias PARAMDATA* LPPARAMDATA;
179 
180 struct METHODDATA{
181 	OLECHAR* szName;
182 	PARAMDATA* ppdata;
183 	DISPID dispid;
184 	UINT iMeth;
185 	CALLCONV cc;
186 	UINT cArgs;
187 	WORD wFlags;
188 	VARTYPE vtReturn;
189 }
190 alias METHODDATA* LPMETHODDATA;
191 
192 struct INTERFACEDATA{
193 	METHODDATA* pmethdata;
194 	UINT cMembers;
195 }
196 alias INTERFACEDATA* LPINTERFACEDATA;
197 
198 struct UDATE {
199 	SYSTEMTIME st;
200 	USHORT wDayOfYear;
201 }
202 
203 struct NUMPARSE {
204 	int cDig;
205 	uint dwInFlags;
206 	uint dwOutFlags;
207 	int cchUsed;
208 	int nBaseShift;
209 	int nPwr10;
210 }
211 
212 
213 // DAC: In MinGW, these were declared but not defined in oaidl.
214 // The SDK docs suggest they belong in this file instead.
215 
216 deprecated {  // not actually deprecated, but they aren't converted yet.
217               // (will need to reinstate CreateTypeLib as well)
218 	interface ICreateTypeInfo {};
219 	interface ICreateTypeInfo2 {};
220 	interface ICreateTypeLib {};
221 	interface ICreateTypeLib2 {};
222 
223 	alias ICreateTypeInfo* LPCREATETYPEINFO;
224 	alias ICreateTypeInfo2* LPCREATETYPEINFO2;
225 	alias ICreateTypeLib* LPCREATETYPELIB;
226 	alias ICreateTypeLib2* LPCREATETYPELIB2;
227 }
228 
229 extern (Windows) {
230 	BSTR SysAllocString(CPtr!(OLECHAR));
231 	int SysReAllocString(BSTR*, CPtr!(OLECHAR));
232 	BSTR SysAllocStringLen(CPtr!(OLECHAR), uint);
233 	int SysReAllocStringLen(BSTR*, CPtr!(OLECHAR), uint);
234 	void SysFreeString(BSTR);
235 	uint SysStringLen(BSTR);
236 	uint SysStringByteLen(BSTR);
237 	BSTR SysAllocStringByteLen(CPtr!(char), uint);
238 	int DosDateTimeToVariantTime(ushort, ushort, double*);
239 	int VariantTimeToDosDateTime(double, ushort*, ushort*);
240 	int VariantTimeToSystemTime(double, LPSYSTEMTIME);
241 	int SystemTimeToVariantTime(LPSYSTEMTIME, double*);
242 	HRESULT VarDateFromUdate(UDATE*, ULONG, DATE*);
243 	HRESULT VarDateFromUdateEx(UDATE*, LCID, ULONG, DATE*);
244 	HRESULT VarUdateFromDate(DATE, ULONG, UDATE*);
245 	HRESULT SafeArrayAllocDescriptor(uint, SAFEARRAY**);
246 	HRESULT SafeArrayAllocData(SAFEARRAY*);
247 	SAFEARRAY* SafeArrayCreate(VARTYPE, uint, SAFEARRAYBOUND*);
248 	HRESULT SafeArrayDestroyDescriptor(SAFEARRAY*);
249 	HRESULT SafeArrayDestroyData(SAFEARRAY*);
250 	HRESULT SafeArrayDestroy(SAFEARRAY*);
251 	HRESULT SafeArrayRedim(SAFEARRAY*, SAFEARRAYBOUND*);
252 	uint SafeArrayGetDim(SAFEARRAY*);
253 	uint SafeArrayGetElemsize(SAFEARRAY*);
254 	HRESULT SafeArrayGetUBound(SAFEARRAY*, uint, int*);
255 	HRESULT SafeArrayGetLBound(SAFEARRAY*, uint, int*);
256 	HRESULT SafeArrayLock(SAFEARRAY*);
257 	HRESULT SafeArrayUnlock(SAFEARRAY*);
258 	HRESULT SafeArrayAccessData(SAFEARRAY*, void**);
259 	HRESULT SafeArrayUnaccessData(SAFEARRAY*);
260 	HRESULT SafeArrayGetElement(SAFEARRAY*, int*, void*);
261 	HRESULT SafeArrayPutElement(SAFEARRAY*, int*, void*);
262 	HRESULT SafeArrayCopy(SAFEARRAY*, SAFEARRAY**);
263 	HRESULT SafeArrayPtrOfIndex(SAFEARRAY*, int*, void**);
264 	SAFEARRAY* SafeArrayCreateVector(VARTYPE, LONG, ULONG);
265 	SAFEARRAY* SafeArrayCreateVectorEx(VARTYPE, LONG, ULONG, LPVOID);
266 	HRESULT SafeArrayAllocDescriptorEx(VARTYPE, UINT, SAFEARRAY**);
267 	HRESULT SafeArrayGetVartype(SAFEARRAY*, VARTYPE*);
268 	HRESULT SafeArraySetRecordInfo(SAFEARRAY*, IRecordInfo*);
269 	HRESULT SafeArrayGetRecordInfo(SAFEARRAY*, IRecordInfo**);
270 	HRESULT SafeArraySetIID(SAFEARRAY*, REFGUID);
271 	HRESULT SafeArrayGetIID(SAFEARRAY*, GUID*);
272 	void VariantInit(VARIANTARG*);
273 	HRESULT VariantClear(VARIANTARG*);
274 	HRESULT VariantCopy(VARIANTARG*, VARIANTARG*);
275 	HRESULT VariantCopyInd(VARIANT*, VARIANTARG*);
276 	HRESULT VariantChangeType(VARIANTARG*, VARIANTARG*, ushort, VARTYPE);
277 	HRESULT VariantChangeTypeEx(VARIANTARG*, VARIANTARG*, LCID, ushort, VARTYPE);
278 	HRESULT VarUI1FromI2(short, ubyte*);
279 	HRESULT VarUI1FromI4(int, ubyte*);
280 	HRESULT VarUI1FromR4(float, ubyte*);
281 	HRESULT VarUI1FromR8(double, ubyte*);
282 	HRESULT VarUI1FromCy(CY, ubyte*);
283 	HRESULT VarUI1FromDate(DATE, ubyte*);
284 	HRESULT VarUI1FromStr(OLECHAR*, LCID, uint, ubyte*);
285 	HRESULT VarUI1FromDisp(LPDISPATCH, LCID, ubyte*);
286 	HRESULT VarUI1FromBool(VARIANT_BOOL, ubyte*);
287 	HRESULT VarI2FromUI1(ubyte, short*);
288 	HRESULT VarI2FromI4(int, short*);
289 	HRESULT VarI2FromR4(float, short*);
290 	HRESULT VarI2FromR8(double, short*);
291 	HRESULT VarI2FromCy(CY cyIn, short*);
292 	HRESULT VarI2FromDate(DATE, short*);
293 	HRESULT VarI2FromStr(OLECHAR*, LCID, uint, short*);
294 	HRESULT VarI2FromDisp(LPDISPATCH, LCID, short*);
295 	HRESULT VarI2FromBool(VARIANT_BOOL, short*);
296 	HRESULT VarI4FromUI1(ubyte, int*);
297 	HRESULT VarI4FromI2(short, int*);
298 	HRESULT VarI4FromR4(float, int*);
299 	HRESULT VarI4FromR8(double, int*);
300 	HRESULT VarI4FromCy(CY, int*);
301 	HRESULT VarI4FromDate(DATE, int*);
302 	HRESULT VarI4FromStr(OLECHAR*, LCID, uint, int*);
303 	HRESULT VarI4FromDisp(LPDISPATCH, LCID, int*);
304 	HRESULT VarI4FromBool(VARIANT_BOOL, int*);
305 	HRESULT VarR4FromUI1(ubyte, float*);
306 	HRESULT VarR4FromI2(short, float*);
307 	HRESULT VarR4FromI4(int, float*);
308 	HRESULT VarR4FromR8(double, float*);
309 	HRESULT VarR4FromCy(CY, float*);
310 	HRESULT VarR4FromDate(DATE, float*);
311 	HRESULT VarR4FromStr(OLECHAR*, LCID, uint, float*);
312 	HRESULT VarR4FromDisp(LPDISPATCH, LCID, float*);
313 	HRESULT VarR4FromBool(VARIANT_BOOL, float*);
314 	HRESULT VarR8FromUI1(ubyte, double*);
315 	HRESULT VarR8FromI2(short, double*);
316 	HRESULT VarR8FromI4(int, double*);
317 	HRESULT VarR8FromR4(float, double*);
318 	HRESULT VarR8FromCy(CY, double*);
319 	HRESULT VarR8FromDate(DATE, double*);
320 	HRESULT VarR8FromStr(OLECHAR*, LCID, uint, double*);
321 	HRESULT VarR8FromDisp(LPDISPATCH, LCID, double*);
322 	HRESULT VarR8FromBool(VARIANT_BOOL, double*);
323 	HRESULT VarR8FromDec(DECIMAL*, double*);
324 	HRESULT VarDateFromUI1(ubyte, DATE*);
325 	HRESULT VarDateFromI2(short, DATE*);
326 	HRESULT VarDateFromI4(int, DATE*);
327 	HRESULT VarDateFromR4(float, DATE*);
328 	HRESULT VarDateFromR8(double, DATE*);
329 	HRESULT VarDateFromCy(CY, DATE*);
330 	HRESULT VarDateFromStr(OLECHAR*, LCID, uint, DATE*);
331 	HRESULT VarDateFromDisp(LPDISPATCH, LCID, DATE*);
332 	HRESULT VarDateFromBool(VARIANT_BOOL, DATE*);
333 	HRESULT VarCyFromUI1(ubyte, CY*);
334 	HRESULT VarCyFromI2(short, CY*);
335 	HRESULT VarCyFromI4(int, CY*);
336 	HRESULT VarCyFromR4(float, CY*);
337 	HRESULT VarCyFromR8(double, CY*);
338 	HRESULT VarCyFromDate(DATE, CY*);
339 	HRESULT VarCyFromStr(OLECHAR*, LCID, uint, CY*);
340 	HRESULT VarCyFromDisp(LPDISPATCH, LCID, CY*);
341 	HRESULT VarCyFromBool(VARIANT_BOOL, CY*);
342 	HRESULT VarBstrFromUI1(ubyte, LCID, uint, BSTR*);
343 	HRESULT VarBstrFromI2(short, LCID, uint, BSTR*);
344 	HRESULT VarBstrFromI4(int, LCID, uint, BSTR*);
345 	HRESULT VarBstrFromR4(float, LCID, uint, BSTR*);
346 	HRESULT VarBstrFromR8(double, LCID, uint, BSTR*);
347 	HRESULT VarBstrFromCy(CY, LCID, uint, BSTR*);
348 	HRESULT VarBstrFromDate(DATE, LCID, uint, BSTR*);
349 	HRESULT VarBstrFromDisp(LPDISPATCH, LCID, uint, BSTR*);
350 	HRESULT VarBstrFromBool(VARIANT_BOOL, LCID, uint, BSTR*);
351 	HRESULT VarBoolFromUI1(ubyte, VARIANT_BOOL*);
352 	HRESULT VarBoolFromI2(short, VARIANT_BOOL*);
353 	HRESULT VarBoolFromI4(int, VARIANT_BOOL*);
354 	HRESULT VarBoolFromR4(float, VARIANT_BOOL*);
355 	HRESULT VarBoolFromR8(double, VARIANT_BOOL*);
356 	HRESULT VarBoolFromDate(DATE, VARIANT_BOOL*);
357 	HRESULT VarBoolFromCy(CY, VARIANT_BOOL*);
358 	HRESULT VarBoolFromStr(OLECHAR*, LCID, uint, VARIANT_BOOL*);
359 	HRESULT VarBoolFromDisp(LPDISPATCH, LCID, VARIANT_BOOL*);
360 	HRESULT VarDecFromR8(double, DECIMAL*);
361 	ULONG LHashValOfNameSysA(SYSKIND, LCID, CPtr!(char));
362 	ULONG LHashValOfNameSys(SYSKIND, LCID, CPtr!(OLECHAR));
363 	HRESULT LoadTypeLib(CPtr!(OLECHAR), LPTYPELIB*);
364 	HRESULT LoadTypeLibEx(LPCOLESTR, REGKIND, LPTYPELIB*);
365 	HRESULT LoadRegTypeLib(REFGUID, WORD, WORD, LCID, LPTYPELIB*);
366 	HRESULT QueryPathOfRegTypeLib(REFGUID, ushort, ushort, LCID, LPBSTR);
367 	HRESULT RegisterTypeLib(LPTYPELIB, OLECHAR*, OLECHAR*);
368 	HRESULT UnRegisterTypeLib(REFGUID, WORD, WORD, LCID, SYSKIND);
369 	// not actually deprecated, but depends on unconverted ICreateTypeLib
370 	deprecated HRESULT CreateTypeLib(SYSKIND, CPtr!(OLECHAR), LPCREATETYPELIB*);
371 	HRESULT DispGetParam(DISPPARAMS*, UINT, VARTYPE, VARIANT*, UINT*);
372 	HRESULT DispGetIDsOfNames(LPTYPEINFO, OLECHAR**, UINT, DISPID*);
373 	HRESULT DispInvoke(void*, LPTYPEINFO, DISPID, WORD, DISPPARAMS*, VARIANT*, EXCEPINFO*, UINT*);
374 	HRESULT CreateDispTypeInfo(INTERFACEDATA*, LCID, LPTYPEINFO*);
375 	HRESULT CreateStdDispatch(IUnknown*, void*, LPTYPEINFO, IUnknown**);
376 	HRESULT RegisterActiveObject(IUnknown*, REFCLSID, DWORD, DWORD*);
377 	HRESULT RevokeActiveObject(DWORD, void*);
378 	HRESULT GetActiveObject(REFCLSID, void*, IUnknown**);
379 	HRESULT SetErrorInfo(uint, LPERRORINFO);
380 	HRESULT GetErrorInfo(uint, LPERRORINFO*);
381 	HRESULT CreateErrorInfo(LPCREATEERRORINFO*);
382 	uint OaBuildVersion();
383 	HRESULT VectorFromBstr (BSTR, SAFEARRAY**);
384 	HRESULT BstrFromVector (SAFEARRAY*, BSTR*);
385 	HRESULT VarParseNumFromStr(OLECHAR*, LCID, ULONG, NUMPARSE*, BYTE*);
386 	HRESULT VarNumFromParseNum(NUMPARSE*, BYTE*, ULONG, VARIANT*);
387 
388 	HRESULT VarAdd(LPVARIANT, LPVARIANT, LPVARIANT);
389 	HRESULT VarSub(LPVARIANT, LPVARIANT, LPVARIANT);
390 	HRESULT VarMul(LPVARIANT, LPVARIANT, LPVARIANT);
391 	HRESULT VarDiv(LPVARIANT, LPVARIANT, LPVARIANT);
392 
393 	HRESULT VarUI1FromI2(SHORT, BYTE*);
394 	HRESULT VarUI1FromI4(LONG, BYTE*);
395 	HRESULT VarUI1FromI8(LONG64, BYTE*);
396 	HRESULT VarUI1FromR4(FLOAT, BYTE*);
397 	HRESULT VarUI1FromR8(DOUBLE, BYTE*);
398 	HRESULT VarUI1FromDate(DATE, BYTE*);
399 	HRESULT VarUI1FromBool(VARIANT_BOOL, BYTE*);
400 	HRESULT VarUI1FromI1(byte, BYTE*);
401 	HRESULT VarUI1FromUI2(USHORT, BYTE*);
402 	HRESULT VarUI1FromUI4(ULONG, BYTE*);
403 	HRESULT VarUI1FromUI8(ULONG64, BYTE*);
404 	HRESULT VarUI1FromStr(OLECHAR*, LCID, ULONG, BYTE*);
405 	HRESULT VarUI1FromCy(CY, BYTE*);
406 	HRESULT VarUI1FromDec(DECIMAL*, BYTE*);
407 	HRESULT VarUI1FromDisp(IDispatch*, LCID, BYTE*);
408 
409 	HRESULT VarI2FromUI1(BYTE, SHORT*);
410 	HRESULT VarI2FromI4(LONG, SHORT*);
411 	HRESULT VarI2FromI8(LONG64, SHORT*);
412 	HRESULT VarI2FromR4(FLOAT, SHORT*);
413 	HRESULT VarI2FromR8(DOUBLE, SHORT*);
414 	HRESULT VarI2FromDate(DATE, SHORT*);
415 	HRESULT VarI2FromBool(VARIANT_BOOL, SHORT*);
416 	HRESULT VarI2FromI1(byte, SHORT*);
417 	HRESULT VarI2FromUI2(USHORT, SHORT*);
418 	HRESULT VarI2FromUI4(ULONG, SHORT*);
419 	HRESULT VarI2FromUI8(ULONG64, SHORT*);
420 	HRESULT VarI2FromStr(OLECHAR*, LCID, ULONG, SHORT*);
421 	HRESULT VarI2FromCy(CY, SHORT*);
422 	HRESULT VarI2FromDec(DECIMAL*, SHORT*);
423 	HRESULT VarI2FromDisp(IDispatch*, LCID, SHORT*);
424 
425 	HRESULT VarI4FromUI1(BYTE, LONG*);
426 	HRESULT VarI4FromI2(SHORT, LONG*);
427 	HRESULT VarI4FromI8(LONG64, LONG*);
428 	HRESULT VarI4FromR4(FLOAT, LONG*);
429 	HRESULT VarI4FromR8(DOUBLE, LONG*);
430 	HRESULT VarI4FromDate(DATE, LONG*);
431 	HRESULT VarI4FromBool(VARIANT_BOOL, LONG*);
432 	HRESULT VarI4FromI1(byte, LONG*);
433 	HRESULT VarI4FromUI2(USHORT, LONG*);
434 	HRESULT VarI4FromUI4(ULONG, LONG*);
435 	HRESULT VarI4FromUI8(ULONG64, LONG*);
436 	HRESULT VarI4FromStr(OLECHAR*, LCID, ULONG, LONG*);
437 	HRESULT VarI4FromCy(CY, LONG*);
438 	HRESULT VarI4FromDec(DECIMAL*, LONG*);
439 	HRESULT VarI4FromDisp(IDispatch*, LCID, LONG*);
440 
441 	HRESULT VarI8FromUI1(BYTE, LONG64*);
442 	HRESULT VarI8FromI2(SHORT, LONG64*);
443 	HRESULT VarI8FromI4(LONG, LONG64*);
444 	HRESULT VarI8FromR4(FLOAT, LONG64*);
445 	HRESULT VarI8FromR8(DOUBLE, LONG64*);
446 	HRESULT VarI8FromDate(DATE, LONG64*);
447 	HRESULT VarI8FromStr(OLECHAR*, LCID, ULONG, LONG64*);
448 	HRESULT VarI8FromBool(VARIANT_BOOL, LONG64*);
449 	HRESULT VarI8FromI1(byte, LONG64*);
450 	HRESULT VarI8FromUI2(USHORT, LONG64*);
451 	HRESULT VarI8FromUI4(ULONG, LONG64*);
452 	HRESULT VarI8FromUI8(ULONG64, LONG64*);
453 	HRESULT VarI8FromDec(DECIMAL* pdecIn, LONG64*);
454 	HRESULT VarI8FromInt(INT intIn, LONG64*);
455 	HRESULT VarI8FromCy(CY, LONG64*);
456 	HRESULT VarI8FromDisp(IDispatch*, LCID, LONG64*);
457 
458 	HRESULT VarR4FromUI1(BYTE, FLOAT*);
459 	HRESULT VarR4FromI2(SHORT, FLOAT*);
460 	HRESULT VarR4FromI4(LONG, FLOAT*);
461 	HRESULT VarR4FromI8(LONG64, FLOAT*);
462 	HRESULT VarR4FromR8(DOUBLE, FLOAT*);
463 	HRESULT VarR4FromDate(DATE, FLOAT*);
464 	HRESULT VarR4FromBool(VARIANT_BOOL, FLOAT*);
465 	HRESULT VarR4FromI1(byte, FLOAT*);
466 	HRESULT VarR4FromUI2(USHORT, FLOAT*);
467 	HRESULT VarR4FromUI4(ULONG, FLOAT*);
468 	HRESULT VarR4FromUI8(ULONG64, FLOAT*);
469 	HRESULT VarR4FromStr(OLECHAR*, LCID, ULONG, FLOAT*);
470 	HRESULT VarR4FromCy(CY, FLOAT*);
471 	HRESULT VarR4FromDec(DECIMAL*, FLOAT*);
472 	HRESULT VarR4FromDisp(IDispatch*, LCID, FLOAT*);
473 
474 	HRESULT VarR8FromUI1(BYTE, double*);
475 	HRESULT VarR8FromI2(SHORT, double*);
476 	HRESULT VarR8FromI4(LONG, double*);
477 	HRESULT VarR8FromI8(LONG64, double*);
478 	HRESULT VarR8FromR4(FLOAT, double*);
479 	HRESULT VarR8FromDate(DATE, double*);
480 	HRESULT VarR8FromBool(VARIANT_BOOL, double*);
481 	HRESULT VarR8FromI1(byte, double*);
482 	HRESULT VarR8FromUI2(USHORT, double*);
483 	HRESULT VarR8FromUI4(ULONG, double*);
484 	HRESULT VarR8FromUI8(ULONG64, double*);
485 	HRESULT VarR8FromStr(OLECHAR*, LCID, ULONG, double*);
486 	HRESULT VarR8FromCy(CY, double*);
487 	HRESULT VarR8FromDec(DECIMAL*, double*);
488 	HRESULT VarR8FromDisp(IDispatch*, LCID, double*);
489 
490 	HRESULT VarDateFromUI1(BYTE, DATE*);
491 	HRESULT VarDateFromI2(SHORT, DATE*);
492 	HRESULT VarDateFromI4(LONG, DATE*);
493 	HRESULT VarDateFromI8(LONG64, DATE*);
494 	HRESULT VarDateFromR4(FLOAT, DATE*);
495 	HRESULT VarDateFromR8(DOUBLE, DATE*);
496 	HRESULT VarDateFromStr(OLECHAR*, LCID, ULONG, DATE*);
497 	HRESULT VarDateFromI1(byte, DATE*);
498 	HRESULT VarDateFromUI2(USHORT, DATE*);
499 	HRESULT VarDateFromUI4(ULONG, DATE*);
500 	HRESULT VarDateFromUI8(ULONG64, DATE*);
501 	HRESULT VarDateFromBool(VARIANT_BOOL, DATE*);
502 	HRESULT VarDateFromCy(CY, DATE*);
503 	HRESULT VarDateFromDec(DECIMAL*, DATE*);
504 	HRESULT VarDateFromDisp(IDispatch*, LCID, DATE*);
505 
506 	HRESULT VarCyFromUI1(BYTE, CY*);
507 	HRESULT VarCyFromI2(SHORT sIn, CY*);
508 	HRESULT VarCyFromI4(LONG, CY*);
509 	HRESULT VarCyFromI8(LONG64, CY*);
510 	HRESULT VarCyFromR4(FLOAT, CY*);
511 	HRESULT VarCyFromR8(DOUBLE, CY*);
512 	HRESULT VarCyFromDate(DATE, CY*);
513 	HRESULT VarCyFromStr(OLECHAR*, LCID, ULONG, CY*);
514 	HRESULT VarCyFromBool(VARIANT_BOOL, CY*);
515 	HRESULT VarCyFromI1(byte, CY*);
516 	HRESULT VarCyFromUI2(USHORT, CY*);
517 	HRESULT VarCyFromUI4(ULONG, CY*);
518 	HRESULT VarCyFromUI8(ULONG64, CY*);
519 	HRESULT VarCyFromDec(DECIMAL*, CY*);
520 	HRESULT VarCyFromStr(OLECHAR*, LCID, ULONG, CY*);
521 	HRESULT VarCyFromDisp(IDispatch*, LCID, CY*);
522 
523 	HRESULT VarBstrFromUI1(BYTE, LCID, ULONG, BSTR*);
524 	HRESULT VarBstrFromI2(SHORT, LCID, ULONG, BSTR*);
525 	HRESULT VarBstrFromI4(LONG, LCID, ULONG, BSTR*);
526 	HRESULT VarBstrFromI8(LONG64, LCID, ULONG, BSTR*);
527 	HRESULT VarBstrFromR4(FLOAT, LCID, ULONG, BSTR*);
528 	HRESULT VarBstrFromR8(DOUBLE, LCID, ULONG, BSTR*);
529 	HRESULT VarBstrFromDate(DATE, LCID, ULONG, BSTR*);
530 	HRESULT VarBstrFromBool(VARIANT_BOOL, LCID, ULONG, BSTR*);
531 	HRESULT VarBstrFromI1(byte, LCID, ULONG, BSTR*);
532 	HRESULT VarBstrFromUI2(USHORT, LCID, ULONG, BSTR*);
533 	HRESULT VarBstrFromUI8(ULONG64, LCID, ULONG, BSTR*);
534 	HRESULT VarBstrFromUI4(ULONG, LCID, ULONG, BSTR*);
535 	HRESULT VarBstrFromCy(CY, LCID, ULONG, BSTR*);
536 	HRESULT VarBstrFromDec(DECIMAL*, LCID, ULONG, BSTR*);
537 	HRESULT VarBstrFromDisp(IDispatch*, LCID, ULONG, BSTR*);
538 
539 	HRESULT VarBoolFromUI1(BYTE, VARIANT_BOOL*);
540 	HRESULT VarBoolFromI2(SHORT, VARIANT_BOOL*);
541 	HRESULT VarBoolFromI4(LONG, VARIANT_BOOL*);
542 	HRESULT VarBoolFromI8(LONG64, VARIANT_BOOL*);
543 	HRESULT VarBoolFromR4(FLOAT, VARIANT_BOOL*);
544 	HRESULT VarBoolFromR8(DOUBLE, VARIANT_BOOL*);
545 	HRESULT VarBoolFromDate(DATE, VARIANT_BOOL*);
546 	HRESULT VarBoolFromStr(OLECHAR*, LCID, ULONG, VARIANT_BOOL*);
547 	HRESULT VarBoolFromI1(byte, VARIANT_BOOL*);
548 	HRESULT VarBoolFromUI2(USHORT, VARIANT_BOOL*);
549 	HRESULT VarBoolFromUI4(ULONG, VARIANT_BOOL*);
550 	HRESULT VarBoolFromUI8(ULONG64, VARIANT_BOOL*);
551 	HRESULT VarBoolFromCy(CY, VARIANT_BOOL*);
552 	HRESULT VarBoolFromDec(DECIMAL*, VARIANT_BOOL*);
553 	HRESULT VarBoolFromDisp(IDispatch*, LCID, VARIANT_BOOL*);
554 
555 	HRESULT VarI1FromUI1(BYTE, byte*);
556 	HRESULT VarI1FromI2(SHORT, byte*);
557 	HRESULT VarI1FromI4(LONG, byte*);
558 	HRESULT VarI1FromI8(LONG64, byte*);
559 	HRESULT VarI1FromR4(FLOAT, byte*);
560 	HRESULT VarI1FromR8(DOUBLE, byte*);
561 	HRESULT VarI1FromDate(DATE, byte*);
562 	HRESULT VarI1FromStr(OLECHAR*, LCID, ULONG, byte*);
563 	HRESULT VarI1FromBool(VARIANT_BOOL, byte*);
564 	HRESULT VarI1FromUI2(USHORT, byte*);
565 	HRESULT VarI1FromUI4(ULONG, byte*);
566 	HRESULT VarI1FromUI8(ULONG64, byte*);
567 	HRESULT VarI1FromCy(CY, byte*);
568 	HRESULT VarI1FromDec(DECIMAL*, byte*);
569 	HRESULT VarI1FromDisp(IDispatch*, LCID, byte*);
570 
571 	HRESULT VarUI2FromUI1(BYTE, USHORT*);
572 	HRESULT VarUI2FromI2(SHORT, USHORT*);
573 	HRESULT VarUI2FromI4(LONG, USHORT*);
574 	HRESULT VarUI2FromI8(LONG64, USHORT*);
575 	HRESULT VarUI2FromR4(FLOAT, USHORT*);
576 	HRESULT VarUI2FromR8(DOUBLE, USHORT*);
577 	HRESULT VarUI2FromDate(DATE, USHORT*);
578 	HRESULT VarUI2FromStr(OLECHAR*, LCID, ULONG, USHORT*);
579 	HRESULT VarUI2FromBool(VARIANT_BOOL, USHORT*);
580 	HRESULT VarUI2FromI1(byte, USHORT*);
581 	HRESULT VarUI2FromUI4(ULONG, USHORT*);
582 	HRESULT VarUI2FromUI8(ULONG64, USHORT*);
583 	HRESULT VarUI2FromCy(CY, USHORT*);
584 	HRESULT VarUI2FromDec(DECIMAL*, USHORT*);
585 	HRESULT VarUI2FromDisp(IDispatch*, LCID, USHORT*);
586 
587 	HRESULT VarUI4FromStr(OLECHAR*, LCID, ULONG, ULONG*);
588 	HRESULT VarUI4FromUI1(BYTE, ULONG*);
589 	HRESULT VarUI4FromI2(SHORT, ULONG*);
590 	HRESULT VarUI4FromI4(LONG, ULONG*);
591 	HRESULT VarUI4FromI8(LONG64, ULONG*);
592 	HRESULT VarUI4FromR4(FLOAT, ULONG*);
593 	HRESULT VarUI4FromR8(DOUBLE, ULONG*);
594 	HRESULT VarUI4FromDate(DATE, ULONG*);
595 	HRESULT VarUI4FromBool(VARIANT_BOOL, ULONG*);
596 	HRESULT VarUI4FromI1(byte, ULONG*);
597 	HRESULT VarUI4FromUI2(USHORT, ULONG*);
598 	HRESULT VarUI4FromUI8(ULONG64, ULONG*);
599 	HRESULT VarUI4FromCy(CY, ULONG*);
600 	HRESULT VarUI4FromDec(DECIMAL*, ULONG*);
601 	HRESULT VarUI4FromDisp(IDispatch*, LCID, ULONG*);
602 
603 	HRESULT VarUI8FromUI1(BYTE, ULONG64*);
604 	HRESULT VarUI8FromI2(SHORT, ULONG64*);
605 	HRESULT VarUI8FromI4(LONG, ULONG64*);
606 	HRESULT VarUI8FromI8(LONG64, ULONG64*);
607 	HRESULT VarUI8FromR4(FLOAT, ULONG64*);
608 	HRESULT VarUI8FromR8(DOUBLE, ULONG64*);
609 	HRESULT VarUI8FromDate(DATE, ULONG64*);
610 	HRESULT VarUI8FromStr(OLECHAR*, LCID, ULONG, ULONG64*);
611 	HRESULT VarUI8FromBool(VARIANT_BOOL, ULONG64*);
612 	HRESULT VarUI8FromI1(byte, ULONG64*);
613 	HRESULT VarUI8FromUI2(USHORT, ULONG64*);
614 	HRESULT VarUI8FromUI4(ULONG, ULONG64*);
615 	HRESULT VarUI8FromDec(DECIMAL*, ULONG64*);
616 	HRESULT VarUI8FromInt(INT, ULONG64*);
617 	HRESULT VarUI8FromCy(CY, ULONG64*);
618 	HRESULT VarUI8FromDisp(IDispatch*, LCID, ULONG64*);
619 
620 	HRESULT VarDecFromUI1(BYTE, DECIMAL*);
621 	HRESULT VarDecFromI2(SHORT, DECIMAL*);
622 	HRESULT VarDecFromI4(LONG, DECIMAL*);
623 	HRESULT VarDecFromI8(LONG64, DECIMAL*);
624 	HRESULT VarDecFromR4(FLOAT, DECIMAL*);
625 	HRESULT VarDecFromR8(DOUBLE, DECIMAL*);
626 	HRESULT VarDecFromDate(DATE, DECIMAL*);
627 	HRESULT VarDecFromStr(OLECHAR*, LCID, ULONG, DECIMAL*);
628 	HRESULT VarDecFromBool(VARIANT_BOOL, DECIMAL*);
629 	HRESULT VarDecFromI1(byte, DECIMAL*);
630 	HRESULT VarDecFromUI2(USHORT, DECIMAL*);
631 	HRESULT VarDecFromUI4(ULONG, DECIMAL*);
632 	HRESULT VarDecFromUI8(ULONG64, DECIMAL*);
633 	HRESULT VarDecFromCy(CY, DECIMAL*);
634 	HRESULT VarDecFromDisp(IDispatch*, LCID, DECIMAL*);
635 
636 	HRESULT VarDecNeg(CPtr!(DECIMAL), DECIMAL*);
637 	HRESULT VarR4CmpR8(float, double);
638 	HRESULT VarR8Pow(double, double, double*);
639 	HRESULT VarR8Round(double, int, double*);
640 	HRESULT VarDecAbs(CPtr!(DECIMAL), DECIMAL*);
641 	HRESULT VarDecAdd(CPtr!(DECIMAL), CPtr!(DECIMAL), DECIMAL*);
642 	HRESULT VarDecCmp(CPtr!(DECIMAL), CPtr!(DECIMAL));
643 	HRESULT VarDecCmpR8(CPtr!(DECIMAL), DOUBLE);
644 	HRESULT VarDecDiv(CPtr!(DECIMAL), CPtr!(DECIMAL), DECIMAL*);
645 	HRESULT VarDecFix(CPtr!(DECIMAL), DECIMAL*);
646 	HRESULT VarDecInt(CPtr!(DECIMAL), DECIMAL*);
647 	HRESULT VarDecMul(CPtr!(DECIMAL), CPtr!(DECIMAL), DECIMAL*);
648 	HRESULT VarDecRound(CPtr!(DECIMAL), int, DECIMAL*);
649 	HRESULT VarDecSub(CPtr!(DECIMAL), CPtr!(DECIMAL), DECIMAL*);
650 	HRESULT VarCyAbs(CY, CY*);
651 	HRESULT VarCyAdd(CY, CY, CY*);
652 	HRESULT VarCyCmp(CY, CY);
653 	HRESULT VarCyCmpR8(CY, DOUBLE);
654 	HRESULT VarCyFix(CY, CY*);
655 	HRESULT VarCyInt(CY, CY*);
656 	HRESULT VarCyMul(CY, CY, CY*);
657 	HRESULT VarCyMulI4(CY, LONG, CY*);
658 	HRESULT VarCyMulI8(CY, LONG64, CY*);
659 	HRESULT VarCyNeg(CY, CY*);
660 	HRESULT VarCyRound(CY, INT, CY*);
661 	HRESULT VarCySub(CY, CY, CY*);
662 	HRESULT VarAdd(LPVARIANT, LPVARIANT, LPVARIANT);
663 	HRESULT VarAnd(LPVARIANT, LPVARIANT, LPVARIANT);
664 	HRESULT VarCat(LPVARIANT, LPVARIANT, LPVARIANT);
665 	HRESULT VarDiv(LPVARIANT, LPVARIANT, LPVARIANT);
666 	HRESULT VarEqv(LPVARIANT, LPVARIANT, LPVARIANT);
667 	HRESULT VarIdiv(LPVARIANT, LPVARIANT, LPVARIANT);
668 	HRESULT VarImp(LPVARIANT, LPVARIANT, LPVARIANT);
669 	HRESULT VarMod(LPVARIANT, LPVARIANT, LPVARIANT);
670 	HRESULT VarMul(LPVARIANT, LPVARIANT, LPVARIANT);
671 	HRESULT VarOr(LPVARIANT, LPVARIANT, LPVARIANT);
672 	HRESULT VarPow(LPVARIANT, LPVARIANT, LPVARIANT);
673 	HRESULT VarSub(LPVARIANT, LPVARIANT, LPVARIANT);
674 	HRESULT VarXor(LPVARIANT, LPVARIANT, LPVARIANT);
675 	HRESULT VarAbs(LPVARIANT, LPVARIANT);
676 	HRESULT VarFix(LPVARIANT, LPVARIANT);
677 	HRESULT VarInt(LPVARIANT, LPVARIANT);
678 	HRESULT VarNeg(LPVARIANT, LPVARIANT);
679 	HRESULT VarNot(LPVARIANT, LPVARIANT);
680 	HRESULT VarRound(LPVARIANT, int, LPVARIANT);
681 	HRESULT VarCmp(LPVARIANT, LPVARIANT, LCID, ULONG);
682 	HRESULT VarBstrCmp(BSTR, BSTR, LCID, ULONG);
683 	HRESULT VarBstrCat(BSTR, BSTR, BSTR*);
684 }