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
3099b08a
Commit
3099b08a
authored
Mar 30, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Pack the MSG structure in messages to allow crossing 32/64 boundaries.
parent
bbdd742a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
7 deletions
+62
-7
message.c
dlls/user32/message.c
+62
-7
No files found.
dlls/user32/message.c
View file @
3099b08a
...
...
@@ -173,6 +173,18 @@ struct packed_NCCALCSIZE_PARAMS
DWORD
__pad4
;
};
struct
packed_MSG
{
user_handle_t
hwnd
;
DWORD
__pad1
;
UINT
message
;
ULONGLONG
wParam
;
ULONGLONG
lParam
;
DWORD
time
;
POINT
pt
;
DWORD
__pad2
;
};
/* 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_DRAWITEMSTRUCT
)
>=
sizeof
(
DRAWITEMSTRUCT
)
);
...
...
@@ -183,6 +195,7 @@ C_ASSERT( sizeof(struct packed_WINDOWPOS) >= sizeof(WINDOWPOS) );
C_ASSERT
(
sizeof
(
struct
packed_COPYDATASTRUCT
)
>=
sizeof
(
COPYDATASTRUCT
)
);
C_ASSERT
(
sizeof
(
struct
packed_HELPINFO
)
>=
sizeof
(
HELPINFO
)
);
C_ASSERT
(
sizeof
(
struct
packed_NCCALCSIZE_PARAMS
)
>=
sizeof
(
NCCALCSIZE_PARAMS
)
+
sizeof
(
WINDOWPOS
)
);
C_ASSERT
(
sizeof
(
struct
packed_MSG
)
>=
sizeof
(
MSG
)
);
union
packed_structs
{
...
...
@@ -195,6 +208,7 @@ union packed_structs
struct
packed_COPYDATASTRUCT
cds
;
struct
packed_HELPINFO
hi
;
struct
packed_NCCALCSIZE_PARAMS
ncp
;
struct
packed_MSG
msg
;
};
/* description of the data fields that need to be packed along with a sent message */
...
...
@@ -851,8 +865,19 @@ static size_t pack_message( HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara
return
sizeof
(
data
->
ps
.
ncp
);
}
case
WM_GETDLGCODE
:
if
(
lparam
)
push_data
(
data
,
(
MSG
*
)
lparam
,
sizeof
(
MSG
)
);
return
sizeof
(
MSG
);
if
(
lparam
)
{
MSG
*
msg
=
(
MSG
*
)
lparam
;
data
->
ps
.
msg
.
hwnd
=
wine_server_user_handle
(
msg
->
hwnd
);
data
->
ps
.
msg
.
message
=
msg
->
message
;
data
->
ps
.
msg
.
wParam
=
msg
->
wParam
;
data
->
ps
.
msg
.
lParam
=
msg
->
lParam
;
data
->
ps
.
msg
.
time
=
msg
->
time
;
data
->
ps
.
msg
.
pt
=
msg
->
pt
;
push_data
(
data
,
&
data
->
ps
.
msg
,
sizeof
(
data
->
ps
.
msg
)
);
return
sizeof
(
data
->
ps
.
msg
);
}
return
0
;
case
SBM_SETSCROLLINFO
:
push_data
(
data
,
(
SCROLLINFO
*
)
lparam
,
sizeof
(
SCROLLINFO
)
);
return
0
;
...
...
@@ -1201,9 +1226,20 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
}
break
;
case
WM_GETDLGCODE
:
if
(
!*
lparam
)
return
TRUE
;
minsize
=
sizeof
(
MSG
);
break
;
if
(
*
lparam
)
{
MSG
msg
;
if
(
size
<
sizeof
(
ps
->
msg
))
return
FALSE
;
msg
.
hwnd
=
wine_server_ptr_handle
(
ps
->
msg
.
hwnd
);
msg
.
message
=
ps
->
msg
.
message
;
msg
.
wParam
=
(
ULONG_PTR
)
unpack_ptr
(
ps
->
msg
.
wParam
);
msg
.
lParam
=
(
ULONG_PTR
)
unpack_ptr
(
ps
->
msg
.
lParam
);
msg
.
time
=
ps
->
msg
.
time
;
msg
.
pt
=
ps
->
msg
.
pt
;
memcpy
(
&
ps
->
msg
,
&
msg
,
sizeof
(
msg
)
);
break
;
}
return
TRUE
;
case
SBM_SETSCROLLINFO
:
minsize
=
sizeof
(
SCROLLINFO
);
break
;
...
...
@@ -1442,7 +1478,17 @@ static void pack_reply( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam,
break
;
}
case
WM_GETDLGCODE
:
if
(
lparam
)
push_data
(
data
,
(
MSG
*
)
lparam
,
sizeof
(
MSG
)
);
if
(
lparam
)
{
MSG
*
msg
=
(
MSG
*
)
lparam
;
data
->
ps
.
msg
.
hwnd
=
wine_server_user_handle
(
msg
->
hwnd
);
data
->
ps
.
msg
.
message
=
msg
->
message
;
data
->
ps
.
msg
.
wParam
=
msg
->
wParam
;
data
->
ps
.
msg
.
lParam
=
msg
->
lParam
;
data
->
ps
.
msg
.
time
=
msg
->
time
;
data
->
ps
.
msg
.
pt
=
msg
->
pt
;
push_data
(
data
,
&
data
->
ps
.
msg
,
sizeof
(
data
->
ps
.
msg
)
);
}
break
;
case
SBM_GETSCROLLINFO
:
push_data
(
data
,
(
SCROLLINFO
*
)
lparam
,
sizeof
(
SCROLLINFO
)
);
...
...
@@ -1568,7 +1614,16 @@ static void unpack_reply( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam,
}
break
;
case
WM_GETDLGCODE
:
if
(
lparam
)
memcpy
(
(
MSG
*
)
lparam
,
buffer
,
min
(
sizeof
(
MSG
),
size
));
if
(
lparam
&&
size
>=
sizeof
(
ps
->
msg
))
{
MSG
*
msg
=
(
MSG
*
)
lparam
;
msg
->
hwnd
=
wine_server_ptr_handle
(
ps
->
msg
.
hwnd
);
msg
->
message
=
ps
->
msg
.
message
;
msg
->
wParam
=
(
ULONG_PTR
)
unpack_ptr
(
ps
->
msg
.
wParam
);
msg
->
lParam
=
(
ULONG_PTR
)
unpack_ptr
(
ps
->
msg
.
lParam
);
msg
->
time
=
ps
->
msg
.
time
;
msg
->
pt
=
ps
->
msg
.
pt
;
}
break
;
case
SBM_GETSCROLLINFO
:
memcpy
(
(
SCROLLINFO
*
)
lparam
,
buffer
,
min
(
sizeof
(
SCROLLINFO
),
size
));
...
...
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