oleaut32: Don't crash in wrapper if variant resides in read-only memory.

This commit is contained in:
David Hedberg 2011-05-30 12:45:32 +02:00 committed by Alexandre Julliard
parent 6d5be5033e
commit fd543f5aa3
1 changed files with 3 additions and 8 deletions

View File

@ -2719,15 +2719,10 @@ HRESULT WINAPI VarCat(LPVARIANT left, LPVARIANT right, LPVARIANT out)
static HRESULT _VarChangeTypeExWrap (VARIANTARG* pvargDest,
VARIANTARG* pvargSrc, LCID lcid, USHORT wFlags, VARTYPE vt)
{
HRESULT res;
VARTYPE flags;
VARIANTARG vtmpsrc = *pvargSrc;
flags = V_VT(pvargSrc) & ~VT_TYPEMASK;
V_VT(pvargSrc) &= ~VT_RESERVED;
res = VariantChangeTypeEx(pvargDest,pvargSrc,lcid,wFlags,vt);
V_VT(pvargSrc) |= flags;
return res;
V_VT(&vtmpsrc) &= ~VT_RESERVED;
return VariantChangeTypeEx(pvargDest,&vtmpsrc,lcid,wFlags,vt);
}
/**********************************************************************