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
a5c90922
Commit
a5c90922
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_GETLINE.
parent
1e409563
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
15 deletions
+41
-15
winproc.c
dlls/user32/winproc.c
+2
-9
message.c
dlls/win32u/message.c
+20
-6
win32u.c
dlls/win32u/tests/win32u.c
+18
-0
user.c
dlls/wow64win/user.c
+1
-0
No files found.
dlls/user32/winproc.c
View file @
a5c90922
...
...
@@ -874,16 +874,8 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
case
CB_GETDROPPEDCONTROLRECT
:
case
EM_SETRECT
:
case
EM_SETRECTNP
:
break
;
case
EM_GETLINE
:
{
WORD
len
;
if
(
size
<
sizeof
(
WORD
))
return
FALSE
;
len
=
*
(
WORD
*
)
*
buffer
;
if
(
!
get_buffer_space
(
buffer
,
(
len
+
1
)
*
sizeof
(
WCHAR
),
size
))
return
FALSE
;
*
lparam
=
(
LPARAM
)
*
buffer
+
sizeof
(
WORD
);
/* don't erase WORD at start of buffer */
return
TRUE
;
}
break
;
case
EM_SETTABSTOPS
:
case
LB_SETTABSTOPS
:
if
(
!*
wparam
)
return
TRUE
;
...
...
@@ -1090,6 +1082,7 @@ BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size )
case
CB_GETDROPPEDCONTROLRECT
:
case
EM_SETRECT
:
case
EM_SETRECTNP
:
case
EM_GETLINE
:
{
LRESULT
*
result_ptr
=
(
LRESULT
*
)
buffer
-
1
;
*
result_ptr
=
result
;
...
...
dlls/win32u/message.c
View file @
a5c90922
...
...
@@ -583,6 +583,17 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
case
EM_SETRECTNP
:
minsize
=
sizeof
(
RECT
);
break
;
case
EM_GETLINE
:
{
WORD
*
len_ptr
,
len
;
if
(
size
<
sizeof
(
WORD
))
return
FALSE
;
len
=
*
(
WORD
*
)
*
buffer
;
if
(
!
get_buffer_space
(
buffer
,
(
len
+
1
)
*
sizeof
(
WCHAR
),
size
))
return
FALSE
;
len_ptr
=
*
buffer
;
len_ptr
[
0
]
=
len_ptr
[
1
]
=
len
;
*
lparam
=
(
LPARAM
)(
len_ptr
+
1
);
return
TRUE
;
}
case
WM_WINE_SETWINDOWPOS
:
{
WINDOWPOS
wp
;
...
...
@@ -1396,6 +1407,9 @@ size_t user_message_size( UINT message, WPARAM wparam, LPARAM lparam, BOOL other
case
EM_SETRECTNP
:
size
=
sizeof
(
RECT
);
break
;
case
EM_GETLINE
:
size
=
max
(
*
(
WORD
*
)
lparam
*
char_size
(
ansi
),
sizeof
(
WORD
)
);
break
;
}
return
size
;
...
...
@@ -1461,6 +1475,9 @@ void pack_user_message( void *buffer, size_t size, UINT message,
case
EM_GETRECT
:
case
CB_GETDROPPEDCONTROLRECT
:
return
;
case
EM_GETLINE
:
size
=
sizeof
(
WORD
);
break
;
}
if
(
size
)
memcpy
(
buffer
,
lparam_ptr
,
size
);
...
...
@@ -1556,6 +1573,9 @@ static void copy_user_result( void *buffer, size_t size, LRESULT result, UINT me
case
CB_GETDROPPEDCONTROLRECT
:
copy_size
=
sizeof
(
RECT
);
break
;
case
EM_GETLINE
:
copy_size
=
string_size
(
buffer
,
ansi
);
break
;
default:
return
;
}
...
...
@@ -1587,12 +1607,6 @@ static void copy_reply( LRESULT result, HWND hwnd, UINT message, WPARAM wparam,
case
WM_MOVING
:
copy_size
=
sizeof
(
RECT
);
break
;
case
EM_GETLINE
:
{
WORD
*
ptr
=
(
WORD
*
)
lparam
;
copy_size
=
ptr
[
-
1
]
*
sizeof
(
WCHAR
);
break
;
}
case
LB_GETSELITEMS
:
copy_size
=
wparam
*
sizeof
(
UINT
);
break
;
...
...
dlls/win32u/tests/win32u.c
View file @
a5c90922
...
...
@@ -1413,6 +1413,14 @@ static void check_params( const struct lparam_hook_test *test, UINT message,
ok
(
wparam
,
"wparam = 0
\n
"
);
break
;
case
EM_GETLINE
:
if
(
!
is_ret
)
{
WCHAR
*
buf
=
(
WCHAR
*
)
lparam
;
ok
(
buf
[
0
]
==
8
,
"buf[0] = %x
\n
"
,
buf
[
0
]);
}
break
;
default:
if
(
test
->
check_size
)
{
const
void
*
expected
=
is_ret
&&
test
->
change_lparam
?
test
->
change_lparam
:
test
->
lparam
;
...
...
@@ -1867,6 +1875,16 @@ static void test_wndproc_hook(void)
.
lparam_size
=
sizeof
(
DWORD
),
.
lparam
=
&
dw_in
,
.
change_lparam
=
&
dw_out
,
.
check_size
=
sizeof
(
DWORD
),
},
{
"EM_GETLINE"
,
EM_GETLINE
,
.
msg_result
=
5
,
.
lparam
=
L"\x8""2345678"
,
.
lparam_size
=
sizeof
(
strbufW
),
.
change_lparam
=
L"abc
\0
defg"
,
.
check_size
=
sizeof
(
WCHAR
),
.
check_lparam
=
L"abc
\0
""5678"
,
},
{
"EM_GETLINE-2"
,
EM_GETLINE
,
.
msg_result
=
1
,
.
lparam
=
L"\x8""2345678"
,
.
lparam_size
=
sizeof
(
strbufW
),
.
change_lparam
=
L"abc
\0
defg"
,
.
check_size
=
sizeof
(
WCHAR
),
.
check_lparam
=
L"abc
\0
""5678"
,
},
/* messages that don't change lparam */
{
"WM_USER"
,
WM_USER
},
{
"WM_NOTIFY"
,
WM_NOTIFY
},
...
...
dlls/wow64win/user.c
View file @
a5c90922
...
...
@@ -843,6 +843,7 @@ static size_t packed_result_32to64( UINT message, WPARAM wparam, const void *par
case
EM_SETRECTNP
:
case
LB_GETITEMRECT
:
case
CB_GETDROPPEDCONTROLRECT
:
case
EM_GETLINE
:
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