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
397bf3c2
Commit
397bf3c2
authored
May 09, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user: Added specific winproc functions for calling dialog procedures.
parent
c1f3adc4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
30 deletions
+97
-30
defdlg.c
dlls/user/defdlg.c
+12
-30
winproc.c
dlls/user/winproc.c
+81
-0
winproc.h
dlls/user/winproc.h
+4
-0
No files found.
dlls/user/defdlg.c
View file @
397bf3c2
...
...
@@ -35,9 +35,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(dialog);
/***********************************************************************
* DEFDLG_GetDlgProc
*/
static
WND
PROC
DEFDLG_GetDlgProc
(
HWND
hwnd
)
static
DLG
PROC
DEFDLG_GetDlgProc
(
HWND
hwnd
)
{
WND
PROC
ret
;
DLG
PROC
ret
;
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
)
return
0
;
...
...
@@ -46,7 +46,7 @@ static WNDPROC DEFDLG_GetDlgProc( HWND hwnd )
ERR
(
"cannot get dlg proc %p from other process
\n
"
,
hwnd
);
return
0
;
}
ret
=
*
(
WND
PROC
*
)((
char
*
)
wndPtr
->
wExtra
+
DWLP_DLGPROC
);
ret
=
*
(
DLG
PROC
*
)((
char
*
)
wndPtr
->
wExtra
+
DWLP_DLGPROC
);
WIN_ReleasePtr
(
wndPtr
);
return
ret
;
}
...
...
@@ -381,7 +381,7 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
LPARAM
lParam
)
{
DIALOGINFO
*
dlgInfo
;
WND
PROC16
dlgproc
;
DLG
PROC16
dlgproc
;
HWND
hwnd32
=
WIN_Handle32
(
hwnd
);
BOOL
result
=
FALSE
;
...
...
@@ -390,14 +390,8 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
SetWindowLongPtrW
(
hwnd32
,
DWLP_MSGRESULT
,
0
);
if
((
dlgproc
=
(
WNDPROC16
)
DEFDLG_GetDlgProc
(
hwnd32
)))
{
/* Call dialog procedure */
result
=
CallWindowProc16
(
dlgproc
,
hwnd
,
msg
,
wParam
,
lParam
);
/* 16 bit dlg procs only return BOOL16 */
if
(
WINPROC_GetProcType
(
(
WNDPROC
)
dlgproc
)
==
WIN_PROC_16
)
result
=
LOWORD
(
result
);
}
if
((
dlgproc
=
(
DLGPROC16
)
DEFDLG_GetDlgProc
(
hwnd32
)))
/* Call dialog procedure */
result
=
WINPROC_CallDlgProc16
(
dlgproc
,
hwnd
,
msg
,
wParam
,
lParam
);
if
(
!
result
&&
IsWindow
(
hwnd32
))
{
...
...
@@ -439,7 +433,7 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
LRESULT
WINAPI
DefDlgProcA
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
DIALOGINFO
*
dlgInfo
;
WND
PROC
dlgproc
;
DLG
PROC
dlgproc
;
BOOL
result
=
FALSE
;
/* Perform DIALOGINFO initialization if not done */
...
...
@@ -447,14 +441,8 @@ LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
SetWindowLongPtrW
(
hwnd
,
DWLP_MSGRESULT
,
0
);
if
((
dlgproc
=
DEFDLG_GetDlgProc
(
hwnd
)))
{
/* Call dialog procedure */
result
=
CallWindowProcA
(
dlgproc
,
hwnd
,
msg
,
wParam
,
lParam
);
/* 16 bit dlg procs only return BOOL16 */
if
(
WINPROC_GetProcType
(
dlgproc
)
==
WIN_PROC_16
)
result
=
LOWORD
(
result
);
}
if
((
dlgproc
=
DEFDLG_GetDlgProc
(
hwnd
)))
/* Call dialog procedure */
result
=
WINPROC_CallDlgProcA
(
dlgproc
,
hwnd
,
msg
,
wParam
,
lParam
);
if
(
!
result
&&
IsWindow
(
hwnd
))
{
...
...
@@ -497,21 +485,15 @@ LRESULT WINAPI DefDlgProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
DIALOGINFO
*
dlgInfo
;
BOOL
result
=
FALSE
;
WND
PROC
dlgproc
;
DLG
PROC
dlgproc
;
/* Perform DIALOGINFO intialization if not done */
if
(
!
(
dlgInfo
=
DIALOG_get_info
(
hwnd
,
TRUE
)))
return
-
1
;
SetWindowLongPtrW
(
hwnd
,
DWLP_MSGRESULT
,
0
);
if
((
dlgproc
=
DEFDLG_GetDlgProc
(
hwnd
)))
{
/* Call dialog procedure */
result
=
CallWindowProcW
(
dlgproc
,
hwnd
,
msg
,
wParam
,
lParam
);
/* 16 bit dlg procs only return BOOL16 */
if
(
WINPROC_GetProcType
(
dlgproc
)
==
WIN_PROC_16
)
result
=
LOWORD
(
result
);
}
if
((
dlgproc
=
DEFDLG_GetDlgProc
(
hwnd
)))
/* Call dialog procedure */
result
=
WINPROC_CallDlgProcW
(
dlgproc
,
hwnd
,
msg
,
wParam
,
lParam
);
if
(
!
result
&&
IsWindow
(
hwnd
))
{
...
...
dlls/user/winproc.c
View file @
397bf3c2
...
...
@@ -3272,3 +3272,84 @@ LRESULT WINAPI CallWindowProcW( WNDPROC func, HWND hwnd, UINT msg,
return
0
;
}
}
/**********************************************************************
* WINPROC_CallDlgProc16
*/
INT_PTR
WINPROC_CallDlgProc16
(
DLGPROC16
func
,
HWND16
hwnd
,
UINT16
msg
,
WPARAM16
wParam
,
LPARAM
lParam
)
{
WINDOWPROC
*
proc
;
if
(
!
func
)
return
0
;
if
(
!
(
proc
=
handle16_to_proc
(
(
WNDPROC16
)
func
)))
return
LOWORD
(
WINPROC_CallWndProc16
(
(
WNDPROC16
)
func
,
hwnd
,
msg
,
wParam
,
lParam
)
);
switch
(
proc
->
type
)
{
case
WIN_PROC_16
:
return
LOWORD
(
WINPROC_CallWndProc16
(
proc
->
proc16
,
hwnd
,
msg
,
wParam
,
lParam
)
);
case
WIN_PROC_32A
:
return
__wine_call_wndproc_32A
(
hwnd
,
msg
,
wParam
,
lParam
,
proc
->
thunk
.
proc
);
case
WIN_PROC_32W
:
return
__wine_call_wndproc_32W
(
hwnd
,
msg
,
wParam
,
lParam
,
proc
->
thunk
.
proc
);
default:
WARN_
(
relay
)(
"Invalid proc %p
\n
"
,
proc
);
return
0
;
}
}
/**********************************************************************
* WINPROC_CallDlgProcA
*/
INT_PTR
WINPROC_CallDlgProcA
(
DLGPROC
func
,
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
WINDOWPROC
*
proc
;
if
(
!
func
)
return
0
;
if
(
!
(
proc
=
handle_to_proc
(
(
WNDPROC
)
func
)))
return
WINPROC_CallWndProc
(
(
WNDPROC
)
func
,
hwnd
,
msg
,
wParam
,
lParam
);
switch
(
proc
->
type
)
{
case
WIN_PROC_16
:
return
LOWORD
(
WINPROC_CallProc32ATo16
(
proc
->
proc16
,
hwnd
,
msg
,
wParam
,
lParam
)
);
case
WIN_PROC_32A
:
return
WINPROC_CallWndProc
(
proc
->
thunk
.
proc
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32W
:
return
WINPROC_CallProc32ATo32W
(
proc
->
thunk
.
proc
,
hwnd
,
msg
,
wParam
,
lParam
);
default:
WARN_
(
relay
)(
"Invalid proc %p
\n
"
,
proc
);
return
0
;
}
}
/**********************************************************************
* WINPROC_CallDlgProcW
*/
INT_PTR
WINPROC_CallDlgProcW
(
DLGPROC
func
,
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
WINDOWPROC
*
proc
;
if
(
!
func
)
return
0
;
if
(
!
(
proc
=
handle_to_proc
(
(
WNDPROC
)
func
)))
return
WINPROC_CallWndProc
(
(
WNDPROC
)
func
,
hwnd
,
msg
,
wParam
,
lParam
);
switch
(
proc
->
type
)
{
case
WIN_PROC_16
:
return
LOWORD
(
WINPROC_CallProc32WTo16
(
proc
->
proc16
,
hwnd
,
msg
,
wParam
,
lParam
));
case
WIN_PROC_32A
:
return
WINPROC_CallProc32WTo32A
(
proc
->
thunk
.
proc
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32W
:
return
WINPROC_CallWndProc
(
proc
->
thunk
.
proc
,
hwnd
,
msg
,
wParam
,
lParam
);
default:
WARN_
(
relay
)(
"Invalid proc %p
\n
"
,
proc
);
return
0
;
}
}
dlls/user/winproc.h
View file @
397bf3c2
...
...
@@ -85,6 +85,10 @@ extern void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam,
extern
void
WINPROC_UnmapMsg32WTo16
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
MSGPARAM16
*
pm16
);
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
);
/* map a Unicode string to a 16-bit pointer */
inline
static
SEGPTR
map_str_32W_to_16
(
LPCWSTR
str
)
{
...
...
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