Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
334ede40
Commit
334ede40
authored
Aug 08, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Factor out the calling of a window's winproc into a separate function.
parent
01de889c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
57 deletions
+62
-57
message.c
dlls/user32/message.c
+19
-57
user_private.h
dlls/user32/user_private.h
+2
-0
winproc.c
dlls/user32/winproc.c
+41
-0
No files found.
dlls/user32/message.c
View file @
334ede40
...
...
@@ -1513,7 +1513,6 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
{
struct
user_thread_info
*
thread_info
=
get_user_thread_info
();
LRESULT
result
=
0
;
WNDPROC
winproc
;
CWPSTRUCT
cwp
;
CWPRETSTRUCT
cwpret
;
...
...
@@ -1535,16 +1534,7 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
HOOK_CallHooks
(
WH_CALLWNDPROC
,
HC_ACTION
,
same_thread
,
(
LPARAM
)
&
cwp
,
unicode
);
/* now call the window procedure */
if
(
unicode
)
{
if
(
!
(
winproc
=
(
WNDPROC
)
GetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
)))
goto
done
;
result
=
CallWindowProcW
(
winproc
,
hwnd
,
msg
,
wparam
,
lparam
);
}
else
{
if
(
!
(
winproc
=
(
WNDPROC
)
GetWindowLongPtrA
(
hwnd
,
GWLP_WNDPROC
)))
goto
done
;
result
=
CallWindowProcA
(
winproc
,
hwnd
,
msg
,
wparam
,
lparam
);
}
if
(
!
WINPROC_call_window
(
hwnd
,
msg
,
wparam
,
lparam
,
&
result
,
unicode
))
goto
done
;
/* and finally the WH_CALLWNDPROCRET hook */
cwpret
.
lResult
=
result
;
...
...
@@ -2971,9 +2961,7 @@ BOOL WINAPI TranslateMessage( const MSG *msg )
*/
LRESULT
WINAPI
DispatchMessageA
(
const
MSG
*
msg
)
{
WND
*
wndPtr
;
LRESULT
retval
;
WNDPROC
winproc
;
/* Process timer messages */
if
((
msg
->
message
==
WM_TIMER
)
||
(
msg
->
message
==
WM_SYSTIMER
))
...
...
@@ -2981,31 +2969,19 @@ LRESULT WINAPI DispatchMessageA( const MSG* msg )
if
(
msg
->
lParam
)
return
CallWindowProcA
(
(
WNDPROC
)
msg
->
lParam
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
GetTickCount
()
);
}
if
(
!
msg
->
hwnd
)
return
0
;
if
(
!
(
wndPtr
=
WIN_GetPtr
(
msg
->
hwnd
)))
{
if
(
msg
->
hwnd
)
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
if
(
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
{
if
(
IsWindow
(
msg
->
hwnd
))
SetLastError
(
ERROR_MESSAGE_SYNC_ONLY
);
else
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
if
(
wndPtr
->
tid
!=
GetCurrentThreadId
())
SPY_EnterMessage
(
SPY_DISPATCHMESSAGE
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
if
(
!
WINPROC_call_window
(
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
,
&
retval
,
FALSE
))
{
SetLastError
(
ERROR_MESSAGE_SYNC_ONLY
);
WIN_ReleasePtr
(
wndPtr
);
ret
urn
0
;
if
(
!
IsWindow
(
msg
->
hwnd
))
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
else
SetLastError
(
ERROR_MESSAGE_SYNC_ONLY
);
ret
val
=
0
;
}
winproc
=
wndPtr
->
winproc
;
WIN_ReleasePtr
(
wndPtr
);
SPY_EnterMessage
(
SPY_DISPATCHMESSAGE
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
retval
=
CallWindowProcA
(
winproc
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
SPY_ExitMessage
(
SPY_RESULT_OK
,
msg
->
hwnd
,
msg
->
message
,
retval
,
msg
->
wParam
,
msg
->
lParam
);
...
...
@@ -3043,9 +3019,7 @@ LRESULT WINAPI DispatchMessageA( const MSG* msg )
*/
LRESULT
WINAPI
DispatchMessageW
(
const
MSG
*
msg
)
{
WND
*
wndPtr
;
LRESULT
retval
;
WNDPROC
winproc
;
/* Process timer messages */
if
((
msg
->
message
==
WM_TIMER
)
||
(
msg
->
message
==
WM_SYSTIMER
))
...
...
@@ -3053,31 +3027,19 @@ LRESULT WINAPI DispatchMessageW( const MSG* msg )
if
(
msg
->
lParam
)
return
CallWindowProcW
(
(
WNDPROC
)
msg
->
lParam
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
GetTickCount
()
);
}
if
(
!
msg
->
hwnd
)
return
0
;
if
(
!
(
wndPtr
=
WIN_GetPtr
(
msg
->
hwnd
)))
{
if
(
msg
->
hwnd
)
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
if
(
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
{
if
(
IsWindow
(
msg
->
hwnd
))
SetLastError
(
ERROR_MESSAGE_SYNC_ONLY
);
else
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
if
(
wndPtr
->
tid
!=
GetCurrentThreadId
())
SPY_EnterMessage
(
SPY_DISPATCHMESSAGE
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
if
(
!
WINPROC_call_window
(
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
,
&
retval
,
TRUE
))
{
SetLastError
(
ERROR_MESSAGE_SYNC_ONLY
);
WIN_ReleasePtr
(
wndPtr
);
ret
urn
0
;
if
(
!
IsWindow
(
msg
->
hwnd
))
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
else
SetLastError
(
ERROR_MESSAGE_SYNC_ONLY
);
ret
val
=
0
;
}
winproc
=
wndPtr
->
winproc
;
WIN_ReleasePtr
(
wndPtr
);
SPY_EnterMessage
(
SPY_DISPATCHMESSAGE
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
retval
=
CallWindowProcW
(
winproc
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
SPY_ExitMessage
(
SPY_RESULT_OK
,
msg
->
hwnd
,
msg
->
message
,
retval
,
msg
->
wParam
,
msg
->
lParam
);
...
...
dlls/user32/user_private.h
View file @
334ede40
...
...
@@ -246,6 +246,8 @@ extern LRESULT WINPROC_CallProc32ATo16( winproc_callback16_t callback, HWND hwnd
extern
INT_PTR
WINPROC_CallDlgProc16
(
DLGPROC16
func
,
HWND16
hwnd
,
UINT16
msg
,
WPARAM16
wParam
,
LPARAM
lParam
);
extern
INT_PTR
WINPROC_CallDlgProcA
(
DLGPROC
func
,
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
);
extern
INT_PTR
WINPROC_CallDlgProcW
(
DLGPROC
func
,
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
);
extern
BOOL
WINPROC_call_window
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
LRESULT
*
result
,
BOOL
unicode
);
/* message spy definitions */
...
...
dlls/user32/winproc.c
View file @
334ede40
...
...
@@ -2197,6 +2197,47 @@ LRESULT WINPROC_CallProc32ATo16( winproc_callback16_t callback, HWND hwnd, UINT
/**********************************************************************
* WINPROC_call_window
*
* Call the window procedure of the specified window.
*/
BOOL
WINPROC_call_window
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
LRESULT
*
result
,
BOOL
unicode
)
{
WND
*
wndPtr
;
WINDOWPROC
*
proc
;
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwnd
)))
return
FALSE
;
if
(
wndPtr
==
WND_OTHER_PROCESS
||
wndPtr
==
WND_DESKTOP
)
return
FALSE
;
if
(
wndPtr
->
tid
!=
GetCurrentThreadId
())
{
WIN_ReleasePtr
(
wndPtr
);
return
FALSE
;
}
proc
=
handle_to_proc
(
wndPtr
->
winproc
);
WIN_ReleasePtr
(
wndPtr
);
if
(
!
proc
)
return
TRUE
;
if
(
unicode
)
{
if
(
proc
->
procW
)
call_window_proc
(
hwnd
,
msg
,
wParam
,
lParam
,
result
,
proc
->
procW
);
else
WINPROC_CallProcWtoA
(
call_window_proc
,
hwnd
,
msg
,
wParam
,
lParam
,
result
,
proc
->
procA
);
}
else
{
if
(
proc
->
procA
)
call_window_proc
(
hwnd
,
msg
,
wParam
,
lParam
,
result
,
proc
->
procA
);
else
WINPROC_CallProcAtoW
(
call_window_proc
,
hwnd
,
msg
,
wParam
,
lParam
,
result
,
proc
->
procW
);
}
return
TRUE
;
}
/**********************************************************************
* CallWindowProc (USER.122)
*/
LRESULT
WINAPI
CallWindowProc16
(
WNDPROC16
func
,
HWND16
hwnd
,
UINT16
msg
,
...
...
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