[PATCH 5/5] user32: Remove no longer needed helpers.
Jacek Caban
wine at gitlab.winehq.org
Mon Jun 27 05:18:38 CDT 2022
From: Jacek Caban <jacek at codeweavers.com>
---
dlls/user32/sysparams.c | 19 -------------------
dlls/user32/win.c | 37 ++++++++++++-------------------------
dlls/user32/win.h | 9 +--------
3 files changed, 13 insertions(+), 52 deletions(-)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
index 738186afb89..26259ab76e9 100644
--- a/dlls/user32/sysparams.c
+++ b/dlls/user32/sysparams.c
@@ -669,15 +669,6 @@ BOOL WINAPI EnumDisplaySettingsExW( const WCHAR *device, DWORD mode,
return NtUserEnumDisplaySettings( &str, mode, dev_mode, flags );
}
-/**********************************************************************
- * get_monitor_dpi
- */
-UINT get_monitor_dpi( HMONITOR monitor )
-{
- /* FIXME: use the monitor DPI instead */
- return system_dpi;
-}
-
/**********************************************************************
* get_win_monitor_dpi
*/
@@ -729,16 +720,6 @@ static POINT point_phys_to_win_dpi( HWND hwnd, POINT pt )
return map_dpi_point( pt, get_win_monitor_dpi( hwnd ), GetDpiForWindow( hwnd ));
}
-/**********************************************************************
- * point_win_to_thread_dpi
- */
-POINT point_win_to_thread_dpi( HWND hwnd, POINT pt )
-{
- UINT dpi = get_thread_dpi();
- if (!dpi) dpi = get_win_monitor_dpi( hwnd );
- return map_dpi_point( pt, GetDpiForWindow( hwnd ), dpi );
-}
-
/**********************************************************************
* map_dpi_rect
*/
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index 9d19376fe44..d1b25da0e68 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -37,25 +37,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(win);
-/***********************************************************************
- * get_user_handle_ptr
- */
-void *get_user_handle_ptr( HANDLE handle, unsigned int type )
-{
- return (void *)NtUserCallTwoParam( HandleToUlong(handle), type, NtUserGetHandlePtr );
-}
-
-
-/***********************************************************************
- * release_user_handle_ptr
- */
-void release_user_handle_ptr( void *ptr )
-{
- assert( ptr && ptr != OBJ_OTHER_PROCESS );
- NtUserCallOneParam( 1, NtUserLock );
-}
-
-
/*******************************************************************
* list_window_children
*
@@ -149,16 +130,22 @@ BOOL is_desktop_window( HWND hwnd )
*/
WND *WIN_GetPtr( HWND hwnd )
{
- WND *ptr;
-
- if ((ptr = get_user_handle_ptr( hwnd, NTUSER_OBJ_WINDOW )) == WND_OTHER_PROCESS)
- {
- if (is_desktop_window( hwnd )) ptr = WND_DESKTOP;
- }
+ WND *ptr = (void *)NtUserCallTwoParam( HandleToUlong(hwnd), NTUSER_OBJ_WINDOW, NtUserGetHandlePtr );
+ if (ptr == WND_OTHER_PROCESS && is_desktop_window( hwnd )) ptr = WND_DESKTOP;
return ptr;
}
+/***********************************************************************
+ * WIN_ReleasePtr
+ */
+void WIN_ReleasePtr( WND *ptr )
+{
+ assert( ptr && ptr != OBJ_OTHER_PROCESS );
+ NtUserCallOneParam( 1, NtUserLock );
+}
+
+
/***********************************************************************
* WIN_IsCurrentProcess
*
diff --git a/dlls/user32/win.h b/dlls/user32/win.h
index bce93617d3f..59a7e0e2e38 100644
--- a/dlls/user32/win.h
+++ b/dlls/user32/win.h
@@ -37,6 +37,7 @@ struct tagDIALOGINFO;
extern HWND get_hwnd_message_parent(void) DECLSPEC_HIDDEN;
extern BOOL is_desktop_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern WND *WIN_GetPtr( HWND hwnd ) DECLSPEC_HIDDEN;
+extern void WIN_ReleasePtr( WND *ptr ) DECLSPEC_HIDDEN;
extern HWND WIN_GetFullHandle( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND WIN_IsCurrentProcess( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND WIN_IsCurrentThread( HWND hwnd ) DECLSPEC_HIDDEN;
@@ -48,20 +49,12 @@ extern HWND *WIN_ListChildren( HWND hwnd ) DECLSPEC_HIDDEN;
extern void MDI_CalcDefaultChildPos( HWND hwndClient, INT total, LPPOINT lpPos, INT delta, UINT *id ) DECLSPEC_HIDDEN;
extern HDESK open_winstation_desktop( HWINSTA hwinsta, LPCWSTR name, DWORD flags, BOOL inherit, ACCESS_MASK access ) DECLSPEC_HIDDEN;
-/* to release pointers retrieved by WIN_GetPtr */
-static inline void WIN_ReleasePtr( WND *ptr )
-{
- release_user_handle_ptr( ptr );
-}
-
extern void WINPOS_ActivateOtherWindow( HWND hwnd ) DECLSPEC_HIDDEN;
-extern UINT get_monitor_dpi( HMONITOR monitor ) DECLSPEC_HIDDEN;
extern UINT get_win_monitor_dpi( HWND hwnd ) DECLSPEC_HIDDEN;
extern UINT get_thread_dpi(void) DECLSPEC_HIDDEN;
extern POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to ) DECLSPEC_HIDDEN;
extern POINT point_win_to_phys_dpi( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
-extern POINT point_win_to_thread_dpi( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
extern RECT map_dpi_rect( RECT rect, UINT dpi_from, UINT dpi_to ) DECLSPEC_HIDDEN;
extern RECT rect_win_to_thread_dpi( HWND hwnd, RECT rect ) DECLSPEC_HIDDEN;
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/321
More information about the wine-devel
mailing list