Jinoh Kang (@iamahuman) commented about dlls/comdlg32/itemdlg.c:
static HRESULT create_dialog(FileDialogImpl *This, HWND parent) { INT_PTR res;
- actctx_state comdlg32_actctx_state = {0};
- if (This->dlg_hwnd)
return E_UNEXPECTED;
- if (!GetCurrentActCtx(&This->user_actctx))
ERR("Failed to get current activation context, last error %lx\n", GetLastError());
There is a memory leak. `GetCurrentActCtx` outputs a reference-counted handle that shall be freed later with [`ReleaseActCtx`].
Also, note that `GetCurrentActCtx` is not supposed to output `INVALID_HANDLE_VALUE` on failure.
[`ReleaseActCtx`]: https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-relea...
```suggestion:-1+0 if (!GetCurrentActCtx(&This->user_actctx)) { ERR("Failed to get current activation context, last error %lx\n", GetLastError()); This->user_actctx = INVALID_HANDLE_VALUE; } ```