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
7f4ffc7c
Commit
7f4ffc7c
authored
Jul 18, 2023
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Use user message packing for WM_DELETEITEM.
parent
58dece67
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
11 deletions
+37
-11
winproc.c
dlls/user32/winproc.c
+1
-11
message.c
dlls/win32u/message.c
+15
-0
win32u.c
dlls/win32u/tests/win32u.c
+6
-0
user.c
dlls/wow64win/user.c
+15
-0
No files found.
dlls/user32/winproc.c
View file @
7f4ffc7c
...
...
@@ -843,19 +843,8 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
case
WM_GETMINMAXINFO
:
case
WM_DRAWITEM
:
case
WM_MEASUREITEM
:
break
;
case
WM_DELETEITEM
:
{
DELETEITEMSTRUCT
dls
;
if
(
size
<
sizeof
(
ps
->
dls
))
return
FALSE
;
dls
.
CtlType
=
ps
->
dls
.
CtlType
;
dls
.
CtlID
=
ps
->
dls
.
CtlID
;
dls
.
itemID
=
ps
->
dls
.
itemID
;
dls
.
hwndItem
=
unpack_handle
(
ps
->
dls
.
hwndItem
);
dls
.
itemData
=
(
ULONG_PTR
)
unpack_ptr
(
ps
->
dls
.
itemData
);
memcpy
(
*
buffer
,
&
dls
,
sizeof
(
dls
)
);
break
;
}
case
WM_COMPAREITEM
:
{
COMPAREITEMSTRUCT
cis
;
...
...
@@ -1160,6 +1149,7 @@ BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size )
case
EM_REPLACESEL
:
case
WM_GETMINMAXINFO
:
case
WM_MEASUREITEM
:
case
WM_DELETEITEM
:
{
LRESULT
*
result_ptr
=
(
LRESULT
*
)
buffer
-
1
;
*
result_ptr
=
result
;
...
...
dlls/win32u/message.c
View file @
7f4ffc7c
...
...
@@ -462,6 +462,18 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
memcpy
(
*
buffer
,
&
mis
,
sizeof
(
mis
)
);
break
;
}
case
WM_DELETEITEM
:
{
DELETEITEMSTRUCT
dls
;
if
(
size
<
sizeof
(
ps
->
dls
))
return
FALSE
;
dls
.
CtlType
=
ps
->
dls
.
CtlType
;
dls
.
CtlID
=
ps
->
dls
.
CtlID
;
dls
.
itemID
=
ps
->
dls
.
itemID
;
dls
.
hwndItem
=
wine_server_ptr_handle
(
ps
->
dls
.
hwndItem
);
dls
.
itemData
=
(
ULONG_PTR
)
unpack_ptr
(
ps
->
dls
.
itemData
);
memcpy
(
*
buffer
,
&
dls
,
sizeof
(
dls
)
);
break
;
}
case
WM_WINE_SETWINDOWPOS
:
{
WINDOWPOS
wp
;
...
...
@@ -1255,6 +1267,9 @@ size_t user_message_size( UINT message, WPARAM wparam, LPARAM lparam, BOOL other
case
WM_MEASUREITEM
:
size
=
sizeof
(
MEASUREITEMSTRUCT
);
break
;
case
WM_DELETEITEM
:
size
=
sizeof
(
DELETEITEMSTRUCT
);
break
;
}
return
size
;
...
...
dlls/win32u/tests/win32u.c
View file @
7f4ffc7c
...
...
@@ -1624,6 +1624,7 @@ static void test_wndproc_hook(void)
static
const
DRAWITEMSTRUCT
drawitem_in
=
{
.
itemID
=
1
};
static
const
MEASUREITEMSTRUCT
mis_in
=
{
.
itemID
=
1
};
static
const
MEASUREITEMSTRUCT
mis_out
=
{
.
itemID
=
2
,
.
CtlType
=
3
,
.
CtlID
=
4
,
.
itemData
=
5
};
static
const
DELETEITEMSTRUCT
dis_in
=
{
.
itemID
=
1
};
static
const
struct
lparam_hook_test
lparam_hook_tests
[]
=
{
...
...
@@ -1718,6 +1719,11 @@ static void test_wndproc_hook(void)
.
lparam_size
=
sizeof
(
mis_in
),
.
lparam
=
&
mis_in
,
.
change_lparam
=
&
mis_out
,
.
check_size
=
sizeof
(
mis_in
),
},
{
"WM_DELETEITEM"
,
WM_DELETEITEM
,
.
wparam
=
10
,
.
lparam_size
=
sizeof
(
dis_in
),
.
lparam
=
&
dis_in
,
.
poison_lparam
=
TRUE
,
.
check_size
=
sizeof
(
dis_in
),
},
/* messages that don't change lparam */
{
"WM_USER"
,
WM_USER
},
{
"WM_NOTIFY"
,
WM_NOTIFY
},
...
...
dlls/wow64win/user.c
View file @
7f4ffc7c
...
...
@@ -684,6 +684,20 @@ static size_t packed_message_64to32( UINT message, WPARAM wparam,
memcpy
(
params32
,
&
mis32
,
sizeof
(
mis32
)
);
return
sizeof
(
mis32
);
}
case
WM_DELETEITEM
:
{
DELETEITEMSTRUCT32
dis32
;
const
DELETEITEMSTRUCT
*
dis64
=
params64
;
dis32
.
CtlType
=
dis64
->
CtlType
;
dis32
.
CtlID
=
dis64
->
CtlID
;
dis32
.
itemID
=
dis64
->
itemID
;
dis32
.
hwndItem
=
HandleToLong
(
dis64
->
hwndItem
);
dis32
.
itemData
=
dis64
->
itemData
;
memcpy
(
params32
,
&
dis32
,
sizeof
(
dis32
)
);
return
sizeof
(
dis32
);
}
}
memmove
(
params32
,
params64
,
size
);
...
...
@@ -3167,6 +3181,7 @@ static LRESULT message_call_32to64( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
dis
.
CtlType
=
dis32
->
CtlType
;
dis
.
CtlID
=
dis32
->
CtlID
;
dis
.
itemID
=
dis32
->
itemID
;
dis
.
hwndItem
=
LongToHandle
(
dis32
->
hwndItem
);
dis
.
itemData
=
dis32
->
itemData
;
return
NtUserMessageCall
(
hwnd
,
msg
,
wparam
,
(
LPARAM
)
&
dis
,
result_info
,
type
,
ansi
);
...
...
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