0fb083338fc17440ab87db2fd7ba3261373689e4
[reactos.git] / include / psdk / oleauto.h
1 /*
2 * Copyright (C) the Wine project
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19 #ifndef __WINE_OLEAUTO_H
20 #define __WINE_OLEAUTO_H
21
22 #include <oaidl.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 DEFINE_OLEGUID(IID_StdOle, 0x00020430,0,0);
29
30 #define STDOLE_MAJORVERNUM 1
31 #define STDOLE_MINORVERNUM 0
32 #define STDOLE_LCID 0
33
34 #define STDOLE2_MAJORVERNUM 2
35 #define STDOLE2_MINORVERNUM 0
36 #define STDOLE2_LCID 0
37
38 ULONG WINAPI OaBuildVersion(void);
39
40 /* BSTR functions */
41 BSTR WINAPI SysAllocString(_In_opt_z_ const OLECHAR*);
42 BSTR WINAPI SysAllocStringByteLen(_In_opt_z_ LPCSTR, _In_ UINT);
43
44 _Ret_writes_maybenull_z_(ui + 1)
45 BSTR
46 WINAPI
47 SysAllocStringLen(
48 _In_reads_opt_(ui) const OLECHAR*,
49 UINT ui);
50
51 void WINAPI SysFreeString(_In_opt_ BSTR);
52
53 INT
54 WINAPI
55 SysReAllocString(
56 _Inout_ _At_(*pbstr, _Pre_z_ _Post_z_ _Post_readable_size_(_String_length_(psz) + 1)) LPBSTR pbstr,
57 _In_opt_z_ const OLECHAR *psz);
58
59 _Check_return_
60 int
61 WINAPI
62 SysReAllocStringLen(
63 _Inout_ _At_(*pbstr, _Pre_z_ _Post_z_ _Post_readable_size_(len + 1)) BSTR *pbstr,
64 _In_opt_z_ const OLECHAR*,
65 _In_ UINT len);
66
67 _Post_equal_to_(_String_length_(bstr) * sizeof(OLECHAR))
68 UINT
69 WINAPI
70 SysStringByteLen(
71 _In_opt_ BSTR bstr);
72
73 _Post_equal_to_(pbstr == NULL ? 0 : _String_length_(pbstr))
74 UINT
75 WINAPI
76 SysStringLen(
77 _In_opt_ BSTR pbstr);
78
79 /* IErrorInfo helpers */
80 HRESULT WINAPI SetErrorInfo(_In_ ULONG, _In_opt_ IErrorInfo*);
81 _Check_return_ HRESULT WINAPI GetErrorInfo(_In_ ULONG, _Outptr_ IErrorInfo**);
82 _Check_return_ HRESULT WINAPI CreateErrorInfo(_Outptr_ ICreateErrorInfo**);
83
84 /* SafeArray functions */
85
86 SAFEARRAY*
87 WINAPI
88 SafeArrayCreate(
89 _In_ VARTYPE,
90 _In_ UINT,
91 _In_ SAFEARRAYBOUND*);
92
93 SAFEARRAY*
94 WINAPI
95 SafeArrayCreateEx(
96 _In_ VARTYPE,
97 _In_ UINT,
98 _In_ SAFEARRAYBOUND*,
99 _In_ LPVOID);
100
101 SAFEARRAY*
102 WINAPI
103 SafeArrayCreateVector(
104 _In_ VARTYPE,
105 _In_ LONG,
106 _In_ ULONG);
107
108 SAFEARRAY*
109 WINAPI
110 SafeArrayCreateVectorEx(
111 _In_ VARTYPE,
112 _In_ LONG,
113 _In_ ULONG,
114 _In_ LPVOID);
115
116 HRESULT WINAPI SafeArrayAllocDescriptor(_In_ UINT, _Outptr_ SAFEARRAY**);
117
118 HRESULT
119 WINAPI
120 SafeArrayAllocDescriptorEx(
121 _In_ VARTYPE,
122 _In_ UINT,
123 _Outptr_ SAFEARRAY**);
124
125 HRESULT WINAPI SafeArrayAllocData(_In_ SAFEARRAY*);
126 HRESULT WINAPI SafeArrayDestroyDescriptor(_In_ SAFEARRAY*);
127
128 _Check_return_
129 HRESULT
130 WINAPI
131 SafeArrayPutElement(
132 _In_ SAFEARRAY*,
133 LONG*,
134 _In_ void*);
135
136 HRESULT WINAPI SafeArrayGetElement(_In_ SAFEARRAY*, LONG*, _Out_ void*);
137 HRESULT WINAPI SafeArrayLock(_In_ SAFEARRAY*);
138 HRESULT WINAPI SafeArrayUnlock(_In_ SAFEARRAY*);
139 HRESULT WINAPI SafeArrayGetUBound(_In_ SAFEARRAY*, _In_ UINT, _Out_ LONG*);
140 HRESULT WINAPI SafeArrayGetLBound(_In_ SAFEARRAY*, _In_ UINT, _Out_ LONG*);
141 UINT WINAPI SafeArrayGetDim(_In_ SAFEARRAY*);
142 UINT WINAPI SafeArrayGetElemsize(_In_ SAFEARRAY*);
143 HRESULT WINAPI SafeArrayGetVartype(_In_ SAFEARRAY*, _Out_ VARTYPE*);
144 HRESULT WINAPI SafeArrayAccessData(_In_ SAFEARRAY*, void**);
145 HRESULT WINAPI SafeArrayUnaccessData(_In_ SAFEARRAY*);
146
147 HRESULT
148 WINAPI
149 SafeArrayPtrOfIndex(
150 _In_ SAFEARRAY *psa,
151 _In_reads_(psa->cDims) LONG*,
152 _Outptr_result_bytebuffer_(psa->cbElements) void **);
153
154 _Check_return_
155 HRESULT
156 WINAPI
157 SafeArrayCopyData(
158 _In_ SAFEARRAY*,
159 _In_ SAFEARRAY*);
160
161 HRESULT WINAPI SafeArrayDestroyData(_In_ SAFEARRAY*);
162 HRESULT WINAPI SafeArrayDestroy(_In_ SAFEARRAY*);
163
164 _Check_return_
165 HRESULT
166 WINAPI
167 SafeArrayCopy(
168 _In_ SAFEARRAY*,
169 _Outptr_ SAFEARRAY**);
170
171 HRESULT WINAPI SafeArrayRedim(_Inout_ SAFEARRAY*, _In_ SAFEARRAYBOUND*);
172 HRESULT WINAPI SafeArraySetRecordInfo(_In_ SAFEARRAY*, _In_ IRecordInfo*);
173 HRESULT WINAPI SafeArrayGetRecordInfo(_In_ SAFEARRAY*, _Outptr_ IRecordInfo**);
174 HRESULT WINAPI SafeArraySetIID(_In_ SAFEARRAY*, _In_ REFGUID);
175 HRESULT WINAPI SafeArrayGetIID(_In_ SAFEARRAY*, _Out_ GUID*);
176
177 _Check_return_ HRESULT WINAPI VectorFromBstr(_In_ BSTR, _Outptr_ SAFEARRAY**);
178 _Check_return_ HRESULT WINAPI BstrFromVector(_In_ SAFEARRAY*, _Out_ BSTR*);
179
180 /* Object registration helpers */
181 #define ACTIVEOBJECT_STRONG 0
182 #define ACTIVEOBJECT_WEAK 1
183
184 _Check_return_
185 HRESULT
186 WINAPI
187 RegisterActiveObject(
188 LPUNKNOWN,
189 REFCLSID,
190 DWORD,
191 LPDWORD);
192
193 HRESULT WINAPI RevokeActiveObject(DWORD,LPVOID);
194 HRESULT WINAPI GetActiveObject(REFCLSID,LPVOID,LPUNKNOWN*);
195
196 /* IRecordInfo helpers */
197 HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo*,IRecordInfo**);
198 HRESULT WINAPI GetRecordInfoFromGuids(REFGUID,ULONG,ULONG,LCID,REFGUID,IRecordInfo**);
199
200 /*
201 * Variants
202 */
203
204 /* Macros for accessing the fields of the VARIANT type */
205 #if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION)
206 #define V_UNION(A,B) ((A)->n1.n2.n3.B)
207 #define V_VT(A) ((A)->n1.n2.vt)
208 #else
209 #define V_UNION(A,B) ((A)->B)
210 #define V_VT(A) ((A)->vt)
211 #endif
212
213 #define V_ISBYREF(A) (V_VT(A) & VT_BYREF)
214 #define V_ISARRAY(A) (V_VT(A) & VT_ARRAY)
215 #define V_ISVECTOR(A) (V_VT(A) & VT_VECTOR)
216 #define V_NONE(A) V_I2(A)
217
218 #define V_ARRAY(A) V_UNION(A,parray)
219 #define V_ARRAYREF(A) V_UNION(A,pparray)
220 #define V_BOOL(A) V_UNION(A,boolVal)
221 #define V_BOOLREF(A) V_UNION(A,pboolVal)
222 #define V_BSTR(A) V_UNION(A,bstrVal)
223 #define V_BSTRREF(A) V_UNION(A,pbstrVal)
224 #define V_BYREF(A) V_UNION(A,byref)
225 #define V_CY(A) V_UNION(A,cyVal)
226 #define V_CYREF(A) V_UNION(A,pcyVal)
227 #define V_DATE(A) V_UNION(A,date)
228 #define V_DATEREF(A) V_UNION(A,pdate)
229 #if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION)
230 #define V_DECIMAL(A) ((A)->n1.decVal)
231 #else
232 #define V_DECIMAL(A) ((A)->decVal)
233 #endif
234 #define V_DECIMALREF(A) V_UNION(A,pdecVal)
235 #define V_DISPATCH(A) V_UNION(A,pdispVal)
236 #define V_DISPATCHREF(A) V_UNION(A,ppdispVal)
237 #define V_ERROR(A) V_UNION(A,scode)
238 #define V_ERRORREF(A) V_UNION(A,pscode)
239 #define V_I1(A) V_UNION(A,cVal)
240 #define V_I1REF(A) V_UNION(A,pcVal)
241 #define V_I2(A) V_UNION(A,iVal)
242 #define V_I2REF(A) V_UNION(A,piVal)
243 #define V_I4(A) V_UNION(A,lVal)
244 #define V_I4REF(A) V_UNION(A,plVal)
245 #define V_I8(A) V_UNION(A,llVal)
246 #define V_I8REF(A) V_UNION(A,pllVal)
247 #define V_INT(A) V_UNION(A,intVal)
248 #define V_INTREF(A) V_UNION(A,pintVal)
249 #ifdef _WIN64
250 #define V_INT_PTR(A) V_I8(A)
251 #define V_INT_PTRREF(A) V_I8REF(A)
252 #else
253 #define V_INT_PTR(A) V_I4(A)
254 #define V_INT_PTRREF(A) V_I4REF(A)
255 #endif
256 #define V_R4(A) V_UNION(A,fltVal)
257 #define V_R4REF(A) V_UNION(A,pfltVal)
258 #define V_R8(A) V_UNION(A,dblVal)
259 #define V_R8REF(A) V_UNION(A,pdblVal)
260 #define V_UINT(A) V_UNION(A,uintVal)
261 #define V_UINTREF(A) V_UNION(A,puintVal)
262 #define V_UI1(A) V_UNION(A,bVal)
263 #define V_UI1REF(A) V_UNION(A,pbVal)
264 #define V_UI2(A) V_UNION(A,uiVal)
265 #define V_UI2REF(A) V_UNION(A,puiVal)
266 #define V_UI4(A) V_UNION(A,ulVal)
267 #define V_UI4REF(A) V_UNION(A,pulVal)
268 #define V_UI8(A) V_UNION(A,ullVal)
269 #define V_UI8REF(A) V_UNION(A,pullVal)
270 #ifdef _WIN64
271 #define V_UINT_PTR(A) V_UI8(A)
272 #define V_UINT_PTRREF(A) V_UI8REF(A)
273 #else
274 #define V_UINT_PTR(A) V_UI4(A)
275 #define V_UINT_PTRREF(A) V_UI4REF(A)
276 #endif
277 #define V_UNKNOWN(A) V_UNION(A,punkVal)
278 #define V_UNKNOWNREF(A) V_UNION(A,ppunkVal)
279 #define V_VARIANTREF(A) V_UNION(A,pvarVal)
280
281 void WINAPI VariantInit(_Out_ VARIANT*);
282 HRESULT WINAPI VariantClear(_Inout_ VARIANT*);
283 _Check_return_ HRESULT WINAPI VariantCopy(_Inout_ VARIANT*, _In_ VARIANT*);
284 _Check_return_ HRESULT WINAPI VariantCopyInd(_Inout_ VARIANT*, _In_ VARIANT*);
285
286 _Check_return_
287 HRESULT
288 WINAPI
289 VariantChangeType(
290 _Inout_ VARIANT*,
291 _In_ VARIANT*,
292 _In_ USHORT,
293 _In_ VARTYPE);
294
295 _Check_return_
296 HRESULT
297 WINAPI
298 VariantChangeTypeEx(
299 _Inout_ VARIANT*,
300 _In_ VARIANT*,
301 _In_ LCID,
302 _In_ USHORT,
303 _In_ VARTYPE);
304
305 /* VariantChangeType/VariantChangeTypeEx flags */
306 #define VARIANT_NOVALUEPROP 0x01 /* Don't get the default value property from IDispatch */
307 #define VARIANT_ALPHABOOL 0x02 /* Coerce to "True"|"False" instead of "-1"|"0" */
308 #define VARIANT_NOUSEROVERRIDE 0x04 /* Pass LOCALE_NOUSEROVERRIDE to low level conversions */
309 #define VARIANT_CALENDAR_HIJRI 0x08 /* Use the Hijri calendar */
310 #define VARIANT_LOCALBOOL 0x10 /* Like VARIANT_ALPHABOOL, but use localised text */
311 #define VARIANT_CALENDAR_THAI 0x20 /* Use the Thai buddhist calendar */
312 #define VARIANT_CALENDAR_GREGORIAN 0x40 /* Use the Gregorian calendar */
313 #define VARIANT_USE_NLS 0x80 /* Format result using NLS calls */
314
315 /*
316 * Low level Variant coercion functions
317 */
318
319 #define VT_HARDTYPE VT_RESERVED /* Don't coerce this variant when comparing it to others */
320
321 /* Flags for low level coercions. LOCALE_ flags can also be passed */
322 #define VAR_TIMEVALUEONLY 0x001 /* Ignore date portion of VT_DATE */
323 #define VAR_DATEVALUEONLY 0x002 /* Ignore time portion of VT_DATE */
324 #define VAR_VALIDDATE 0x004
325 #define VAR_CALENDAR_HIJRI 0x008 /* Use the Hijri calendar */
326 #define VAR_LOCALBOOL 0x010 /* VT_BOOL<->VT_BSTR: Use localised boolean text */
327 #define VAR_FORMAT_NOSUBSTITUTE 0x020 /* Don't change format strings for un-coercable types */
328 #define VAR_FOURDIGITYEARS 0x040 /* Always print years with 4 digits */
329 #define VAR_CALENDAR_THAI 0x080 /* Use the Thai buddhist calendar */
330 #define VAR_CALENDAR_GREGORIAN 0x100 /* Use the Gregorian calendar */
331
332 #ifndef LOCALE_USE_NLS
333 /* This is missing from native winnls.h, but may be added at some point */
334 #define LOCALE_USE_NLS 0x10000000
335 #endif
336
337 #define VTDATEGRE_MIN -657434 /* Minimum possible Gregorian date: 1/1/100 */
338 #define VTDATEGRE_MAX 2958465 /* Maximum possible Gregorian date: 31/12/9999 */
339
340 HRESULT WINAPI VarUI1FromI2(SHORT, _Out_ BYTE*);
341 HRESULT WINAPI VarUI1FromI4(LONG, _Out_ BYTE*);
342 HRESULT WINAPI VarUI1FromI8(LONG64, _Out_ BYTE*);
343 HRESULT WINAPI VarUI1FromR4(FLOAT, _Out_ BYTE*);
344 HRESULT WINAPI VarUI1FromR8(DOUBLE, _Out_ BYTE*);
345 HRESULT WINAPI VarUI1FromDate(DATE, _Out_ BYTE*);
346 HRESULT WINAPI VarUI1FromBool(VARIANT_BOOL, _Out_ BYTE*);
347 HRESULT WINAPI VarUI1FromI1(signed char, _Out_ BYTE*);
348 HRESULT WINAPI VarUI1FromUI2(USHORT, _Out_ BYTE*);
349 HRESULT WINAPI VarUI1FromUI4(ULONG, _Out_ BYTE*);
350 HRESULT WINAPI VarUI1FromUI8(ULONG64, _Out_ BYTE*);
351 HRESULT WINAPI VarUI1FromStr(_In_ OLECHAR*, LCID, ULONG, _Out_ BYTE*);
352 HRESULT WINAPI VarUI1FromCy(CY, _Out_ BYTE*);
353 HRESULT WINAPI VarUI1FromDec(_In_ DECIMAL*, _Out_ BYTE*);
354 HRESULT WINAPI VarUI1FromDisp(IDispatch*, LCID, _Out_ BYTE*);
355
356 HRESULT WINAPI VarI2FromUI1(BYTE, _Out_ SHORT*);
357 HRESULT WINAPI VarI2FromI4(LONG, _Out_ SHORT*);
358 HRESULT WINAPI VarI2FromI8(LONG64, _Out_ SHORT*);
359 HRESULT WINAPI VarI2FromR4(FLOAT, _Out_ SHORT*);
360 HRESULT WINAPI VarI2FromR8(DOUBLE, _Out_ SHORT*);
361 HRESULT WINAPI VarI2FromDate(DATE, _Out_ SHORT*);
362 HRESULT WINAPI VarI2FromBool(VARIANT_BOOL, _Out_ SHORT*);
363 HRESULT WINAPI VarI2FromI1(signed char, _Out_ SHORT*);
364 HRESULT WINAPI VarI2FromUI2(USHORT, _Out_ SHORT*);
365 HRESULT WINAPI VarI2FromUI4(ULONG, _Out_ SHORT*);
366 HRESULT WINAPI VarI2FromUI8(ULONG64, _Out_ SHORT*);
367 HRESULT WINAPI VarI2FromStr(_In_ OLECHAR*, LCID, ULONG, _Out_ SHORT*);
368 HRESULT WINAPI VarI2FromCy(CY,SHORT*);
369 HRESULT WINAPI VarI2FromDec(_In_ DECIMAL*, _Out_ SHORT*);
370 HRESULT WINAPI VarI2FromDisp(IDispatch*, LCID, _Out_ SHORT*);
371
372 HRESULT WINAPI VarI4FromUI1(BYTE, _Out_ LONG*);
373 HRESULT WINAPI VarI4FromI2(SHORT, _Out_ LONG*);
374 HRESULT WINAPI VarI4FromI8(LONG64, _Out_ LONG*);
375 HRESULT WINAPI VarI4FromR4(FLOAT, _Out_ LONG*);
376 HRESULT WINAPI VarI4FromR8(DOUBLE, _Out_ LONG*);
377 HRESULT WINAPI VarI4FromDate(DATE, _Out_ LONG*);
378 HRESULT WINAPI VarI4FromBool(VARIANT_BOOL, _Out_ LONG*);
379 HRESULT WINAPI VarI4FromI1(signed char, _Out_ LONG*);
380 HRESULT WINAPI VarI4FromUI2(USHORT, _Out_ LONG*);
381 HRESULT WINAPI VarI4FromUI4(ULONG, _Out_ LONG*);
382 HRESULT WINAPI VarI4FromUI8(ULONG64, _Out_ LONG*);
383 HRESULT WINAPI VarI4FromStr(_In_ OLECHAR*, LCID, ULONG, _Out_ LONG*);
384 HRESULT WINAPI VarI4FromCy(CY, _Out_ LONG*);
385 HRESULT WINAPI VarI4FromDec(_In_ DECIMAL*, _Out_ LONG*);
386 HRESULT WINAPI VarI4FromDisp(IDispatch*, _In_ LCID, _Out_ LONG*);
387
388 HRESULT WINAPI VarI8FromUI1(BYTE, _Out_ LONG64*);
389 HRESULT WINAPI VarI8FromI2(SHORT, _Out_ LONG64*);
390 HRESULT WINAPI VarI8FromI4(LONG,LONG64*);
391 HRESULT WINAPI VarI8FromR4(FLOAT, _Out_ LONG64*);
392 HRESULT WINAPI VarI8FromR8(DOUBLE, _Out_ LONG64*);
393 HRESULT WINAPI VarI8FromDate(DATE, _Out_ LONG64*);
394 HRESULT WINAPI VarI8FromStr(_In_ OLECHAR*, _In_ LCID, _In_ ULONG, _Out_ LONG64*);
395 HRESULT WINAPI VarI8FromBool(VARIANT_BOOL, _Out_ LONG64*);
396 HRESULT WINAPI VarI8FromI1(signed char, _Out_ LONG64*);
397 HRESULT WINAPI VarI8FromUI2(USHORT, _Out_ LONG64*);
398 HRESULT WINAPI VarI8FromUI4(ULONG, _Out_ LONG64*);
399 HRESULT WINAPI VarI8FromUI8(ULONG64, _Out_ LONG64*);
400 HRESULT WINAPI VarI8FromDec(_In_ DECIMAL *pdecIn, _Out_ LONG64*);
401 HRESULT WINAPI VarI8FromInt(INT intIn,LONG64*);
402 HRESULT WINAPI VarI8FromCy(_In_ CY, _Out_ LONG64*);
403 HRESULT WINAPI VarI8FromDisp(IDispatch*, _In_ LCID, _Out_ LONG64*);
404
405 HRESULT WINAPI VarR4FromUI1(BYTE, _Out_ FLOAT*);
406 HRESULT WINAPI VarR4FromI2(SHORT, _Out_ FLOAT*);
407 HRESULT WINAPI VarR4FromI4(LONG, _Out_ FLOAT*);
408 HRESULT WINAPI VarR4FromI8(LONG64, _Out_ FLOAT*);
409 HRESULT WINAPI VarR4FromR8(DOUBLE, _Out_ FLOAT*);
410 HRESULT WINAPI VarR4FromDate(DATE, _Out_ FLOAT*);
411 HRESULT WINAPI VarR4FromBool(VARIANT_BOOL, _Out_ FLOAT*);
412 HRESULT WINAPI VarR4FromI1(signed char, _Out_ FLOAT*);
413 HRESULT WINAPI VarR4FromUI2(USHORT, _Out_ FLOAT*);
414 HRESULT WINAPI VarR4FromUI4(ULONG, _Out_ FLOAT*);
415 HRESULT WINAPI VarR4FromUI8(ULONG64, _Out_ FLOAT*);
416 HRESULT WINAPI VarR4FromStr(_In_ OLECHAR*, LCID, ULONG, _Out_ FLOAT*);
417 HRESULT WINAPI VarR4FromCy(CY,FLOAT*);
418 HRESULT WINAPI VarR4FromDec(_In_ DECIMAL*, _Out_ FLOAT*);
419 HRESULT WINAPI VarR4FromDisp(IDispatch*, LCID, _Out_ FLOAT*);
420
421 HRESULT WINAPI VarR8FromUI1(BYTE, _Out_ double*);
422 HRESULT WINAPI VarR8FromI2(SHORT, _Out_ double*);
423 HRESULT WINAPI VarR8FromI4(LONG, _Out_ double*);
424 HRESULT WINAPI VarR8FromI8(LONG64, _Out_ double*);
425 HRESULT WINAPI VarR8FromR4(FLOAT, _Out_ double*);
426 HRESULT WINAPI VarR8FromDate(DATE, _Out_ double*);
427 HRESULT WINAPI VarR8FromBool(VARIANT_BOOL, _Out_ double*);
428 HRESULT WINAPI VarR8FromI1(signed char,double*);
429 HRESULT WINAPI VarR8FromUI2(USHORT, _Out_ double*);
430 HRESULT WINAPI VarR8FromUI4(ULONG, _Out_ double*);
431 HRESULT WINAPI VarR8FromUI8(ULONG64, _Out_ double*);
432 HRESULT WINAPI VarR8FromStr(_In_ OLECHAR*, LCID, ULONG, _Out_ double*);
433 HRESULT WINAPI VarR8FromCy(CY,double*);
434 HRESULT WINAPI VarR8FromDec(_In_ const DECIMAL*, _Out_ double*);
435 HRESULT WINAPI VarR8FromDisp(IDispatch*, LCID, _Out_ double*);
436
437 HRESULT WINAPI VarDateFromUI1(BYTE, _Out_ DATE*);
438 HRESULT WINAPI VarDateFromI2(SHORT, _Out_ DATE*);
439 HRESULT WINAPI VarDateFromI4(LONG, _Out_ DATE*);
440 HRESULT WINAPI VarDateFromI8(LONG64, _Out_ DATE*);
441 HRESULT WINAPI VarDateFromR4(FLOAT, _Out_ DATE*);
442 HRESULT WINAPI VarDateFromR8(DOUBLE, _Out_ DATE*);
443 HRESULT WINAPI VarDateFromStr(_In_ OLECHAR*, _In_ LCID, _In_ ULONG, _Out_ DATE*);
444 HRESULT WINAPI VarDateFromI1(signed char, _Out_ DATE*);
445 HRESULT WINAPI VarDateFromUI2(USHORT, _Out_ DATE*);
446 HRESULT WINAPI VarDateFromUI4(ULONG, _Out_ DATE*);
447 HRESULT WINAPI VarDateFromUI8(ULONG64, _Out_ DATE*);
448 HRESULT WINAPI VarDateFromBool(VARIANT_BOOL, _Out_ DATE*);
449 HRESULT WINAPI VarDateFromCy(CY, _Out_ DATE*);
450 HRESULT WINAPI VarDateFromDec(_In_ DECIMAL*, _Out_ DATE*);
451 HRESULT WINAPI VarDateFromDisp(IDispatch*, LCID, _Out_ DATE*);
452
453 HRESULT WINAPI VarCyFromUI1(BYTE, _Out_ CY*);
454 HRESULT WINAPI VarCyFromI2(SHORT sIn, _Out_ CY*);
455 HRESULT WINAPI VarCyFromI4(LONG, _Out_ CY*);
456 HRESULT WINAPI VarCyFromI8(LONG64, _Out_ CY*);
457 HRESULT WINAPI VarCyFromR4(FLOAT, _Out_ CY*);
458 HRESULT WINAPI VarCyFromR8(DOUBLE, _Out_ CY*);
459 HRESULT WINAPI VarCyFromDate(DATE, _Out_ CY*);
460 HRESULT WINAPI VarCyFromStr(_In_ OLECHAR*, _In_ LCID, _In_ ULONG, _Out_ CY*);
461 HRESULT WINAPI VarCyFromBool(VARIANT_BOOL, _Out_ CY*);
462 HRESULT WINAPI VarCyFromI1(signed char, _Out_ CY*);
463 HRESULT WINAPI VarCyFromUI2(USHORT, _Out_ CY*);
464 HRESULT WINAPI VarCyFromUI4(ULONG, _Out_ CY*);
465 HRESULT WINAPI VarCyFromUI8(ULONG64, _Out_ CY*);
466 HRESULT WINAPI VarCyFromDec(_In_ DECIMAL*, _Out_ CY*);
467 HRESULT WINAPI VarCyFromDisp(_In_ IDispatch*, LCID, _Out_ CY*);
468
469 HRESULT WINAPI VarBstrFromUI1(BYTE, LCID, ULONG, _Out_ BSTR*);
470 HRESULT WINAPI VarBstrFromI2(SHORT,LCID,ULONG,BSTR*);
471 HRESULT WINAPI VarBstrFromI4(LONG, LCID, ULONG, _Out_ BSTR*);
472 HRESULT WINAPI VarBstrFromI8(LONG64, LCID, ULONG, _Out_ BSTR*);
473 HRESULT WINAPI VarBstrFromR4(FLOAT, LCID, ULONG, _Out_ BSTR*);
474 HRESULT WINAPI VarBstrFromR8(DOUBLE, LCID, ULONG, _Out_ BSTR*);
475 HRESULT WINAPI VarBstrFromDate(_In_ DATE, _In_ LCID, _In_ ULONG, _Out_ BSTR*);
476 HRESULT WINAPI VarBstrFromBool(VARIANT_BOOL, LCID, ULONG, _Out_ BSTR*);
477 HRESULT WINAPI VarBstrFromI1(signed char, LCID, ULONG, _Out_ BSTR*);
478 HRESULT WINAPI VarBstrFromUI2(USHORT, LCID, ULONG, _Out_ BSTR*);
479 HRESULT WINAPI VarBstrFromUI8(ULONG64, LCID, ULONG, _Out_ BSTR*);
480 HRESULT WINAPI VarBstrFromUI4(ULONG, LCID, ULONG, _Out_ BSTR*);
481 HRESULT WINAPI VarBstrFromCy(CY, LCID, ULONG, _Out_ BSTR*);
482 HRESULT WINAPI VarBstrFromDec(_In_ DECIMAL*, _In_ LCID, _In_ ULONG, _Out_ BSTR*);
483 HRESULT WINAPI VarBstrFromDisp(IDispatch*, LCID, ULONG, _Out_ BSTR*);
484
485 HRESULT WINAPI VarBoolFromUI1(BYTE, _Out_ VARIANT_BOOL*);
486 _Check_return_ HRESULT WINAPI VarBoolFromI2(_In_ SHORT, _Out_ VARIANT_BOOL*);
487 HRESULT WINAPI VarBoolFromI4(LONG, _Out_ VARIANT_BOOL*);
488 HRESULT WINAPI VarBoolFromI8(LONG64, _Out_ VARIANT_BOOL*);
489 HRESULT WINAPI VarBoolFromR4(FLOAT, _Out_ VARIANT_BOOL*);
490 HRESULT WINAPI VarBoolFromR8(DOUBLE, _Out_ VARIANT_BOOL*);
491 HRESULT WINAPI VarBoolFromDate(DATE, _Out_ VARIANT_BOOL*);
492 HRESULT WINAPI VarBoolFromStr(_In_ OLECHAR*, LCID, ULONG, _Out_ VARIANT_BOOL*);
493 HRESULT WINAPI VarBoolFromI1(signed char, _Out_ VARIANT_BOOL*);
494 HRESULT WINAPI VarBoolFromUI2(USHORT, _Out_ VARIANT_BOOL*);
495 HRESULT WINAPI VarBoolFromUI4(ULONG, _Out_ VARIANT_BOOL*);
496 HRESULT WINAPI VarBoolFromUI8(ULONG64, _Out_ VARIANT_BOOL*);
497 HRESULT WINAPI VarBoolFromCy(CY, _Out_ VARIANT_BOOL*);
498 HRESULT WINAPI VarBoolFromDec(_In_ DECIMAL*, _Out_ VARIANT_BOOL*);
499 HRESULT WINAPI VarBoolFromDisp(IDispatch*, LCID, _Out_ VARIANT_BOOL*);
500
501 HRESULT WINAPI VarI1FromUI1(_In_ BYTE, _Out_ signed char*);
502 HRESULT WINAPI VarI1FromI2(_In_ SHORT, _Out_ signed char*);
503 HRESULT WINAPI VarI1FromI4(_In_ LONG, _Out_ signed char*);
504 HRESULT WINAPI VarI1FromI8(_In_ LONG64, _Out_ signed char*);
505 HRESULT WINAPI VarI1FromR4(_In_ FLOAT, _Out_ signed char*);
506 HRESULT WINAPI VarI1FromR8(_In_ DOUBLE, _Out_ signed char*);
507 HRESULT WINAPI VarI1FromDate(_In_ DATE, _Out_ signed char*);
508 HRESULT WINAPI VarI1FromStr(_In_ OLECHAR*, _In_ LCID, _In_ ULONG, _Out_ signed char*);
509 HRESULT WINAPI VarI1FromBool(_In_ VARIANT_BOOL, _Out_ signed char*);
510 HRESULT WINAPI VarI1FromUI2(_In_ USHORT, _Out_ signed char*);
511 HRESULT WINAPI VarI1FromUI4(_In_ ULONG, _Out_ signed char*);
512 HRESULT WINAPI VarI1FromUI8(_In_ ULONG64, _Out_ signed char*);
513 HRESULT WINAPI VarI1FromCy(_In_ CY, _Out_ signed char*);
514 HRESULT WINAPI VarI1FromDec(_In_ DECIMAL*, _Out_ signed char*);
515 HRESULT WINAPI VarI1FromDisp(_In_ IDispatch*, _In_ LCID, _Out_ signed char*);
516
517 HRESULT WINAPI VarUI2FromUI1(BYTE, _Out_ USHORT*);
518 HRESULT WINAPI VarUI2FromI2(SHORT, _Out_ USHORT*);
519 HRESULT WINAPI VarUI2FromI4(LONG, _Out_ USHORT*);
520 HRESULT WINAPI VarUI2FromI8(LONG64, _Out_ USHORT*);
521 HRESULT WINAPI VarUI2FromR4(FLOAT, _Out_ USHORT*);
522 HRESULT WINAPI VarUI2FromR8(DOUBLE,USHORT*);
523 HRESULT WINAPI VarUI2FromDate(DATE, _Out_ USHORT*);
524 HRESULT WINAPI VarUI2FromStr(_In_ OLECHAR*, _In_ LCID, _In_ ULONG, _Out_ USHORT*);
525 HRESULT WINAPI VarUI2FromBool(VARIANT_BOOL, _Out_ USHORT*);
526 HRESULT WINAPI VarUI2FromI1(signed char, _Out_ USHORT*);
527 HRESULT WINAPI VarUI2FromUI4(ULONG, _Out_ USHORT*);
528 HRESULT WINAPI VarUI2FromUI8(ULONG64, _Out_ USHORT*);
529 HRESULT WINAPI VarUI2FromCy(CY, _Out_ USHORT*);
530 HRESULT WINAPI VarUI2FromDec(_In_ DECIMAL*, _Out_ USHORT*);
531 HRESULT WINAPI VarUI2FromDisp(_In_ IDispatch*, LCID, _Out_ USHORT*);
532
533 HRESULT WINAPI VarUI4FromStr(_In_ OLECHAR*, _In_ LCID, _In_ ULONG, _Out_ ULONG*);
534 HRESULT WINAPI VarUI4FromUI1(BYTE, _Out_ ULONG*);
535 HRESULT WINAPI VarUI4FromI2(_In_ SHORT, _Out_ ULONG*);
536 HRESULT WINAPI VarUI4FromI4(LONG, _Out_ ULONG*);
537 HRESULT WINAPI VarUI4FromI8(LONG64, _Out_ ULONG*);
538 HRESULT WINAPI VarUI4FromR4(FLOAT, _Out_ ULONG*);
539 HRESULT WINAPI VarUI4FromR8(DOUBLE, _Out_ ULONG*);
540 HRESULT WINAPI VarUI4FromDate(DATE, _Out_ ULONG*);
541 HRESULT WINAPI VarUI4FromBool(VARIANT_BOOL, _Out_ ULONG*);
542 HRESULT WINAPI VarUI4FromI1(signed char, _Out_ ULONG*);
543 HRESULT WINAPI VarUI4FromUI2(USHORT, _Out_ ULONG*);
544 HRESULT WINAPI VarUI4FromUI8(ULONG64, _Out_ ULONG*);
545 HRESULT WINAPI VarUI4FromCy(CY, _Out_ ULONG*);
546 HRESULT WINAPI VarUI4FromDec(_In_ DECIMAL*, _Out_ ULONG*);
547 HRESULT WINAPI VarUI4FromDisp(_In_ IDispatch*, LCID, _Out_ ULONG*);
548
549 HRESULT WINAPI VarUI8FromUI1(BYTE, _Out_ ULONG64*);
550 HRESULT WINAPI VarUI8FromI2(SHORT, _Out_ ULONG64*);
551 HRESULT WINAPI VarUI8FromI4(LONG, _Out_ ULONG64*);
552 HRESULT WINAPI VarUI8FromI8(LONG64, _Out_ ULONG64*);
553 HRESULT WINAPI VarUI8FromR4(FLOAT, _Out_ ULONG64*);
554 HRESULT WINAPI VarUI8FromR8(DOUBLE, _Out_ ULONG64*);
555 HRESULT WINAPI VarUI8FromDate(DATE, _Out_ ULONG64*);
556 HRESULT WINAPI VarUI8FromStr(_In_ OLECHAR*, _In_ LCID, _In_ ULONG, _Out_ ULONG64*);
557 HRESULT WINAPI VarUI8FromBool(VARIANT_BOOL, _Out_ ULONG64*);
558 HRESULT WINAPI VarUI8FromI1(signed char, _Out_ ULONG64*);
559 HRESULT WINAPI VarUI8FromUI2(USHORT, _Out_ ULONG64*);
560 HRESULT WINAPI VarUI8FromUI4(ULONG, _Out_ ULONG64*);
561 HRESULT WINAPI VarUI8FromDec(_In_ DECIMAL*, _Out_ ULONG64*);
562 HRESULT WINAPI VarUI8FromInt(INT,ULONG64*);
563 HRESULT WINAPI VarUI8FromCy(CY, _Out_ ULONG64*);
564 HRESULT WINAPI VarUI8FromDisp(_In_ IDispatch*, LCID, _Out_ ULONG64*);
565
566 HRESULT WINAPI VarDecFromUI1(_In_ BYTE, _Out_ DECIMAL*);
567 HRESULT WINAPI VarDecFromI2(_In_ SHORT, _Out_ DECIMAL*);
568 HRESULT WINAPI VarDecFromI4(_In_ LONG, _Out_ DECIMAL*);
569 HRESULT WINAPI VarDecFromI8(LONG64, _Out_ DECIMAL*);
570 HRESULT WINAPI VarDecFromR4(_In_ FLOAT, _Out_ DECIMAL*);
571 HRESULT WINAPI VarDecFromR8(_In_ DOUBLE, _Out_ DECIMAL*);
572 HRESULT WINAPI VarDecFromDate(_In_ DATE, _Out_ DECIMAL*);
573 HRESULT WINAPI VarDecFromStr(_In_ OLECHAR*, _In_ LCID, _In_ ULONG, _Out_ DECIMAL*);
574 HRESULT WINAPI VarDecFromBool(_In_ VARIANT_BOOL, _Out_ DECIMAL*);
575 HRESULT WINAPI VarDecFromI1(_In_ signed char, _Out_ DECIMAL*);
576 HRESULT WINAPI VarDecFromUI2(_In_ USHORT, _Out_ DECIMAL*);
577 HRESULT WINAPI VarDecFromUI4(_In_ ULONG, _Out_ DECIMAL*);
578 HRESULT WINAPI VarDecFromUI8(ULONG64, _Out_ DECIMAL*);
579 HRESULT WINAPI VarDecFromCy(_In_ CY, _Out_ DECIMAL*);
580 HRESULT WINAPI VarDecFromDisp(_In_ IDispatch*, _In_ LCID, _Out_ DECIMAL*);
581
582 #define VarUI4FromUI4( in,pOut ) ( *(pOut) = (in) )
583 #define VarI4FromI4( in,pOut ) ( *(pOut) = (in) )
584
585 #define VarUI1FromInt VarUI1FromI4
586 #define VarUI1FromUint VarUI1FromUI4
587 #define VarI2FromInt VarI2FromI4
588 #define VarI2FromUint VarI2FromUI4
589 #define VarI4FromInt VarI4FromI4
590 #define VarI4FromUint VarI4FromUI4
591 #define VarI8FromInt VarI8FromI4
592 #define VarI8FromUint VarI8FromUI4
593 #define VarR4FromInt VarR4FromI4
594 #define VarR4FromUint VarR4FromUI4
595 #define VarR8FromInt VarR8FromI4
596 #define VarR8FromUint VarR8FromUI4
597 #define VarDateFromInt VarDateFromI4
598 #define VarDateFromUint VarDateFromUI4
599 #define VarCyFromInt VarCyFromI4
600 #define VarCyFromUint VarCyFromUI4
601 #define VarBstrFromInt VarBstrFromI4
602 #define VarBstrFromUint VarBstrFromUI4
603 #define VarBoolFromInt VarBoolFromI4
604 #define VarBoolFromUint VarBoolFromUI4
605 #define VarI1FromInt VarI1FromI4
606 #define VarI1FromUint VarI1FromUI4
607 #define VarUI2FromInt VarUI2FromI4
608 #define VarUI2FromUint VarUI2FromUI4
609 #define VarUI4FromInt VarUI4FromI4
610 #define VarUI4FromUint VarUI4FromUI4
611 #define VarUI8FromInt VarUI8FromI4
612 #define VarUI8FromUint VarUI8FromUI4
613 #define VarDecFromInt VarDecFromI4
614 #define VarDecFromUint VarDecFromUI4
615 #define VarIntFromUI1 VarI4FromUI1
616 #define VarIntFromI2 VarI4FromI2
617 #define VarIntFromI4 VarI4FromI4
618 #define VarIntFromI8 VarI4FromI8
619 #define VarIntFromR4 VarI4FromR4
620 #define VarIntFromR8 VarI4FromR8
621 #define VarIntFromDate VarI4FromDate
622 #define VarIntFromCy VarI4FromCy
623 #define VarIntFromStr VarI4FromStr
624 #define VarIntFromDisp VarI4FromDisp
625 #define VarIntFromBool VarI4FromBool
626 #define VarIntFromI1 VarI4FromI1
627 #define VarIntFromUI2 VarI4FromUI2
628 #define VarIntFromUI4 VarI4FromUI4
629 #define VarIntFromUI8 VarI4FromUI8
630 #define VarIntFromDec VarI4FromDec
631 #define VarIntFromUint VarI4FromUI4
632 #define VarUintFromUI1 VarUI4FromUI1
633 #define VarUintFromI2 VarUI4FromI2
634 #define VarUintFromI4 VarUI4FromI4
635 #define VarUintFromI8 VarUI4FromI8
636 #define VarUintFromR4 VarUI4FromR4
637 #define VarUintFromR8 VarUI4FromR8
638 #define VarUintFromDate VarUI4FromDate
639 #define VarUintFromCy VarUI4FromCy
640 #define VarUintFromStr VarUI4FromStr
641 #define VarUintFromDisp VarUI4FromDisp
642 #define VarUintFromBool VarUI4FromBool
643 #define VarUintFromI1 VarUI4FromI1
644 #define VarUintFromUI2 VarUI4FromUI2
645 #define VarUintFromUI4 VarUI4FromUI4
646 #define VarUintFromUI8 VarUI4FromUI8
647 #define VarUintFromDec VarUI4FromDec
648 #define VarUintFromInt VarUI4FromI4
649
650 /*
651 * Variant Math operations
652 */
653 #define VARCMP_LT 0
654 #define VARCMP_EQ 1
655 #define VARCMP_GT 2
656 #define VARCMP_NULL 3
657
658 HRESULT WINAPI VarR4CmpR8(_In_ float, _In_ double);
659
660 HRESULT WINAPI VarR8Pow(_In_ double, _In_ double, _Out_ double*);
661 HRESULT WINAPI VarR8Round(_In_ double, _In_ int, _Out_ double*);
662
663 HRESULT WINAPI VarDecAbs(_In_ const DECIMAL*, _Out_ DECIMAL*);
664 HRESULT WINAPI VarDecAdd(_In_ const DECIMAL*, _In_ const DECIMAL*, _Out_ DECIMAL*);
665 HRESULT WINAPI VarDecCmp(_In_ const DECIMAL*, _In_ const DECIMAL*);
666 HRESULT WINAPI VarDecCmpR8(_In_ const DECIMAL*, _In_ DOUBLE);
667 HRESULT WINAPI VarDecDiv(_In_ const DECIMAL*, _In_ const DECIMAL*, _Out_ DECIMAL*);
668 HRESULT WINAPI VarDecFix(_In_ const DECIMAL*, _Out_ DECIMAL*);
669 HRESULT WINAPI VarDecInt(_In_ const DECIMAL*, _Out_ DECIMAL*);
670 HRESULT WINAPI VarDecMul(_In_ const DECIMAL*, _In_ const DECIMAL*, _Out_ DECIMAL*);
671 HRESULT WINAPI VarDecNeg(_In_ const DECIMAL*, _Out_ DECIMAL*);
672 HRESULT WINAPI VarDecRound(_In_ const DECIMAL*, int, _Out_ DECIMAL*);
673 HRESULT WINAPI VarDecSub(_In_ const DECIMAL*, _In_ const DECIMAL*, _Out_ DECIMAL*);
674
675 HRESULT WINAPI VarCyAbs(_In_ const CY, _Out_ CY*);
676 HRESULT WINAPI VarCyAdd(_In_ const CY, _In_ const CY, _Out_ CY*);
677 HRESULT WINAPI VarCyCmp(_In_ const CY, _In_ const CY);
678 HRESULT WINAPI VarCyCmpR8(_In_ const CY, _In_ DOUBLE);
679 HRESULT WINAPI VarCyFix(_In_ const CY, _Out_ CY*);
680 HRESULT WINAPI VarCyInt(_In_ const CY, _Out_ CY*);
681 HRESULT WINAPI VarCyMul(_In_ const CY, _In_ CY, _Out_ CY*);
682 HRESULT WINAPI VarCyMulI4(_In_ const CY, _In_ LONG, _Out_ CY*);
683 HRESULT WINAPI VarCyMulI8(_In_ const CY, _In_ LONG64, _Out_ CY*);
684 HRESULT WINAPI VarCyNeg(_In_ const CY, _Out_ CY*);
685 HRESULT WINAPI VarCyRound(_In_ const CY, _In_ INT, _Out_ CY*);
686 HRESULT WINAPI VarCySub(_In_ const CY, _In_ const CY, _Out_ CY*);
687
688 HRESULT WINAPI VarAdd(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
689 HRESULT WINAPI VarAnd(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
690 HRESULT WINAPI VarCat(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
691 HRESULT WINAPI VarDiv(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
692 HRESULT WINAPI VarEqv(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
693 HRESULT WINAPI VarIdiv(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
694 HRESULT WINAPI VarImp(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
695 HRESULT WINAPI VarMod(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
696 HRESULT WINAPI VarMul(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
697 HRESULT WINAPI VarOr(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
698 HRESULT WINAPI VarPow(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
699 HRESULT WINAPI VarSub(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
700 HRESULT WINAPI VarXor(_In_ LPVARIANT, _In_ LPVARIANT, _Out_ LPVARIANT);
701
702 HRESULT WINAPI VarAbs(_In_ LPVARIANT, _Out_ LPVARIANT);
703 HRESULT WINAPI VarFix(_In_ LPVARIANT, _Out_ LPVARIANT);
704 HRESULT WINAPI VarInt(_In_ LPVARIANT, _Out_ LPVARIANT);
705 HRESULT WINAPI VarNeg(_In_ LPVARIANT, _Out_ LPVARIANT);
706 HRESULT WINAPI VarNot(_In_ LPVARIANT, _Out_ LPVARIANT);
707
708 HRESULT WINAPI VarRound(_In_ LPVARIANT, _In_ int, _Out_ LPVARIANT);
709
710 HRESULT WINAPI VarCmp(_In_ LPVARIANT, _In_ LPVARIANT, _In_ LCID, _In_ ULONG);
711
712 HRESULT WINAPI VarBstrCmp(_In_ BSTR, _In_ BSTR, _In_ LCID, _In_ ULONG);
713 HRESULT WINAPI VarBstrCat(_In_ BSTR, _In_ BSTR, _Out_ BSTR*);
714
715
716 typedef struct {
717 SYSTEMTIME st;
718 USHORT wDayOfYear;
719 } UDATE;
720
721 typedef struct
722 {
723 INT cDig; /* Number of parsed digits */
724 ULONG dwInFlags; /* Acceptable state of the input string (NUMPRS_ flags) */
725 ULONG dwOutFlags; /* Parsed state of the output string (NUMPRS_ flags) */
726 INT cchUsed; /* Number of characters parsed from input string */
727 INT nBaseShift; /* Base of the number (but apparently unused) */
728 INT nPwr10; /* Scale of the number in powers of 10 */
729 } NUMPARSE;
730
731 #define NUMPRS_LEADING_WHITE 0x00001 /* Leading whitespace */
732 #define NUMPRS_TRAILING_WHITE 0x00002 /* Trailing whitespace */
733 #define NUMPRS_LEADING_PLUS 0x00004 /* Leading '+' sign */
734 #define NUMPRS_TRAILING_PLUS 0x00008 /* Trailing '+' sign */
735 #define NUMPRS_LEADING_MINUS 0x00010 /* Leading '-' sign */
736 #define NUMPRS_TRAILING_MINUS 0x00020 /* Trailing '-' sign */
737 #define NUMPRS_HEX_OCT 0x00040 /* Octal number (with a leading 0) */
738 #define NUMPRS_PARENS 0x00080 /* Parentheses for negative numbers */
739 #define NUMPRS_DECIMAL 0x00100 /* Decimal separator */
740 #define NUMPRS_THOUSANDS 0x00200 /* Thousands separator */
741 #define NUMPRS_CURRENCY 0x00400 /* Currency symbol */
742 #define NUMPRS_EXPONENT 0x00800 /* Exponent (e.g. "e-14") */
743 #define NUMPRS_USE_ALL 0x01000 /* Parse the entire string */
744 #define NUMPRS_STD 0x01FFF /* Standard flags for internal coercions (All of the above) */
745 #define NUMPRS_NEG 0x10000 /* Number is negative (dwOutFlags only) */
746 #define NUMPRS_INEXACT 0x20000 /* Number is represented inexactly (dwOutFlags only) */
747
748 #define VTBIT_I1 (1 << VT_I1)
749 #define VTBIT_UI1 (1 << VT_UI1)
750 #define VTBIT_I2 (1 << VT_I2)
751 #define VTBIT_UI2 (1 << VT_UI2)
752 #define VTBIT_I4 (1 << VT_I4)
753 #define VTBIT_UI4 (1 << VT_UI4)
754 #define VTBIT_I8 (1 << VT_I8)
755 #define VTBIT_UI8 (1 << VT_UI8)
756 #define VTBIT_R4 (1 << VT_R4)
757 #define VTBIT_R8 (1 << VT_R8)
758 #define VTBIT_CY (1 << VT_CY)
759 #define VTBIT_DECIMAL (1 << VT_DECIMAL)
760
761 _Check_return_
762 HRESULT
763 WINAPI
764 VarParseNumFromStr(
765 _In_ OLECHAR*,
766 _In_ LCID,
767 _In_ ULONG,
768 _Out_ NUMPARSE*,
769 _Out_ BYTE*);
770
771 _Check_return_
772 HRESULT
773 WINAPI
774 VarNumFromParseNum(
775 _In_ NUMPARSE*,
776 _In_ BYTE*,
777 _In_ ULONG,
778 _Out_ VARIANT*);
779
780 INT WINAPI DosDateTimeToVariantTime(_In_ USHORT, _In_ USHORT, _Out_ double*);
781 INT WINAPI VariantTimeToDosDateTime(_In_ double, _Out_ USHORT*, _Out_ USHORT*);
782
783 INT WINAPI VariantTimeToSystemTime(_In_ DOUBLE, _Out_ LPSYSTEMTIME);
784 INT WINAPI SystemTimeToVariantTime(_In_ LPSYSTEMTIME, _Out_ double*);
785
786 _Check_return_
787 HRESULT
788 WINAPI
789 VarDateFromUdate(
790 _In_ UDATE*,
791 _In_ ULONG,
792 _Out_ DATE*);
793
794 HRESULT
795 WINAPI
796 VarDateFromUdateEx(
797 _In_ UDATE*,
798 _In_ LCID,
799 _In_ ULONG,
800 _Out_ DATE*);
801
802 _Check_return_
803 HRESULT
804 WINAPI
805 VarUdateFromDate(
806 _In_ DATE,
807 _In_ ULONG,
808 _Out_ UDATE*);
809
810 /* Variant formatting */
811 HRESULT WINAPI VarWeekdayName(int, int, int, ULONG, _Out_ BSTR*);
812 HRESULT WINAPI VarMonthName(int, int, ULONG, _Out_ BSTR*);
813
814 _Check_return_
815 HRESULT
816 WINAPI
817 GetAltMonthNames(
818 LCID,
819 _Outptr_result_buffer_maybenull_(13) LPOLESTR**);
820
821 HRESULT
822 WINAPI
823 VarFormat(
824 _In_ LPVARIANT,
825 _In_opt_ LPOLESTR,
826 int,
827 int,
828 ULONG,
829 _Out_ BSTR*);
830
831 HRESULT
832 WINAPI
833 VarFormatCurrency(
834 _In_ LPVARIANT,
835 int,
836 int,
837 int,
838 int,
839 ULONG,
840 _Out_ BSTR*);
841
842 HRESULT WINAPI VarFormatDateTime(_In_ LPVARIANT, int, ULONG, _Out_ BSTR*);
843
844 HRESULT
845 WINAPI
846 VarFormatNumber(
847 _In_ LPVARIANT,
848 int,
849 int,
850 int,
851 int,
852 ULONG,
853 _Out_ BSTR*);
854
855 HRESULT
856 WINAPI
857 VarFormatPercent(
858 _In_ LPVARIANT,
859 int,
860 int,
861 int,
862 int,
863 ULONG,
864 _Out_ BSTR*);
865
866 HRESULT
867 WINAPI
868 VarFormatFromTokens(
869 _In_ LPVARIANT,
870 _In_opt_ LPOLESTR,
871 LPBYTE,
872 ULONG,
873 _Out_ BSTR*,
874 LCID);
875
876 HRESULT
877 WINAPI
878 VarTokenizeFormatString(
879 _In_opt_ LPOLESTR,
880 _Inout_ LPBYTE,
881 int,
882 int,
883 int,
884 LCID,
885 _In_opt_ int*);
886
887
888 /*
889 * IDispatch types and helper functions
890 */
891
892 /* A structure describing a single parameter to a com object method. */
893 typedef struct tagPARAMDATA
894 {
895 OLECHAR *szName; /* Name of Parameter */
896 VARTYPE vt; /* Type of Parameter */
897 } PARAMDATA, *LPPARAMDATA;
898
899 /* A structure describing a single method of a com object. */
900 typedef struct tagMETHODDATA
901 {
902 OLECHAR *szName; /* Name of method */
903 PARAMDATA *ppdata; /* Parameters of the method */
904 DISPID dispid; /* Id of the method */
905 UINT iMeth; /* Vtable index of the method */
906 CALLCONV cc; /* Calling convention of the method */
907 UINT cArgs; /* Number of parameters in the method */
908 WORD wFlags; /* Type of the method (DISPATCH_ flags) */
909 VARTYPE vtReturn; /* Type of the return value */
910 } METHODDATA, *LPMETHODDATA;
911
912 /* Structure describing a single com object */
913 typedef struct tagINTERFACEDATA
914 {
915 METHODDATA *pmethdata; /* Methods of the object */
916 UINT cMembers; /* Number of methods in the object */
917 } INTERFACEDATA, *LPINTERFACEDATA;
918
919 typedef enum tagREGKIND
920 {
921 REGKIND_DEFAULT,
922 REGKIND_REGISTER,
923 REGKIND_NONE
924 } REGKIND;
925
926 _Check_return_
927 HRESULT
928 WINAPI
929 DispGetParam(
930 _In_ DISPPARAMS*,
931 UINT,
932 VARTYPE,
933 _Out_ VARIANT*,
934 _Out_opt_ UINT*);
935
936 _Check_return_
937 HRESULT
938 WINAPI
939 DispGetIDsOfNames(
940 ITypeInfo*,
941 _In_reads_(cNames) OLECHAR**,
942 UINT cNames,
943 _Out_writes_(cNames) DISPID*);
944
945 _Check_return_
946 HRESULT
947 WINAPI
948 DispInvoke(
949 void*,
950 ITypeInfo*,
951 DISPID,
952 WORD,
953 DISPPARAMS*,
954 VARIANT*,
955 EXCEPINFO*,
956 UINT*);
957
958 _Check_return_
959 HRESULT
960 WINAPI
961 CreateDispTypeInfo(
962 INTERFACEDATA*,
963 LCID,
964 ITypeInfo**);
965
966 _Check_return_
967 HRESULT
968 WINAPI
969 CreateStdDispatch(
970 IUnknown*,
971 void*,
972 ITypeInfo*,
973 IUnknown**);
974
975 HRESULT
976 WINAPI
977 DispCallFunc(
978 void*,
979 ULONG_PTR,
980 CALLCONV,
981 VARTYPE,
982 UINT,
983 VARTYPE*,
984 VARIANTARG**,
985 VARIANT*);
986
987
988 /*
989 * TypeLib API
990 */
991
992 ULONG WINAPI LHashValOfNameSysA(SYSKIND,LCID,LPCSTR);
993 ULONG WINAPI LHashValOfNameSys(SYSKIND,LCID,LPCOLESTR);
994
995 #define LHashValOfName(lcid,name) LHashValOfNameSys(SYS_WIN32,lcid,name)
996 #define WHashValOfLHashVal(hash) ((USHORT)((hash) & 0xffff))
997 #define IsHashValCompatible(hash1,hash2) ((hash1) & 0xff0000 == (hash2) & 0xff0000)
998
999 #define MEMBERID_NIL DISPID_UNKNOWN
1000 #define ID_DEFAULTINST -2
1001
1002 #define DISPATCH_METHOD 0x1
1003 #define DISPATCH_PROPERTYGET 0x2
1004 #define DISPATCH_PROPERTYPUT 0x4
1005 #define DISPATCH_PROPERTYPUTREF 0x8
1006
1007 #define LOAD_TLB_AS_32BIT 0x20
1008 #define LOAD_TLB_AS_64BIT 0x40
1009 #define MASK_TO_RESET_TLB_BITS ~(LOAD_TLB_AS_32BIT|LOAD_TLB_AS_64BIT)
1010
1011 _Check_return_
1012 HRESULT
1013 WINAPI
1014 CreateTypeLib(
1015 SYSKIND,
1016 const OLECHAR*,
1017 ICreateTypeLib**);
1018
1019 _Check_return_
1020 HRESULT
1021 WINAPI
1022 CreateTypeLib2(
1023 SYSKIND,
1024 LPCOLESTR,
1025 ICreateTypeLib2**);
1026
1027 _Check_return_
1028 HRESULT
1029 WINAPI
1030 LoadRegTypeLib(
1031 REFGUID,
1032 WORD,
1033 WORD,
1034 LCID,
1035 ITypeLib**);
1036
1037 HRESULT WINAPI LoadTypeLib(_In_z_ const OLECHAR*, ITypeLib**);
1038 _Check_return_ HRESULT WINAPI LoadTypeLibEx(LPCOLESTR, REGKIND, ITypeLib**);
1039 HRESULT WINAPI QueryPathOfRegTypeLib(REFGUID,WORD,WORD,LCID,LPBSTR);
1040
1041 _Check_return_
1042 HRESULT
1043 WINAPI
1044 RegisterTypeLib(
1045 ITypeLib*,
1046 _In_ OLECHAR*,
1047 _In_opt_ OLECHAR*);
1048
1049 _Check_return_
1050 HRESULT
1051 WINAPI
1052 UnRegisterTypeLib(
1053 REFGUID,
1054 WORD,
1055 WORD,
1056 LCID,
1057 SYSKIND);
1058
1059 HRESULT
1060 WINAPI
1061 RegisterTypeLibForUser(
1062 ITypeLib*,
1063 _In_ OLECHAR*,
1064 _In_opt_ OLECHAR*);
1065
1066 HRESULT WINAPI UnRegisterTypeLibForUser(REFGUID,WORD,WORD,LCID,SYSKIND);
1067
1068 VOID WINAPI ClearCustData(LPCUSTDATA);
1069
1070 #ifdef __cplusplus
1071 } /* extern "C" */
1072 #endif
1073
1074
1075 #endif /*__WINE_OLEAUTO_H*/