Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
803a5f07
Commit
803a5f07
authored
Aug 26, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move NtUserPerMonitorDPIPhysicalToLogicalPoint implementation from user32.
parent
352e24dc
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
52 deletions
+30
-52
sysparams.c
dlls/user32/sysparams.c
+0
-50
user32.spec
dlls/user32/user32.spec
+1
-1
syscall.c
dlls/win32u/syscall.c
+1
-0
sysparams.c
dlls/win32u/sysparams.c
+17
-0
win32u.spec
dlls/win32u/win32u.spec
+1
-1
syscall.h
dlls/wow64win/syscall.h
+1
-0
user.c
dlls/wow64win/user.c
+8
-0
ntuser.h
include/ntuser.h
+1
-0
No files found.
dlls/user32/sysparams.c
View file @
803a5f07
...
@@ -670,36 +670,6 @@ BOOL WINAPI EnumDisplaySettingsExW( const WCHAR *device, DWORD mode,
...
@@ -670,36 +670,6 @@ BOOL WINAPI EnumDisplaySettingsExW( const WCHAR *device, DWORD mode,
}
}
/**********************************************************************
/**********************************************************************
* get_win_monitor_dpi
*/
static
UINT
get_win_monitor_dpi
(
HWND
hwnd
)
{
/* FIXME: use the monitor DPI instead */
return
system_dpi
;
}
/**********************************************************************
* map_dpi_point
*/
static
POINT
map_dpi_point
(
POINT
pt
,
UINT
dpi_from
,
UINT
dpi_to
)
{
if
(
dpi_from
&&
dpi_to
&&
dpi_from
!=
dpi_to
)
{
pt
.
x
=
MulDiv
(
pt
.
x
,
dpi_to
,
dpi_from
);
pt
.
y
=
MulDiv
(
pt
.
y
,
dpi_to
,
dpi_from
);
}
return
pt
;
}
/**********************************************************************
* point_phys_to_win_dpi
*/
static
POINT
point_phys_to_win_dpi
(
HWND
hwnd
,
POINT
pt
)
{
return
map_dpi_point
(
pt
,
get_win_monitor_dpi
(
hwnd
),
GetDpiForWindow
(
hwnd
));
}
/**********************************************************************
* SetProcessDpiAwarenessContext (USER32.@)
* SetProcessDpiAwarenessContext (USER32.@)
*/
*/
BOOL
WINAPI
SetProcessDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT
context
)
BOOL
WINAPI
SetProcessDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT
context
)
...
@@ -871,26 +841,6 @@ DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT
...
@@ -871,26 +841,6 @@ DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT
return
ULongToHandle
(
prev
);
return
ULongToHandle
(
prev
);
}
}
/**********************************************************************
* PhysicalToLogicalPointForPerMonitorDPI (USER32.@)
*/
BOOL
WINAPI
PhysicalToLogicalPointForPerMonitorDPI
(
HWND
hwnd
,
POINT
*
pt
)
{
DPI_AWARENESS_CONTEXT
context
;
RECT
rect
;
BOOL
ret
=
FALSE
;
context
=
SetThreadDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
);
if
(
GetWindowRect
(
hwnd
,
&
rect
)
&&
pt
->
x
>=
rect
.
left
&&
pt
->
y
>=
rect
.
top
&&
pt
->
x
<=
rect
.
right
&&
pt
->
y
<=
rect
.
bottom
)
{
*
pt
=
point_phys_to_win_dpi
(
hwnd
,
*
pt
);
ret
=
TRUE
;
}
SetThreadDpiAwarenessContext
(
context
);
return
ret
;
}
/***********************************************************************
/***********************************************************************
* MonitorFromRect (USER32.@)
* MonitorFromRect (USER32.@)
*/
*/
...
...
dlls/user32/user32.spec
View file @
803a5f07
...
@@ -565,7 +565,7 @@
...
@@ -565,7 +565,7 @@
@ stdcall PeekMessageA(ptr long long long long)
@ stdcall PeekMessageA(ptr long long long long)
@ stdcall PeekMessageW(ptr long long long long)
@ stdcall PeekMessageW(ptr long long long long)
@ stdcall PhysicalToLogicalPoint(long ptr)
@ stdcall PhysicalToLogicalPoint(long ptr)
@ stdcall PhysicalToLogicalPointForPerMonitorDPI(long ptr)
@ stdcall PhysicalToLogicalPointForPerMonitorDPI(long ptr)
NtUserPerMonitorDPIPhysicalToLogicalPoint
@ stub PlaySoundEvent
@ stub PlaySoundEvent
@ stdcall PostMessageA(long long long long)
@ stdcall PostMessageA(long long long long)
@ stdcall PostMessageW(long long long long)
@ stdcall PostMessageW(long long long long)
...
...
dlls/win32u/syscall.c
View file @
803a5f07
...
@@ -230,6 +230,7 @@ static void * const syscalls[] =
...
@@ -230,6 +230,7 @@ static void * const syscalls[] =
NtUserOpenInputDesktop
,
NtUserOpenInputDesktop
,
NtUserOpenWindowStation
,
NtUserOpenWindowStation
,
NtUserPeekMessage
,
NtUserPeekMessage
,
NtUserPerMonitorDPIPhysicalToLogicalPoint
,
NtUserPostMessage
,
NtUserPostMessage
,
NtUserPostThreadMessage
,
NtUserPostThreadMessage
,
NtUserQueryInputContext
,
NtUserQueryInputContext
,
...
...
dlls/win32u/sysparams.c
View file @
803a5f07
...
@@ -2461,6 +2461,23 @@ BOOL WINAPI NtUserLogicalToPerMonitorDPIPhysicalPoint( HWND hwnd, POINT *pt )
...
@@ -2461,6 +2461,23 @@ BOOL WINAPI NtUserLogicalToPerMonitorDPIPhysicalPoint( HWND hwnd, POINT *pt )
return
TRUE
;
return
TRUE
;
}
}
/**********************************************************************
* NtUserPerMonitorDPIPhysicalToLogicalPoint (win32u.@)
*/
BOOL
WINAPI
NtUserPerMonitorDPIPhysicalToLogicalPoint
(
HWND
hwnd
,
POINT
*
pt
)
{
RECT
rect
;
BOOL
ret
=
FALSE
;
if
(
get_window_rect
(
hwnd
,
&
rect
,
0
)
&&
pt
->
x
>=
rect
.
left
&&
pt
->
y
>=
rect
.
top
&&
pt
->
x
<=
rect
.
right
&&
pt
->
y
<=
rect
.
bottom
)
{
*
pt
=
point_phys_to_win_dpi
(
hwnd
,
*
pt
);
ret
=
TRUE
;
}
return
ret
;
}
/* retrieve the cached base keys for a given entry */
/* retrieve the cached base keys for a given entry */
static
BOOL
get_base_keys
(
enum
parameter_key
index
,
HKEY
*
base_key
,
HKEY
*
volatile_key
)
static
BOOL
get_base_keys
(
enum
parameter_key
index
,
HKEY
*
base_key
,
HKEY
*
volatile_key
)
{
{
...
...
dlls/win32u/win32u.spec
View file @
803a5f07
...
@@ -1099,7 +1099,7 @@
...
@@ -1099,7 +1099,7 @@
@ stub NtUserPaintMenuBar
@ stub NtUserPaintMenuBar
@ stub NtUserPaintMonitor
@ stub NtUserPaintMonitor
@ stdcall -syscall NtUserPeekMessage(ptr long long long long)
@ stdcall -syscall NtUserPeekMessage(ptr long long long long)
@ st
ub NtUserPerMonitorDPIPhysicalToLogicalPoint
@ st
dcall -syscall NtUserPerMonitorDPIPhysicalToLogicalPoint(long ptr)
@ stub NtUserPhysicalToLogicalDpiPointForWindow
@ stub NtUserPhysicalToLogicalDpiPointForWindow
@ stub NtUserPhysicalToLogicalPoint
@ stub NtUserPhysicalToLogicalPoint
@ stub NtUserPostKeyboardInputMessage
@ stub NtUserPostKeyboardInputMessage
...
...
dlls/wow64win/syscall.h
View file @
803a5f07
...
@@ -216,6 +216,7 @@
...
@@ -216,6 +216,7 @@
SYSCALL_ENTRY( NtUserOpenInputDesktop ) \
SYSCALL_ENTRY( NtUserOpenInputDesktop ) \
SYSCALL_ENTRY( NtUserOpenWindowStation ) \
SYSCALL_ENTRY( NtUserOpenWindowStation ) \
SYSCALL_ENTRY( NtUserPeekMessage ) \
SYSCALL_ENTRY( NtUserPeekMessage ) \
SYSCALL_ENTRY( NtUserPerMonitorDPIPhysicalToLogicalPoint ) \
SYSCALL_ENTRY( NtUserPostMessage ) \
SYSCALL_ENTRY( NtUserPostMessage ) \
SYSCALL_ENTRY( NtUserPostThreadMessage ) \
SYSCALL_ENTRY( NtUserPostThreadMessage ) \
SYSCALL_ENTRY( NtUserQueryInputContext ) \
SYSCALL_ENTRY( NtUserQueryInputContext ) \
...
...
dlls/wow64win/user.c
View file @
803a5f07
...
@@ -3100,6 +3100,14 @@ NTSTATUS WINAPI wow64_NtUserPeekMessage( UINT *args )
...
@@ -3100,6 +3100,14 @@ NTSTATUS WINAPI wow64_NtUserPeekMessage( UINT *args )
return
TRUE
;
return
TRUE
;
}
}
NTSTATUS
WINAPI
wow64_NtUserPerMonitorDPIPhysicalToLogicalPoint
(
UINT
*
args
)
{
HWND
hwnd
=
get_handle
(
&
args
);
POINT
*
pt
=
get_ptr
(
&
args
);
return
NtUserPerMonitorDPIPhysicalToLogicalPoint
(
hwnd
,
pt
);
}
NTSTATUS
WINAPI
wow64_NtUserPostMessage
(
UINT
*
args
)
NTSTATUS
WINAPI
wow64_NtUserPostMessage
(
UINT
*
args
)
{
{
HWND
hwnd
=
get_handle
(
&
args
);
HWND
hwnd
=
get_handle
(
&
args
);
...
...
include/ntuser.h
View file @
803a5f07
...
@@ -788,6 +788,7 @@ BOOL WINAPI NtUserOpenClipboard( HWND hwnd, ULONG unk );
...
@@ -788,6 +788,7 @@ BOOL WINAPI NtUserOpenClipboard( HWND hwnd, ULONG unk );
HDESK
WINAPI
NtUserOpenDesktop
(
OBJECT_ATTRIBUTES
*
attr
,
DWORD
flags
,
ACCESS_MASK
access
);
HDESK
WINAPI
NtUserOpenDesktop
(
OBJECT_ATTRIBUTES
*
attr
,
DWORD
flags
,
ACCESS_MASK
access
);
HDESK
WINAPI
NtUserOpenInputDesktop
(
DWORD
flags
,
BOOL
inherit
,
ACCESS_MASK
access
);
HDESK
WINAPI
NtUserOpenInputDesktop
(
DWORD
flags
,
BOOL
inherit
,
ACCESS_MASK
access
);
BOOL
WINAPI
NtUserPeekMessage
(
MSG
*
msg_out
,
HWND
hwnd
,
UINT
first
,
UINT
last
,
UINT
flags
);
BOOL
WINAPI
NtUserPeekMessage
(
MSG
*
msg_out
,
HWND
hwnd
,
UINT
first
,
UINT
last
,
UINT
flags
);
BOOL
WINAPI
NtUserPerMonitorDPIPhysicalToLogicalPoint
(
HWND
hwnd
,
POINT
*
pt
);
BOOL
WINAPI
NtUserPostMessage
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
);
BOOL
WINAPI
NtUserPostMessage
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
);
BOOL
WINAPI
NtUserPostThreadMessage
(
DWORD
thread
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
);
BOOL
WINAPI
NtUserPostThreadMessage
(
DWORD
thread
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
);
UINT_PTR
WINAPI
NtUserQueryInputContext
(
HIMC
handle
,
UINT
attr
);
UINT_PTR
WINAPI
NtUserQueryInputContext
(
HIMC
handle
,
UINT
attr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment