Jacek Caban (@jacek) commented about dlls/win32u/window.c:
*/ HWND is_current_thread_window( HWND hwnd ) { - WND *win; - HWND ret = 0; + struct user_entry entry; + HANDLE handle;
- if (!(win = get_win_ptr( hwnd )) || win == WND_OTHER_PROCESS || win == WND_DESKTOP) - return 0; - if (win->tid == GetCurrentThreadId()) ret = win->obj.handle; - release_win_ptr( win ); - return ret; + if (!get_user_entry( hwnd, NTUSER_OBJ_WINDOW, &entry, &handle )) return 0; + if (entry.tid != GetCurrentThreadId()) return 0; Not a big deal, but since `get_window_thread` is optimized later in the series, we could just use it here to simplify the code a bit. Same goes for `is_current_process_window`.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/8018#note_103100