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
2de2222a
Commit
2de2222a
authored
Mar 30, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Pack the low-level hook structure in messages to allow crossing 32/64 boundaries.
parent
366c5cee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
message.c
dlls/user32/message.c
+18
-6
No files found.
dlls/user32/message.c
View file @
2de2222a
...
@@ -208,6 +208,13 @@ struct packed_MDICREATESTRUCTW
...
@@ -208,6 +208,13 @@ struct packed_MDICREATESTRUCTW
ULONGLONG
lParam
;
ULONGLONG
lParam
;
};
};
struct
packed_hook_extra_info
{
user_handle_t
handle
;
DWORD
__pad
;
ULONGLONG
lparam
;
};
/* the structures are unpacked on top of the packed ones, so make sure they fit */
/* the structures are unpacked on top of the packed ones, so make sure they fit */
C_ASSERT
(
sizeof
(
struct
packed_CREATESTRUCTW
)
>=
sizeof
(
CREATESTRUCTW
)
);
C_ASSERT
(
sizeof
(
struct
packed_CREATESTRUCTW
)
>=
sizeof
(
CREATESTRUCTW
)
);
C_ASSERT
(
sizeof
(
struct
packed_DRAWITEMSTRUCT
)
>=
sizeof
(
DRAWITEMSTRUCT
)
);
C_ASSERT
(
sizeof
(
struct
packed_DRAWITEMSTRUCT
)
>=
sizeof
(
DRAWITEMSTRUCT
)
);
...
@@ -221,6 +228,7 @@ C_ASSERT( sizeof(struct packed_NCCALCSIZE_PARAMS) >= sizeof(NCCALCSIZE_PARAMS) +
...
@@ -221,6 +228,7 @@ C_ASSERT( sizeof(struct packed_NCCALCSIZE_PARAMS) >= sizeof(NCCALCSIZE_PARAMS) +
C_ASSERT
(
sizeof
(
struct
packed_MSG
)
>=
sizeof
(
MSG
)
);
C_ASSERT
(
sizeof
(
struct
packed_MSG
)
>=
sizeof
(
MSG
)
);
C_ASSERT
(
sizeof
(
struct
packed_MDINEXTMENU
)
>=
sizeof
(
MDINEXTMENU
)
);
C_ASSERT
(
sizeof
(
struct
packed_MDINEXTMENU
)
>=
sizeof
(
MDINEXTMENU
)
);
C_ASSERT
(
sizeof
(
struct
packed_MDICREATESTRUCTW
)
>=
sizeof
(
MDICREATESTRUCTW
)
);
C_ASSERT
(
sizeof
(
struct
packed_MDICREATESTRUCTW
)
>=
sizeof
(
MDICREATESTRUCTW
)
);
C_ASSERT
(
sizeof
(
struct
packed_hook_extra_info
)
>=
sizeof
(
struct
hook_extra_info
)
);
union
packed_structs
union
packed_structs
{
{
...
@@ -236,6 +244,7 @@ union packed_structs
...
@@ -236,6 +244,7 @@ union packed_structs
struct
packed_MSG
msg
;
struct
packed_MSG
msg
;
struct
packed_MDINEXTMENU
mnm
;
struct
packed_MDINEXTMENU
mnm
;
struct
packed_MDICREATESTRUCTW
mcs
;
struct
packed_MDICREATESTRUCTW
mcs
;
struct
packed_hook_extra_info
hook
;
};
};
/* description of the data fields that need to be packed along with a sent message */
/* description of the data fields that need to be packed along with a sent message */
...
@@ -1012,14 +1021,16 @@ static size_t pack_message( HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara
...
@@ -1012,14 +1021,16 @@ static size_t pack_message( HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara
case
WM_WINE_KEYBOARD_LL_HOOK
:
case
WM_WINE_KEYBOARD_LL_HOOK
:
{
{
struct
hook_extra_info
*
h_extra
=
(
struct
hook_extra_info
*
)
lparam
;
struct
hook_extra_info
*
h_extra
=
(
struct
hook_extra_info
*
)
lparam
;
push_data
(
data
,
h_extra
,
sizeof
(
*
h_extra
)
);
data
->
ps
.
hook
.
handle
=
wine_server_user_handle
(
h_extra
->
handle
);
push_data
(
data
,
&
data
->
ps
.
hook
,
sizeof
(
data
->
ps
.
hook
)
);
push_data
(
data
,
(
LPVOID
)
h_extra
->
lparam
,
sizeof
(
KBDLLHOOKSTRUCT
)
);
push_data
(
data
,
(
LPVOID
)
h_extra
->
lparam
,
sizeof
(
KBDLLHOOKSTRUCT
)
);
return
0
;
return
0
;
}
}
case
WM_WINE_MOUSE_LL_HOOK
:
case
WM_WINE_MOUSE_LL_HOOK
:
{
{
struct
hook_extra_info
*
h_extra
=
(
struct
hook_extra_info
*
)
lparam
;
struct
hook_extra_info
*
h_extra
=
(
struct
hook_extra_info
*
)
lparam
;
push_data
(
data
,
h_extra
,
sizeof
(
*
h_extra
)
);
data
->
ps
.
hook
.
handle
=
wine_server_user_handle
(
h_extra
->
handle
);
push_data
(
data
,
&
data
->
ps
.
hook
,
sizeof
(
data
->
ps
.
hook
)
);
push_data
(
data
,
(
LPVOID
)
h_extra
->
lparam
,
sizeof
(
MSLLHOOKSTRUCT
)
);
push_data
(
data
,
(
LPVOID
)
h_extra
->
lparam
,
sizeof
(
MSLLHOOKSTRUCT
)
);
return
0
;
return
0
;
}
}
...
@@ -1412,13 +1423,14 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
...
@@ -1412,13 +1423,14 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
case
WM_WINE_KEYBOARD_LL_HOOK
:
case
WM_WINE_KEYBOARD_LL_HOOK
:
case
WM_WINE_MOUSE_LL_HOOK
:
case
WM_WINE_MOUSE_LL_HOOK
:
{
{
struct
hook_extra_info
*
h_extra
=
*
buffer
;
struct
hook_extra_info
h_extra
;
minsize
=
sizeof
(
ps
->
hook
)
+
minsize
=
sizeof
(
struct
hook_extra_info
)
+
(
message
==
WM_WINE_KEYBOARD_LL_HOOK
?
sizeof
(
KBDLLHOOKSTRUCT
)
(
message
==
WM_WINE_KEYBOARD_LL_HOOK
?
sizeof
(
KBDLLHOOKSTRUCT
)
:
sizeof
(
MSLLHOOKSTRUCT
));
:
sizeof
(
MSLLHOOKSTRUCT
));
if
(
size
<
minsize
)
return
FALSE
;
if
(
size
<
minsize
)
return
FALSE
;
h_extra
->
lparam
=
(
LPARAM
)(
h_extra
+
1
);
h_extra
.
handle
=
wine_server_ptr_handle
(
ps
->
hook
.
handle
);
h_extra
.
lparam
=
(
LPARAM
)(
&
ps
->
hook
+
1
);
memcpy
(
&
ps
->
hook
,
&
h_extra
,
sizeof
(
h_extra
)
);
break
;
break
;
}
}
case
WM_NCPAINT
:
case
WM_NCPAINT
:
...
...
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