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
0667292e
Commit
0667292e
authored
May 17, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user: Support storing multiple winprocs in a single winproc handle.
Allows to remove special cases for window classes being Ascii and Unicode at the same time.
parent
2a809c19
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
212 deletions
+86
-212
class.c
dlls/user/class.c
+13
-66
message.c
dlls/user/message.c
+2
-2
win.c
dlls/user/win.c
+4
-2
winproc.c
dlls/user/winproc.c
+66
-141
winproc.h
dlls/user/winproc.h
+1
-1
No files found.
dlls/user/class.c
View file @
0667292e
...
...
@@ -48,8 +48,7 @@ typedef struct tagCLASS
struct
list
entry
;
/* Entry in class list */
UINT
style
;
/* Class style */
BOOL
local
;
/* Local class? */
WNDPROC
winprocA
;
/* Window procedure (ASCII) */
WNDPROC
winprocW
;
/* Window procedure (Unicode) */
WNDPROC
winproc
;
/* Window procedure */
INT
cbClsExtra
;
/* Class extra bytes */
INT
cbWndExtra
;
/* Window extra bytes */
LPWSTR
menuName
;
/* Default menu name (Unicode followed by ASCII) */
...
...
@@ -144,49 +143,6 @@ static BOOL set_server_info( HWND hwnd, INT offset, LONG newval )
/***********************************************************************
* CLASS_GetProc
*
* Get the class winproc for a given proc type
*/
static
WNDPROC
CLASS_GetProc
(
CLASS
*
classPtr
,
BOOL
unicode
)
{
WNDPROC
proc
=
classPtr
->
winprocA
;
if
(
classPtr
->
winprocW
)
{
/* if we have a Unicode proc, use it if we have no ASCII proc
* or if we have both and Unicode was requested
*/
if
(
!
proc
||
unicode
)
proc
=
classPtr
->
winprocW
;
}
return
WINPROC_GetProc
(
proc
,
unicode
);
}
/***********************************************************************
* CLASS_SetProc
*
* Set the class winproc for a given proc type.
* Returns the previous window proc.
*/
static
void
CLASS_SetProc
(
CLASS
*
classPtr
,
WNDPROC
newproc
,
BOOL
unicode
)
{
WNDPROC
proc
=
WINPROC_AllocProc
(
newproc
,
unicode
);
if
(
WINPROC_IsUnicode
(
proc
,
unicode
))
{
classPtr
->
winprocA
=
0
;
classPtr
->
winprocW
=
proc
;
}
else
{
classPtr
->
winprocA
=
proc
;
classPtr
->
winprocW
=
0
;
}
}
/***********************************************************************
* CLASS_GetMenuNameA
*
* Get the menu name as a ASCII string.
...
...
@@ -417,9 +373,7 @@ static CLASS *register_builtin( const struct builtin_class_descr *descr )
classPtr
->
hCursor
=
LoadCursorA
(
0
,
(
LPSTR
)
descr
->
cursor
);
classPtr
->
hbrBackground
=
descr
->
brush
;
if
(
descr
->
procA
)
classPtr
->
winprocA
=
WINPROC_AllocProc
(
descr
->
procA
,
FALSE
);
if
(
descr
->
procW
)
classPtr
->
winprocW
=
WINPROC_AllocProc
(
descr
->
procW
,
TRUE
);
classPtr
->
winproc
=
WINPROC_AllocProc
(
descr
->
procA
,
descr
->
procW
);
release_class_ptr
(
classPtr
);
return
classPtr
;
}
...
...
@@ -466,16 +420,9 @@ void CLASS_RegisterBuiltinClasses(void)
*/
void
CLASS_AddWindow
(
CLASS
*
class
,
WND
*
win
,
BOOL
unicode
)
{
if
(
unicode
)
{
if
(
!
(
win
->
winproc
=
class
->
winprocW
))
win
->
winproc
=
class
->
winprocA
;
}
else
{
if
(
!
(
win
->
winproc
=
class
->
winprocA
))
win
->
winproc
=
class
->
winprocW
;
}
win
->
class
=
class
;
win
->
clsStyle
=
class
->
style
;
win
->
winproc
=
class
->
winproc
;
if
(
WINPROC_IsUnicode
(
win
->
winproc
,
unicode
))
win
->
flags
|=
WIN_ISUNICODE
;
}
...
...
@@ -565,7 +512,7 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc )
classPtr
->
hIconSm
=
wc
->
hIconSm
;
classPtr
->
hCursor
=
wc
->
hCursor
;
classPtr
->
hbrBackground
=
wc
->
hbrBackground
;
classPtr
->
winproc
A
=
WINPROC_AllocProc
(
wc
->
lpfnWndProc
,
FALSE
);
classPtr
->
winproc
=
WINPROC_AllocProc
(
wc
->
lpfnWndProc
,
NULL
);
CLASS_SetMenuNameA
(
classPtr
,
wc
->
lpszMenuName
);
release_class_ptr
(
classPtr
);
return
atom
;
...
...
@@ -603,7 +550,7 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc )
classPtr
->
hIconSm
=
wc
->
hIconSm
;
classPtr
->
hCursor
=
wc
->
hCursor
;
classPtr
->
hbrBackground
=
wc
->
hbrBackground
;
classPtr
->
winproc
W
=
WINPROC_AllocProc
(
wc
->
lpfnWndProc
,
TRUE
);
classPtr
->
winproc
=
WINPROC_AllocProc
(
NULL
,
wc
->
lpfnWndProc
);
CLASS_SetMenuNameW
(
classPtr
,
wc
->
lpszMenuName
);
release_class_ptr
(
classPtr
);
return
atom
;
...
...
@@ -782,7 +729,7 @@ DWORD WINAPI GetClassLongW( HWND hwnd, INT offset )
retvalue
=
(
DWORD
)
class
->
hInstance
;
break
;
case
GCLP_WNDPROC
:
retvalue
=
(
DWORD
)
CLASS_GetProc
(
class
,
TRUE
);
retvalue
=
(
DWORD
)
WINPROC_GetProc
(
class
->
winproc
,
TRUE
);
break
;
case
GCLP_MENUNAME
:
retvalue
=
(
DWORD
)
CLASS_GetMenuNameW
(
class
);
...
...
@@ -822,7 +769,7 @@ DWORD WINAPI GetClassLongA( HWND hwnd, INT offset )
}
if
(
offset
==
GCLP_WNDPROC
)
retvalue
=
(
DWORD
)
CLASS_GetProc
(
class
,
FALSE
);
retvalue
=
(
DWORD
)
WINPROC_GetProc
(
class
->
winproc
,
FALSE
);
else
/* GCL_MENUNAME */
retvalue
=
(
DWORD
)
CLASS_GetMenuNameA
(
class
);
...
...
@@ -893,8 +840,8 @@ DWORD WINAPI SetClassLongW( HWND hwnd, INT offset, LONG newval )
retval
=
0
;
/* Old value is now meaningless anyway */
break
;
case
GCLP_WNDPROC
:
retval
=
(
DWORD
)
CLASS_GetProc
(
class
,
TRUE
);
CLASS_SetProc
(
class
,
(
WNDPROC
)
newval
,
TRUE
);
retval
=
(
DWORD
)
WINPROC_GetProc
(
class
->
winproc
,
TRUE
);
class
->
winproc
=
WINPROC_AllocProc
(
NULL
,
(
WNDPROC
)
newval
);
break
;
case
GCLP_HBRBACKGROUND
:
retval
=
(
DWORD
)
class
->
hbrBackground
;
...
...
@@ -961,8 +908,8 @@ DWORD WINAPI SetClassLongA( HWND hwnd, INT offset, LONG newval )
if
(
offset
==
GCLP_WNDPROC
)
{
retval
=
(
DWORD
)
CLASS_GetProc
(
class
,
FALSE
);
CLASS_SetProc
(
class
,
(
WNDPROC
)
newval
,
FALSE
);
retval
=
(
DWORD
)
WINPROC_GetProc
(
class
->
winproc
,
FALSE
);
class
->
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
newval
,
NULL
);
}
else
/* GCL_MENUNAME */
{
...
...
@@ -1084,7 +1031,7 @@ BOOL WINAPI GetClassInfoExA( HINSTANCE hInstance, LPCSTR name, WNDCLASSEXA *wc )
return
FALSE
;
}
wc
->
style
=
classPtr
->
style
;
wc
->
lpfnWndProc
=
(
WNDPROC
)
CLASS_GetProc
(
classPtr
,
FALSE
);
wc
->
lpfnWndProc
=
WINPROC_GetProc
(
classPtr
->
winproc
,
FALSE
);
wc
->
cbClsExtra
=
classPtr
->
cbClsExtra
;
wc
->
cbWndExtra
=
classPtr
->
cbWndExtra
;
wc
->
hInstance
=
(
hInstance
==
user32_module
)
?
0
:
hInstance
;
...
...
@@ -1119,7 +1066,7 @@ BOOL WINAPI GetClassInfoExW( HINSTANCE hInstance, LPCWSTR name, WNDCLASSEXW *wc
return
FALSE
;
}
wc
->
style
=
classPtr
->
style
;
wc
->
lpfnWndProc
=
(
WNDPROC
)
CLASS_GetProc
(
classPtr
,
TRUE
);
wc
->
lpfnWndProc
=
WINPROC_GetProc
(
classPtr
->
winproc
,
TRUE
);
wc
->
cbClsExtra
=
classPtr
->
cbClsExtra
;
wc
->
cbWndExtra
=
classPtr
->
cbWndExtra
;
wc
->
hInstance
=
(
hInstance
==
user32_module
)
?
0
:
hInstance
;
...
...
dlls/user/message.c
View file @
0667292e
...
...
@@ -3338,7 +3338,7 @@ UINT_PTR WINAPI SetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc )
UINT_PTR
ret
;
WNDPROC
winproc
=
0
;
if
(
proc
)
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
proc
,
FALSE
);
if
(
proc
)
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
proc
,
NULL
);
SERVER_START_REQ
(
set_win_timer
)
{
...
...
@@ -3369,7 +3369,7 @@ UINT_PTR WINAPI SetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC
UINT_PTR
ret
;
WNDPROC
winproc
=
0
;
if
(
proc
)
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
proc
,
FALSE
);
if
(
proc
)
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
proc
,
NULL
);
SERVER_START_REQ
(
set_win_timer
)
{
...
...
dlls/user/win.c
View file @
0667292e
...
...
@@ -1987,7 +1987,8 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval, BOOL
{
UINT
old_flags
=
wndPtr
->
flags
;
retval
=
(
ULONG_PTR
)
WINPROC_GetProc
(
wndPtr
->
winproc
,
unicode
);
wndPtr
->
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
newval
,
unicode
);
if
(
unicode
)
wndPtr
->
winproc
=
WINPROC_AllocProc
(
NULL
,
(
WNDPROC
)
newval
);
else
wndPtr
->
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
newval
,
NULL
);
if
(
WINPROC_IsUnicode
(
wndPtr
->
winproc
,
unicode
))
wndPtr
->
flags
|=
WIN_ISUNICODE
;
else
wndPtr
->
flags
&=
~
WIN_ISUNICODE
;
if
(
!
((
old_flags
^
wndPtr
->
flags
)
&
WIN_ISUNICODE
))
...
...
@@ -2007,7 +2008,8 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval, BOOL
{
WNDPROC
*
ptr
=
(
WNDPROC
*
)((
char
*
)
wndPtr
->
wExtra
+
DWLP_DLGPROC
);
retval
=
(
ULONG_PTR
)
WINPROC_GetProc
(
*
ptr
,
unicode
);
*
ptr
=
WINPROC_AllocProc
(
(
WNDPROC
)
newval
,
unicode
);
if
(
unicode
)
*
ptr
=
WINPROC_AllocProc
(
NULL
,
(
WNDPROC
)
newval
);
else
*
ptr
=
WINPROC_AllocProc
(
(
WNDPROC
)
newval
,
NULL
);
WIN_ReleasePtr
(
wndPtr
);
return
retval
;
}
...
...
dlls/user/winproc.c
View file @
0667292e
...
...
@@ -47,24 +47,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(win);
typedef
struct
tagWINDOWPROC
{
BYTE
type
;
/* Function type */
union
{
WNDPROC16
proc16
;
/* 16-bit window proc */
WNDPROC
proc32
;
/* 32-bit
window proc */
}
u
;
WNDPROC
procA
;
/* ASCII
window proc */
WNDPROC
procW
;
/* Unicode window proc */
}
WINDOWPROC
;
typedef
enum
{
WIN_PROC_INVALID
,
WIN_PROC_16
,
WIN_PROC_32A
,
WIN_PROC_32W
}
WINDOWPROCTYPE
;
#define WINPROC_HANDLE (~0UL >> 16)
#define MAX_WINPROCS
(0x10000 / sizeof(WINDOWPROC))
#define MAX_WINPROCS
8192
static
WINDOWPROC
winproc_array
[
MAX_WINPROCS
];
static
UINT
winproc_used
;
...
...
@@ -86,37 +75,26 @@ static inline WINDOWPROC *find_winproc16( WNDPROC16 func )
for
(
i
=
0
;
i
<
winproc_used
;
i
++
)
{
if
(
winproc_array
[
i
].
type
==
WIN_PROC_16
&&
winproc_array
[
i
].
u
.
proc16
==
func
)
return
&
winproc_array
[
i
];
if
(
winproc_array
[
i
].
proc16
==
func
)
return
&
winproc_array
[
i
];
}
return
NULL
;
}
/* find an existing winproc for a given function and type */
/* FIXME: probably should do something more clever than a linear search */
static
inline
WINDOWPROC
*
find_winproc
(
WNDPROC
func
,
BOOL
unicode
)
static
inline
WINDOWPROC
*
find_winproc
(
WNDPROC
func
A
,
WNDPROC
funcW
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
winproc_used
;
i
++
)
{
if
(
winproc_array
[
i
].
u
.
proc32
==
func
&&
winproc_array
[
i
].
type
==
(
unicode
?
WIN_PROC_32W
:
WIN_PROC_32A
))
if
(
funcA
&&
winproc_array
[
i
].
procA
!=
funcA
)
continue
;
if
(
funcW
&&
winproc_array
[
i
].
procW
!=
funcW
)
continue
;
return
&
winproc_array
[
i
];
}
return
NULL
;
}
/* initialize a new winproc */
static
inline
WINDOWPROC
*
init_winproc
(
void
)
{
WINDOWPROC
*
proc
;
if
(
winproc_used
>=
MAX_WINPROCS
)
return
NULL
;
proc
=
&
winproc_array
[
winproc_used
++
];
return
proc
;
}
/* return the window proc for a given handle, or NULL for an invalid handle */
static
inline
WINDOWPROC
*
handle_to_proc
(
WNDPROC
handle
)
{
...
...
@@ -133,30 +111,31 @@ static inline WNDPROC proc_to_handle( WINDOWPROC *proc )
}
/* allocate and initialize a new winproc */
static
inline
WINDOWPROC
*
alloc_winproc
(
WNDPROC
func
,
BOOL
unicode
)
static
inline
WINDOWPROC
*
alloc_winproc
(
WNDPROC
func
A
,
WNDPROC
funcW
)
{
WINDOWPROC
*
proc
;
if
(
!
func
)
return
NULL
;
/* check if the function is already a win proc */
if
((
proc
=
handle_to_proc
(
func
)))
return
proc
;
if
(
funcA
&&
(
proc
=
handle_to_proc
(
funcA
)))
return
proc
;
if
(
funcW
&&
(
proc
=
handle_to_proc
(
funcW
)))
return
proc
;
if
(
!
funcA
&&
!
funcW
)
return
NULL
;
EnterCriticalSection
(
&
winproc_cs
);
/* check if we already have a winproc for that function */
if
(
!
(
proc
=
find_winproc
(
func
,
unicode
)))
if
(
!
(
proc
=
find_winproc
(
func
A
,
funcW
)))
{
if
(
(
proc
=
init_winproc
())
)
if
(
winproc_used
<
MAX_WINPROCS
)
{
proc
->
type
=
unicode
?
WIN_PROC_32W
:
WIN_PROC_32A
;
proc
->
u
.
proc32
=
func
;
TRACE
(
"allocated %p for %p %c (%d/%d used)
\n
"
,
proc_to_handle
(
proc
),
func
,
unicode
?
'W'
:
'A'
,
winproc_used
,
MAX_WINPROCS
);
proc
=
&
winproc_array
[
winproc_used
++
];
proc
->
procA
=
funcA
;
proc
->
procW
=
funcW
;
TRACE
(
"allocated %p for %p/%p (%d/%d used)
\n
"
,
proc_to_handle
(
proc
),
funcA
,
funcW
,
winproc_used
,
MAX_WINPROCS
);
}
else
FIXME
(
"too many winprocs, cannot allocate one for %p
%c
\n
"
,
func
,
unicode
?
'W'
:
'A'
);
else
FIXME
(
"too many winprocs, cannot allocate one for %p
/%p
\n
"
,
funcA
,
funcW
);
}
else
TRACE
(
"reusing %p for %p
%c
\n
"
,
proc_to_handle
(
proc
),
func
,
unicode
?
'W'
:
'A'
);
else
TRACE
(
"reusing %p for %p
/%p
\n
"
,
proc_to_handle
(
proc
),
funcA
,
funcW
);
LeaveCriticalSection
(
&
winproc_cs
);
return
proc
;
...
...
@@ -206,9 +185,10 @@ static inline WINDOWPROC *handle16_to_proc( WNDPROC16 handle )
static
WNDPROC16
alloc_win16_thunk
(
WINDOWPROC
*
proc
)
{
static
FARPROC16
relay
;
WNDPROC16
ret
=
0
;
UINT
i
;
if
(
proc
->
proc16
)
return
proc
->
proc16
;
EnterCriticalSection
(
&
winproc_cs
);
if
(
!
thunk_array
)
/* allocate the array and its selector */
...
...
@@ -242,10 +222,10 @@ static WNDPROC16 alloc_win16_thunk( WINDOWPROC *proc )
thunk
->
relay_offset
=
OFFSETOF
(
relay
);
thunk
->
relay_sel
=
SELECTOROF
(
relay
);
}
ret
=
(
WNDPROC16
)
MAKESEGPTR
(
thunk_selector
,
i
*
sizeof
(
WINPROC_THUNK
)
);
proc
->
proc16
=
(
WNDPROC16
)
MAKESEGPTR
(
thunk_selector
,
i
*
sizeof
(
WINPROC_THUNK
)
);
done:
LeaveCriticalSection
(
&
winproc_cs
);
return
ret
;
return
proc
->
proc16
;
}
#else
/* __i386__ */
...
...
@@ -503,13 +483,12 @@ static LRESULT WINAPI WINPROC_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
*/
WNDPROC16
WINPROC_GetProc16
(
WNDPROC
proc
,
BOOL
unicode
)
{
WINDOWPROC
*
ptr
=
alloc_winproc
(
proc
,
unicode
)
;
WINDOWPROC
*
ptr
;
if
(
!
ptr
)
return
0
;
if
(
unicode
)
ptr
=
alloc_winproc
(
NULL
,
proc
);
else
ptr
=
alloc_winproc
(
proc
,
NULL
);
if
(
ptr
->
type
==
WIN_PROC_16
)
return
ptr
->
u
.
proc16
;
else
if
(
!
ptr
)
return
0
;
return
alloc_win16_thunk
(
ptr
);
}
...
...
@@ -523,8 +502,17 @@ WNDPROC WINPROC_GetProc( WNDPROC proc, BOOL unicode )
{
WINDOWPROC
*
ptr
=
handle_to_proc
(
proc
);
if
(
!
ptr
||
ptr
->
type
!=
(
unicode
?
WIN_PROC_32W
:
WIN_PROC_32A
))
return
proc
;
return
ptr
->
u
.
proc32
;
/* we can return the original proc in that case */
if
(
!
ptr
)
return
proc
;
if
(
unicode
)
{
if
(
ptr
->
procW
)
return
ptr
->
procW
;
return
proc
;
}
else
{
if
(
ptr
->
procA
)
return
ptr
->
procA
;
return
proc
;
}
}
...
...
@@ -551,10 +539,10 @@ WNDPROC WINPROC_AllocProc16( WNDPROC16 func )
/* then check if we already have a winproc for that function */
if
(
!
(
proc
=
find_winproc16
(
func
)))
{
if
(
(
proc
=
init_winproc
())
)
if
(
winproc_used
<
MAX_WINPROCS
)
{
proc
->
type
=
WIN_PROC_16
;
proc
->
u
.
proc16
=
func
;
proc
=
&
winproc_array
[
winproc_used
++
]
;
proc
->
proc16
=
func
;
TRACE
(
"allocated %p for %p/16-bit (%d/%d used)
\n
"
,
proc_to_handle
(
proc
),
func
,
winproc_used
,
MAX_WINPROCS
);
}
...
...
@@ -577,11 +565,11 @@ WNDPROC WINPROC_AllocProc16( WNDPROC16 func )
* lot of windows, it will usually only have a limited number of window procedures, so the
* array won't grow too large, and this way we avoid the need to track allocations per window.
*/
WNDPROC
WINPROC_AllocProc
(
WNDPROC
func
,
BOOL
unicode
)
WNDPROC
WINPROC_AllocProc
(
WNDPROC
func
A
,
WNDPROC
funcW
)
{
WINDOWPROC
*
proc
;
if
(
!
(
proc
=
alloc_winproc
(
func
,
unicode
)))
return
NULL
;
if
(
!
(
proc
=
alloc_winproc
(
func
A
,
funcW
)))
return
NULL
;
return
proc_to_handle
(
proc
);
}
...
...
@@ -596,7 +584,8 @@ BOOL WINPROC_IsUnicode( WNDPROC proc, BOOL def_val )
WINDOWPROC
*
ptr
=
handle_to_proc
(
proc
);
if
(
!
ptr
)
return
def_val
;
return
(
ptr
->
type
==
WIN_PROC_32W
);
if
(
ptr
->
procA
&&
ptr
->
procW
)
return
def_val
;
/* can be both */
return
(
ptr
->
procW
!=
NULL
);
}
...
...
@@ -3136,18 +3125,8 @@ static LRESULT WINPROC_CallProc16To32W( WNDPROC func, HWND16 hwnd, UINT16 msg,
LRESULT
WINAPI
__wine_call_wndproc
(
HWND16
hwnd
,
UINT16
msg
,
WPARAM16
wParam
,
LPARAM
lParam
,
WINDOWPROC
*
proc
)
{
switch
(
proc
->
type
)
{
case
WIN_PROC_16
:
return
WINPROC_CallWndProc16
(
proc
->
u
.
proc16
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32A
:
return
WINPROC_CallProc16To32A
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32W
:
return
WINPROC_CallProc16To32W
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
default:
WARN_
(
relay
)(
"Invalid proc %p
\n
"
,
proc
);
return
0
;
}
if
(
proc
->
procA
)
return
WINPROC_CallProc16To32A
(
proc
->
procA
,
hwnd
,
msg
,
wParam
,
lParam
);
else
return
WINPROC_CallProc16To32W
(
proc
->
procW
,
hwnd
,
msg
,
wParam
,
lParam
);
}
...
...
@@ -3213,18 +3192,9 @@ LRESULT WINAPI CallWindowProc16( WNDPROC16 func, HWND16 hwnd, UINT16 msg,
if
(
!
(
proc
=
handle16_to_proc
(
func
)))
return
WINPROC_CallWndProc16
(
func
,
hwnd
,
msg
,
wParam
,
lParam
);
switch
(
proc
->
type
)
{
case
WIN_PROC_16
:
return
WINPROC_CallWndProc16
(
proc
->
u
.
proc16
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32A
:
return
WINPROC_CallProc16To32A
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32W
:
return
WINPROC_CallProc16To32W
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
default:
WARN_
(
relay
)(
"Invalid proc %p
\n
"
,
proc
);
return
0
;
}
if
(
proc
->
procA
)
return
WINPROC_CallProc16To32A
(
proc
->
procA
,
hwnd
,
msg
,
wParam
,
lParam
);
if
(
proc
->
procW
)
return
WINPROC_CallProc16To32W
(
proc
->
procW
,
hwnd
,
msg
,
wParam
,
lParam
);
return
WINPROC_CallWndProc16
(
proc
->
proc16
,
hwnd
,
msg
,
wParam
,
lParam
);
}
...
...
@@ -3266,18 +3236,9 @@ LRESULT WINAPI CallWindowProcA(
if
(
!
(
proc
=
handle_to_proc
(
func
)))
return
WINPROC_CallWndProc
(
func
,
hwnd
,
msg
,
wParam
,
lParam
);
switch
(
proc
->
type
)
{
case
WIN_PROC_16
:
return
WINPROC_CallProc32ATo16
(
proc
->
u
.
proc16
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32A
:
return
WINPROC_CallWndProc
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32W
:
return
WINPROC_CallProc32ATo32W
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
default:
WARN_
(
relay
)(
"Invalid proc %p
\n
"
,
proc
);
return
0
;
}
if
(
proc
->
procA
)
return
WINPROC_CallWndProc
(
proc
->
procA
,
hwnd
,
msg
,
wParam
,
lParam
);
if
(
proc
->
procW
)
return
WINPROC_CallProc32ATo32W
(
proc
->
procW
,
hwnd
,
msg
,
wParam
,
lParam
);
return
WINPROC_CallProc32ATo16
(
proc
->
proc16
,
hwnd
,
msg
,
wParam
,
lParam
);
}
...
...
@@ -3296,18 +3257,9 @@ LRESULT WINAPI CallWindowProcW( WNDPROC func, HWND hwnd, UINT msg,
if
(
!
(
proc
=
handle_to_proc
(
func
)))
return
WINPROC_CallWndProc
(
func
,
hwnd
,
msg
,
wParam
,
lParam
);
switch
(
proc
->
type
)
{
case
WIN_PROC_16
:
return
WINPROC_CallProc32WTo16
(
proc
->
u
.
proc16
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32A
:
return
WINPROC_CallProc32WTo32A
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32W
:
return
WINPROC_CallWndProc
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
default:
WARN_
(
relay
)(
"Invalid proc %p
\n
"
,
proc
);
return
0
;
}
if
(
proc
->
procW
)
return
WINPROC_CallWndProc
(
proc
->
procW
,
hwnd
,
msg
,
wParam
,
lParam
);
if
(
proc
->
procA
)
return
WINPROC_CallProc32WTo32A
(
proc
->
procA
,
hwnd
,
msg
,
wParam
,
lParam
);
return
WINPROC_CallProc32WTo16
(
proc
->
proc16
,
hwnd
,
msg
,
wParam
,
lParam
);
}
...
...
@@ -3323,18 +3275,9 @@ INT_PTR WINPROC_CallDlgProc16( DLGPROC16 func, HWND16 hwnd, UINT16 msg, WPARAM16
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
->
u
.
proc16
,
hwnd
,
msg
,
wParam
,
lParam
)
);
case
WIN_PROC_32A
:
return
WINPROC_CallProc16To32A
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32W
:
return
WINPROC_CallProc16To32W
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
default:
WARN_
(
relay
)(
"Invalid proc %p
\n
"
,
proc
);
return
0
;
}
if
(
proc
->
procA
)
return
WINPROC_CallProc16To32A
(
proc
->
procA
,
hwnd
,
msg
,
wParam
,
lParam
);
if
(
proc
->
procW
)
return
WINPROC_CallProc16To32W
(
proc
->
procW
,
hwnd
,
msg
,
wParam
,
lParam
);
return
LOWORD
(
WINPROC_CallWndProc16
(
proc
->
proc16
,
hwnd
,
msg
,
wParam
,
lParam
)
);
}
...
...
@@ -3350,18 +3293,9 @@ INT_PTR WINPROC_CallDlgProcA( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam,
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
->
u
.
proc16
,
hwnd
,
msg
,
wParam
,
lParam
)
);
case
WIN_PROC_32A
:
return
WINPROC_CallWndProc
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32W
:
return
WINPROC_CallProc32ATo32W
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
default:
WARN_
(
relay
)(
"Invalid proc %p
\n
"
,
proc
);
return
0
;
}
if
(
proc
->
procA
)
return
WINPROC_CallWndProc
(
proc
->
procA
,
hwnd
,
msg
,
wParam
,
lParam
);
if
(
proc
->
procW
)
return
WINPROC_CallProc32ATo32W
(
proc
->
procW
,
hwnd
,
msg
,
wParam
,
lParam
);
return
LOWORD
(
WINPROC_CallProc32ATo16
(
proc
->
proc16
,
hwnd
,
msg
,
wParam
,
lParam
)
);
}
...
...
@@ -3377,16 +3311,7 @@ INT_PTR WINPROC_CallDlgProcW( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam,
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
->
u
.
proc16
,
hwnd
,
msg
,
wParam
,
lParam
));
case
WIN_PROC_32A
:
return
WINPROC_CallProc32WTo32A
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
case
WIN_PROC_32W
:
return
WINPROC_CallWndProc
(
proc
->
u
.
proc32
,
hwnd
,
msg
,
wParam
,
lParam
);
default:
WARN_
(
relay
)(
"Invalid proc %p
\n
"
,
proc
);
return
0
;
}
if
(
proc
->
procW
)
return
WINPROC_CallWndProc
(
proc
->
procW
,
hwnd
,
msg
,
wParam
,
lParam
);
if
(
proc
->
procA
)
return
WINPROC_CallProc32WTo32A
(
proc
->
procA
,
hwnd
,
msg
,
wParam
,
lParam
);
return
LOWORD
(
WINPROC_CallProc32WTo16
(
proc
->
proc16
,
hwnd
,
msg
,
wParam
,
lParam
));
}
dlls/user/winproc.h
View file @
0667292e
...
...
@@ -47,7 +47,7 @@ struct tagWINDOWPROC;
extern
WNDPROC16
WINPROC_GetProc16
(
WNDPROC
proc
,
BOOL
unicode
);
extern
WNDPROC
WINPROC_AllocProc16
(
WNDPROC16
func
);
extern
WNDPROC
WINPROC_GetProc
(
WNDPROC
proc
,
BOOL
unicode
);
extern
WNDPROC
WINPROC_AllocProc
(
WNDPROC
func
,
BOOL
unicode
);
extern
WNDPROC
WINPROC_AllocProc
(
WNDPROC
func
A
,
WNDPROC
funcW
);
extern
BOOL
WINPROC_IsUnicode
(
WNDPROC
proc
,
BOOL
def_val
);
extern
INT
WINPROC_MapMsg32ATo32W
(
HWND
hwnd
,
UINT
msg
,
WPARAM
*
pwparam
,
...
...
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