Hi,
Part 4 of oleaut32 updates.
Cheers,
Jon
License: X11
Changelog:
Jon Griffiths <jon_p_griffiths@yahoo.com>
+dlls/oleaut32/i1.c dlls/oleaut32/i2.c dlls/oleaut32/i4.c
dlls/oleaut32/r4.c dlls/oleaut32/Makefile.in
dlls/oleaut32/oleaut32.spec
dlls/oleaut32/variant.c
Implement/document i1/ui1/i2/ui2/i4/ui4/r4 low-level calls
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
diff -uP wine-diff/dlls/oleaut32/i1.c wine-develop/dlls/oleaut32/i1.c
--- wine-diff/dlls/oleaut32/i1.c 1970-01-01 01:00:00.000000000 +0100
+++ wine-develop/dlls/oleaut32/i1.c 2003-10-06 18:31:23.000000000 +0100
@@ -0,0 +1,637 @@
+/*
+ * Variant I1 and UI1 Functions
+ *
+ * Copyright 2003 Jon Griffiths
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+#include "wine/debug.h"
+#include "winbase.h"
+#include "variant.h"
+
+/************************************************************************
+ * VarI1FromUI1 (OLEAUT32.244)
+ *
+ * Convert a VT_UI1 to a VT_I1.
+ *
+ * PARAMS
+ * bIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI1FromUI1(BYTE bIn, signed char* pcOut)
+{
+ return _VarI1FromUI1(bIn, pcOut);
+}
+
+/************************************************************************
+ * VarI1FromI2 (OLEAUT32.245)
+ *
+ * Convert a VT_I2 to a VT_I1.
+ *
+ * PARAMS
+ * sIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI1FromI2(SHORT sIn, signed char* pcOut)
+{
+ return _VarI1FromI2(sIn, pcOut);
+}
+
+/************************************************************************
+ * VarI1FromI4 (OLEAUT32.246)
+ *
+ * Convert a VT_I4 to a VT_I1.
+ *
+ * PARAMS
+ * iIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI1FromI4(LONG iIn, signed char* pcOut)
+{
+ return _VarI1FromI4(iIn, pcOut);
+}
+
+/************************************************************************
+ * VarI1FromR4 (OLEAUT32.247)
+ *
+ * Convert a VT_R4 to a VT_I1.
+ *
+ * PARAMS
+ * fltIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI1FromR4(FLOAT fltIn, signed char* pcOut)
+{
+ return _VarI1FromR4(fltIn, pcOut);
+}
+
+/************************************************************************
+ * VarI1FromR8 (OLEAUT32.248)
+ *
+ * Convert a VT_R8 to a VT_I1.
+ *
+ * PARAMS
+ * dblIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ *
+ * NOTES
+ * See VarI8FromR8() for details concerning rounding.
+ */
+HRESULT WINAPI VarI1FromR8(double dblIn, signed char* pcOut)
+{
+ if (dblIn < (double)I1_MIN || dblIn > (double)I1_MAX)
+ return DISP_E_OVERFLOW;
+ OLEAUT32_DutchRound(CHAR, dblIn, *pcOut);
+ return S_OK;
+}
+
+/************************************************************************
+ * VarI1FromDate (OLEAUT32.249)
+ *
+ * Convert a VT_DATE to a VT_I1.
+ *
+ * PARAMS
+ * dateIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI1FromDate(DATE dateIn, signed char* pcOut)
+{
+ return _VarI1FromDate(dateIn, pcOut);
+}
+
+/************************************************************************
+ * VarI1FromCy (OLEAUT32.250)
+ *
+ * Convert a VT_CY to a VT_I1.
+ *
+ * PARAMS
+ * cyIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI1FromCy(CY cyIn, signed char* pcOut)
+{
+ LONG i = I1_MAX + 1;
+
+ _VarI4FromCy(cyIn, &i);
+ return _VarI1FromI4(i, pcOut);
+}
+
+/************************************************************************
+ * VarI1FromStr (OLEAUT32.251)
+ *
+ * Convert a VT_BSTR to a VT_I1.
+ *
+ * PARAMS
+ * strIn [I] Source
+ * lcid [I] LCID for the conversion
+ * dwFlags [I] VAR_ flags from "oleauto.h"
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarI1FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, signed char* pcOut)
+{
+ return _VarI1FromStr(strIn, lcid, dwFlags, pcOut);
+}
+
+/************************************************************************
+ * VarI1FromDisp (OLEAUT32.252)
+ *
+ * Convert a VT_DISPATCH to a VT_I1.
+ *
+ * PARAMS
+ * pdispIn [I] Source
+ * lcid [I] LCID for conversion
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarI1FromDisp(IDispatch* pdispIn, LCID lcid, signed char* pcOut)
+{
+ return _VarI1FromDisp(pdispIn, lcid, pcOut);
+}
+
+/************************************************************************
+ * VarI1FromBool (OLEAUT32.253)
+ *
+ * Convert a VT_BOOL to a VT_I1.
+ *
+ * PARAMS
+ * boolIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarI1FromBool(VARIANT_BOOL boolIn, signed char* pcOut)
+{
+ return _VarI1FromBool(boolIn, pcOut);
+}
+
+/************************************************************************
+ * VarI1FromUI2 (OLEAUT32.254)
+ *
+ * Convert a VT_UI2 to a VT_I1.
+ *
+ * PARAMS
+ * usIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI1FromUI2(USHORT usIn, signed char* pcOut)
+{
+ return _VarI1FromUI2(usIn, pcOut);
+}
+
+/************************************************************************
+ * VarI1FromUI4 (OLEAUT32.255)
+ *
+ * Convert a VT_UI4 to a VT_I1.
+ *
+ * PARAMS
+ * ulIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarI1FromUI4(ULONG ulIn, signed char* pcOut)
+{
+ return _VarI1FromUI4(ulIn, pcOut);
+}
+
+/************************************************************************
+ * VarI1FromDec (OLEAUT32.256)
+ *
+ * Convert a VT_DECIMAL to a VT_I1.
+ *
+ * PARAMS
+ * pDecIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI1FromDec(DECIMAL *pdecIn, signed char* pcOut)
+{
+ LONG64 i64;
+ HRESULT hRet;
+
+ hRet = _VarI8FromDec(pdecIn, &i64);
+
+ if (SUCCEEDED(hRet))
+ hRet = _VarI1FromI8(i64, pcOut);
+ return hRet;
+}
+
+/************************************************************************
+ * VarI1FromI8 (OLEAUT32.376)
+ *
+ * Convert a VT_I8 to a VT_I1.
+ *
+ * PARAMS
+ * llIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI1FromI8(LONG64 llIn, signed char* pcOut)
+{
+ return _VarI1FromI8(llIn, pcOut);
+}
+
+/************************************************************************
+ * VarI1FromUI8 (OLEAUT32.377)
+ *
+ * Convert a VT_UI8 to a VT_I1.
+ *
+ * PARAMS
+ * ullIn [I] Source
+ * pcOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI1FromUI8(ULONG64 ullIn, signed char* pcOut)
+{
+ return _VarI1FromUI8(ullIn, pcOut);
+}
+
+/************************************************************************
+ * VarUI1FromI2 (OLEAUT32.130)
+ *
+ * Convert a VT_I2 to a VT_UI1.
+ *
+ * PARAMS
+ * sIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI1FromI2(SHORT sIn, BYTE* pbOut)
+{
+ return _VarUI1FromI2(sIn, pbOut);
+}
+
+/************************************************************************
+ * VarUI1FromI4 (OLEAUT32.131)
+ *
+ * Convert a VT_I4 to a VT_UI1.
+ *
+ * PARAMS
+ * iIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI1FromI4(LONG iIn, BYTE* pbOut)
+{
+ return _VarUI1FromI4(iIn, pbOut);
+}
+
+/************************************************************************
+ * VarUI1FromR4 (OLEAUT32.132)
+ *
+ * Convert a VT_R4 to a VT_UI1.
+ *
+ * PARAMS
+ * fltIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarUI1FromR4(FLOAT fltIn, BYTE* pbOut)
+{
+ return _VarUI1FromR4(fltIn, pbOut);
+}
+
+/************************************************************************
+ * VarUI1FromR8 (OLEAUT32.133)
+ *
+ * Convert a VT_R8 to a VT_UI1.
+ *
+ * PARAMS
+ * dblIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ *
+ * NOTES
+ * See VarI8FromR8() for details concerning rounding.
+ */
+HRESULT WINAPI VarUI1FromR8(double dblIn, BYTE* pbOut)
+{
+ if (dblIn < -0.5 || dblIn > (double)UI1_MAX)
+ return DISP_E_OVERFLOW;
+ OLEAUT32_DutchRound(BYTE, dblIn, *pbOut);
+ return S_OK;
+}
+
+/************************************************************************
+ * VarUI1FromCy (OLEAUT32.134)
+ *
+ * Convert a VT_CY to a VT_UI1.
+ *
+ * PARAMS
+ * cyIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ *
+ * NOTES
+ * Negative values >= -5000 will be converted to 0.
+ */
+HRESULT WINAPI VarUI1FromCy(CY cyIn, BYTE* pbOut)
+{
+ ULONG i = UI1_MAX + 1;
+
+ _VarUI4FromCy(cyIn, &i);
+ return _VarUI1FromUI4(i, pbOut);
+}
+
+/************************************************************************
+ * VarUI1FromDate (OLEAUT32.135)
+ *
+ * Convert a VT_DATE to a VT_UI1.
+ *
+ * PARAMS
+ * dateIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI1FromDate(DATE dateIn, BYTE* pbOut)
+{
+ return _VarUI1FromDate(dateIn, pbOut);
+}
+
+/************************************************************************
+ * VarUI1FromStr (OLEAUT32.136)
+ *
+ * Convert a VT_BSTR to a VT_UI1.
+ *
+ * PARAMS
+ * strIn [I] Source
+ * lcid [I] LCID for the conversion
+ * dwFlags [I] VAR_ flags from "oleauto.h"
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarUI1FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, BYTE* pbOut)
+{
+ return _VarUI1FromStr(strIn, lcid, dwFlags, pbOut);
+}
+
+/************************************************************************
+ * VarUI1FromDisp (OLEAUT32.137)
+ *
+ * Convert a VT_DISPATCH to a VT_UI1.
+ *
+ * PARAMS
+ * pdispIn [I] Source
+ * lcid [I] LCID for conversion
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarUI1FromDisp(IDispatch* pdispIn, LCID lcid, BYTE* pbOut)
+{
+ return _VarUI1FromDisp(pdispIn, lcid, pbOut);
+}
+
+/************************************************************************
+ * VarUI1FromBool (OLEAUT32.138)
+ *
+ * Convert a VT_BOOL to a VT_UI1.
+ *
+ * PARAMS
+ * boolIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarUI1FromBool(VARIANT_BOOL boolIn, BYTE* pbOut)
+{
+ return _VarUI1FromBool(boolIn, pbOut);
+}
+
+/************************************************************************
+ * VarUI1FromI1 (OLEAUT32.237)
+ *
+ * Convert a VT_I1 to a VT_UI1.
+ *
+ * PARAMS
+ * cIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI1FromI1(signed char cIn, BYTE* pbOut)
+{
+ return _VarUI1FromI1(cIn, pbOut);
+}
+
+/************************************************************************
+ * VarUI1FromUI2 (OLEAUT32.238)
+ *
+ * Convert a VT_UI2 to a VT_UI1.
+ *
+ * PARAMS
+ * usIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI1FromUI2(USHORT usIn, BYTE* pbOut)
+{
+ return _VarUI1FromUI2(usIn, pbOut);
+}
+
+/************************************************************************
+ * VarUI1FromUI4 (OLEAUT32.239)
+ *
+ * Convert a VT_UI4 to a VT_UI1.
+ *
+ * PARAMS
+ * ulIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI1FromUI4(ULONG ulIn, BYTE* pbOut)
+{
+ return _VarUI1FromUI4(ulIn, pbOut);
+}
+
+/************************************************************************
+ * VarUI1FromDec (OLEAUT32.240)
+ *
+ * Convert a VT_DECIMAL to a VT_UI1.
+ *
+ * PARAMS
+ * pDecIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI1FromDec(DECIMAL *pdecIn, BYTE* pbOut)
+{
+ LONG64 i64;
+ HRESULT hRet;
+
+ hRet = _VarI8FromDec(pdecIn, &i64);
+
+ if (SUCCEEDED(hRet))
+ hRet = _VarUI1FromI8(i64, pbOut);
+ return hRet;
+}
+
+/************************************************************************
+ * VarUI1FromI8 (OLEAUT32.372)
+ *
+ * Convert a VT_I8 to a VT_UI1.
+ *
+ * PARAMS
+ * llIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI1FromI8(LONG64 llIn, BYTE* pbOut)
+{
+ return _VarUI1FromI8(llIn, pbOut);
+}
+
+/************************************************************************
+ * VarUI1FromUI8 (OLEAUT32.373)
+ *
+ * Convert a VT_UI8 to a VT_UI1.
+ *
+ * PARAMS
+ * ullIn [I] Source
+ * pbOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI1FromUI8(ULONG64 ullIn, BYTE* pbOut)
+{
+ return _VarUI1FromUI8(ullIn, pbOut);
+}
diff -uP wine-diff/dlls/oleaut32/i2.c wine-develop/dlls/oleaut32/i2.c
--- wine-diff/dlls/oleaut32/i2.c 1970-01-01 01:00:00.000000000 +0100
+++ wine-develop/dlls/oleaut32/i2.c 2003-10-06 18:31:29.000000000 +0100
@@ -0,0 +1,609 @@
+/*
+ * Variant I2 and UI2 Functions
+ *
+ * Copyright 2003 Jon Griffiths
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+#include "wine/debug.h"
+#include "winbase.h"
+#include "variant.h"
+
+/************************************************************************
+ * VarI2FromUI1 (OLEAUT32.48)
+ *
+ * Convert a VT_UI2 to a VT_I2.
+ *
+ * PARAMS
+ * bIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarI2FromUI1(BYTE bIn, SHORT* psOut)
+{
+ return _VarI2FromUI1(bIn, psOut);
+}
+
+/************************************************************************
+ * VarI2FromI4 (OLEAUT32.49)
+ *
+ * Convert a VT_I4 to a VT_I2.
+ *
+ * PARAMS
+ * iIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI2FromI4(LONG iIn, SHORT* psOut)
+{
+ return _VarI2FromI4(iIn, psOut);
+}
+
+/************************************************************************
+ * VarI2FromR4 (OLEAUT32.50)
+ *
+ * Convert a VT_R4 to a VT_I2.
+ *
+ * PARAMS
+ * fltIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI2FromR4(FLOAT fltIn, SHORT* psOut)
+{
+ return _VarI2FromR4(fltIn, psOut);
+}
+
+/************************************************************************
+ * VarI2FromR8 (OLEAUT32.51)
+ *
+ * Convert a VT_R8 to a VT_I2.
+ *
+ * PARAMS
+ * dblIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ *
+ * NOTES
+ * See VarI8FromR8() for details concerning rounding.
+ */
+HRESULT WINAPI VarI2FromR8(double dblIn, SHORT* psOut)
+{
+ if (dblIn < (double)I2_MIN || dblIn > (double)I2_MAX)
+ return DISP_E_OVERFLOW;
+ OLEAUT32_DutchRound(SHORT, dblIn, *psOut);
+ return S_OK;
+}
+
+/************************************************************************
+ * VarI2FromCy (OLEAUT32.52)
+ *
+ * Convert a VT_CY to a VT_I2.
+ *
+ * PARAMS
+ * cyIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI2FromCy(CY cyIn, SHORT* psOut)
+{
+ LONG i = I2_MAX + 1;
+
+ _VarI4FromCy(cyIn, &i);
+ return _VarI2FromI4(i, psOut);
+}
+
+/************************************************************************
+ * VarI2FromDate (OLEAUT32.53)
+ *
+ * Convert a VT_DATE to a VT_I2.
+ *
+ * PARAMS
+ * dateIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI2FromDate(DATE dateIn, SHORT* psOut)
+{
+ return _VarI2FromDate(dateIn, psOut);
+}
+
+/************************************************************************
+ * VarI2FromStr (OLEAUT32.54)
+ *
+ * Convert a VT_BSTR to a VT_I2.
+ *
+ * PARAMS
+ * strIn [I] Source
+ * lcid [I] LCID for the conversion
+ * dwFlags [I] VAR_ flags from "oleauto.h"
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if any parameter is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarI2FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, SHORT* psOut)
+{
+ return _VarI2FromStr(strIn, lcid, dwFlags, psOut);
+}
+
+/************************************************************************
+ * VarI2FromDisp (OLEAUT32.55)
+ *
+ * Convert a VT_DISPATCH to a VT_I2.
+ *
+ * PARAMS
+ * pdispIn [I] Source
+ * lcid [I] LCID for conversion
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if pdispIn is invalid,
+ * DISP_E_OVERFLOW, if the value will not fit in the destination,
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarI2FromDisp(IDispatch* pdispIn, LCID lcid, SHORT* psOut)
+{
+ return _VarI2FromDisp(pdispIn, lcid, psOut);
+}
+
+/************************************************************************
+ * VarI2FromBool (OLEAUT32.56)
+ *
+ * Convert a VT_BOOL to a VT_I2.
+ *
+ * PARAMS
+ * boolIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarI2FromBool(VARIANT_BOOL boolIn, SHORT* psOut)
+{
+ return _VarI2FromBool(boolIn, psOut);
+}
+
+/************************************************************************
+ * VarI2FromI1 (OLEAUT32.205)
+ *
+ * Convert a VT_I1 to a VT_I2.
+ *
+ * PARAMS
+ * cIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarI2FromI1(signed char cIn, SHORT* psOut)
+{
+ return _VarI2FromI1(cIn, psOut);
+}
+
+/************************************************************************
+ * VarI2FromUI2 (OLEAUT32.206)
+ *
+ * Convert a VT_UI2 to a VT_I2.
+ *
+ * PARAMS
+ * usIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI2FromUI2(USHORT usIn, SHORT* psOut)
+{
+ return _VarI2FromUI2(usIn, psOut);
+}
+
+/************************************************************************
+ * VarI2FromUI4 (OLEAUT32.207)
+ *
+ * Convert a VT_UI4 to a VT_I2.
+ *
+ * PARAMS
+ * ulIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI2FromUI4(ULONG ulIn, SHORT* psOut)
+{
+ return _VarI2FromUI4(ulIn, psOut);
+}
+
+/************************************************************************
+ * VarI2FromDec (OLEAUT32.208)
+ *
+ * Convert a VT_DECIMAL to a VT_I2.
+ *
+ * PARAMS
+ * pDecIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI2FromDec(DECIMAL *pdecIn, SHORT* psOut)
+{
+ LONG64 i64;
+ HRESULT hRet;
+
+ hRet = _VarI8FromDec(pdecIn, &i64);
+
+ if (SUCCEEDED(hRet))
+ hRet = _VarI2FromI8(i64, psOut);
+ return hRet;
+}
+
+/************************************************************************
+ * VarI2FromI8 (OLEAUT32.346)
+ *
+ * Convert a VT_I8 to a VT_I2.
+ *
+ * PARAMS
+ * llIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI2FromI8(LONG64 llIn, SHORT* psOut)
+{
+ return _VarI2FromI8(llIn, psOut);
+}
+
+/************************************************************************
+ * VarI2FromUI8 (OLEAUT32.347)
+ *
+ * Convert a VT_UI8 to a VT_I2.
+ *
+ * PARAMS
+ * ullIn [I] Source
+ * psOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI2FromUI8(ULONG64 ullIn, SHORT* psOut)
+{
+ return _VarI2FromUI8(ullIn, psOut);
+}
+
+/************************************************************************
+ * VarUI2FromUI1 (OLEAUT32.257)
+ *
+ * Convert a VT_UI1 to a VT_UI2.
+ *
+ * PARAMS
+ * bIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarUI2FromUI1(BYTE bIn, USHORT* pusOut)
+{
+ return _VarUI2FromUI1(bIn, pusOut);
+}
+
+/************************************************************************
+ * VarUI2FromI2 (OLEAUT32.258)
+ *
+ * Convert a VT_I2 to a VT_UI2.
+ *
+ * PARAMS
+ * sIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI2FromI2(SHORT sIn, USHORT* pusOut)
+{
+ return _VarUI2FromI2(sIn, pusOut);
+}
+
+/************************************************************************
+ * VarUI2FromI4 (OLEAUT32.259)
+ *
+ * Convert a VT_I4 to a VT_UI2.
+ *
+ * PARAMS
+ * iIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI2FromI4(LONG iIn, USHORT* pusOut)
+{
+ return _VarUI2FromI4(iIn, pusOut);
+}
+
+/************************************************************************
+ * VarUI2FromR4 (OLEAUT32.260)
+ *
+ * Convert a VT_R4 to a VT_UI2.
+ *
+ * PARAMS
+ * fltIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI2FromR4(FLOAT fltIn, USHORT* pusOut)
+{
+ return _VarUI2FromR4(fltIn, pusOut);
+}
+
+/************************************************************************
+ * VarUI2FromR8 (OLEAUT32.261)
+ *
+ * Convert a VT_R8 to a VT_UI2.
+ *
+ * PARAMS
+ * dblIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ *
+ * NOTES
+ * See VarI8FromR8() for details concerning rounding.
+ */
+HRESULT WINAPI VarUI2FromR8(double dblIn, USHORT* pusOut)
+{
+ if (dblIn < -0.5 || dblIn > (double)UI2_MAX)
+ return DISP_E_OVERFLOW;
+ OLEAUT32_DutchRound(USHORT, dblIn, *pusOut);
+ return S_OK;
+}
+
+/************************************************************************
+ * VarUI2FromDate (OLEAUT32.262)
+ *
+ * Convert a VT_DATE to a VT_UI2.
+ *
+ * PARAMS
+ * dateIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI2FromDate(DATE dateIn, USHORT* pusOut)
+{
+ return _VarUI2FromDate(dateIn, pusOut);
+}
+
+/************************************************************************
+ * VarUI2FromCy (OLEAUT32.263)
+ *
+ * Convert a VT_CY to a VT_UI2.
+ *
+ * PARAMS
+ * cyIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ *
+ * NOTES
+ * Negative values >= -5000 will be converted to 0.
+ */
+HRESULT WINAPI VarUI2FromCy(CY cyIn, USHORT* pusOut)
+{
+ ULONG i = UI2_MAX + 1;
+
+ _VarUI4FromCy(cyIn, &i);
+ return _VarUI2FromUI4(i, pusOut);
+}
+
+/************************************************************************
+ * VarUI2FromStr (OLEAUT32.264)
+ *
+ * Convert a VT_BSTR to a VT_UI2.
+ *
+ * PARAMS
+ * strIn [I] Source
+ * lcid [I] LCID for the conversion
+ * dwFlags [I] VAR_ flags from "oleauto.h"
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarUI2FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, USHORT* pusOut)
+{
+ return _VarUI2FromStr(strIn, lcid, dwFlags, pusOut);
+}
+
+/************************************************************************
+ * VarUI2FromDisp (OLEAUT32.265)
+ *
+ * Convert a VT_DISPATCH to a VT_UI2.
+ *
+ * PARAMS
+ * pdispIn [I] Source
+ * lcid [I] LCID for conversion
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarUI2FromDisp(IDispatch* pdispIn, LCID lcid, USHORT* pusOut)
+{
+ return _VarUI2FromDisp(pdispIn, lcid, pusOut);
+}
+
+/************************************************************************
+ * VarUI2FromBool (OLEAUT32.266)
+ *
+ * Convert a VT_BOOL to a VT_UI2.
+ *
+ * PARAMS
+ * boolIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarUI2FromBool(VARIANT_BOOL boolIn, USHORT* pusOut)
+{
+ return _VarUI2FromBool(boolIn, pusOut);
+}
+
+/************************************************************************
+ * VarUI2FromI1 (OLEAUT32.267)
+ *
+ * Convert a VT_I1 to a VT_UI2.
+ *
+ * PARAMS
+ * cIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI2FromI1(signed char cIn, USHORT* pusOut)
+{
+ return _VarUI2FromI1(cIn, pusOut);
+}
+
+/************************************************************************
+ * VarUI2FromUI4 (OLEAUT32.268)
+ *
+ * Convert a VT_UI4 to a VT_UI2.
+ *
+ * PARAMS
+ * ulIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI2FromUI4(ULONG ulIn, USHORT* pusOut)
+{
+ return _VarUI2FromUI4(ulIn, pusOut);
+}
+
+/************************************************************************
+ * VarUI2FromDec (OLEAUT32.269)
+ *
+ * Convert a VT_DECIMAL to a VT_UI2.
+ *
+ * PARAMS
+ * pDecIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source vale is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI2FromDec(DECIMAL *pdecIn, USHORT* pusOut)
+{
+ LONG64 i64;
+ HRESULT hRet;
+
+ hRet = _VarI8FromDec(pdecIn, &i64);
+
+ if (SUCCEEDED(hRet))
+ hRet = _VarUI2FromI8(i64, pusOut);
+ return hRet;
+}
+
+/************************************************************************
+ * VarUI2FromI8 (OLEAUT32.378)
+ *
+ * Convert a VT_I8 to a VT_UI2.
+ *
+ * PARAMS
+ * llIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI2FromI8(LONG64 llIn, USHORT* pusOut)
+{
+ return _VarUI2FromI8(llIn, pusOut);
+}
+
+/************************************************************************
+ * VarUI2FromUI8 (OLEAUT32.379)
+ *
+ * Convert a VT_UI8 to a VT_UI2.
+ *
+ * PARAMS
+ * ullIn [I] Source
+ * pusOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI2FromUI8(ULONG64 ullIn, USHORT* pusOut)
+{
+ return _VarUI2FromUI8(ullIn, pusOut);
+}
diff -uP wine-diff/dlls/oleaut32/i4.c wine-develop/dlls/oleaut32/i4.c
--- wine-diff/dlls/oleaut32/i4.c 1970-01-01 01:00:00.000000000 +0100
+++ wine-develop/dlls/oleaut32/i4.c 2003-10-06 18:31:33.000000000 +0100
@@ -0,0 +1,602 @@
+/*
+ * Variant I4 and UI4 Functions
+ *
+ * Copyright 2003 Jon Griffiths
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+#include "wine/debug.h"
+#include "winbase.h"
+#include "variant.h"
+
+/************************************************************************
+ * VarI4FromUI1 (OLEAUT32.58)
+ *
+ * Convert a VT_UI1 to a VT_I4.
+ *
+ * PARAMS
+ * bIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarI4FromUI1(BYTE bIn, LONG *piOut)
+{
+ return _VarI4FromUI1(bIn, piOut);
+}
+
+/************************************************************************
+ * VarI4FromI2 (OLEAUT32.59)
+ *
+ * Convert a VT_I2 to a VT_I4.
+ *
+ * PARAMS
+ * iIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI4FromI2(SHORT sIn, LONG *piOut)
+{
+ return _VarI4FromI2(sIn, piOut);
+}
+
+/************************************************************************
+ * VarI4FromR4 (OLEAUT32.60)
+ *
+ * Convert a VT_R4 to a VT_I4.
+ *
+ * PARAMS
+ * fltIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI4FromR4(FLOAT fltIn, LONG *piOut)
+{
+ return _VarI4FromR4(fltIn, piOut);
+}
+
+/************************************************************************
+ * VarI4FromR8 (OLEAUT32.61)
+ *
+ * Convert a VT_R8 to a VT_I4.
+ *
+ * PARAMS
+ * dblIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ *
+ * NOTES
+ * See VarI8FromR8() for details concerning rounding.
+ */
+HRESULT WINAPI VarI4FromR8(double dblIn, LONG *piOut)
+{
+ if (dblIn < (double)I4_MIN || dblIn > (double)I4_MAX)
+ return DISP_E_OVERFLOW;
+ OLEAUT32_DutchRound(LONG, dblIn, *piOut);
+ return S_OK;
+}
+
+/************************************************************************
+ * VarI4FromCy (OLEAUT32.62)
+ *
+ * Convert a VT_CY to a VT_I4.
+ *
+ * PARAMS
+ * cyIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI4FromCy(CY cyIn, LONG *piOut)
+{
+ double d = cyIn.int64 / CY_MULTIPLIER_F;
+ return _VarI4FromR8(d, piOut);
+}
+
+/************************************************************************
+ * VarI4FromDate (OLEAUT32.63)
+ *
+ * Convert a VT_DATE to a VT_I4.
+ *
+ * PARAMS
+ * dateIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI4FromDate(DATE dateIn, LONG *piOut)
+{
+ return _VarI4FromDate(dateIn, piOut);
+}
+
+/************************************************************************
+ * VarI4FromStr (OLEAUT32.64)
+ *
+ * Convert a VT_BSTR to a VT_I4.
+ *
+ * PARAMS
+ * strIn [I] Source
+ * lcid [I] LCID for the conversion
+ * dwFlags [I] VAR_ flags from "oleauto.h"
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if any parameter is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if strIn cannot be converted
+ */
+HRESULT WINAPI VarI4FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, LONG *piOut)
+{
+ return _VarI4FromStr(strIn, lcid, dwFlags, piOut);
+}
+
+/************************************************************************
+ * VarI4FromDisp (OLEAUT32.65)
+ *
+ * Convert a VT_DISPATCH to a VT_I4.
+ *
+ * PARAMS
+ * pdispIn [I] Source
+ * lcid [I] LCID for conversion
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarI4FromDisp(IDispatch* pdispIn, LCID lcid, LONG *piOut)
+{
+ return _VarI4FromDisp(pdispIn, lcid, piOut);
+}
+
+/************************************************************************
+ * VarI4FromBool (OLEAUT32.66)
+ *
+ * Convert a VT_BOOL to a VT_I4.
+ *
+ * PARAMS
+ * boolIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarI4FromBool(VARIANT_BOOL boolIn, LONG *piOut)
+{
+ return _VarI4FromBool(boolIn, piOut);
+}
+
+/************************************************************************
+ * VarI4FromI1 (OLEAUT32.209)
+ *
+ * Convert a VT_I4 to a VT_I4.
+ *
+ * PARAMS
+ * cIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarI4FromI1(signed char cIn, LONG *piOut)
+{
+ return _VarI4FromI1(cIn, piOut);
+}
+
+/************************************************************************
+ * VarI4FromUI2 (OLEAUT32.210)
+ *
+ * Convert a VT_UI2 to a VT_I4.
+ *
+ * PARAMS
+ * usIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarI4FromUI2(USHORT usIn, LONG *piOut)
+{
+ return _VarI4FromUI2(usIn, piOut);
+}
+
+/************************************************************************
+ * VarI4FromUI4 (OLEAUT32.211)
+ *
+ * Convert a VT_UI4 to a VT_I4.
+ *
+ * PARAMS
+ * ulIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI4FromUI4(ULONG ulIn, LONG *piOut)
+{
+ return _VarI4FromUI4(ulIn, piOut);
+}
+
+/************************************************************************
+ * VarI4FromDec (OLEAUT32.212)
+ *
+ * Convert a VT_DECIMAL to a VT_I4.
+ *
+ * PARAMS
+ * pDecIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if pdecIn is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI4FromDec(DECIMAL *pdecIn, LONG *piOut)
+{
+ LONG64 i64;
+ HRESULT hRet;
+
+ hRet = _VarI8FromDec(pdecIn, &i64);
+
+ if (SUCCEEDED(hRet))
+ hRet = _VarI4FromI8(i64, piOut);
+ return hRet;
+}
+
+/************************************************************************
+ * VarI4FromI8 (OLEAUT32.348)
+ *
+ * Convert a VT_I8 to a VT_I4.
+ *
+ * PARAMS
+ * llIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI4FromI8(LONG64 llIn, LONG *piOut)
+{
+ return _VarI4FromI8(llIn, piOut);
+}
+
+/************************************************************************
+ * VarI4FromUI8 (OLEAUT32.349)
+ *
+ * Convert a VT_UI8 to a VT_I4.
+ *
+ * PARAMS
+ * ullIn [I] Source
+ * piOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarI4FromUI8(ULONG64 ullIn, LONG *piOut)
+{
+ return _VarI4FromUI8(ullIn, piOut);
+}
+
+/************************************************************************
+ * VarUI4FromUI1 (OLEAUT32.270)
+ *
+ * Convert a VT_UI1 to a VT_UI4.
+ *
+ * PARAMS
+ * bIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarUI4FromUI1(BYTE bIn, ULONG *pulOut)
+{
+ return _VarUI4FromUI1(bIn, pulOut);
+}
+
+/************************************************************************
+ * VarUI4FromI2 (OLEAUT32.271)
+ *
+ * Convert a VT_I2 to a VT_UI4.
+ *
+ * PARAMS
+ * sIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI4FromI2(SHORT sIn, ULONG *pulOut)
+{
+ return _VarUI4FromI2(sIn, pulOut);
+}
+
+/************************************************************************
+ * VarUI4FromI4 (OLEAUT32.272)
+ *
+ * Convert a VT_I4 to a VT_UI4.
+ *
+ * PARAMS
+ * iIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI4FromI4(LONG iIn, ULONG *pulOut)
+{
+ return _VarUI4FromI4(iIn, pulOut);
+}
+
+/************************************************************************
+ * VarUI4FromR4 (OLEAUT32.273)
+ *
+ * Convert a VT_R4 to a VT_UI4.
+ *
+ * PARAMS
+ * fltIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI4FromR4(FLOAT fltIn, ULONG *pulOut)
+{
+ return _VarUI4FromR4(fltIn, pulOut);
+}
+
+/************************************************************************
+ * VarUI4FromR8 (OLEAUT32.274)
+ *
+ * Convert a VT_R8 to a VT_UI4.
+ *
+ * PARAMS
+ * dblIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ *
+ * NOTES
+ * See VarI8FromR8() for details concerning rounding.
+ */
+HRESULT WINAPI VarUI4FromR8(double dblIn, ULONG *pulOut)
+{
+ if (dblIn < -0.5 || dblIn > (double)UI4_MAX)
+ return DISP_E_OVERFLOW;
+ OLEAUT32_DutchRound(ULONG, dblIn, *pulOut);
+ return S_OK;
+}
+
+/************************************************************************
+ * VarUI4FromDate (OLEAUT32.275)
+ *
+ * Convert a VT_DATE to a VT_UI4.
+ *
+ * PARAMS
+ * dateIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI4FromDate(DATE dateIn, ULONG *pulOut)
+{
+ return _VarUI4FromDate(dateIn, pulOut);
+}
+
+/************************************************************************
+ * VarUI4FromCy (OLEAUT32.276)
+ *
+ * Convert a VT_CY to a VT_UI4.
+ *
+ * PARAMS
+ * cyIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI4FromCy(CY cyIn, ULONG *pulOut)
+{
+ double d = cyIn.int64 / CY_MULTIPLIER_F;
+ return _VarUI4FromR8(d, pulOut);
+}
+
+/************************************************************************
+ * VarUI4FromStr (OLEAUT32.277)
+ *
+ * Convert a VT_BSTR to a VT_UI4.
+ *
+ * PARAMS
+ * strIn [I] Source
+ * lcid [I] LCID for the conversion
+ * dwFlags [I] VAR_ flags from "oleauto.h"
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if any parameter is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if strIn cannot be converted
+ */
+HRESULT WINAPI VarUI4FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, ULONG *pulOut)
+{
+ return _VarUI4FromStr(strIn, lcid, dwFlags, pulOut);
+}
+
+/************************************************************************
+ * VarUI4FromDisp (OLEAUT32.278)
+ *
+ * Convert a VT_DISPATCH to a VT_UI4.
+ *
+ * PARAMS
+ * pdispIn [I] Source
+ * lcid [I] LCID for conversion
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarUI4FromDisp(IDispatch* pdispIn, LCID lcid, ULONG *pulOut)
+{
+ return _VarUI4FromDisp(pdispIn, lcid, pulOut);
+}
+
+/************************************************************************
+ * VarUI4FromBool (OLEAUT32.279)
+ *
+ * Convert a VT_BOOL to a VT_UI4.
+ *
+ * PARAMS
+ * boolIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarUI4FromBool(VARIANT_BOOL boolIn, ULONG *pulOut)
+{
+ return _VarUI4FromBool(boolIn, pulOut);
+}
+
+/************************************************************************
+ * VarUI4FromI1 (OLEAUT32.280)
+ *
+ * Convert a VT_I1 to a VT_UI4.
+ *
+ * PARAMS
+ * cIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI4FromI1(signed char cIn, ULONG *pulOut)
+{
+ return _VarUI4FromI1(cIn, pulOut);
+}
+
+/************************************************************************
+ * VarUI4FromUI2 (OLEAUT32.281)
+ *
+ * Convert a VT_UI2 to a VT_UI4.
+ *
+ * PARAMS
+ * usIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarUI4FromUI2(USHORT usIn, ULONG *pulOut)
+{
+ return _VarUI4FromUI2(usIn, pulOut);
+}
+
+/************************************************************************
+ * VarUI4FromDec (OLEAUT32.282)
+ *
+ * Convert a VT_DECIMAL to a VT_UI4.
+ *
+ * PARAMS
+ * pDecIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if pdecIn is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI4FromDec(DECIMAL *pdecIn, ULONG *pulOut)
+{
+ LONG64 i64;
+ HRESULT hRet;
+
+ hRet = _VarI8FromDec(pdecIn, &i64);
+
+ if (SUCCEEDED(hRet))
+ hRet = _VarUI4FromI8(i64, pulOut);
+ return hRet;
+}
+
+/************************************************************************
+ * VarUI4FromI8 (OLEAUT32.425)
+ *
+ * Convert a VT_I8 to a VT_UI4.
+ *
+ * PARAMS
+ * llIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI4FromI8(LONG64 llIn, ULONG *pulOut)
+{
+ return _VarUI4FromI8(llIn, pulOut);
+}
+
+/************************************************************************
+ * VarUI4FromUI8 (OLEAUT32.426)
+ *
+ * Convert a VT_UI8 to a VT_UI4.
+ *
+ * PARAMS
+ * ullIn [I] Source
+ * pulOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination
+ */
+HRESULT WINAPI VarUI4FromUI8(ULONG64 ullIn, ULONG *pulOut)
+{
+ return _VarUI4FromUI8(ullIn, pulOut);
+}
diff -uP wine-diff/dlls/oleaut32/Makefile.in wine-develop/dlls/oleaut32/Makefile.in
--- wine-diff/dlls/oleaut32/Makefile.in 2003-10-06 18:15:44.000000000 +0100
+++ wine-develop/dlls/oleaut32/Makefile.in 2003-10-06 18:30:53.000000000 +0100
@@ -19,12 +19,16 @@
dispatch.c \
dec.c \
hash.c \
+ i1.c\
+ i2.c \
+ i4.c \
i8.c \
oaidl_p.c \
oleaut.c \
olefont.c \
olepicture.c \
parsedt.c \
+ r4.c \
r8.c \
regsvr.c \
safearray.c \
diff -uP wine-diff/dlls/oleaut32/oleaut32.spec wine-develop/dlls/oleaut32/oleaut32.spec
--- wine-diff/dlls/oleaut32/oleaut32.spec 2003-10-06 18:15:44.000000000 +0100
+++ wine-develop/dlls/oleaut32/oleaut32.spec 2003-10-06 18:47:18.000000000 +0100
@@ -49,37 +49,37 @@
49 stdcall VarI2FromI4(long ptr)
50 stdcall VarI2FromR4(long ptr)
51 stdcall VarI2FromR8(double ptr)
-52 stdcall VarI2FromCy(double ptr)
+52 stdcall VarI2FromCy(long long ptr)
53 stdcall VarI2FromDate(double ptr)
54 stdcall VarI2FromStr(wstr long long ptr)
-55 stub VarI2FromDisp
+55 stdcall VarI2FromDisp(ptr long ptr)
56 stdcall VarI2FromBool(long ptr)
57 stdcall SafeArraySetIID(ptr ptr)
58 stdcall VarI4FromUI1(long ptr)
59 stdcall VarI4FromI2(long ptr)
60 stdcall VarI4FromR4(long ptr)
61 stdcall VarI4FromR8(double ptr)
-62 stdcall VarI4FromCy(double ptr)
+62 stdcall VarI4FromCy(long long ptr)
63 stdcall VarI4FromDate(double ptr)
64 stdcall VarI4FromStr(wstr long long ptr)
-65 stub VarI4FromDisp
+65 stdcall VarI4FromDisp(ptr long ptr)
66 stdcall VarI4FromBool(long ptr)
67 stdcall SafeArrayGetIID(ptr ptr)
68 stdcall VarR4FromUI1(long ptr)
69 stdcall VarR4FromI2(long ptr)
70 stdcall VarR4FromI4(long ptr)
71 stdcall VarR4FromR8(double ptr)
-72 stdcall VarR4FromCy(double ptr)
+72 stdcall VarR4FromCy(long long ptr)
73 stdcall VarR4FromDate(double ptr)
74 stdcall VarR4FromStr(wstr long long ptr)
-75 stub VarR4FromDisp
+75 stdcall VarR4FromDisp(ptr long ptr)
76 stdcall VarR4FromBool(long ptr)
77 stdcall SafeArrayGetVartype(ptr ptr)
78 stdcall VarR8FromUI1(long ptr)
79 stdcall VarR8FromI2(long ptr)
80 stdcall VarR8FromI4(long ptr)
81 stdcall VarR8FromR4(long ptr)
-82 stdcall VarR8FromCy(double ptr)
+82 stdcall VarR8FromCy(long long ptr)
83 stdcall VarR8FromDate(double ptr)
84 stdcall VarR8FromStr(wstr long long ptr)
85 stdcall VarR8FromDisp(ptr long ptr)
@@ -90,7 +90,7 @@
90 stdcall VarDateFromI4(long ptr)
91 stdcall VarDateFromR4(long ptr)
92 stdcall VarDateFromR8(double ptr)
-93 stdcall VarDateFromCy(double ptr)
+93 stdcall VarDateFromCy(long long ptr)
94 stdcall VarDateFromStr(wstr long long ptr)
95 stub VarDateFromDisp
96 stdcall VarDateFromBool(long ptr)
@@ -110,7 +110,7 @@
110 stdcall VarBstrFromI4(long long long ptr)
111 stdcall VarBstrFromR4(long long long ptr)
112 stdcall VarBstrFromR8(double long long ptr)
-113 stdcall VarBstrFromCy(double long long ptr)
+113 stdcall VarBstrFromCy(long long long long ptr)
114 stdcall VarBstrFromDate(double long long ptr)
115 stub VarBstrFromDisp
116 stdcall VarBstrFromBool(long long long ptr)
@@ -121,7 +121,7 @@
121 stdcall VarBoolFromR4(long ptr)
122 stdcall VarBoolFromR8(double ptr)
123 stdcall VarBoolFromDate(double ptr)
-124 stdcall VarBoolFromCy(double ptr)
+124 stdcall VarBoolFromCy(long long ptr)
125 stdcall VarBoolFromStr(wstr long long ptr)
126 stub VarBoolFromDisp
127 stdcall VarFormatCurrency(ptr long long long long long ptr)
@@ -131,10 +131,10 @@
131 stdcall VarUI1FromI4(long ptr)
132 stdcall VarUI1FromR4(long ptr)
133 stdcall VarUI1FromR8(double ptr)
-134 stdcall VarUI1FromCy(double ptr)
+134 stdcall VarUI1FromCy(long long ptr)
135 stdcall VarUI1FromDate(double ptr)
136 stdcall VarUI1FromStr(wstr long long ptr)
-137 stub VarUI1FromDisp
+137 stdcall VarUI1FromDisp(ptr long ptr)
138 stdcall VarUI1FromBool(long ptr)
139 stdcall VarFormatFromTokens (ptr ptr ptr long ptr long)
140 stdcall VarTokenizeFormatString (ptr ptr long long long long ptr)
@@ -203,15 +203,15 @@
205 stdcall VarI2FromI1(long ptr)
206 stdcall VarI2FromUI2(long ptr)
207 stdcall VarI2FromUI4(long ptr)
-208 stub VarI2FromDec
+208 stdcall VarI2FromDec(ptr ptr)
209 stdcall VarI4FromI1(long ptr)
210 stdcall VarI4FromUI2(long ptr)
211 stdcall VarI4FromUI4(long ptr)
-212 stub VarI4FromDec
+212 stdcall VarI4FromDec(ptr ptr)
213 stdcall VarR4FromI1(long ptr)
214 stdcall VarR4FromUI2(long ptr)
215 stdcall VarR4FromUI4(long ptr)
-216 stub VarR4FromDec
+216 stdcall VarR4FromDec(ptr ptr)
217 stdcall VarR8FromI1(long ptr)
218 stdcall VarR8FromUI2(long ptr)
219 stdcall VarR8FromUI4(long ptr)
@@ -235,7 +235,7 @@
237 stdcall VarUI1FromI1(long ptr)
238 stdcall VarUI1FromUI2(long ptr)
239 stdcall VarUI1FromUI4(long ptr)
-240 stub VarUI1FromDec
+240 stdcall VarUI1FromDec(ptr ptr)
241 stdcall VarDecFromI1(long ptr)
242 stdcall VarDecFromUI2(long ptr)
243 stdcall VarDecFromUI4(long ptr)
@@ -245,39 +245,39 @@
247 stdcall VarI1FromR4(long ptr)
248 stdcall VarI1FromR8(double ptr)
249 stdcall VarI1FromDate(double ptr)
-250 stdcall VarI1FromCy(double ptr)
+250 stdcall VarI1FromCy(long long ptr)
251 stdcall VarI1FromStr(wstr long long ptr)
-252 stub VarI1FromDisp
+252 stdcall VarI1FromDisp(ptr long ptr)
253 stdcall VarI1FromBool(long ptr)
254 stdcall VarI1FromUI2(long ptr)
255 stdcall VarI1FromUI4(long ptr)
-256 stub VarI1FromDec
+256 stdcall VarI1FromDec(ptr ptr)
257 stdcall VarUI2FromUI1(long ptr)
258 stdcall VarUI2FromI2(long ptr)
259 stdcall VarUI2FromI4(long ptr)
260 stdcall VarUI2FromR4(long ptr)
261 stdcall VarUI2FromR8(double ptr)
262 stdcall VarUI2FromDate(double ptr)
-263 stdcall VarUI2FromCy(double ptr)
+263 stdcall VarUI2FromCy(long long ptr)
264 stdcall VarUI2FromStr(wstr long long ptr)
-265 stub VarUI2FromDisp
+265 stdcall VarUI2FromDisp(ptr long ptr)
266 stdcall VarUI2FromBool(long ptr)
267 stdcall VarUI2FromI1(long ptr)
268 stdcall VarUI2FromUI4(long ptr)
-269 stub VarUI2FromDec
+269 stdcall VarUI2FromDec(ptr ptr)
270 stdcall VarUI4FromUI1(long ptr)
271 stdcall VarUI4FromI2(long ptr)
272 stdcall VarUI4FromI4(long ptr)
273 stdcall VarUI4FromR4(long ptr)
274 stdcall VarUI4FromR8(double ptr)
275 stdcall VarUI4FromDate(double ptr)
-276 stdcall VarUI4FromCy(double ptr)
+276 stdcall VarUI4FromCy(long long ptr)
277 stdcall VarUI4FromStr(wstr long long ptr)
-278 stub VarUI4FromDisp
+278 stdcall VarUI4FromDisp(ptr long ptr)
279 stdcall VarUI4FromBool(long ptr)
280 stdcall VarUI4FromI1(long ptr)
281 stdcall VarUI4FromUI2(long ptr)
-282 stub VarUI4FromDec
+282 stdcall VarUI4FromDec(ptr ptr)
283 stdcall BSTR_UserSize(ptr long ptr)
284 stdcall BSTR_UserMarshal(ptr ptr ptr)
285 stdcall BSTR_UserUnmarshal(ptr ptr ptr)
@@ -308,7 +308,7 @@
313 stdcall VarBstrCat(wstr wstr ptr)
314 stdcall VarBstrCmp(wstr wstr long long)
315 stub VarR8Pow # stdcall (double double ptr)
-316 stub VarR4CmpR8
+316 stdcall VarR4CmpR8(long double)
317 stub VarR8Round # stdcall (double long ptr)
318 stdcall VarCat(ptr ptr ptr)
319 stub VarDateFromUdateEx # stdcall (ptr long long ptr)
@@ -336,12 +336,12 @@
343 stdcall VarI8FromUI2(long long)
344 stdcall VarI8FromUI4(long long)
345 stdcall VarI8FromDec(ptr ptr)
-346 stub VarI2FromI8
-347 stub VarI2FromUI8
-348 stub VarI4FromI8
-349 stub VarI4FromUI8
-360 stub VarR4FromI8
-361 stub VarR4FromUI8
+346 stdcall VarI2FromI8(long long ptr)
+347 stdcall VarI2FromUI8(long long ptr)
+348 stdcall VarI4FromI8(long long ptr)
+349 stdcall VarI4FromUI8(long long ptr)
+360 stdcall VarR4FromI8(long long ptr)
+361 stdcall VarR4FromUI8(long long ptr)
362 stdcall VarR8FromI8(long long ptr)
363 stdcall VarR8FromUI8(long long ptr)
364 stub VarDateFromI8
@@ -352,14 +352,14 @@
369 stub VarBstrFromUI8
370 stub VarBoolFromI8
371 stub VarBoolFromUI8
-372 stub VarUI1FromI8
-373 stub VarUI1FromUI8
-374 stub VarDecFromI8
-375 stub VarDecFromUI8
-376 stub VarI1FromI8
-377 stub VarI1FromUI8
-378 stub VarUI2FromI8
-379 stub VarUI2FromUI8
+372 stdcall VarUI1FromI8(long long ptr)
+373 stdcall VarUI1FromUI8(long long ptr)
+374 stdcall VarDecFromI8(long long ptr)
+375 stdcall VarDecFromUI8(long long ptr)
+376 stdcall VarI1FromI8(long long ptr)
+377 stdcall VarI1FromUI8(long long ptr)
+378 stdcall VarUI2FromI8(long long ptr)
+379 stdcall VarUI2FromUI8(long long ptr)
380 stub UserHWND_from_local
381 stub UserHWND_to_local
382 stub UserHWND_free_inst
@@ -397,8 +397,8 @@
422 stub OleLoadPictureFile
423 stub OleSavePictureFile
424 stub OleLoadPicturePath
-425 stub VarUI4FromI8
-426 stub VarUI4FromUI8
+425 stdcall VarUI4FromI8(long long ptr)
+426 stdcall VarUI4FromUI8(long long ptr)
427 stdcall VarI8FromUI8(long long ptr)
428 stdcall VarUI8FromI8(long long ptr)
429 stdcall VarUI8FromUI1(long ptr)
diff -uP wine-diff/dlls/oleaut32/r4.c wine-develop/dlls/oleaut32/r4.c
--- wine-diff/dlls/oleaut32/r4.c 1970-01-01 01:00:00.000000000 +0100
+++ wine-develop/dlls/oleaut32/r4.c 2003-10-06 18:56:37.000000000 +0100
@@ -0,0 +1,343 @@
+/*
+ * Variant VT_R4 (float) Functions
+ *
+ * Copyright 2003 Jon Griffiths
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+#include "wine/debug.h"
+#include "winbase.h"
+#include "variant.h"
+
+/************************************************************************
+ * VarR4FromUI1 (OLEAUT32.68)
+ *
+ * Convert a VT_UI1 to a VT_R4.
+ *
+ * PARAMS
+ * bIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarR4FromUI1(BYTE bIn, float *pFltOut)
+{
+ return _VarR4FromUI1(bIn, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromI2 (OLEAUT32.69)
+ *
+ * Convert a VT_I2 to a VT_R4.
+ *
+ * PARAMS
+ * sIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarR4FromI2(SHORT sIn, float *pFltOut)
+{
+ return _VarR4FromI2(sIn, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromI4 (OLEAUT32.70)
+ *
+ * Convert a VT_I4 to a VT_R4.
+ *
+ * PARAMS
+ * sIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarR4FromI4(LONG lIn, float *pFltOut)
+{
+ return _VarR4FromI4(lIn, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromR8 (OLEAUT32.71)
+ *
+ * Convert a VT_R8 to a VT_R4.
+ *
+ * PARAMS
+ * dblIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination.
+ */
+HRESULT WINAPI VarR4FromR8(double dblIn, float *pFltOut)
+{
+ return _VarR4FromR8(dblIn, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromCy (OLEAUT32.72)
+ *
+ * Convert a VT_CY to a VT_R4.
+ *
+ * PARAMS
+ * cyIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarR4FromCy(CY cyIn, float *pFltOut)
+{
+ return _VarR4FromCy(cyIn, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromDate (OLEAUT32.73)
+ *
+ * Convert a VT_DATE to a VT_R4.
+ *
+ * PARAMS
+ * dateIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: DISP_E_OVERFLOW, if the value will not fit in the destination.
+ */
+HRESULT WINAPI VarR4FromDate(DATE dateIn, float *pFltOut)
+{
+ return _VarR4FromDate(dateIn, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromStr (OLEAUT32.74)
+ *
+ * Convert a VT_BSTR to a VT_R4.
+ *
+ * PARAMS
+ * strIn [I] Source
+ * lcid [I] LCID for the conversion
+ * dwFlags [I] VAR_ flags from "oleauto.h"
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if strIn or pFltOut is invalid.
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarR4FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, float *pFltOut)
+{
+ return _VarR4FromStr(strIn, lcid, dwFlags, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromDisp (OLEAUT32.75)
+ *
+ * Convert a VT_DISPATCH to a VT_R4.
+ *
+ * PARAMS
+ * pdispIn [I] Source
+ * lcid [I] LCID for conversion
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarR4FromDisp(IDispatch* pdispIn, LCID lcid, float *pFltOut)
+{
+ return _VarR4FromDisp(pdispIn, lcid, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromBool (OLEAUT32.76)
+ *
+ * Convert a VT_BOOL to a VT_R4.
+ *
+ * PARAMS
+ * boolIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarR4FromBool(VARIANT_BOOL boolIn, float *pFltOut)
+{
+ return _VarR4FromBool(boolIn, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromI1 (OLEAUT32.213)
+ *
+ * Convert a VT_I1 to a VT_R4.
+ *
+ * PARAMS
+ * cIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarR4FromI1(signed char cIn, float *pFltOut)
+{
+ return _VarR4FromI1(cIn, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromUI2 (OLEAUT32.214)
+ *
+ * Convert a VT_UI2 to a VT_R4.
+ *
+ * PARAMS
+ * usIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarR4FromUI2(USHORT usIn, float *pFltOut)
+{
+ return _VarR4FromUI2(usIn, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromUI4 (OLEAUT32.215)
+ *
+ * Convert a VT_UI4 to a VT_R4.
+ *
+ * PARAMS
+ * ulIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid
+ * DISP_E_OVERFLOW, if the value will not fit in the destination
+ * DISP_E_TYPEMISMATCH, if the type cannot be converted
+ */
+HRESULT WINAPI VarR4FromUI4(ULONG ulIn, float *pFltOut)
+{
+ return _VarR4FromUI4(ulIn, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromDec (OLEAUT32.216)
+ *
+ * Convert a VT_DECIMAL to a VT_R4.
+ *
+ * PARAMS
+ * pDecIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * Success: S_OK.
+ * Failure: E_INVALIDARG, if the source value is invalid.
+ */
+HRESULT WINAPI VarR4FromDec(DECIMAL* pDecIn, float *pFltOut)
+{
+ BYTE scale = DEC_SCALE(pDecIn);
+ int divisor = 1;
+ double highPart;
+
+ if (scale > DEC_MAX_SCALE || DEC_SIGN(pDecIn) & ~DECIMAL_NEG)
+ return E_INVALIDARG;
+
+ while (scale--)
+ divisor *= 10;
+
+ if (DEC_SIGN(pDecIn))
+ divisor = -divisor;
+
+ if (DEC_HI32(pDecIn))
+ {
+ highPart = (double)DEC_HI32(pDecIn) / (double)divisor;
+ highPart *= 1.0e64;
+ }
+ else
+ highPart = 0.0;
+
+ *pFltOut = (double)DEC_LO64(pDecIn) / (double)divisor + highPart;
+ return S_OK;
+}
+
+/************************************************************************
+ * VarR4FromI8 (OLEAUT32.360)
+ *
+ * Convert a VT_I8 to a VT_R4.
+ *
+ * PARAMS
+ * ullIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarR4FromI8(LONG64 llIn, float *pFltOut)
+{
+ return _VarR4FromI8(llIn, pFltOut);
+}
+
+/************************************************************************
+ * VarR4FromUI8 (OLEAUT32.361)
+ *
+ * Convert a VT_UI8 to a VT_R4.
+ *
+ * PARAMS
+ * ullIn [I] Source
+ * pFltOut [O] Destination
+ *
+ * RETURNS
+ * S_OK.
+ */
+HRESULT WINAPI VarR4FromUI8(ULONG64 ullIn, float *pFltOut)
+{
+ return _VarR4FromUI8(ullIn, pFltOut);
+}
+
+/************************************************************************
+ * VarR4CmpR8 (OLEAUT32.316)
+ *
+ * Compare a VT_R4 to a VT_R8.
+ *
+ * PARAMS
+ * fltLeft [I] Source
+ * dblRight [I] Value to compare
+ *
+ * RETURNS
+ * VARCMP_LT, VARCMP_EQ or VARCMP_GT indicating that fltLeft is less than,
+ * equal to or greater than dblRight respectively.
+ */
+HRESULT WINAPI VarR4CmpR8(float fltLeft, double dblRight)
+{
+ if (fltLeft < dblRight)
+ return VARCMP_LT;
+ else if (fltLeft > dblRight)
+ return VARCMP_GT;
+ return VARCMP_EQ;
+}
--- wine-diff/dlls/oleaut32/variant.c 2003-10-06 18:15:44.000000000 +0100
+++ wine-develop/dlls/oleaut32/variant.c 2003-10-06 18:34:58.000000000 +0100
@@ -2178,671 +2178,6 @@
return res;
}
-
-
-
-/******************************************************************************
- * VarUI1FromI2 [OLEAUT32.130]
- */
-HRESULT WINAPI VarUI1FromI2(short sIn, BYTE* pbOut)
-{
- TRACE("( %d, %p ), stub\n", sIn, pbOut );
-
- /* Check range of value.
- */
- if( sIn < UI1_MIN || sIn > UI1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pbOut = (BYTE) sIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI1FromI4 [OLEAUT32.131]
- */
-HRESULT WINAPI VarUI1FromI4(LONG lIn, BYTE* pbOut)
-{
- TRACE("( %ld, %p ), stub\n", lIn, pbOut );
-
- /* Check range of value.
- */
- if( lIn < UI1_MIN || lIn > UI1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pbOut = (BYTE) lIn;
-
- return S_OK;
-}
-
-
-/******************************************************************************
- * VarUI1FromR4 [OLEAUT32.132]
- */
-HRESULT WINAPI VarUI1FromR4(FLOAT fltIn, BYTE* pbOut)
-{
- TRACE("( %f, %p ), stub\n", fltIn, pbOut );
-
- /* Check range of value.
- */
- fltIn = round( fltIn );
- if( fltIn < UI1_MIN || fltIn > UI1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pbOut = (BYTE) fltIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI1FromR8 [OLEAUT32.133]
- */
-HRESULT WINAPI VarUI1FromR8(double dblIn, BYTE* pbOut)
-{
- TRACE("( %f, %p ), stub\n", dblIn, pbOut );
-
- /* Check range of value.
- */
- dblIn = round( dblIn );
- if( dblIn < UI1_MIN || dblIn > UI1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pbOut = (BYTE) dblIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI1FromDate [OLEAUT32.135]
- */
-HRESULT WINAPI VarUI1FromDate(DATE dateIn, BYTE* pbOut)
-{
- TRACE("( %f, %p ), stub\n", dateIn, pbOut );
-
- /* Check range of value.
- */
- dateIn = round( dateIn );
- if( dateIn < UI1_MIN || dateIn > UI1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pbOut = (BYTE) dateIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI1FromBool [OLEAUT32.138]
- */
-HRESULT WINAPI VarUI1FromBool(VARIANT_BOOL boolIn, BYTE* pbOut)
-{
- TRACE("( %d, %p ), stub\n", boolIn, pbOut );
-
- *pbOut = (BYTE) boolIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI1FromI1 [OLEAUT32.237]
- */
-HRESULT WINAPI VarUI1FromI1(signed char cIn, BYTE* pbOut)
-{
- TRACE("( %c, %p ), stub\n", cIn, pbOut );
-
- *pbOut = cIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI1FromUI2 [OLEAUT32.238]
- */
-HRESULT WINAPI VarUI1FromUI2(USHORT uiIn, BYTE* pbOut)
-{
- TRACE("( %d, %p ), stub\n", uiIn, pbOut );
-
- /* Check range of value.
- */
- if( uiIn > UI1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pbOut = (BYTE) uiIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI1FromUI4 [OLEAUT32.239]
- */
-HRESULT WINAPI VarUI1FromUI4(ULONG ulIn, BYTE* pbOut)
-{
- TRACE("( %ld, %p ), stub\n", ulIn, pbOut );
-
- /* Check range of value.
- */
- if( ulIn > UI1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pbOut = (BYTE) ulIn;
-
- return S_OK;
-}
-
-
-/******************************************************************************
- * VarUI1FromStr [OLEAUT32.136]
- */
-HRESULT WINAPI VarUI1FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, BYTE* pbOut)
-{
- TRACE("(%s, 0x%08lx, 0x%08lx, %p)\n", debugstr_w(strIn), lcid, dwFlags, pbOut);
- return _VarUI1FromStr(strIn, lcid, dwFlags, pbOut);
-}
-
-/**********************************************************************
- * VarUI1FromCy [OLEAUT32.134]
- * Convert currency to unsigned char
- */
-HRESULT WINAPI VarUI1FromCy(CY cyIn, BYTE* pbOut) {
- double t = round((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000);
-
- if (t > UI1_MAX || t < UI1_MIN) return DISP_E_OVERFLOW;
-
- *pbOut = (BYTE)t;
- return S_OK;
-}
-
-/******************************************************************************
- * VarI2FromUI1 [OLEAUT32.48]
- */
-HRESULT WINAPI VarI2FromUI1(BYTE bIn, short* psOut)
-{
- TRACE("( 0x%08x, %p ), stub\n", bIn, psOut );
-
- *psOut = (short) bIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI2FromI4 [OLEAUT32.49]
- */
-HRESULT WINAPI VarI2FromI4(LONG lIn, short* psOut)
-{
- TRACE("( %lx, %p ), stub\n", lIn, psOut );
-
- /* Check range of value.
- */
- if( lIn < I2_MIN || lIn > I2_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *psOut = (short) lIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI2FromR4 [OLEAUT32.50]
- */
-HRESULT WINAPI VarI2FromR4(FLOAT fltIn, short* psOut)
-{
- TRACE("( %f, %p ), stub\n", fltIn, psOut );
-
- /* Check range of value.
- */
- fltIn = round( fltIn );
- if( fltIn < I2_MIN || fltIn > I2_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *psOut = (short) fltIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI2FromR8 [OLEAUT32.51]
- */
-HRESULT WINAPI VarI2FromR8(double dblIn, short* psOut)
-{
- TRACE("( %f, %p ), stub\n", dblIn, psOut );
-
- /* Check range of value.
- */
- dblIn = round( dblIn );
- if( dblIn < I2_MIN || dblIn > I2_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *psOut = (short) dblIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI2FromDate [OLEAUT32.53]
- */
-HRESULT WINAPI VarI2FromDate(DATE dateIn, short* psOut)
-{
- TRACE("( %f, %p ), stub\n", dateIn, psOut );
-
- /* Check range of value.
- */
- dateIn = round( dateIn );
- if( dateIn < I2_MIN || dateIn > I2_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *psOut = (short) dateIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI2FromBool [OLEAUT32.56]
- */
-HRESULT WINAPI VarI2FromBool(VARIANT_BOOL boolIn, short* psOut)
-{
- TRACE("( %d, %p ), stub\n", boolIn, psOut );
-
- *psOut = (short) boolIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI2FromI1 [OLEAUT32.205]
- */
-HRESULT WINAPI VarI2FromI1(signed char cIn, short* psOut)
-{
- TRACE("( %c, %p ), stub\n", cIn, psOut );
-
- *psOut = (short) cIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI2FromUI2 [OLEAUT32.206]
- */
-HRESULT WINAPI VarI2FromUI2(USHORT uiIn, short* psOut)
-{
- TRACE("( %d, %p ), stub\n", uiIn, psOut );
-
- /* Check range of value.
- */
- if( uiIn > I2_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *psOut = (short) uiIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI2FromUI4 [OLEAUT32.207]
- */
-HRESULT WINAPI VarI2FromUI4(ULONG ulIn, short* psOut)
-{
- TRACE("( %lx, %p ), stub\n", ulIn, psOut );
-
- /* Check range of value.
- */
- if( ulIn < I2_MIN || ulIn > I2_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *psOut = (short) ulIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI2FromStr [OLEAUT32.54]
- */
-HRESULT WINAPI VarI2FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, short* psOut)
-{
- TRACE("(%s, 0x%08lx, 0x%08lx, %p)\n", debugstr_w(strIn), lcid, dwFlags, psOut);
- return _VarI2FromStr(strIn, lcid, dwFlags, psOut);
-}
-
-/**********************************************************************
- * VarI2FromCy [OLEAUT32.52]
- * Convert currency to signed short
- */
-HRESULT WINAPI VarI2FromCy(CY cyIn, short* psOut) {
- double t = round((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000);
-
- if (t > I2_MAX || t < I2_MIN) return DISP_E_OVERFLOW;
-
- *psOut = (SHORT)t;
- return S_OK;
-}
-
-/******************************************************************************
- * VarI4FromUI1 [OLEAUT32.58]
- */
-HRESULT WINAPI VarI4FromUI1(BYTE bIn, LONG* plOut)
-{
- TRACE("( %X, %p ), stub\n", bIn, plOut );
-
- *plOut = (LONG) bIn;
-
- return S_OK;
-}
-
-
-/******************************************************************************
- * VarI4FromR4 [OLEAUT32.60]
- */
-HRESULT WINAPI VarI4FromR4(FLOAT fltIn, LONG* plOut)
-{
- TRACE("( %f, %p ), stub\n", fltIn, plOut );
-
- /* Check range of value.
- */
- fltIn = round( fltIn );
- if( fltIn < I4_MIN || fltIn > I4_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *plOut = (LONG) fltIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI4FromR8 [OLEAUT32.61]
- */
-HRESULT WINAPI VarI4FromR8(double dblIn, LONG* plOut)
-{
- TRACE("( %f, %p ), stub\n", dblIn, plOut );
-
- /* Check range of value.
- */
- dblIn = round( dblIn );
- if( dblIn < I4_MIN || dblIn > I4_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *plOut = (LONG) dblIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI4FromDate [OLEAUT32.63]
- */
-HRESULT WINAPI VarI4FromDate(DATE dateIn, LONG* plOut)
-{
- TRACE("( %f, %p ), stub\n", dateIn, plOut );
-
- /* Check range of value.
- */
- dateIn = round( dateIn );
- if( dateIn < I4_MIN || dateIn > I4_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *plOut = (LONG) dateIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI4FromBool [OLEAUT32.66]
- */
-HRESULT WINAPI VarI4FromBool(VARIANT_BOOL boolIn, LONG* plOut)
-{
- TRACE("( %d, %p ), stub\n", boolIn, plOut );
-
- *plOut = (LONG) boolIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI4FromI1 [OLEAUT32.209]
- */
-HRESULT WINAPI VarI4FromI1(signed char cIn, LONG* plOut)
-{
- TRACE("( %c, %p ), stub\n", cIn, plOut );
-
- *plOut = (LONG) cIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI4FromUI2 [OLEAUT32.210]
- */
-HRESULT WINAPI VarI4FromUI2(USHORT uiIn, LONG* plOut)
-{
- TRACE("( %d, %p ), stub\n", uiIn, plOut );
-
- *plOut = (LONG) uiIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI4FromUI4 [OLEAUT32.211]
- */
-HRESULT WINAPI VarI4FromUI4(ULONG ulIn, LONG* plOut)
-{
- TRACE("( %lx, %p ), stub\n", ulIn, plOut );
-
- /* Check range of value.
- */
- if( ulIn < I4_MIN || ulIn > I4_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *plOut = (LONG) ulIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI4FromI2 [OLEAUT32.59]
- */
-HRESULT WINAPI VarI4FromI2(short sIn, LONG* plOut)
-{
- TRACE("( %d, %p ), stub\n", sIn, plOut );
-
- *plOut = (LONG) sIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI4FromStr [OLEAUT32.64]
- */
-HRESULT WINAPI VarI4FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, LONG* plOut)
-{
- TRACE("(%s, 0x%08lx, 0x%08lx, %p)\n", debugstr_w(strIn), lcid, dwFlags, plOut);
- return _VarI4FromStr(strIn, lcid, dwFlags, plOut);
-}
-
-/**********************************************************************
- * VarI4FromCy [OLEAUT32.62]
- * Convert currency to signed long
- */
-HRESULT WINAPI VarI4FromCy(CY cyIn, LONG* plOut) {
- double t = round((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000);
-
- if (t > I4_MAX || t < I4_MIN) return DISP_E_OVERFLOW;
-
- *plOut = (LONG)t;
- return S_OK;
-}
-
-/******************************************************************************
- * VarR4FromUI1 [OLEAUT32.68]
- */
-HRESULT WINAPI VarR4FromUI1(BYTE bIn, FLOAT* pfltOut)
-{
- TRACE("( %X, %p ), stub\n", bIn, pfltOut );
-
- *pfltOut = (FLOAT) bIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarR4FromI2 [OLEAUT32.69]
- */
-HRESULT WINAPI VarR4FromI2(short sIn, FLOAT* pfltOut)
-{
- TRACE("( %d, %p ), stub\n", sIn, pfltOut );
-
- *pfltOut = (FLOAT) sIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarR4FromI4 [OLEAUT32.70]
- */
-HRESULT WINAPI VarR4FromI4(LONG lIn, FLOAT* pfltOut)
-{
- TRACE("( %lx, %p ), stub\n", lIn, pfltOut );
-
- *pfltOut = (FLOAT) lIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarR4FromR8 [OLEAUT32.71]
- */
-HRESULT WINAPI VarR4FromR8(double dblIn, FLOAT* pfltOut)
-{
- TRACE("( %f, %p ), stub\n", dblIn, pfltOut );
-
- /* Check range of value.
- */
- if( dblIn < -(R4_MAX) || dblIn > R4_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pfltOut = (FLOAT) dblIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarR4FromDate [OLEAUT32.73]
- */
-HRESULT WINAPI VarR4FromDate(DATE dateIn, FLOAT* pfltOut)
-{
- TRACE("( %f, %p ), stub\n", dateIn, pfltOut );
-
- /* Check range of value.
- */
- if( dateIn < -(R4_MAX) || dateIn > R4_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pfltOut = (FLOAT) dateIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarR4FromBool [OLEAUT32.76]
- */
-HRESULT WINAPI VarR4FromBool(VARIANT_BOOL boolIn, FLOAT* pfltOut)
-{
- TRACE("( %d, %p ), stub\n", boolIn, pfltOut );
-
- *pfltOut = (FLOAT) boolIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarR4FromI1 [OLEAUT32.213]
- */
-HRESULT WINAPI VarR4FromI1(signed char cIn, FLOAT* pfltOut)
-{
- TRACE("( %c, %p ), stub\n", cIn, pfltOut );
-
- *pfltOut = (FLOAT) cIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarR4FromUI2 [OLEAUT32.214]
- */
-HRESULT WINAPI VarR4FromUI2(USHORT uiIn, FLOAT* pfltOut)
-{
- TRACE("( %d, %p ), stub\n", uiIn, pfltOut );
-
- *pfltOut = (FLOAT) uiIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarR4FromUI4 [OLEAUT32.215]
- */
-HRESULT WINAPI VarR4FromUI4(ULONG ulIn, FLOAT* pfltOut)
-{
- TRACE("( %ld, %p ), stub\n", ulIn, pfltOut );
-
- *pfltOut = (FLOAT) ulIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarR4FromStr [OLEAUT32.74]
- */
-HRESULT WINAPI VarR4FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, FLOAT* pfltOut)
-{
- TRACE("(%s, 0x%08lx, 0x%08lx, %p)\n", debugstr_w(strIn), lcid, dwFlags, pfltOut);
- return _VarR4FromStr(strIn, lcid, dwFlags, pfltOut);
-}
-
-/**********************************************************************
- * VarR4FromCy [OLEAUT32.72]
- * Convert currency to float
- */
-HRESULT WINAPI VarR4FromCy(CY cyIn, FLOAT* pfltOut) {
- *pfltOut = (FLOAT)((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000);
-
- return S_OK;
-}
-
/******************************************************************************
* VarDateFromUI1 [OLEAUT32.88]
*/
@@ -3409,502 +2744,6 @@
return S_OK;
}
-/******************************************************************************
- * VarI1FromUI1 [OLEAUT32.244]
- */
-HRESULT WINAPI VarI1FromUI1(BYTE bIn, signed char *pcOut)
-{
- TRACE("( %d, %p ), stub\n", bIn, pcOut );
-
- /* Check range of value.
- */
- if( bIn > I1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pcOut = (CHAR) bIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI1FromI2 [OLEAUT32.245]
- */
-HRESULT WINAPI VarI1FromI2(short uiIn, signed char *pcOut)
-{
- TRACE("( %d, %p ), stub\n", uiIn, pcOut );
-
- if( uiIn > I1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pcOut = (CHAR) uiIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI1FromI4 [OLEAUT32.246]
- */
-HRESULT WINAPI VarI1FromI4(LONG lIn, signed char *pcOut)
-{
- TRACE("( %ld, %p ), stub\n", lIn, pcOut );
-
- if( lIn < I1_MIN || lIn > I1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pcOut = (CHAR) lIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI1FromR4 [OLEAUT32.247]
- */
-HRESULT WINAPI VarI1FromR4(FLOAT fltIn, signed char *pcOut)
-{
- TRACE("( %f, %p ), stub\n", fltIn, pcOut );
-
- fltIn = round( fltIn );
- if( fltIn < I1_MIN || fltIn > I1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pcOut = (CHAR) fltIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI1FromR8 [OLEAUT32.248]
- */
-HRESULT WINAPI VarI1FromR8(double dblIn, signed char *pcOut)
-{
- TRACE("( %f, %p ), stub\n", dblIn, pcOut );
-
- dblIn = round( dblIn );
- if( dblIn < I1_MIN || dblIn > I1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pcOut = (CHAR) dblIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI1FromDate [OLEAUT32.249]
- */
-HRESULT WINAPI VarI1FromDate(DATE dateIn, signed char *pcOut)
-{
- TRACE("( %f, %p ), stub\n", dateIn, pcOut );
-
- dateIn = round( dateIn );
- if( dateIn < I1_MIN || dateIn > I1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pcOut = (CHAR) dateIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI1FromStr [OLEAUT32.251]
- */
-HRESULT WINAPI VarI1FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, signed char *pcOut)
-{
- TRACE("(%s, 0x%08lx, 0x%08lx, %p)\n", debugstr_w(strIn), lcid, dwFlags, pcOut);
- return _VarI1FromStr(strIn, lcid, dwFlags, pcOut);
-}
-
-/******************************************************************************
- * VarI1FromBool [OLEAUT32.253]
- */
-HRESULT WINAPI VarI1FromBool(VARIANT_BOOL boolIn, signed char *pcOut)
-{
- TRACE("( %d, %p ), stub\n", boolIn, pcOut );
-
- *pcOut = (CHAR) boolIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI1FromUI2 [OLEAUT32.254]
- */
-HRESULT WINAPI VarI1FromUI2(USHORT uiIn, signed char *pcOut)
-{
- TRACE("( %d, %p ), stub\n", uiIn, pcOut );
-
- if( uiIn > I1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pcOut = (CHAR) uiIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarI1FromUI4 [OLEAUT32.255]
- */
-HRESULT WINAPI VarI1FromUI4(ULONG ulIn, signed char *pcOut)
-{
- TRACE("( %ld, %p ), stub\n", ulIn, pcOut );
-
- if( ulIn > I1_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pcOut = (CHAR) ulIn;
-
- return S_OK;
-}
-
-/**********************************************************************
- * VarI1FromCy [OLEAUT32.250]
- * Convert currency to signed char
- */
-HRESULT WINAPI VarI1FromCy(CY cyIn, signed char *pcOut) {
- double t = round((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000);
-
- if (t > I1_MAX || t < I1_MIN) return DISP_E_OVERFLOW;
-
- *pcOut = (CHAR)t;
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI2FromUI1 [OLEAUT32.257]
- */
-HRESULT WINAPI VarUI2FromUI1(BYTE bIn, USHORT* puiOut)
-{
- TRACE("( %d, %p ), stub\n", bIn, puiOut );
-
- *puiOut = (USHORT) bIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI2FromI2 [OLEAUT32.258]
- */
-HRESULT WINAPI VarUI2FromI2(short uiIn, USHORT* puiOut)
-{
- TRACE("( %d, %p ), stub\n", uiIn, puiOut );
-
- if( uiIn < UI2_MIN )
- {
- return DISP_E_OVERFLOW;
- }
-
- *puiOut = (USHORT) uiIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI2FromI4 [OLEAUT32.259]
- */
-HRESULT WINAPI VarUI2FromI4(LONG lIn, USHORT* puiOut)
-{
- TRACE("( %ld, %p ), stub\n", lIn, puiOut );
-
- if( lIn < UI2_MIN || lIn > UI2_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *puiOut = (USHORT) lIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI2FromR4 [OLEAUT32.260]
- */
-HRESULT WINAPI VarUI2FromR4(FLOAT fltIn, USHORT* puiOut)
-{
- TRACE("( %f, %p ), stub\n", fltIn, puiOut );
-
- fltIn = round( fltIn );
- if( fltIn < UI2_MIN || fltIn > UI2_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *puiOut = (USHORT) fltIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI2FromR8 [OLEAUT32.261]
- */
-HRESULT WINAPI VarUI2FromR8(double dblIn, USHORT* puiOut)
-{
- TRACE("( %f, %p ), stub\n", dblIn, puiOut );
-
- dblIn = round( dblIn );
- if( dblIn < UI2_MIN || dblIn > UI2_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *puiOut = (USHORT) dblIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI2FromDate [OLEAUT32.262]
- */
-HRESULT WINAPI VarUI2FromDate(DATE dateIn, USHORT* puiOut)
-{
- TRACE("( %f, %p ), stub\n", dateIn, puiOut );
-
- dateIn = round( dateIn );
- if( dateIn < UI2_MIN || dateIn > UI2_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *puiOut = (USHORT) dateIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI2FromStr [OLEAUT32.264]
- */
-HRESULT WINAPI VarUI2FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, USHORT* puiOut)
-{
- TRACE("(%s, 0x%08lx, 0x%08lx, %p)\n", debugstr_w(strIn), lcid, dwFlags, puiOut);
- return _VarUI2FromStr(strIn, lcid, dwFlags, puiOut);
-}
-
-/******************************************************************************
- * VarUI2FromBool [OLEAUT32.266]
- */
-HRESULT WINAPI VarUI2FromBool(VARIANT_BOOL boolIn, USHORT* puiOut)
-{
- TRACE("( %d, %p ), stub\n", boolIn, puiOut );
-
- *puiOut = (USHORT) boolIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI2FromI1 [OLEAUT32.267]
- */
-HRESULT WINAPI VarUI2FromI1(signed char cIn, USHORT* puiOut)
-{
- TRACE("( %c, %p ), stub\n", cIn, puiOut );
-
- *puiOut = (USHORT) cIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI2FromUI4 [OLEAUT32.268]
- */
-HRESULT WINAPI VarUI2FromUI4(ULONG ulIn, USHORT* puiOut)
-{
- TRACE("( %ld, %p ), stub\n", ulIn, puiOut );
-
- if( ulIn > UI2_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *puiOut = (USHORT) ulIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI4FromStr [OLEAUT32.277]
- */
-HRESULT WINAPI VarUI4FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, ULONG* pulOut)
-{
- TRACE("(%s, 0x%08lx, 0x%08lx, %p)\n", debugstr_w(strIn), lcid, dwFlags, pulOut);
- return _VarUI4FromStr(strIn, lcid, dwFlags, pulOut);
-}
-
-/**********************************************************************
- * VarUI2FromCy [OLEAUT32.263]
- * Convert currency to unsigned short
- */
-HRESULT WINAPI VarUI2FromCy(CY cyIn, USHORT* pusOut) {
- double t = round((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000);
-
- if (t > UI2_MAX || t < UI2_MIN) return DISP_E_OVERFLOW;
-
- *pusOut = (USHORT)t;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI4FromUI1 [OLEAUT32.270]
- */
-HRESULT WINAPI VarUI4FromUI1(BYTE bIn, ULONG* pulOut)
-{
- TRACE("( %d, %p ), stub\n", bIn, pulOut );
-
- *pulOut = (USHORT) bIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI4FromI2 [OLEAUT32.271]
- */
-HRESULT WINAPI VarUI4FromI2(short uiIn, ULONG* pulOut)
-{
- TRACE("( %d, %p ), stub\n", uiIn, pulOut );
-
- if( uiIn < UI4_MIN )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pulOut = (ULONG) uiIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI4FromI4 [OLEAUT32.272]
- */
-HRESULT WINAPI VarUI4FromI4(LONG lIn, ULONG* pulOut)
-{
- TRACE("( %ld, %p ), stub\n", lIn, pulOut );
-
- if( lIn < 0 )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pulOut = (ULONG) lIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI4FromR4 [OLEAUT32.273]
- */
-HRESULT WINAPI VarUI4FromR4(FLOAT fltIn, ULONG* pulOut)
-{
- fltIn = round( fltIn );
- if( fltIn < UI4_MIN || fltIn > UI4_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pulOut = (ULONG) fltIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI4FromR8 [OLEAUT32.274]
- */
-HRESULT WINAPI VarUI4FromR8(double dblIn, ULONG* pulOut)
-{
- TRACE("( %f, %p ), stub\n", dblIn, pulOut );
-
- dblIn = round( dblIn );
- if( dblIn < UI4_MIN || dblIn > UI4_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pulOut = (ULONG) dblIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI4FromDate [OLEAUT32.275]
- */
-HRESULT WINAPI VarUI4FromDate(DATE dateIn, ULONG* pulOut)
-{
- TRACE("( %f, %p ), stub\n", dateIn, pulOut );
-
- dateIn = round( dateIn );
- if( dateIn < UI4_MIN || dateIn > UI4_MAX )
- {
- return DISP_E_OVERFLOW;
- }
-
- *pulOut = (ULONG) dateIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI4FromBool [OLEAUT32.279]
- */
-HRESULT WINAPI VarUI4FromBool(VARIANT_BOOL boolIn, ULONG* pulOut)
-{
- TRACE("( %d, %p ), stub\n", boolIn, pulOut );
-
- *pulOut = (ULONG) boolIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI4FromI1 [OLEAUT32.280]
- */
-HRESULT WINAPI VarUI4FromI1(signed char cIn, ULONG* pulOut)
-{
- TRACE("( %c, %p ), stub\n", cIn, pulOut );
-
- *pulOut = (ULONG) cIn;
-
- return S_OK;
-}
-
-/******************************************************************************
- * VarUI4FromUI2 [OLEAUT32.281]
- */
-HRESULT WINAPI VarUI4FromUI2(USHORT uiIn, ULONG* pulOut)
-{
- TRACE("( %d, %p ), stub\n", uiIn, pulOut );
-
- *pulOut = (ULONG) uiIn;
-
- return S_OK;
-}
-
-/**********************************************************************
- * VarUI4FromCy [OLEAUT32.276]
- * Convert currency to unsigned long
- */
-HRESULT WINAPI VarUI4FromCy(CY cyIn, ULONG* pulOut) {
- double t = round((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000);
-
- if (t > UI4_MAX || t < UI4_MIN) return DISP_E_OVERFLOW;
-
- *pulOut = (ULONG)t;
-
- return S_OK;
-}
-
/**********************************************************************
* VarCyFromUI1 [OLEAUT32.98]
* Convert unsigned char to currency