2 * Copyright (C) the Wine project
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.
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.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_OLEAUTO_H
20 #define __WINE_OLEAUTO_H
24 #include "wine/obj_base.h"
25 #include "wine/obj_oleaut.h"
26 #include "wine/obj_errorinfo.h"
37 struct tagSAFEARRAYBOUND
;
44 BSTR WINAPI
SysAllocString(const OLECHAR
*);
45 BSTR WINAPI
SysAllocStringByteLen(LPCSTR
,UINT
);
46 BSTR WINAPI
SysAllocStringLen(const OLECHAR
*,UINT
);
47 void WINAPI
SysFreeString(BSTR
);
48 INT WINAPI
SysReAllocString(LPBSTR
,const OLECHAR
*);
49 int WINAPI
SysReAllocStringLen(BSTR
*,const OLECHAR
*,UINT
);
50 int WINAPI
SysStringByteLen(BSTR
);
51 int WINAPI
SysStringLen(BSTR
);
54 /*****************************************************************
58 HRESULT WINAPI
SetErrorInfo(ULONG dwReserved
, IErrorInfo
*perrinfo
);
59 HRESULT WINAPI
GetErrorInfo(ULONG dwReserved
, IErrorInfo
**pperrinfo
);
60 HRESULT WINAPI
CreateErrorInfo(ICreateErrorInfo
**pperrinfo
);
62 /*****************************************************************
67 SafeArrayAllocDescriptor(UINT cDims
, struct tagSAFEARRAY
**ppsaOut
);
70 SafeArrayAllocData(struct tagSAFEARRAY
*psa
);
72 struct tagSAFEARRAY
* WINAPI
73 SafeArrayCreate(VARTYPE vt
, UINT cDims
, struct tagSAFEARRAYBOUND
*rgsabound
);
76 SafeArrayDestroyDescriptor(struct tagSAFEARRAY
*psa
);
79 SafeArrayPutElement(struct tagSAFEARRAY
*psa
, LONG
*rgIndices
, void *pv
);
82 SafeArrayGetElement(struct tagSAFEARRAY
*psa
, LONG
*rgIndices
, void *pv
);
85 SafeArrayLock(struct tagSAFEARRAY
*psa
);
88 SafeArrayUnlock(struct tagSAFEARRAY
*psa
);
91 SafeArrayGetUBound(struct tagSAFEARRAY
*psa
, UINT nDim
, LONG
*plUbound
);
94 SafeArrayGetLBound(struct tagSAFEARRAY
*psa
, UINT nDim
, LONG
*plLbound
);
97 SafeArrayGetDim(struct tagSAFEARRAY
*psa
);
100 SafeArrayGetElemsize(struct tagSAFEARRAY
*psa
);
103 SafeArrayAccessData(struct tagSAFEARRAY
*psa
, void **ppvData
);
106 SafeArrayUnaccessData(struct tagSAFEARRAY
*psa
);
109 SafeArrayPtrOfIndex(struct tagSAFEARRAY
*psa
, LONG
*rgIndices
, void **ppvData
);
112 SafeArrayCopyData(struct tagSAFEARRAY
*psaSource
, struct tagSAFEARRAY
**psaTarget
);
115 SafeArrayDestroyData(struct tagSAFEARRAY
*psa
);
118 SafeArrayDestroy(struct tagSAFEARRAY
*psa
);
121 SafeArrayCopy(struct tagSAFEARRAY
*psa
, struct tagSAFEARRAY
**ppsaOut
);
123 struct tagSAFEARRAY
* WINAPI
124 SafeArrayCreateVector(VARTYPE vt
, LONG lLbound
, ULONG cElements
);
127 SafeArrayRedim(struct tagSAFEARRAY
*psa
, struct tagSAFEARRAYBOUND
*psaboundNew
);
130 /* These are macros that help accessing the VARIANT date type.
132 #if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION)
133 #define V_UNION(A, B) ((A)->n1.n2.n3.B)
134 #define V_VT(A) ((A)->n1.n2.vt)
136 #define V_UNION(A, B) ((A)->B)
137 #define V_VT(A) ((A)->vt)
138 #endif /* cplusplus */
140 #define V_ISBYREF(A) (V_VT(A)&VT_BYREF)
141 #define V_ISARRAY(A) (V_VT(A)&VT_ARRAY)
142 #define V_ISVECTOR(A) (V_VT(A)&VT_VECTOR)
143 #define V_NONE(A) V_I2(A)
145 #define V_UI1(A) V_UNION(A, bVal)
146 #define V_UI1REF(A) V_UNION(A, pbVal)
147 #define V_I2(A) V_UNION(A, iVal)
148 #define V_I2REF(A) V_UNION(A, piVal)
149 #define V_I4(A) V_UNION(A, lVal)
150 #define V_I4REF(A) V_UNION(A, plVal)
151 #define V_R4(A) V_UNION(A, fltVal)
152 #define V_R4REF(A) V_UNION(A, pfltVal)
153 #define V_R8(A) V_UNION(A, dblVal)
154 #define V_R8REF(A) V_UNION(A, pdblVal)
155 #define V_I1(A) V_UNION(A, cVal)
156 #define V_I1REF(A) V_UNION(A, pcVal)
157 #define V_UI2(A) V_UNION(A, uiVal)
158 #define V_UI2REF(A) V_UNION(A, puiVal)
159 #define V_UI4(A) V_UNION(A, ulVal)
160 #define V_UI4REF(A) V_UNION(A, pulVal)
161 #define V_INT(A) V_UNION(A, intVal)
162 #define V_INTREF(A) V_UNION(A, pintVal)
163 #define V_UINT(A) V_UNION(A, uintVal)
164 #define V_UINTREF(A) V_UNION(A, puintVal)
165 #define V_CY(A) V_UNION(A, cyVal)
166 #define V_CYREF(A) V_UNION(A, pcyVal)
167 #define V_DATE(A) V_UNION(A, date)
168 #define V_DATEREF(A) V_UNION(A, pdate)
169 #define V_BSTR(A) V_UNION(A, bstrVal)
170 #define V_BSTRREF(A) V_UNION(A, pbstrVal)
171 #define V_DISPATCH(A) V_UNION(A, pdispVal)
172 #define V_DISPATCHREF(A) V_UNION(A, ppdispVal)
173 #define V_ERROR(A) V_UNION(A, scode)
174 #define V_ERRORREF(A) V_UNION(A, pscode)
175 #define V_BOOL(A) V_UNION(A, boolVal)
176 #define V_BOOLREF(A) V_UNION(A, pboolVal)
177 #define V_UNKNOWN(A) V_UNION(A, punkVal)
178 #define V_UNKNOWNREF(A) V_UNION(A, ppunkVal)
179 #define V_VARIANTREF(A) V_UNION(A, pvarVal)
180 #define V_ARRAY(A) V_UNION(A, parray)
181 #define V_ARRAYREF(A) V_UNION(A, pparray)
182 #define V_BYREF(A) V_UNION(A, byref)
183 #define V_DECIMALREF(A) V_UNION(A, pdecVal)
184 #if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION)
185 #define V_DECIMAL(A) ((A)->n1.decVal)
187 #define V_DECIMAL(A) ((A)->decVal)
194 void WINAPI
VariantInit(struct tagVARIANT
* pvarg
);
195 HRESULT WINAPI
VariantClear(struct tagVARIANT
* pvarg
);
196 HRESULT WINAPI
VariantCopy(struct tagVARIANT
* pvargDest
, struct tagVARIANT
* pvargSrc
);
197 HRESULT WINAPI
VariantCopyInd(struct tagVARIANT
* pvargDest
, struct tagVARIANT
* pvargSrc
);
198 HRESULT WINAPI
VariantChangeType(struct tagVARIANT
* pvargDest
, struct tagVARIANT
* pvargSrc
,
199 USHORT wFlags
, VARTYPE vt
);
200 HRESULT WINAPI
VariantChangeTypeEx(struct tagVARIANT
* pvargDest
, struct tagVARIANT
* pvargSrc
,
201 LCID lcid
, USHORT wFlags
, VARTYPE vt
);
204 * These flags are used for the VariantChangeType and VariantChangeTypeEx APIs.
208 * This one is of general use.
210 #define VARIANT_NOVALUEPROP 0x1
212 * This one is used for conversions of VT_BOOL to VT_BSTR,
213 * the API will convert to "True"|"False" instead of "-1"|"0".
215 #define VARIANT_ALPHABOOL 0x2
217 * This one is used for conversions to or from a VT_BSTR string,
218 * it passes LOCALE_NOUSEROVERRIDE to the core (low-level) coercion routines.
219 * This means it will use the system default locale settings instead of custom
222 #define VARIANT_NOUSEROVERRIDE 0x4
226 * VARTYPE Coercion API
229 /* Omits the date portion and return only the time value.
231 #define VAR_TIMEVALUEONLY ((DWORD)0x00000001)
232 /* Omits the time portion and return only the date value.
234 #define VAR_DATEVALUEONLY ((DWORD)0x00000002)
237 HRESULT WINAPI
VarUI1FromI2(short sIn
, BYTE
* pbOut
);
238 HRESULT WINAPI
VarUI1FromI4(LONG lIn
, BYTE
* pbOut
);
239 HRESULT WINAPI
VarUI1FromR4(FLOAT fltIn
, BYTE
* pbOut
);
240 HRESULT WINAPI
VarUI1FromR8(double dblIn
, BYTE
* pbOut
);
241 HRESULT WINAPI
VarUI1FromDate(DATE dateIn
, BYTE
* pbOut
);
242 HRESULT WINAPI
VarUI1FromBool(VARIANT_BOOL boolIn
, BYTE
* pbOut
);
243 HRESULT WINAPI
VarUI1FromI1(CHAR cIn
, BYTE
*pbOut
);
244 HRESULT WINAPI
VarUI1FromUI2(USHORT uiIn
, BYTE
*pbOut
);
245 HRESULT WINAPI
VarUI1FromUI4(ULONG ulIn
, BYTE
*pbOut
);
246 HRESULT WINAPI
VarUI1FromStr(OLECHAR
* strIn
, LCID lcid
, ULONG dwFlags
, BYTE
* pbOut
);
247 HRESULT WINAPI
VarUI1FromCy(CY cyIn
, BYTE
* pbOut
);
248 HRESULT WINAPI
VarUI1FromDec(DECIMAL
* pdecIn
, BYTE
* pbOut
);
249 HRESULT WINAPI
VarUI1FromDisp(IDispatch
* pdispIn
, LCID lcid
, BYTE
* pbOut
);
251 HRESULT WINAPI
VarI2FromUI1(BYTE bIn
, short* psOut
);
252 HRESULT WINAPI
VarI2FromI4(LONG lIn
, short* psOut
);
253 HRESULT WINAPI
VarI2FromR4(FLOAT fltIn
, short* psOut
);
254 HRESULT WINAPI
VarI2FromR8(double dblIn
, short* psOut
);
255 HRESULT WINAPI
VarI2FromDate(DATE dateIn
, short* psOut
);
256 HRESULT WINAPI
VarI2FromBool(VARIANT_BOOL boolIn
, short* psOut
);
257 HRESULT WINAPI
VarI2FromI1(CHAR cIn
, short*psOut
);
258 HRESULT WINAPI
VarI2FromUI2(USHORT uiIn
, short*psOut
);
259 HRESULT WINAPI
VarI2FromUI4(ULONG ulIn
, short*psOut
);
260 HRESULT WINAPI
VarI2FromStr(OLECHAR
* strIn
, LCID lcid
, ULONG dwFlags
, short* psOut
);
261 HRESULT WINAPI
VarI2FromCy(CY cyIn
, short* psOut
);
262 HRESULT WINAPI
VarI2FromDec(DECIMAL
* pdecIn
, short* psOut
);
263 HRESULT WINAPI
VarI2FromDisp(IDispatch
* pdispIn
, LCID lcid
, short* psOut
);
265 HRESULT WINAPI
VarI4FromUI1(BYTE bIn
, LONG
* plOut
);
266 HRESULT WINAPI
VarI4FromI2(short sIn
, LONG
* plOut
);
267 HRESULT WINAPI
VarI4FromR4(FLOAT fltIn
, LONG
* plOut
);
268 HRESULT WINAPI
VarI4FromR8(double dblIn
, LONG
* plOut
);
269 HRESULT WINAPI
VarI4FromDate(DATE dateIn
, LONG
* plOut
);
270 HRESULT WINAPI
VarI4FromBool(VARIANT_BOOL boolIn
, LONG
* plOut
);
271 HRESULT WINAPI
VarI4FromI1(CHAR cIn
, LONG
* plOut
);
272 HRESULT WINAPI
VarI4FromUI2(USHORT uiIn
, LONG
*plOut
);
273 HRESULT WINAPI
VarI4FromUI4(ULONG ulIn
, LONG
*plOut
);
274 HRESULT WINAPI
VarI4FromStr(OLECHAR
* strIn
, LCID lcid
, ULONG dwFlags
, LONG
* plOut
);
275 HRESULT WINAPI
VarI4FromCy(CY cyIn
, LONG
* plOut
);
276 HRESULT WINAPI
VarI4FromDec(DECIMAL
* pdecIn
, LONG
* plOut
);
277 HRESULT WINAPI
VarI4FromDisp(IDispatch
* pdispIn
, LCID lcid
, LONG
* plOut
);
279 HRESULT WINAPI
VarR4FromUI1(BYTE bIn
, FLOAT
* pfltOut
);
280 HRESULT WINAPI
VarR4FromI2(short sIn
, FLOAT
* pfltOut
);
281 HRESULT WINAPI
VarR4FromI4(LONG lIn
, FLOAT
* pfltOut
);
282 HRESULT WINAPI
VarR4FromR8(double dblIn
, FLOAT
* pfltOut
);
283 HRESULT WINAPI
VarR4FromDate(DATE dateIn
, FLOAT
* pfltOut
);
284 HRESULT WINAPI
VarR4FromBool(VARIANT_BOOL boolIn
, FLOAT
* pfltOut
);
285 HRESULT WINAPI
VarR4FromI1(CHAR cIn
, FLOAT
*pfltOut
);
286 HRESULT WINAPI
VarR4FromUI2(USHORT uiIn
, FLOAT
*pfltOut
);
287 HRESULT WINAPI
VarR4FromUI4(ULONG ulIn
, FLOAT
*pfltOut
);
288 HRESULT WINAPI
VarR4FromStr(OLECHAR
* strIn
, LCID lcid
, ULONG dwFlags
, FLOAT
*pfltOut
);
289 HRESULT WINAPI
VarR4FromCy(CY cyIn
, FLOAT
* pfltOut
);
290 HRESULT WINAPI
VarR4FromDec(DECIMAL
* pdecIn
, FLOAT
* pfltOut
);
291 HRESULT WINAPI
VarR4FromDisp(IDispatch
* pdispIn
, LCID lcid
, FLOAT
* pfltOut
);
293 HRESULT WINAPI
VarR8FromUI1(BYTE bIn
, double* pdblOut
);
294 HRESULT WINAPI
VarR8FromI2(short sIn
, double* pdblOut
);
295 HRESULT WINAPI
VarR8FromI4(LONG lIn
, double* pdblOut
);
296 HRESULT WINAPI
VarR8FromR4(FLOAT fltIn
, double* pdblOut
);
297 HRESULT WINAPI
VarR8FromDate(DATE dateIn
, double* pdblOut
);
298 HRESULT WINAPI
VarR8FromBool(VARIANT_BOOL boolIn
, double* pdblOut
);
299 HRESULT WINAPI
VarR8FromI1(CHAR cIn
, double*pdblOut
);
300 HRESULT WINAPI
VarR8FromUI2(USHORT uiIn
, double*pdblOut
);
301 HRESULT WINAPI
VarR8FromUI4(ULONG ulIn
, double*pdblOut
);
302 HRESULT WINAPI
VarR8FromStr(OLECHAR
*strIn
, LCID lcid
, ULONG dwFlags
, double*pdblOut
);
303 HRESULT WINAPI
VarR8FromCy(CY cyIn
, double* pdblOut
);
304 HRESULT WINAPI
VarR8FromDec(DECIMAL
* pdecIn
, double* pdblOut
);
305 HRESULT WINAPI
VarR8FromDisp(IDispatch
* pdispIn
, LCID lcid
, double* pdblOut
);
307 HRESULT WINAPI
VarDateFromUI1(BYTE bIn
, DATE
* pdateOut
);
308 HRESULT WINAPI
VarDateFromI2(short sIn
, DATE
* pdateOut
);
309 HRESULT WINAPI
VarDateFromI4(LONG lIn
, DATE
* pdateOut
);
310 HRESULT WINAPI
VarDateFromR4(FLOAT fltIn
, DATE
* pdateOut
);
311 HRESULT WINAPI
VarDateFromR8(double dblIn
, DATE
* pdateOut
);
312 HRESULT WINAPI
VarDateFromStr(OLECHAR
*strIn
, LCID lcid
, ULONG dwFlags
, DATE
*pdateOut
);
313 HRESULT WINAPI
VarDateFromI1(CHAR cIn
, DATE
*pdateOut
);
314 HRESULT WINAPI
VarDateFromUI2(USHORT uiIn
, DATE
*pdateOut
);
315 HRESULT WINAPI
VarDateFromUI4(ULONG ulIn
, DATE
*pdateOut
);
316 HRESULT WINAPI
VarDateFromBool(VARIANT_BOOL boolIn
, DATE
* pdateOut
);
317 HRESULT WINAPI
VarDateFromCy(CY cyIn
, DATE
* pdateOut
);
318 HRESULT WINAPI
VarDateFromDec(DECIMAL
* pdecIn
, DATE
* pdateOut
);
319 HRESULT WINAPI
VarDateFromDisp(IDispatch
* pdispIn
, LCID lcid
, DATE
* pdateOut
);
321 HRESULT WINAPI
VarCyFromUI1(BYTE bIn
, CY
* pcyOut
);
322 HRESULT WINAPI
VarCyFromI2(short sIn
, CY
* pcyOut
);
323 HRESULT WINAPI
VarCyFromI4(LONG lIn
, CY
* pcyOut
);
324 HRESULT WINAPI
VarCyFromR4(FLOAT fltIn
, CY
* pcyOut
);
325 HRESULT WINAPI
VarCyFromR8(double dblIn
, CY
* pcyOut
);
326 HRESULT WINAPI
VarCyFromDate(DATE dateIn
, CY
* pcyOut
);
327 HRESULT WINAPI
VarCyFromStr(OLECHAR
*strIn
, LCID lcid
, ULONG dwFlags
, CY
*pcyOut
);
328 HRESULT WINAPI
VarCyFromBool(VARIANT_BOOL boolIn
, CY
* pcyOut
);
329 HRESULT WINAPI
VarCyFromI1(signed char cIn
, CY
*pcyOut
);
330 HRESULT WINAPI
VarCyFromUI2(USHORT uiIn
, CY
*pcyOut
);
331 HRESULT WINAPI
VarCyFromUI4(ULONG ulIn
, CY
*pcyOut
);
332 HRESULT WINAPI
VarCyFromDec(DECIMAL
*pdecIn
, CY
*pcyOut
);
333 HRESULT WINAPI
VarCyFromStr(OLECHAR
* strIn
, LCID lcid
, ULONG dwFlags
, CY
* pcyOut
);
334 HRESULT WINAPI
VarCyFromDisp(IDispatch
* pdispIn
, LCID lcid
, CY
* pcyOut
);
336 HRESULT WINAPI
VarBstrFromUI1(BYTE bVal
, LCID lcid
, ULONG dwFlags
, BSTR
* pbstrOut
);
337 HRESULT WINAPI
VarBstrFromI2(short iVal
, LCID lcid
, ULONG dwFlags
, BSTR
* pbstrOut
);
338 HRESULT WINAPI
VarBstrFromI4(LONG lIn
, LCID lcid
, ULONG dwFlags
, BSTR
* pbstrOut
);
339 HRESULT WINAPI
VarBstrFromR4(FLOAT fltIn
, LCID lcid
, ULONG dwFlags
, BSTR
* pbstrOut
);
340 HRESULT WINAPI
VarBstrFromR8(double dblIn
, LCID lcid
, ULONG dwFlags
, BSTR
* pbstrOut
);
341 HRESULT WINAPI
VarBstrFromDate(DATE dateIn
, LCID lcid
, ULONG dwFlags
, BSTR
* pbstrOut
);
342 HRESULT WINAPI
VarBstrFromBool(VARIANT_BOOL boolIn
, LCID lcid
, ULONG dwFlags
, BSTR
* pbstrOut
);
343 HRESULT WINAPI
VarBstrFromI1(CHAR cIn
, LCID lcid
, ULONG dwFlags
, BSTR
*pbstrOut
);
344 HRESULT WINAPI
VarBstrFromUI2(USHORT uiIn
, LCID lcid
, ULONG dwFlags
, BSTR
*pbstrOut
);
345 HRESULT WINAPI
VarBstrFromUI4(ULONG ulIn
, LCID lcid
, ULONG dwFlags
, BSTR
*pbstrOut
);
346 HRESULT WINAPI
VarBstrFromCy(CY cyIn
, LCID lcid
, ULONG dwFlags
, BSTR
* pbstrOut
);
347 HRESULT WINAPI
VarBstrFromDec(DECIMAL
* pdecIn
, LCID lcid
, ULONG dwFlags
, BSTR
* pbstrOut
);
348 HRESULT WINAPI
VarBstrFromDisp(IDispatch
* pdispIn
, LCID lcid
, ULONG dwFlags
, BSTR
* pbstrOut
);
350 HRESULT WINAPI
VarBoolFromUI1(BYTE bIn
, VARIANT_BOOL
* pboolOut
);
351 HRESULT WINAPI
VarBoolFromI2(short sIn
, VARIANT_BOOL
* pboolOut
);
352 HRESULT WINAPI
VarBoolFromI4(LONG lIn
, VARIANT_BOOL
* pboolOut
);
353 HRESULT WINAPI
VarBoolFromR4(FLOAT fltIn
, VARIANT_BOOL
* pboolOut
);
354 HRESULT WINAPI
VarBoolFromR8(double dblIn
, VARIANT_BOOL
* pboolOut
);
355 HRESULT WINAPI
VarBoolFromDate(DATE dateIn
, VARIANT_BOOL
* pboolOut
);
356 HRESULT WINAPI
VarBoolFromStr(OLECHAR
* strIn
, LCID lcid
, ULONG dwFlags
, VARIANT_BOOL
* pboolOut
);
357 HRESULT WINAPI
VarBoolFromI1(CHAR cIn
, VARIANT_BOOL
*pboolOut
);
358 HRESULT WINAPI
VarBoolFromUI2(USHORT uiIn
, VARIANT_BOOL
*pboolOut
);
359 HRESULT WINAPI
VarBoolFromUI4(ULONG ulIn
, VARIANT_BOOL
*pboolOut
);
360 HRESULT WINAPI
VarBoolFromCy(CY cyIn
, VARIANT_BOOL
* pboolOut
);
361 HRESULT WINAPI
VarBoolFromDec(DECIMAL
* pdecIn
, VARIANT_BOOL
* pboolOut
);
362 HRESULT WINAPI
VarBoolFromDisp(IDispatch
* pdispIn
, LCID lcid
, VARIANT_BOOL
* pboolOut
);
364 HRESULT WINAPI
VarI1FromUI1(BYTE bIn
, CHAR
*pcOut
);
365 HRESULT WINAPI
VarI1FromI2(short uiIn
, CHAR
*pcOut
);
366 HRESULT WINAPI
VarI1FromI4(LONG lIn
, CHAR
*pcOut
);
367 HRESULT WINAPI
VarI1FromR4(FLOAT fltIn
, CHAR
*pcOut
);
368 HRESULT WINAPI
VarI1FromR8(double dblIn
, CHAR
*pcOut
);
369 HRESULT WINAPI
VarI1FromDate(DATE dateIn
, CHAR
*pcOut
);
370 HRESULT WINAPI
VarI1FromStr(OLECHAR
*strIn
, LCID lcid
, ULONG dwFlags
, CHAR
*pcOut
);
371 HRESULT WINAPI
VarI1FromBool(VARIANT_BOOL boolIn
, CHAR
*pcOut
);
372 HRESULT WINAPI
VarI1FromUI2(USHORT uiIn
, CHAR
*pcOut
);
373 HRESULT WINAPI
VarI1FromUI4(ULONG ulIn
, CHAR
*pcOut
);
374 HRESULT WINAPI
VarI1FromCy(CY cyIn
, CHAR
*pcOut
);
375 HRESULT WINAPI
VarI1FromDec(DECIMAL
* pdecIn
, CHAR
* pcOut
);
376 HRESULT WINAPI
VarI1FromDisp(IDispatch
* pdispIn
, LCID lcid
, CHAR
* pcOut
);
378 HRESULT WINAPI
VarUI2FromUI1(BYTE bIn
, USHORT
*puiOut
);
379 HRESULT WINAPI
VarUI2FromI2(short uiIn
, USHORT
*puiOut
);
380 HRESULT WINAPI
VarUI2FromI4(LONG lIn
, USHORT
*puiOut
);
381 HRESULT WINAPI
VarUI2FromR4(FLOAT fltIn
, USHORT
*puiOut
);
382 HRESULT WINAPI
VarUI2FromR8(double dblIn
, USHORT
*puiOut
);
383 HRESULT WINAPI
VarUI2FromDate(DATE dateIn
, USHORT
*puiOut
);
384 HRESULT WINAPI
VarUI2FromStr(OLECHAR
*strIn
, LCID lcid
, ULONG dwFlags
, USHORT
*puiOut
);
385 HRESULT WINAPI
VarUI2FromBool(VARIANT_BOOL boolIn
, USHORT
*puiOut
);
386 HRESULT WINAPI
VarUI2FromI1(CHAR cIn
, USHORT
*puiOut
);
387 HRESULT WINAPI
VarUI2FromUI4(ULONG ulIn
, USHORT
*puiOut
);
388 HRESULT WINAPI
VarUI2FromCy(CY cyIn
, USHORT
*puiOut
);
389 HRESULT WINAPI
VarUI2FromDec(DECIMAL
* pdecIn
, USHORT
* puiOut
);
390 HRESULT WINAPI
VarUI2FromDisp(IDispatch
* pdispIn
, LCID lcid
, USHORT
* puiOut
);
392 HRESULT WINAPI
VarUI4FromStr(OLECHAR
*strIn
, LCID lcid
, ULONG dwFlags
, ULONG
*pulOut
);
393 HRESULT WINAPI
VarUI4FromUI1(BYTE bIn
, ULONG
*pulOut
);
394 HRESULT WINAPI
VarUI4FromI2(short uiIn
, ULONG
*pulOut
);
395 HRESULT WINAPI
VarUI4FromI4(LONG lIn
, ULONG
*pulOut
);
396 HRESULT WINAPI
VarUI4FromR4(FLOAT fltIn
, ULONG
*pulOut
);
397 HRESULT WINAPI
VarUI4FromR8(double dblIn
, ULONG
*pulOut
);
398 HRESULT WINAPI
VarUI4FromDate(DATE dateIn
, ULONG
*pulOut
);
399 HRESULT WINAPI
VarUI4FromBool(VARIANT_BOOL boolIn
, ULONG
*pulOut
);
400 HRESULT WINAPI
VarUI4FromI1(CHAR cIn
, ULONG
*pulOut
);
401 HRESULT WINAPI
VarUI4FromUI2(USHORT uiIn
, ULONG
*pulOut
);
402 HRESULT WINAPI
VarUI4FromCy(CY cyIn
, ULONG
*pulOut
);
403 HRESULT WINAPI
VarUI4FromDec(DECIMAL
* pdecIn
, ULONG
* pulOut
);
404 HRESULT WINAPI
VarUI4FromDisp(IDispatch
* pdispIn
, LCID lcid
, ULONG
* pulOut
);
406 HRESULT WINAPI
VarDecFromUI1(BYTE bIn
, DECIMAL
*pdecOut
);
407 HRESULT WINAPI
VarDecFromI2(short uiIn
, DECIMAL
*pdecOut
);
408 HRESULT WINAPI
VarDecFromI4(LONG lIn
, DECIMAL
*pdecOut
);
409 HRESULT WINAPI
VarDecFromR4(FLOAT fltIn
, DECIMAL
*pdecOut
);
410 HRESULT WINAPI
VarDecFromR8(double dblIn
, DECIMAL
*pdecOut
);
411 HRESULT WINAPI
VarDecFromDate(DATE dateIn
, DECIMAL
*pdecOut
);
412 HRESULT WINAPI
VarDecFromStr(OLECHAR
* strIn
, LCID lcid
, ULONG dwFlags
, DECIMAL
* pdecOut
);
413 HRESULT WINAPI
VarDecFromBool(VARIANT_BOOL boolIn
, DECIMAL
* pdecOut
);
414 HRESULT WINAPI
VarDecFromI1(CHAR cIn
, DECIMAL
* pdecOut
);
415 HRESULT WINAPI
VarDecFromUI2(USHORT uiIn
, DECIMAL
* pdecOut
);
416 HRESULT WINAPI
VarDecFromUI4(ULONG ulIn
, DECIMAL
* pdecOut
);
417 HRESULT WINAPI
VarDecFromCy(CY cyIn
, DECIMAL
* pdecOut
);
418 HRESULT WINAPI
VarDecFromDisp(IDispatch
* pdispIn
, LCID lcid
, DECIMAL
* pdecOut
);
422 #define VarUI4FromUI4( in, pOut ) ( *(pOut) = (in) )
423 #define VarI4FromI4( in, pOut ) ( *(pOut) = (in) )
425 #define VarUI1FromInt VarUI1FromI4
426 #define VarUI1FromUint VarUI1FromUI4
427 #define VarI2FromInt VarI2FromI4
428 #define VarI2FromUint VarI2FromUI4
429 #define VarI4FromInt VarI4FromI4
430 #define VarI4FromUint VarI4FromUI4
431 #define VarR4FromInt VarR4FromI4
432 #define VarR4FromUint VarR4FromUI4
433 #define VarR8FromInt VarR8FromI4
434 #define VarR8FromUint VarR8FromUI4
435 #define VarDateFromInt VarDateFromI4
436 #define VarDateFromUint VarDateFromUI4
437 #define VarCyFromInt VarCyFromI4
438 #define VarCyFromUint VarCyFromUI4
439 #define VarBstrFromInt VarBstrFromI4
440 #define VarBstrFromUint VarBstrFromUI4
441 #define VarBoolFromInt VarBoolFromI4
442 #define VarBoolFromUint VarBoolFromUI4
443 #define VarI1FromInt VarI1FromI4
444 #define VarI1FromUint VarI1FromUI4
445 #define VarUI2FromInt VarUI2FromI4
446 #define VarUI2FromUint VarUI2FromUI4
447 #define VarUI4FromInt VarUI4FromI4
448 #define VarUI4FromUint VarUI4FromUI4
449 #define VarDecFromInt VarDecFromI4
450 #define VarDecFromUint VarDecFromUI4
451 #define VarIntFromUI1 VarI4FromUI1
452 #define VarIntFromI2 VarI4FromI2
453 #define VarIntFromI4 VarI4FromI4
454 #define VarIntFromR4 VarI4FromR4
455 #define VarIntFromR8 VarI4FromR8
456 #define VarIntFromDate VarI4FromDate
457 #define VarIntFromCy VarI4FromCy
458 #define VarIntFromStr VarI4FromStr
459 #define VarIntFromDisp VarI4FromDisp
460 #define VarIntFromBool VarI4FromBool
461 #define VarIntFromI1 VarI4FromI1
462 #define VarIntFromUI2 VarI4FromUI2
463 #define VarIntFromUI4 VarI4FromUI4
464 #define VarIntFromDec VarI4FromDec
465 #define VarIntFromUint VarI4FromUI4
466 #define VarUintFromUI1 VarUI4FromUI1
467 #define VarUintFromI2 VarUI4FromI2
468 #define VarUintFromI4 VarUI4FromI4
469 #define VarUintFromR4 VarUI4FromR4
470 #define VarUintFromR8 VarUI4FromR8
471 #define VarUintFromDate VarUI4FromDate
472 #define VarUintFromCy VarUI4FromCy
473 #define VarUintFromStr VarUI4FromStr
474 #define VarUintFromDisp VarUI4FromDisp
475 #define VarUintFromBool VarUI4FromBool
476 #define VarUintFromI1 VarUI4FromI1
477 #define VarUintFromUI2 VarUI4FromUI2
478 #define VarUintFromUI4 VarUI4FromUI4
479 #define VarUintFromDec VarUI4FromDec
480 #define VarUintFromInt VarUI4FromI4
483 * Variant Math operations
488 #define VARCMP_NULL 3
490 HRESULT WINAPI
VarAdd(LPVARIANT
,LPVARIANT
,LPVARIANT
);
491 HRESULT WINAPI
VarAnd(LPVARIANT
,LPVARIANT
,LPVARIANT
);
492 HRESULT WINAPI
VarCat(LPVARIANT
,LPVARIANT
,LPVARIANT
);
493 HRESULT WINAPI
VarDiv(LPVARIANT
,LPVARIANT
,LPVARIANT
);
494 HRESULT WINAPI
VarEqv(LPVARIANT
,LPVARIANT
,LPVARIANT
);
495 HRESULT WINAPI
VarIdiv(LPVARIANT
,LPVARIANT
,LPVARIANT
);
496 HRESULT WINAPI
VarImp(LPVARIANT
,LPVARIANT
,LPVARIANT
);
497 HRESULT WINAPI
VarMod(LPVARIANT
,LPVARIANT
,LPVARIANT
);
498 HRESULT WINAPI
VarMul(LPVARIANT
,LPVARIANT
,LPVARIANT
);
499 HRESULT WINAPI
VarOr(LPVARIANT
,LPVARIANT
,LPVARIANT
);
500 HRESULT WINAPI
VarPow(LPVARIANT
,LPVARIANT
,LPVARIANT
);
501 HRESULT WINAPI
VarSub(LPVARIANT
,LPVARIANT
,LPVARIANT
);
502 HRESULT WINAPI
VarXor(LPVARIANT
,LPVARIANT
,LPVARIANT
);
504 HRESULT WINAPI
VarAbs(LPVARIANT
,LPVARIANT
);
505 HRESULT WINAPI
VarFix(LPVARIANT
,LPVARIANT
);
506 HRESULT WINAPI
VarInt(LPVARIANT
,LPVARIANT
);
507 HRESULT WINAPI
VarNeg(LPVARIANT
,LPVARIANT
);
508 HRESULT WINAPI
VarNot(LPVARIANT
,LPVARIANT
);
510 HRESULT WINAPI
VarRound(LPVARIANT
,int,LPVARIANT
);
512 HRESULT WINAPI
VarCmp(LPVARIANT
,LPVARIANT
,LCID
,ULONG
);
516 typedef struct tagPARAMDATA
{
517 OLECHAR
* szName
; /* parameter name */
518 VARTYPE vt
; /* parameter type */
519 } PARAMDATA
, * LPPARAMDATA
;
521 typedef struct tagMETHODDATA
{
522 OLECHAR
* szName
; /* method name */
523 PARAMDATA
* ppdata
; /* pointer to an array of PARAMDATAs */
524 DISPID dispid
; /* method ID */
525 UINT iMeth
; /* method index */
526 CALLCONV cc
; /* calling convention */
527 UINT cArgs
; /* count of arguments */
528 WORD wFlags
; /* same wFlags as on IDispatch::Invoke() */
530 } METHODDATA
, * LPMETHODDATA
;
532 typedef struct tagINTERFACEDATA
{
533 METHODDATA
* pmethdata
; /* pointer to an array of METHODDATAs */
534 UINT cMembers
; /* count of members */
535 } INTERFACEDATA
, * LPINTERFACEDATA
;
537 typedef enum tagREGKIND
558 #define NUMPRS_LEADING_WHITE 0x0001
559 #define NUMPRS_TRAILING_WHITE 0x0002
560 #define NUMPRS_LEADING_PLUS 0x0004
561 #define NUMPRS_TRAILING_PLUS 0x0008
562 #define NUMPRS_LEADING_MINUS 0x0010
563 #define NUMPRS_TRAILING_MINUS 0x0020
564 #define NUMPRS_HEX_OCT 0x0040
565 #define NUMPRS_PARENS 0x0080
566 #define NUMPRS_DECIMAL 0x0100
567 #define NUMPRS_THOUSANDS 0x0200
568 #define NUMPRS_CURRENCY 0x0400
569 #define NUMPRS_EXPONENT 0x0800
570 #define NUMPRS_USE_ALL 0x1000
571 #define NUMPRS_STD 0x1FFF
573 #define NUMPRS_NEG 0x10000
574 #define NUMPRS_INEXACT 0x20000
576 #define VTBIT_I1 (1 << VT_I1)
577 #define VTBIT_UI1 (1 << VT_UI1)
578 #define VTBIT_I2 (1 << VT_I2)
579 #define VTBIT_UI2 (1 << VT_UI2)
580 #define VTBIT_I4 (1 << VT_I4)
581 #define VTBIT_UI4 (1 << VT_UI4)
582 #define VTBIT_R4 (1 << VT_R4)
583 #define VTBIT_R8 (1 << VT_R8)
584 #define VTBIT_CY (1 << VT_CY)
585 #define VTBIT_DECIMAL (1 << VT_DECIMAL)
587 HRESULT WINAPI
VarParseNumFromStr(OLECHAR
*,LCID
,ULONG
,NUMPARSE
*,BYTE
*);
588 HRESULT WINAPI
VarNumFromParseNum(NUMPARSE
*,BYTE
*,ULONG
,VARIANT
*);
590 INT WINAPI
DosDateTimeToVariantTime(USHORT
,USHORT
,DATE
*);
591 INT WINAPI
VariantTimeToDosDateTime(DATE
, USHORT
*, USHORT
*);
593 HRESULT WINAPI
VariantTimeToSystemTime(double,LPSYSTEMTIME
);
594 HRESULT WINAPI
SystemTimeToVariantTime(LPSYSTEMTIME
,double*);
596 HRESULT WINAPI
VarDateFromUdate(UDATE
*,ULONG
, DATE
*);
597 HRESULT WINAPI
VarUdateFromDate(DATE
, ULONG
, UDATE
*);
599 ULONG WINAPI
LHashValOfNameSysA(SYSKIND syskind
,LCID lcid
,LPCSTR szName
);
600 ULONG WINAPI
LHashValOfNameSys (SYSKIND syskind
,LCID lcid
,LPCOLESTR szName
);
602 HRESULT WINAPI
DispGetParam(DISPPARAMS
* pdispparams
, UINT position
,
603 VARTYPE vtTarg
, VARIANT
* pvarResult
, UINT
* puArgErr
);
604 HRESULT WINAPI
DispGetIDsOfNames(ITypeInfo
* ptinfo
, OLECHAR
** rgszNames
,
605 UINT cNames
, DISPID
* rgdispid
);
606 HRESULT WINAPI
DispInvoke(void* _this
, ITypeInfo
* ptinfo
, DISPID dispidMember
,
607 WORD wFlags
, DISPPARAMS
* pparams
, VARIANT
* pvarResult
,
608 EXCEPINFO
* pexcepinfo
, UINT
* puArgErr
);
609 HRESULT WINAPI
CreateDispTypeInfo(INTERFACEDATA
* pidata
, LCID lcid
,
610 ITypeInfo
** pptinfo
);
611 HRESULT WINAPI
CreateStdDispatch(IUnknown
* punkOuter
, void* pvThis
,
612 ITypeInfo
* ptinfo
, IUnknown
** ppunkStdDisp
);
613 HRESULT WINAPI
DispCallFunc(void* pvInstance
, ULONG oVft
, CALLCONV cc
,
614 VARTYPE vtReturn
, UINT cActuals
, VARTYPE
* prgvt
,
615 VARIANTARG
** prgpvarg
, VARIANT
* pvargResult
);
622 HRESULT WINAPI
CreateTypeLib(SYSKIND
,const OLECHAR
*,ICreateTypeLib
**);
623 HRESULT WINAPI
CreateTypeLib2(SYSKIND
,LPCOLESTR
,ICreateTypeLib2
**);
624 HRESULT WINAPI
LoadRegTypeLib(REFGUID
,WORD
,WORD
,LCID
,ITypeLib
**);
625 HRESULT WINAPI
LoadTypeLib(const OLECHAR
*,ITypeLib
**);
626 HRESULT WINAPI
LoadTypeLibEx(LPCOLESTR
,REGKIND
,ITypeLib
**);
627 HRESULT WINAPI
QueryPathOfRegTypeLib(REFGUID
,WORD
,WORD
,LCID
,LPBSTR
);
628 HRESULT WINAPI
RegisterTypeLib(ITypeLib
*,OLECHAR
*,OLECHAR
*);
629 HRESULT WINAPI
UnRegisterTypeLib(REFGUID
,WORD
,WORD
,LCID
,SYSKIND
);
636 #endif /*__WINE_OLEAUTO_H*/