Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
aac37e8d
Commit
aac37e8d
authored
Jul 17, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Implement monitor rectangle filtering on the user32 side.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2be5b054
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
22 deletions
+53
-22
sysparams.c
dlls/user32/sysparams.c
+53
-22
No files found.
dlls/user32/sysparams.c
View file @
aac37e8d
...
...
@@ -21,6 +21,7 @@
#include "config.h"
#include <assert.h>
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
...
...
@@ -3562,49 +3563,79 @@ BOOL WINAPI GetMonitorInfoW( HMONITOR monitor, LPMONITORINFO info )
return
ret
;
}
#ifdef __i386__
/* Some apps pass a non-stdcall callback to EnumDisplayMonitors,
* so we need a small assembly wrapper to call it.
* MJ's Help Diagnostic expects that %ecx contains the address to the rect.
*/
struct
enumdisplaymonitors_lparam
struct
enum_mon_data
{
MONITORENUMPROC
proc
;
LPARAM
lparam
;
HDC
hdc
;
POINT
origin
;
RECT
limit
;
};
extern
BOOL
CALLBACK
enumdisplaymonitors_callback_wrapper
(
HMONITOR
monitor
,
HDC
hdc
,
LPRECT
rect
,
LPARAM
lparam
);
__ASM_STDCALL_FUNC
(
enumdisplaymonitors_callback_wrapper
,
16
,
#ifdef __i386__
/* Some apps pass a non-stdcall callback to EnumDisplayMonitors,
* so we need a small assembly wrapper to call it.
* MJ's Help Diagnostic expects that %ecx contains the address to the rect.
*/
extern
BOOL
enum_mon_callback_wrapper
(
HMONITOR
monitor
,
LPRECT
rect
,
struct
enum_mon_data
*
data
);
__ASM_GLOBAL_FUNC
(
enum_mon_callback_wrapper
,
"pushl %ebp
\n\t
"
__ASM_CFI
(
".cfi_adjust_cfa_offset 4
\n\t
"
)
__ASM_CFI
(
".cfi_rel_offset %ebp,0
\n\t
"
)
"movl %esp,%ebp
\n\t
"
__ASM_CFI
(
".cfi_def_cfa_register %ebp
\n\t
"
)
"subl $8,%esp
\n\t
"
"movl
20(%ebp),%eax
\n\t
"
/* struct enumdisplaymonitors_lparam *orig = (struct enumdisplaymonitors_lparam*)lparam
*/
"
pushl 4(%eax)
\n\t
"
/* push orig->lparam
*/
"pushl
16(%ebp)
\n\t
"
"pushl
12(%ebp)
\n\t
"
"pushl 8(%e
bp)
\n\t
"
"
movl 16(%ebp),%ecx
\n\t
"
"call *(%eax)
\n\t
"
/*
call orig
->proc */
"movl
16(%ebp),%eax
\n\t
"
/* data
*/
"
movl 12(%ebp),%ecx
\n\t
"
/* rect
*/
"pushl
4(%eax)
\n\t
"
/* data->lparam */
"pushl
%ecx
\n\t
"
/* rect */
"pushl 8(%e
ax)
\n\t
"
/* data->hdc */
"
pushl 8(%ebp)
\n\t
"
/* monitor */
"call *(%eax)
\n\t
"
/*
data
->proc */
"leave
\n\t
"
__ASM_CFI
(
".cfi_def_cfa %esp,4
\n\t
"
)
__ASM_CFI
(
".cfi_same_value %ebp
\n\t
"
)
"ret
$16
"
)
"ret"
)
#endif
/* __i386__ */
static
BOOL
CALLBACK
enum_mon_callback
(
HMONITOR
monitor
,
HDC
hdc
,
LPRECT
rect
,
LPARAM
lp
)
{
struct
enum_mon_data
*
data
=
(
struct
enum_mon_data
*
)
lp
;
RECT
monrect
=
*
rect
;
OffsetRect
(
&
monrect
,
-
data
->
origin
.
x
,
-
data
->
origin
.
y
);
if
(
!
IntersectRect
(
&
monrect
,
&
monrect
,
&
data
->
limit
))
return
TRUE
;
#ifdef __i386__
return
enum_mon_callback_wrapper
(
monitor
,
&
monrect
,
data
);
#else
return
data
->
proc
(
monitor
,
data
->
hdc
,
&
monrect
,
data
->
lparam
);
#endif
}
/***********************************************************************
* EnumDisplayMonitors (USER32.@)
*/
BOOL
WINAPI
EnumDisplayMonitors
(
HDC
hdc
,
LPRECT
rect
,
MONITORENUMPROC
proc
,
LPARAM
lp
)
{
#ifdef __i386__
struct
enumdisplaymonitors_lparam
orig
=
{
proc
,
lp
};
proc
=
enumdisplaymonitors_callback_wrapper
;
lp
=
(
LPARAM
)
&
orig
;
#endif
return
USER_Driver
->
pEnumDisplayMonitors
(
hdc
,
rect
,
proc
,
lp
);
struct
enum_mon_data
data
;
data
.
proc
=
proc
;
data
.
lparam
=
lp
;
data
.
hdc
=
hdc
;
if
(
hdc
)
{
if
(
!
GetDCOrgEx
(
hdc
,
&
data
.
origin
))
return
FALSE
;
if
(
GetClipBox
(
hdc
,
&
data
.
limit
)
==
ERROR
)
return
FALSE
;
}
else
{
data
.
origin
.
x
=
data
.
origin
.
y
=
0
;
data
.
limit
.
left
=
data
.
limit
.
top
=
INT_MIN
;
data
.
limit
.
right
=
data
.
limit
.
bottom
=
INT_MAX
;
}
if
(
rect
&&
!
IntersectRect
(
&
data
.
limit
,
&
data
.
limit
,
rect
))
return
TRUE
;
return
USER_Driver
->
pEnumDisplayMonitors
(
0
,
NULL
,
enum_mon_callback
,
(
LPARAM
)
&
data
);
}
...
...
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