16 Jun
2023
16 Jun
'23
8:43 p.m.
Esme Povirk (@madewokherd) commented about dlls/uiautomationcore/uia_event.c:
+ return S_OK; +} + +static HRESULT create_clientside_uia_event(struct uia_event **out_event, int event_id, int scope, UiaEventCallback *cback, + SAFEARRAY *runtime_id) +{ + struct uia_event *event = NULL; + static LONG next_event_cookie; + HRESULT hr; + + *out_event = NULL; + hr = create_uia_event(&event, next_event_cookie, EVENT_TYPE_CLIENTSIDE); + if (FAILED(hr)) + return hr; + + InterlockedIncrement(&next_event_cookie); This isn't going to guarantee uniqueness when used concurrently unless you use the return value of InterlockedIncrement.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3066#note_35949