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
0dbafa84
Commit
0dbafa84
authored
Jul 18, 2023
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Use user message packing for EM_GETSEL.
parent
10254e32
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
18 deletions
+68
-18
winproc.c
dlls/user32/winproc.c
+12
-10
message.c
dlls/win32u/message.c
+28
-6
win32u.c
dlls/win32u/tests/win32u.c
+25
-2
user.c
dlls/wow64win/user.c
+3
-0
No files found.
dlls/user32/winproc.c
View file @
0dbafa84
...
...
@@ -837,6 +837,15 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
if
(
cds
->
lpData
)
cds
->
lpData
=
cds
+
1
;
break
;
}
case
EM_GETSEL
:
case
SBM_GETRANGE
:
case
CB_GETEDITSEL
:
{
DWORD
*
ptr
=
*
buffer
;
*
wparam
=
(
WPARAM
)
ptr
++
;
*
lparam
=
(
LPARAM
)
ptr
;
return
TRUE
;
}
case
WM_GETTEXT
:
case
WM_ASKCBFORMATNAME
:
case
WM_WININICHANGE
:
...
...
@@ -864,16 +873,6 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
case
WM_NOTIFY
:
/* WM_NOTIFY cannot be sent across processes (MSDN) */
return
FALSE
;
case
EM_GETSEL
:
case
SBM_GETRANGE
:
case
CB_GETEDITSEL
:
if
(
*
wparam
||
*
lparam
)
{
if
(
!
get_buffer_space
(
buffer
,
2
*
sizeof
(
DWORD
),
size
))
return
FALSE
;
if
(
*
wparam
)
*
wparam
=
(
WPARAM
)
*
buffer
;
if
(
*
lparam
)
*
lparam
=
(
LPARAM
)((
DWORD
*
)
*
buffer
+
1
);
}
return
TRUE
;
case
EM_GETRECT
:
case
LB_GETITEMRECT
:
case
CB_GETDROPPEDCONTROLRECT
:
...
...
@@ -1087,6 +1086,9 @@ BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size )
case
SBM_SETSCROLLINFO
:
case
SBM_GETSCROLLINFO
:
case
SBM_GETSCROLLBARINFO
:
case
EM_GETSEL
:
case
SBM_GETRANGE
:
case
CB_GETEDITSEL
:
{
LRESULT
*
result_ptr
=
(
LRESULT
*
)
buffer
-
1
;
*
result_ptr
=
result
;
...
...
dlls/win32u/message.c
View file @
0dbafa84
...
...
@@ -564,6 +564,16 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
case
SBM_GETSCROLLBARINFO
:
if
(
!
get_buffer_space
(
buffer
,
sizeof
(
SCROLLBARINFO
),
size
))
return
FALSE
;
break
;
case
EM_GETSEL
:
case
SBM_GETRANGE
:
case
CB_GETEDITSEL
:
if
(
*
wparam
||
*
lparam
)
{
if
(
!
get_buffer_space
(
buffer
,
2
*
sizeof
(
DWORD
),
size
))
return
FALSE
;
if
(
*
wparam
)
*
wparam
=
(
WPARAM
)
*
buffer
;
if
(
*
lparam
)
*
lparam
=
(
LPARAM
)((
DWORD
*
)
*
buffer
+
1
);
}
return
TRUE
;
case
WM_WINE_SETWINDOWPOS
:
{
WINDOWPOS
wp
;
...
...
@@ -1365,6 +1375,11 @@ size_t user_message_size( UINT message, WPARAM wparam, LPARAM lparam, BOOL other
case
SBM_GETSCROLLBARINFO
:
size
=
sizeof
(
SCROLLBARINFO
);
break
;
case
EM_GETSEL
:
case
SBM_GETRANGE
:
case
CB_GETEDITSEL
:
size
=
2
*
sizeof
(
DWORD
);
break
;
}
return
size
;
...
...
@@ -1424,6 +1439,10 @@ void pack_user_message( void *buffer, size_t size, UINT message,
size
=
sizeof
(
*
cds
);
break
;
}
case
EM_GETSEL
:
case
SBM_GETRANGE
:
case
CB_GETEDITSEL
:
return
;
}
if
(
size
)
memcpy
(
buffer
,
lparam_ptr
,
size
);
...
...
@@ -1503,6 +1522,15 @@ static void copy_user_result( void *buffer, size_t size, LRESULT result, UINT me
case
SBM_GETSCROLLBARINFO
:
copy_size
=
sizeof
(
SCROLLBARINFO
);
break
;
case
EM_GETSEL
:
case
SBM_GETRANGE
:
case
CB_GETEDITSEL
:
{
DWORD
*
ptr
=
buffer
;
if
(
wparam
)
*
(
DWORD
*
)
wparam
=
ptr
[
0
];
if
(
lparam
)
*
(
DWORD
*
)
lparam
=
ptr
[
1
];
break
;
}
default:
return
;
}
...
...
@@ -1549,12 +1577,6 @@ static void copy_reply( LRESULT result, HWND hwnd, UINT message, WPARAM wparam,
case
WM_MDIGETACTIVE
:
if
(
lparam
)
copy_size
=
sizeof
(
BOOL
);
break
;
case
EM_GETSEL
:
case
SBM_GETRANGE
:
case
CB_GETEDITSEL
:
if
(
wparam
)
*
(
DWORD
*
)
wparam
=
*
(
DWORD
*
)
wparam_src
;
if
(
lparam
)
copy_size
=
sizeof
(
DWORD
);
break
;
case
WM_NEXTMENU
:
copy_size
=
sizeof
(
MDINEXTMENU
);
break
;
...
...
dlls/win32u/tests/win32u.c
View file @
0dbafa84
...
...
@@ -1355,6 +1355,7 @@ struct lparam_hook_test
const
char
*
name
;
UINT
message
;
WPARAM
wparam
;
BOOL
no_wparam_check
;
LRESULT
msg_result
;
LRESULT
check_result
;
BOOL
todo_result
;
...
...
@@ -1378,7 +1379,7 @@ static char lparam_buffer[521];
static
void
check_params
(
const
struct
lparam_hook_test
*
test
,
UINT
message
,
WPARAM
wparam
,
LPARAM
lparam
,
BOOL
is_ret
)
{
if
(
test
->
message
!=
WM_MDIGETACTIVE
)
if
(
!
test
->
no_wparam_check
)
ok
(
wparam
==
test
->
wparam
,
"got wparam %Ix, expected %Ix
\n
"
,
wparam
,
test
->
wparam
);
if
(
lparam
==
(
LPARAM
)
lparam_buffer
)
return
;
...
...
@@ -1406,6 +1407,12 @@ static void check_params( const struct lparam_hook_test *test, UINT message,
}
break
;
case
EM_GETSEL
:
case
SBM_GETRANGE
:
case
CB_GETEDITSEL
:
ok
(
wparam
,
"wparam = 0
\n
"
);
break
;
default:
if
(
test
->
check_size
)
{
const
void
*
expected
=
is_ret
&&
test
->
change_lparam
?
test
->
change_lparam
:
test
->
lparam
;
...
...
@@ -1663,6 +1670,7 @@ static void test_wndproc_hook(void)
static
const
SCROLLINFO
si_out
=
{
.
cbSize
=
sizeof
(
si_in
),
.
nPos
=
60
};
static
const
SCROLLBARINFO
sbi_in
=
{
.
xyThumbTop
=
6
};
static
const
SCROLLBARINFO
sbi_out
=
{
.
xyThumbTop
=
60
};
static
const
DWORD
dw_in
=
1
,
dw_out
=
2
;
static
const
struct
lparam_hook_test
lparam_hook_tests
[]
=
{
...
...
@@ -1743,7 +1751,7 @@ static void test_wndproc_hook(void)
.
todo
=
TRUE
},
{
"WM_MDIGETACTIVE"
,
WM_MDIGETACTIVE
,
"WM_MDIGETACTIVE"
,
WM_MDIGETACTIVE
,
.
no_wparam_check
=
TRUE
,
.
lparam_size
=
sizeof
(
BOOL
),
.
change_lparam
=
&
false_lparam
,
.
todo
=
TRUE
},
...
...
@@ -1832,6 +1840,21 @@ static void test_wndproc_hook(void)
.
lparam_size
=
sizeof
(
sbi_in
),
.
lparam
=
&
sbi_in
,
.
change_lparam
=
&
sbi_out
,
.
check_size
=
sizeof
(
sbi_in
),
},
{
"EM_GETSEL"
,
EM_GETSEL
,
.
no_wparam_check
=
TRUE
,
.
lparam_size
=
sizeof
(
DWORD
),
.
lparam
=
&
dw_in
,
.
change_lparam
=
&
dw_out
,
.
check_size
=
sizeof
(
DWORD
),
},
{
"SBM_GETRANGE"
,
SBM_GETRANGE
,
.
no_wparam_check
=
TRUE
,
.
lparam_size
=
sizeof
(
DWORD
),
.
lparam
=
&
dw_in
,
.
change_lparam
=
&
dw_out
,
.
check_size
=
sizeof
(
DWORD
),
},
{
"CB_GETEDITSEL"
,
CB_GETEDITSEL
,
.
no_wparam_check
=
TRUE
,
.
lparam_size
=
sizeof
(
DWORD
),
.
lparam
=
&
dw_in
,
.
change_lparam
=
&
dw_out
,
.
check_size
=
sizeof
(
DWORD
),
},
/* messages that don't change lparam */
{
"WM_USER"
,
WM_USER
},
{
"WM_NOTIFY"
,
WM_NOTIFY
},
...
...
dlls/wow64win/user.c
View file @
0dbafa84
...
...
@@ -835,6 +835,9 @@ static size_t packed_result_32to64( UINT message, WPARAM wparam, const void *par
case
SBM_SETSCROLLINFO
:
case
SBM_GETSCROLLINFO
:
case
SBM_GETSCROLLBARINFO
:
case
EM_GETSEL
:
case
SBM_GETRANGE
:
case
CB_GETEDITSEL
:
break
;
default:
...
...
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