Commit cd38abc4 authored by Kevin Puetz's avatar Kevin Puetz Committed by Alexandre Julliard

oleaut32: Fix error handling/reporting in TLB_copy_all_custdata.

VariantCopy clears existing contents of pvargDest and thus requires it contain a valid (possibly-empty) VARIANT, not uninitialized garbage. If a failure still occurs, propgate the HRESULT to GetAll*CustData. Signed-off-by: 's avatarKevin Puetz <PuetzKevinA@JohnDeere.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 8341b255
...@@ -5288,6 +5288,7 @@ static HRESULT TLB_copy_all_custdata(const struct list *custdata_list, CUSTDATA ...@@ -5288,6 +5288,7 @@ static HRESULT TLB_copy_all_custdata(const struct list *custdata_list, CUSTDATA
TLBCustData *pCData; TLBCustData *pCData;
unsigned int ct; unsigned int ct;
CUSTDATAITEM *cdi; CUSTDATAITEM *cdi;
HRESULT hr = S_OK;
ct = list_count(custdata_list); ct = list_count(custdata_list);
...@@ -5300,11 +5301,13 @@ static HRESULT TLB_copy_all_custdata(const struct list *custdata_list, CUSTDATA ...@@ -5300,11 +5301,13 @@ static HRESULT TLB_copy_all_custdata(const struct list *custdata_list, CUSTDATA
cdi = pCustData->prgCustData; cdi = pCustData->prgCustData;
LIST_FOR_EACH_ENTRY(pCData, custdata_list, TLBCustData, entry){ LIST_FOR_EACH_ENTRY(pCData, custdata_list, TLBCustData, entry){
cdi->guid = *TLB_get_guid_null(pCData->guid); cdi->guid = *TLB_get_guid_null(pCData->guid);
VariantCopy(&cdi->varValue, &pCData->data); VariantInit(&cdi->varValue);
hr = VariantCopy(&cdi->varValue, &pCData->data);
if(FAILED(hr)) break;
++cdi; ++cdi;
} }
return S_OK; return hr;
} }
......
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