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
9fa96f54
Commit
9fa96f54
authored
Apr 11, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Implement Get/SetProcessDpiAwarenessInternal().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4a6a7655
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
2 deletions
+58
-2
ext-ms-win-rtcore-ntuser-dpi-l1-1-0.spec
...tuser-dpi-l1-1-0/ext-ms-win-rtcore-ntuser-dpi-l1-1-0.spec
+2
-2
sysparams.c
dlls/user32/sysparams.c
+31
-0
sysparams.c
dlls/user32/tests/sysparams.c
+21
-0
user32.spec
dlls/user32/user32.spec
+2
-0
winuser.h
include/winuser.h
+2
-0
No files found.
dlls/ext-ms-win-rtcore-ntuser-dpi-l1-1-0/ext-ms-win-rtcore-ntuser-dpi-l1-1-0.spec
View file @
9fa96f54
@ stub GetDpiForMonitorInternal
@ st
ub
GetProcessDpiAwarenessInternal
@ st
ub
SetProcessDpiAwarenessInternal
@ st
dcall GetProcessDpiAwarenessInternal(long ptr) user32.
GetProcessDpiAwarenessInternal
@ st
dcall SetProcessDpiAwarenessInternal(long) user32.
SetProcessDpiAwarenessInternal
dlls/user32/sysparams.c
View file @
9fa96f54
...
...
@@ -2963,6 +2963,37 @@ BOOL WINAPI SetProcessDpiAwarenessContext( DPI_AWARENESS_CONTEXT context )
return
TRUE
;
}
/**********************************************************************
* GetProcessDpiAwarenessInternal (USER32.@)
*/
BOOL
WINAPI
GetProcessDpiAwarenessInternal
(
HANDLE
process
,
DPI_AWARENESS
*
awareness
)
{
if
(
process
&&
process
!=
GetCurrentProcess
())
{
WARN
(
"not supported on other process %p
\n
"
,
process
);
*
awareness
=
DPI_AWARENESS_UNAWARE
;
}
else
*
awareness
=
GetAwarenessFromDpiAwarenessContext
(
dpi_awareness
);
return
TRUE
;
}
/**********************************************************************
* SetProcessDpiAwarenessInternal (USER32.@)
*/
BOOL
WINAPI
SetProcessDpiAwarenessInternal
(
DPI_AWARENESS
awareness
)
{
static
const
DPI_AWARENESS_CONTEXT
contexts
[
3
]
=
{
DPI_AWARENESS_CONTEXT_UNAWARE
,
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
,
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
};
if
(
awareness
<
DPI_AWARENESS_UNAWARE
||
awareness
>
DPI_AWARENESS_PER_MONITOR_AWARE
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
return
SetProcessDpiAwarenessContext
(
contexts
[
awareness
]
);
}
/***********************************************************************
* AreDpiAwarenessContextsEqual (USER32.@)
*/
...
...
dlls/user32/tests/sysparams.c
View file @
9fa96f54
...
...
@@ -42,6 +42,8 @@ static LONG (WINAPI *pChangeDisplaySettingsExA)(LPCSTR, LPDEVMODEA, HWND, DWORD,
static
BOOL
(
WINAPI
*
pIsProcessDPIAware
)(
void
);
static
BOOL
(
WINAPI
*
pSetProcessDPIAware
)(
void
);
static
BOOL
(
WINAPI
*
pSetProcessDpiAwarenessContext
)(
DPI_AWARENESS_CONTEXT
);
static
BOOL
(
WINAPI
*
pGetProcessDpiAwarenessInternal
)(
HANDLE
,
DPI_AWARENESS
*
);
static
BOOL
(
WINAPI
*
pSetProcessDpiAwarenessInternal
)(
DPI_AWARENESS
);
static
DPI_AWARENESS_CONTEXT
(
WINAPI
*
pGetThreadDpiAwarenessContext
)(
void
);
static
DPI_AWARENESS_CONTEXT
(
WINAPI
*
pSetThreadDpiAwarenessContext
)(
DPI_AWARENESS_CONTEXT
);
static
DPI_AWARENESS_CONTEXT
(
WINAPI
*
pGetWindowDpiAwarenessContext
)(
HWND
);
...
...
@@ -3027,6 +3029,23 @@ static void test_dpi_aware(void)
ret
=
pSetProcessDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_UNAWARE
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %u
\n
"
,
GetLastError
()
);
ret
=
pSetProcessDpiAwarenessInternal
(
DPI_AWARENESS_INVALID
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error %u
\n
"
,
GetLastError
()
);
ret
=
pSetProcessDpiAwarenessInternal
(
DPI_AWARENESS_UNAWARE
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %u
\n
"
,
GetLastError
()
);
ret
=
pGetProcessDpiAwarenessInternal
(
0
,
&
awareness
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
ok
(
awareness
==
DPI_AWARENESS_SYSTEM_AWARE
,
"wrong value %d
\n
"
,
awareness
);
ret
=
pGetProcessDpiAwarenessInternal
(
GetCurrentProcess
(),
&
awareness
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
ok
(
awareness
==
DPI_AWARENESS_SYSTEM_AWARE
,
"wrong value %d
\n
"
,
awareness
);
ret
=
pGetProcessDpiAwarenessInternal
(
(
HANDLE
)
0xdeadbeef
,
&
awareness
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
ok
(
awareness
==
DPI_AWARENESS_UNAWARE
,
"wrong value %d
\n
"
,
awareness
);
ret
=
pIsProcessDPIAware
();
ok
(
ret
,
"got %d
\n
"
,
ret
);
context
=
pGetThreadDpiAwarenessContext
();
...
...
@@ -3140,6 +3159,8 @@ START_TEST(sysparams)
pIsProcessDPIAware
=
(
void
*
)
GetProcAddress
(
hdll
,
"IsProcessDPIAware"
);
pSetProcessDPIAware
=
(
void
*
)
GetProcAddress
(
hdll
,
"SetProcessDPIAware"
);
pSetProcessDpiAwarenessContext
=
(
void
*
)
GetProcAddress
(
hdll
,
"SetProcessDpiAwarenessContext"
);
pGetProcessDpiAwarenessInternal
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetProcessDpiAwarenessInternal"
);
pSetProcessDpiAwarenessInternal
=
(
void
*
)
GetProcAddress
(
hdll
,
"SetProcessDpiAwarenessInternal"
);
pGetThreadDpiAwarenessContext
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetThreadDpiAwarenessContext"
);
pSetThreadDpiAwarenessContext
=
(
void
*
)
GetProcAddress
(
hdll
,
"SetThreadDpiAwarenessContext"
);
pGetWindowDpiAwarenessContext
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetWindowDpiAwarenessContext"
);
...
...
dlls/user32/user32.spec
View file @
9fa96f54
...
...
@@ -353,6 +353,7 @@
@ stdcall GetPhysicalCursorPos(ptr)
@ stdcall GetPriorityClipboardFormat(ptr long)
@ stdcall GetProcessDefaultLayout(ptr)
@ stdcall GetProcessDpiAwarenessInternal(long ptr)
@ stdcall GetProcessWindowStation()
@ stdcall GetProgmanWindow ()
@ stdcall GetPropA(long str)
...
...
@@ -676,6 +677,7 @@
@ stdcall SetProcessDPIAware()
@ stdcall SetProcessDefaultLayout(long)
@ stdcall SetProcessDpiAwarenessContext(long)
@ stdcall SetProcessDpiAwarenessInternal(long)
@ stdcall SetProcessWindowStation(long)
@ stdcall SetProgmanWindow (long)
@ stdcall SetPropA(long str long)
...
...
include/winuser.h
View file @
9fa96f54
...
...
@@ -3747,6 +3747,7 @@ WINUSERAPI HWND WINAPI GetParent(HWND);
WINUSERAPI
BOOL
WINAPI
GetPhysicalCursorPos
(
POINT
*
);
WINUSERAPI
INT
WINAPI
GetPriorityClipboardFormat
(
UINT
*
,
INT
);
WINUSERAPI
BOOL
WINAPI
GetProcessDefaultLayout
(
DWORD
*
);
WINUSERAPI
BOOL
WINAPI
GetProcessDpiAwarenessInternal
(
HANDLE
,
DPI_AWARENESS
*
);
WINUSERAPI
HANDLE
WINAPI
GetPropA
(
HWND
,
LPCSTR
);
WINUSERAPI
HANDLE
WINAPI
GetPropW
(
HWND
,
LPCWSTR
);
#define GetProp WINELIB_NAME_AW(GetProp)
...
...
@@ -4067,6 +4068,7 @@ WINUSERAPI BOOL WINAPI SetPhysicalCursorPos(INT,INT);
WINUSERAPI
BOOL
WINAPI
SetProcessDPIAware
(
void
);
WINUSERAPI
BOOL
WINAPI
SetProcessDefaultLayout
(
DWORD
);
WINUSERAPI
BOOL
WINAPI
SetProcessDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT
);
WINUSERAPI
BOOL
WINAPI
SetProcessDpiAwarenessInternal
(
DPI_AWARENESS
);
WINUSERAPI
BOOL
WINAPI
SetProcessWindowStation
(
HWINSTA
);
WINUSERAPI
BOOL
WINAPI
SetPropA
(
HWND
,
LPCSTR
,
HANDLE
);
WINUSERAPI
BOOL
WINAPI
SetPropW
(
HWND
,
LPCWSTR
,
HANDLE
);
...
...
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