May 17, 2026
7:38 a.m.
The OLE clipboard caches a per-process window handle. When the STA thread that created this window terminates, the window is destroyed but the stale handle remains cached. Subsequent OleSetClipboard calls use this stale handle, causing OpenClipboard to fail with CLIPBRD_E_CANT_OPEN. Check whether the cached window is still valid using IsWindow() before returning it. If the window has been destroyed, clear the cache so a fresh window is created on the current thread. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59519 -- v2: ole32: Validate cached clipboard window handle in get_clipbrd_window. ole32/tests: Add test for OLE clipboard reuse across STA threads. https://gitlab.winehq.org/wine/wine/-/merge_requests/10889