24 Feb
2023
24 Feb
'23
6:01 p.m.
Esme Povirk (@madewokherd) commented about dlls/uiautomationcore/uia_com_client.c:
+ *out_arr = NULL; + hr = SafeArrayGetVartype(sa, &vt); + if (FAILED(hr)) + return hr; + + if (vt != VT_I4) + return E_INVALIDARG; + + hr = get_safearray_bounds(sa, &lbound, &elems); + if (FAILED(hr)) + return hr; + + if (!(arr = CoTaskMemAlloc(elems * sizeof(int)))) + return E_OUTOFMEMORY; + + for (i = 0; i < elems; i++) I'd expect that a memcpy would be faster and no more complex than this.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2269#note_25423