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
dc61a4bc
Commit
dc61a4bc
authored
May 20, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user: Use winproc callbacks instead of message map/unmap for 16-bit hooks.
parent
58a03a10
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
29 deletions
+62
-29
hook16.c
dlls/user/hook16.c
+58
-27
winproc.c
dlls/user/winproc.c
+2
-2
winproc.h
dlls/user/winproc.h
+2
-0
No files found.
dlls/user/hook16.c
View file @
dc61a4bc
...
...
@@ -133,6 +133,50 @@ static LRESULT call_hook_16( INT id, INT code, WPARAM wp, LPARAM lp )
}
struct
wndproc_hook_params
{
HHOOK
hhook
;
INT
code
;
WPARAM
wparam
;
};
/* callback for WINPROC_Call16To32A */
static
LRESULT
wndproc_hook_callback
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
,
LRESULT
*
result
,
void
*
arg
)
{
struct
wndproc_hook_params
*
params
=
arg
;
CWPSTRUCT
cwp
;
cwp
.
hwnd
=
hwnd
;
cwp
.
message
=
msg
;
cwp
.
wParam
=
wp
;
cwp
.
lParam
=
lp
;
*
result
=
0
;
return
CallNextHookEx
(
params
->
hhook
,
params
->
code
,
params
->
wparam
,
(
LPARAM
)
&
cwp
);
}
/* callback for WINPROC_Call32ATo16 */
static
LRESULT
wndproc_hook_callback16
(
HWND16
hwnd
,
UINT16
msg
,
WPARAM16
wp
,
LPARAM
lp
,
LRESULT
*
result
,
void
*
arg
)
{
struct
wndproc_hook_params
*
params
=
arg
;
CWPSTRUCT16
cwp
;
LRESULT
ret
;
cwp
.
hwnd
=
hwnd
;
cwp
.
message
=
msg
;
cwp
.
wParam
=
wp
;
cwp
.
lParam
=
lp
;
lp
=
MapLS
(
&
cwp
);
ret
=
call_hook_16
(
WH_CALLWNDPROC
,
params
->
code
,
params
->
wparam
,
lp
);
UnMapLS
(
lp
);
*
result
=
0
;
return
ret
;
}
/***********************************************************************
* call_WH_MSGFILTER
*/
...
...
@@ -184,26 +228,14 @@ static LRESULT CALLBACK call_WH_GETMESSAGE( INT code, WPARAM wp, LPARAM lp )
*/
static
LRESULT
CALLBACK
call_WH_CALLWNDPROC
(
INT
code
,
WPARAM
wp
,
LPARAM
lp
)
{
struct
wndproc_hook_params
params
;
CWPSTRUCT
*
cwp32
=
(
CWPSTRUCT
*
)
lp
;
CWPSTRUCT16
cwp16
;
MSGPARAM16
mp16
;
LRESULT
ret
;
cwp16
.
hwnd
=
HWND_16
(
cwp32
->
hwnd
);
cwp16
.
lParam
=
cwp32
->
lParam
;
LRESULT
result
;
WINPROC_MapMsg32ATo16
(
cwp32
->
hwnd
,
cwp32
->
message
,
cwp32
->
wParam
,
&
cwp16
.
message
,
&
cwp16
.
wParam
,
&
cwp16
.
lParam
);
lp
=
MapLS
(
&
cwp16
);
ret
=
call_hook_16
(
WH_CALLWNDPROC
,
code
,
wp
,
lp
);
UnMapLS
(
lp
);
mp16
.
wParam
=
cwp16
.
wParam
;
mp16
.
lParam
=
cwp16
.
lParam
;
mp16
.
lResult
=
0
;
WINPROC_UnmapMsg32ATo16
(
cwp32
->
hwnd
,
cwp32
->
message
,
cwp32
->
wParam
,
cwp32
->
lParam
,
&
mp16
);
return
ret
;
params
.
code
=
code
;
params
.
wparam
=
wp
;
return
WINPROC_CallProc32ATo16
(
wndproc_hook_callback16
,
cwp32
->
hwnd
,
cwp32
->
message
,
cwp32
->
wParam
,
cwp32
->
lParam
,
&
result
,
&
params
);
}
...
...
@@ -499,15 +531,14 @@ LRESULT WINAPI CallNextHookEx16( HHOOK hhook, INT16 code, WPARAM16 wparam, LPARA
case
WH_CALLWNDPROC
:
{
CWPSTRUCT16
*
cwp16
=
MapSL
(
lparam
);
CWPSTRUCT
cwp32
;
cwp32
.
hwnd
=
WIN_Handle32
(
cwp16
->
hwnd
);
cwp32
.
lParam
=
cwp16
->
lParam
;
WINPROC_MapMsg16To32A
(
cwp32
.
hwnd
,
cwp16
->
message
,
cwp16
->
wParam
,
&
cwp32
.
message
,
&
cwp32
.
wParam
,
&
cwp32
.
lParam
);
ret
=
CallNextHookEx
(
hhook
,
code
,
wparam
,
(
LPARAM
)
&
cwp32
);
WINPROC_UnmapMsg16To32A
(
cwp32
.
hwnd
,
cwp32
.
message
,
cwp32
.
wParam
,
cwp32
.
lParam
,
0
);
LRESULT
result
;
struct
wndproc_hook_params
params
;
params
.
hhook
=
hhook
;
params
.
code
=
code
;
params
.
wparam
=
wparam
;
ret
=
WINPROC_CallProc16To32A
(
wndproc_hook_callback
,
cwp16
->
hwnd
,
cwp16
->
message
,
cwp16
->
wParam
,
cwp16
->
lParam
,
&
result
,
&
params
);
break
;
}
...
...
dlls/user/winproc.c
View file @
dc61a4bc
...
...
@@ -2967,8 +2967,8 @@ LRESULT WINAPI __wine_call_wndproc( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LP
*
* Call a 16-bit window procedure, translating the 32-bit args.
*/
static
LRESULT
WINPROC_CallProc32ATo16
(
winproc_callback16_t
callback
,
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
LRESULT
*
result
,
void
*
arg
)
LRESULT
WINPROC_CallProc32ATo16
(
winproc_callback16_t
callback
,
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
LRESULT
*
result
,
void
*
arg
)
{
LRESULT
ret
;
UINT16
msg16
;
...
...
dlls/user/winproc.h
View file @
dc61a4bc
...
...
@@ -59,6 +59,8 @@ extern LRESULT WINPROC_CallProcAtoW( winproc_callback_t callback, HWND hwnd, UIN
WPARAM
wParam
,
LPARAM
lParam
,
LRESULT
*
result
,
void
*
arg
);
extern
LRESULT
WINPROC_CallProc16To32A
(
winproc_callback_t
callback
,
HWND16
hwnd
,
UINT16
msg
,
WPARAM16
wParam
,
LPARAM
lParam
,
LRESULT
*
result
,
void
*
arg
);
extern
LRESULT
WINPROC_CallProc32ATo16
(
winproc_callback16_t
callback
,
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
LRESULT
*
result
,
void
*
arg
);
extern
INT
WINPROC_MapMsg16To32A
(
HWND
hwnd
,
UINT16
msg16
,
WPARAM16
wParam16
,
UINT
*
pmsg32
,
WPARAM
*
pwparam32
,
...
...
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