Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/oleaut32/variant.c | 13 +++++++------ include/oleauto.h | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 36191b6b424..b20ddffab5f 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -689,10 +689,10 @@ HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG* pVarg) /****************************************************************************** * Copy an IRecordInfo object contained in a variant. */ -static HRESULT VARIANT_CopyIRecordInfo(VARIANT *dest, VARIANT *src) +static HRESULT VARIANT_CopyIRecordInfo(VARIANT *dest, const VARIANT *src) { struct __tagBRECORD *dest_rec = &V_UNION(dest, brecVal); - struct __tagBRECORD *src_rec = &V_UNION(src, brecVal); + const struct __tagBRECORD *src_rec = &V_UNION(src, brecVal); HRESULT hr = S_OK; ULONG size;
@@ -745,7 +745,7 @@ static HRESULT VARIANT_CopyIRecordInfo(VARIANT *dest, VARIANT *src) * reference count increased using IUnknown_AddRef(). * - For all by-reference types, only the referencing pointer is copied. */ -HRESULT WINAPI VariantCopy(VARIANTARG* pvargDest, VARIANTARG* pvargSrc) +HRESULT WINAPI VariantCopy(VARIANTARG* pvargDest, const VARIANTARG* pvargSrc) { HRESULT hres = S_OK;
@@ -844,9 +844,10 @@ static inline size_t VARIANT_DataSize(const VARIANT* pv) * pvargDest is always cleared using VariantClear() before pvargSrc is copied * to it. If clearing pvargDest fails, so does this function. */ -HRESULT WINAPI VariantCopyInd(VARIANT* pvargDest, VARIANTARG* pvargSrc) +HRESULT WINAPI VariantCopyInd(VARIANT* pvargDest, const VARIANTARG* pvargSrc) { - VARIANTARG vTmp, *pSrc = pvargSrc; + const VARIANTARG *pSrc = pvargSrc; + VARIANTARG vTmp; VARTYPE vt; HRESULT hres = S_OK;
@@ -934,7 +935,7 @@ HRESULT WINAPI VariantCopyInd(VARIANT* pvargDest, VARIANTARG* pvargSrc) VariantCopyInd_Return:
if (pSrc != pvargSrc) - VariantClear(pSrc); + VariantClear(&vTmp);
TRACE("returning 0x%08x, %s\n", hres, debugstr_variant(pvargDest)); return hres; diff --git a/include/oleauto.h b/include/oleauto.h index cc50f189475..8528b74c02f 100644 --- a/include/oleauto.h +++ b/include/oleauto.h @@ -186,8 +186,8 @@ HRESULT WINAPI GetRecordInfoFromGuids(REFGUID,ULONG,ULONG,LCID,REFGUID,IRecordIn
void WINAPI VariantInit(VARIANT*); HRESULT WINAPI VariantClear(VARIANT*); -HRESULT WINAPI VariantCopy(VARIANT*,VARIANT*); -HRESULT WINAPI VariantCopyInd(VARIANT*,VARIANT*); +HRESULT WINAPI VariantCopy(VARIANTARG *dst, const VARIANTARG *src); +HRESULT WINAPI VariantCopyInd(VARIANT *dst, const VARIANTARG *src); HRESULT WINAPI VariantChangeType(VARIANT*,VARIANT*,USHORT,VARTYPE); HRESULT WINAPI VariantChangeTypeEx(VARIANT*,VARIANT*,LCID,USHORT,VARTYPE);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/oleaut32/variant.c | 4 ++-- include/oleauto.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index b20ddffab5f..ace33a006f4 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -960,7 +960,7 @@ VariantCopyInd_Return: * The LCID used for the conversion is LOCALE_USER_DEFAULT. * See VariantChangeTypeEx. */ -HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG* pvargDest, VARIANTARG* pvargSrc, +HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG* pvargDest, const VARIANTARG* pvargSrc, USHORT wFlags, VARTYPE vt) { return VariantChangeTypeEx( pvargDest, pvargSrc, LOCALE_USER_DEFAULT, wFlags, vt ); @@ -986,7 +986,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG* pvargDest, VARIAN * pvargDest and pvargSrc can point to the same variant to perform an in-place * conversion. If the conversion is successful, pvargSrc will be freed. */ -HRESULT WINAPI VariantChangeTypeEx(VARIANTARG* pvargDest, VARIANTARG* pvargSrc, +HRESULT WINAPI VariantChangeTypeEx(VARIANTARG* pvargDest, const VARIANTARG* pvargSrc, LCID lcid, USHORT wFlags, VARTYPE vt) { HRESULT res = S_OK; diff --git a/include/oleauto.h b/include/oleauto.h index 8528b74c02f..45edfbb84af 100644 --- a/include/oleauto.h +++ b/include/oleauto.h @@ -188,8 +188,8 @@ void WINAPI VariantInit(VARIANT*); HRESULT WINAPI VariantClear(VARIANT*); HRESULT WINAPI VariantCopy(VARIANTARG *dst, const VARIANTARG *src); HRESULT WINAPI VariantCopyInd(VARIANT *dst, const VARIANTARG *src); -HRESULT WINAPI VariantChangeType(VARIANT*,VARIANT*,USHORT,VARTYPE); -HRESULT WINAPI VariantChangeTypeEx(VARIANT*,VARIANT*,LCID,USHORT,VARTYPE); +HRESULT WINAPI VariantChangeType(VARIANTARG *dst, const VARIANTARG *src, USHORT flags, VARTYPE vt); +HRESULT WINAPI VariantChangeTypeEx(VARIANTARG *dst, const VARIANTARG *src, LCID lcid, USHORT flags, VARTYPE vt);
/* VariantChangeType/VariantChangeTypeEx flags */ #define VARIANT_NOVALUEPROP 0x01 /* Don't get the default value property from IDispatch */