Commit b6c5bae7 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

oleaut32: Don't use __tagBRECORD type.

parent b87e9620
...@@ -585,11 +585,11 @@ HRESULT VARIANT_ClearInd(VARIANTARG *pVarg) ...@@ -585,11 +585,11 @@ HRESULT VARIANT_ClearInd(VARIANTARG *pVarg)
case VT_RECORD: case VT_RECORD:
case VT_RECORD | VT_BYREF: case VT_RECORD | VT_BYREF:
{ {
struct __tagBRECORD* pBr = &V_UNION(pVarg,brecVal); IRecordInfo *rec_info = V_RECORDINFO(pVarg);
if (pBr->pRecInfo) if (rec_info)
{ {
IRecordInfo_RecordClear(pBr->pRecInfo, pBr->pvRecord); IRecordInfo_RecordClear(rec_info, V_RECORD(pVarg));
IRecordInfo_Release(pBr->pRecInfo); IRecordInfo_Release(rec_info);
} }
break; break;
} }
...@@ -645,11 +645,11 @@ HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG* pVarg) ...@@ -645,11 +645,11 @@ HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG* pVarg)
} }
else if (V_VT(pVarg) == VT_RECORD) else if (V_VT(pVarg) == VT_RECORD)
{ {
struct __tagBRECORD* pBr = &V_UNION(pVarg,brecVal); IRecordInfo *rec_info = V_RECORDINFO(pVarg);
if (pBr->pRecInfo) if (rec_info)
{ {
IRecordInfo_RecordClear(pBr->pRecInfo, pBr->pvRecord); IRecordInfo_RecordClear(rec_info, V_RECORD(pVarg));
IRecordInfo_Release(pBr->pRecInfo); IRecordInfo_Release(rec_info);
} }
} }
else if (V_VT(pVarg) == VT_DISPATCH || else if (V_VT(pVarg) == VT_DISPATCH ||
...@@ -669,31 +669,28 @@ HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG* pVarg) ...@@ -669,31 +669,28 @@ HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG* pVarg)
*/ */
static HRESULT VARIANT_CopyIRecordInfo(VARIANT *dest, const VARIANT *src) static HRESULT VARIANT_CopyIRecordInfo(VARIANT *dest, const VARIANT *src)
{ {
struct __tagBRECORD *dest_rec = &V_UNION(dest, brecVal); IRecordInfo *src_info = V_RECORDINFO(src);
const struct __tagBRECORD *src_rec = &V_UNION(src, brecVal);
HRESULT hr = S_OK; HRESULT hr = S_OK;
ULONG size; ULONG size;
if (!src_rec->pRecInfo) if (!src_info)
{ {
if (src_rec->pvRecord) return E_INVALIDARG; if (V_RECORD(src)) return E_INVALIDARG;
return S_OK; return S_OK;
} }
hr = IRecordInfo_GetSize(src_rec->pRecInfo, &size); hr = IRecordInfo_GetSize(src_info, &size);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
/* Windows does not use RecordCreate() here, memory should be allocated in compatible way so RecordDestroy() /* Windows does not use RecordCreate() here, memory should be allocated in compatible way so RecordDestroy()
could free it later. */ could free it later. */
dest_rec->pvRecord = CoTaskMemAlloc(size); V_RECORD(dest) = CoTaskMemAlloc(size);
if (!dest_rec->pvRecord) return E_OUTOFMEMORY; if (!V_RECORD(dest)) return E_OUTOFMEMORY;
if (size) if (size)
memset(dest_rec->pvRecord, 0, size); memset(V_RECORD(dest), 0, size);
dest_rec->pRecInfo = src_rec->pRecInfo; IRecordInfo_AddRef(V_RECORDINFO(dest) = src_info);
IRecordInfo_AddRef(src_rec->pRecInfo); return IRecordInfo_RecordCopy(src_info, V_RECORD(src), V_RECORD(dest));
return IRecordInfo_RecordCopy(src_rec->pRecInfo, src_rec->pvRecord, dest_rec->pvRecord);
} }
/****************************************************************************** /******************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment