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
a9e5e94b
Commit
a9e5e94b
authored
May 10, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user: Replace WINDOWPROCTYPE by a unicode flag in WINPROC_GetProc/AllocProc.
parent
ef741939
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
61 deletions
+57
-61
class.c
dlls/user/class.c
+17
-17
message.c
dlls/user/message.c
+2
-2
win.c
dlls/user/win.c
+13
-14
winproc.c
dlls/user/winproc.c
+22
-25
winproc.h
dlls/user/winproc.h
+2
-2
wnd16.c
dlls/user/wnd16.c
+1
-1
No files found.
dlls/user/class.c
View file @
a9e5e94b
...
@@ -162,7 +162,7 @@ static WNDPROC16 CLASS_GetProc16( CLASS *classPtr )
...
@@ -162,7 +162,7 @@ static WNDPROC16 CLASS_GetProc16( CLASS *classPtr )
*
*
* Get the class winproc for a given proc type
* Get the class winproc for a given proc type
*/
*/
static
WNDPROC
CLASS_GetProc
(
CLASS
*
classPtr
,
WINDOWPROCTYPE
typ
e
)
static
WNDPROC
CLASS_GetProc
(
CLASS
*
classPtr
,
BOOL
unicod
e
)
{
{
WNDPROC
proc
=
classPtr
->
winprocA
;
WNDPROC
proc
=
classPtr
->
winprocA
;
...
@@ -171,9 +171,9 @@ static WNDPROC CLASS_GetProc( CLASS *classPtr, WINDOWPROCTYPE type )
...
@@ -171,9 +171,9 @@ static WNDPROC CLASS_GetProc( CLASS *classPtr, WINDOWPROCTYPE type )
/* if we have a Unicode proc, use it if we have no ASCII proc
/* if we have a Unicode proc, use it if we have no ASCII proc
* or if we have both and Unicode was requested
* or if we have both and Unicode was requested
*/
*/
if
(
!
proc
||
type
==
WIN_PROC_32W
)
proc
=
classPtr
->
winprocW
;
if
(
!
proc
||
unicode
)
proc
=
classPtr
->
winprocW
;
}
}
return
WINPROC_GetProc
(
proc
,
typ
e
);
return
WINPROC_GetProc
(
proc
,
unicod
e
);
}
}
...
@@ -206,9 +206,9 @@ static void CLASS_SetProc16( CLASS *classPtr, WNDPROC16 newproc )
...
@@ -206,9 +206,9 @@ static void CLASS_SetProc16( CLASS *classPtr, WNDPROC16 newproc )
* Set the class winproc for a given proc type.
* Set the class winproc for a given proc type.
* Returns the previous window proc.
* Returns the previous window proc.
*/
*/
static
void
CLASS_SetProc
(
CLASS
*
classPtr
,
WNDPROC
newproc
,
WINDOWPROCTYPE
typ
e
)
static
void
CLASS_SetProc
(
CLASS
*
classPtr
,
WNDPROC
newproc
,
BOOL
unicod
e
)
{
{
WNDPROC
proc
=
WINPROC_AllocProc
(
newproc
,
typ
e
);
WNDPROC
proc
=
WINPROC_AllocProc
(
newproc
,
unicod
e
);
if
(
WINPROC_GetProcType
(
proc
)
==
WIN_PROC_32W
)
if
(
WINPROC_GetProcType
(
proc
)
==
WIN_PROC_32W
)
{
{
...
@@ -474,8 +474,8 @@ static CLASS *register_builtin( const struct builtin_class_descr *descr )
...
@@ -474,8 +474,8 @@ static CLASS *register_builtin( const struct builtin_class_descr *descr )
classPtr
->
hCursor
=
LoadCursorA
(
0
,
(
LPSTR
)
descr
->
cursor
);
classPtr
->
hCursor
=
LoadCursorA
(
0
,
(
LPSTR
)
descr
->
cursor
);
classPtr
->
hbrBackground
=
descr
->
brush
;
classPtr
->
hbrBackground
=
descr
->
brush
;
if
(
descr
->
procA
)
classPtr
->
winprocA
=
WINPROC_AllocProc
(
descr
->
procA
,
WIN_PROC_32A
);
if
(
descr
->
procA
)
classPtr
->
winprocA
=
WINPROC_AllocProc
(
descr
->
procA
,
FALSE
);
if
(
descr
->
procW
)
classPtr
->
winprocW
=
WINPROC_AllocProc
(
descr
->
procW
,
WIN_PROC_32W
);
if
(
descr
->
procW
)
classPtr
->
winprocW
=
WINPROC_AllocProc
(
descr
->
procW
,
TRUE
);
release_class_ptr
(
classPtr
);
release_class_ptr
(
classPtr
);
return
classPtr
;
return
classPtr
;
}
}
...
@@ -621,7 +621,7 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc )
...
@@ -621,7 +621,7 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc )
classPtr
->
hIconSm
=
wc
->
hIconSm
;
classPtr
->
hIconSm
=
wc
->
hIconSm
;
classPtr
->
hCursor
=
wc
->
hCursor
;
classPtr
->
hCursor
=
wc
->
hCursor
;
classPtr
->
hbrBackground
=
wc
->
hbrBackground
;
classPtr
->
hbrBackground
=
wc
->
hbrBackground
;
classPtr
->
winprocA
=
WINPROC_AllocProc
(
wc
->
lpfnWndProc
,
WIN_PROC_32A
);
classPtr
->
winprocA
=
WINPROC_AllocProc
(
wc
->
lpfnWndProc
,
FALSE
);
CLASS_SetMenuNameA
(
classPtr
,
wc
->
lpszMenuName
);
CLASS_SetMenuNameA
(
classPtr
,
wc
->
lpszMenuName
);
release_class_ptr
(
classPtr
);
release_class_ptr
(
classPtr
);
return
atom
;
return
atom
;
...
@@ -659,7 +659,7 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc )
...
@@ -659,7 +659,7 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc )
classPtr
->
hIconSm
=
wc
->
hIconSm
;
classPtr
->
hIconSm
=
wc
->
hIconSm
;
classPtr
->
hCursor
=
wc
->
hCursor
;
classPtr
->
hCursor
=
wc
->
hCursor
;
classPtr
->
hbrBackground
=
wc
->
hbrBackground
;
classPtr
->
hbrBackground
=
wc
->
hbrBackground
;
classPtr
->
winprocW
=
WINPROC_AllocProc
(
wc
->
lpfnWndProc
,
WIN_PROC_32W
);
classPtr
->
winprocW
=
WINPROC_AllocProc
(
wc
->
lpfnWndProc
,
TRUE
);
CLASS_SetMenuNameW
(
classPtr
,
wc
->
lpszMenuName
);
CLASS_SetMenuNameW
(
classPtr
,
wc
->
lpszMenuName
);
release_class_ptr
(
classPtr
);
release_class_ptr
(
classPtr
);
return
atom
;
return
atom
;
...
@@ -872,7 +872,7 @@ DWORD WINAPI GetClassLongW( HWND hwnd, INT offset )
...
@@ -872,7 +872,7 @@ DWORD WINAPI GetClassLongW( HWND hwnd, INT offset )
retvalue
=
(
DWORD
)
class
->
hInstance
;
retvalue
=
(
DWORD
)
class
->
hInstance
;
break
;
break
;
case
GCLP_WNDPROC
:
case
GCLP_WNDPROC
:
retvalue
=
(
DWORD
)
CLASS_GetProc
(
class
,
WIN_PROC_32W
);
retvalue
=
(
DWORD
)
CLASS_GetProc
(
class
,
TRUE
);
break
;
break
;
case
GCLP_MENUNAME
:
case
GCLP_MENUNAME
:
retvalue
=
(
DWORD
)
CLASS_GetMenuNameW
(
class
);
retvalue
=
(
DWORD
)
CLASS_GetMenuNameW
(
class
);
...
@@ -912,7 +912,7 @@ DWORD WINAPI GetClassLongA( HWND hwnd, INT offset )
...
@@ -912,7 +912,7 @@ DWORD WINAPI GetClassLongA( HWND hwnd, INT offset )
}
}
if
(
offset
==
GCLP_WNDPROC
)
if
(
offset
==
GCLP_WNDPROC
)
retvalue
=
(
DWORD
)
CLASS_GetProc
(
class
,
WIN_PROC_32A
);
retvalue
=
(
DWORD
)
CLASS_GetProc
(
class
,
FALSE
);
else
/* GCL_MENUNAME */
else
/* GCL_MENUNAME */
retvalue
=
(
DWORD
)
CLASS_GetMenuNameA
(
class
);
retvalue
=
(
DWORD
)
CLASS_GetMenuNameA
(
class
);
...
@@ -1011,8 +1011,8 @@ DWORD WINAPI SetClassLongW( HWND hwnd, INT offset, LONG newval )
...
@@ -1011,8 +1011,8 @@ DWORD WINAPI SetClassLongW( HWND hwnd, INT offset, LONG newval )
retval
=
0
;
/* Old value is now meaningless anyway */
retval
=
0
;
/* Old value is now meaningless anyway */
break
;
break
;
case
GCLP_WNDPROC
:
case
GCLP_WNDPROC
:
retval
=
(
DWORD
)
CLASS_GetProc
(
class
,
WIN_PROC_32W
);
retval
=
(
DWORD
)
CLASS_GetProc
(
class
,
TRUE
);
CLASS_SetProc
(
class
,
(
WNDPROC
)
newval
,
WIN_PROC_32W
);
CLASS_SetProc
(
class
,
(
WNDPROC
)
newval
,
TRUE
);
break
;
break
;
case
GCLP_HBRBACKGROUND
:
case
GCLP_HBRBACKGROUND
:
retval
=
(
DWORD
)
class
->
hbrBackground
;
retval
=
(
DWORD
)
class
->
hbrBackground
;
...
@@ -1079,8 +1079,8 @@ DWORD WINAPI SetClassLongA( HWND hwnd, INT offset, LONG newval )
...
@@ -1079,8 +1079,8 @@ DWORD WINAPI SetClassLongA( HWND hwnd, INT offset, LONG newval )
if
(
offset
==
GCLP_WNDPROC
)
if
(
offset
==
GCLP_WNDPROC
)
{
{
retval
=
(
DWORD
)
CLASS_GetProc
(
class
,
WIN_PROC_32A
);
retval
=
(
DWORD
)
CLASS_GetProc
(
class
,
FALSE
);
CLASS_SetProc
(
class
,
(
WNDPROC
)
newval
,
WIN_PROC_32A
);
CLASS_SetProc
(
class
,
(
WNDPROC
)
newval
,
FALSE
);
}
}
else
/* GCL_MENUNAME */
else
/* GCL_MENUNAME */
{
{
...
@@ -1202,7 +1202,7 @@ BOOL WINAPI GetClassInfoExA( HINSTANCE hInstance, LPCSTR name, WNDCLASSEXA *wc )
...
@@ -1202,7 +1202,7 @@ BOOL WINAPI GetClassInfoExA( HINSTANCE hInstance, LPCSTR name, WNDCLASSEXA *wc )
return
FALSE
;
return
FALSE
;
}
}
wc
->
style
=
classPtr
->
style
;
wc
->
style
=
classPtr
->
style
;
wc
->
lpfnWndProc
=
(
WNDPROC
)
CLASS_GetProc
(
classPtr
,
WIN_PROC_32A
);
wc
->
lpfnWndProc
=
(
WNDPROC
)
CLASS_GetProc
(
classPtr
,
FALSE
);
wc
->
cbClsExtra
=
classPtr
->
cbClsExtra
;
wc
->
cbClsExtra
=
classPtr
->
cbClsExtra
;
wc
->
cbWndExtra
=
classPtr
->
cbWndExtra
;
wc
->
cbWndExtra
=
classPtr
->
cbWndExtra
;
wc
->
hInstance
=
(
hInstance
==
user32_module
)
?
0
:
hInstance
;
wc
->
hInstance
=
(
hInstance
==
user32_module
)
?
0
:
hInstance
;
...
@@ -1237,7 +1237,7 @@ BOOL WINAPI GetClassInfoExW( HINSTANCE hInstance, LPCWSTR name, WNDCLASSEXW *wc
...
@@ -1237,7 +1237,7 @@ BOOL WINAPI GetClassInfoExW( HINSTANCE hInstance, LPCWSTR name, WNDCLASSEXW *wc
return
FALSE
;
return
FALSE
;
}
}
wc
->
style
=
classPtr
->
style
;
wc
->
style
=
classPtr
->
style
;
wc
->
lpfnWndProc
=
(
WNDPROC
)
CLASS_GetProc
(
classPtr
,
WIN_PROC_32W
);
wc
->
lpfnWndProc
=
(
WNDPROC
)
CLASS_GetProc
(
classPtr
,
TRUE
);
wc
->
cbClsExtra
=
classPtr
->
cbClsExtra
;
wc
->
cbClsExtra
=
classPtr
->
cbClsExtra
;
wc
->
cbWndExtra
=
classPtr
->
cbWndExtra
;
wc
->
cbWndExtra
=
classPtr
->
cbWndExtra
;
wc
->
hInstance
=
(
hInstance
==
user32_module
)
?
0
:
hInstance
;
wc
->
hInstance
=
(
hInstance
==
user32_module
)
?
0
:
hInstance
;
...
...
dlls/user/message.c
View file @
a9e5e94b
...
@@ -3338,7 +3338,7 @@ UINT_PTR WINAPI SetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc )
...
@@ -3338,7 +3338,7 @@ UINT_PTR WINAPI SetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc )
UINT_PTR
ret
;
UINT_PTR
ret
;
WNDPROC
winproc
=
0
;
WNDPROC
winproc
=
0
;
if
(
proc
)
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
proc
,
WIN_PROC_32A
);
if
(
proc
)
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
proc
,
FALSE
);
SERVER_START_REQ
(
set_win_timer
)
SERVER_START_REQ
(
set_win_timer
)
{
{
...
@@ -3369,7 +3369,7 @@ UINT_PTR WINAPI SetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC
...
@@ -3369,7 +3369,7 @@ UINT_PTR WINAPI SetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC
UINT_PTR
ret
;
UINT_PTR
ret
;
WNDPROC
winproc
=
0
;
WNDPROC
winproc
=
0
;
if
(
proc
)
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
proc
,
WIN_PROC_32A
);
if
(
proc
)
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
proc
,
FALSE
);
SERVER_START_REQ
(
set_win_timer
)
SERVER_START_REQ
(
set_win_timer
)
{
{
...
...
dlls/user/win.c
View file @
a9e5e94b
...
@@ -1832,7 +1832,7 @@ WORD WINAPI SetWindowWord( HWND hwnd, INT offset, WORD newval )
...
@@ -1832,7 +1832,7 @@ WORD WINAPI SetWindowWord( HWND hwnd, INT offset, WORD newval )
*
*
* Helper function for GetWindowLong().
* Helper function for GetWindowLong().
*/
*/
static
LONG_PTR
WIN_GetWindowLong
(
HWND
hwnd
,
INT
offset
,
WINDOWPROCTYPE
typ
e
)
static
LONG_PTR
WIN_GetWindowLong
(
HWND
hwnd
,
INT
offset
,
BOOL
unicod
e
)
{
{
LONG_PTR
retvalue
=
0
;
LONG_PTR
retvalue
=
0
;
WND
*
wndPtr
;
WND
*
wndPtr
;
...
@@ -1897,7 +1897,7 @@ static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
...
@@ -1897,7 +1897,7 @@ static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
retvalue
=
*
(
LONG_PTR
*
)(((
char
*
)
wndPtr
->
wExtra
)
+
offset
);
retvalue
=
*
(
LONG_PTR
*
)(((
char
*
)
wndPtr
->
wExtra
)
+
offset
);
/* Special case for dialog window procedure */
/* Special case for dialog window procedure */
if
((
offset
==
DWLP_DLGPROC
)
&&
(
wndPtr
->
flags
&
WIN_ISDIALOG
))
if
((
offset
==
DWLP_DLGPROC
)
&&
(
wndPtr
->
flags
&
WIN_ISDIALOG
))
retvalue
=
(
LONG_PTR
)
WINPROC_GetProc
(
(
WNDPROC
)
retvalue
,
typ
e
);
retvalue
=
(
LONG_PTR
)
WINPROC_GetProc
(
(
WNDPROC
)
retvalue
,
unicod
e
);
WIN_ReleasePtr
(
wndPtr
);
WIN_ReleasePtr
(
wndPtr
);
return
retvalue
;
return
retvalue
;
}
}
...
@@ -1908,7 +1908,7 @@ static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
...
@@ -1908,7 +1908,7 @@ static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
case
GWL_STYLE
:
retvalue
=
wndPtr
->
dwStyle
;
break
;
case
GWL_STYLE
:
retvalue
=
wndPtr
->
dwStyle
;
break
;
case
GWL_EXSTYLE
:
retvalue
=
wndPtr
->
dwExStyle
;
break
;
case
GWL_EXSTYLE
:
retvalue
=
wndPtr
->
dwExStyle
;
break
;
case
GWLP_ID
:
retvalue
=
(
ULONG_PTR
)
wndPtr
->
wIDmenu
;
break
;
case
GWLP_ID
:
retvalue
=
(
ULONG_PTR
)
wndPtr
->
wIDmenu
;
break
;
case
GWLP_WNDPROC
:
retvalue
=
(
ULONG_PTR
)
WINPROC_GetProc
(
wndPtr
->
winproc
,
typ
e
);
break
;
case
GWLP_WNDPROC
:
retvalue
=
(
ULONG_PTR
)
WINPROC_GetProc
(
wndPtr
->
winproc
,
unicod
e
);
break
;
case
GWLP_HINSTANCE
:
retvalue
=
(
ULONG_PTR
)
wndPtr
->
hInstance
;
break
;
case
GWLP_HINSTANCE
:
retvalue
=
(
ULONG_PTR
)
wndPtr
->
hInstance
;
break
;
default:
default:
WARN
(
"Unknown offset %d
\n
"
,
offset
);
WARN
(
"Unknown offset %d
\n
"
,
offset
);
...
@@ -1928,15 +1928,14 @@ static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
...
@@ -1928,15 +1928,14 @@ static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type )
* 0 is the failure code. However, in the case of failure SetLastError
* 0 is the failure code. However, in the case of failure SetLastError
* must be set to distinguish between a 0 return value and a failure.
* must be set to distinguish between a 0 return value and a failure.
*/
*/
static
LONG_PTR
WIN_SetWindowLong
(
HWND
hwnd
,
INT
offset
,
LONG_PTR
newval
,
static
LONG_PTR
WIN_SetWindowLong
(
HWND
hwnd
,
INT
offset
,
LONG_PTR
newval
,
BOOL
unicode
)
WINDOWPROCTYPE
type
)
{
{
STYLESTRUCT
style
;
STYLESTRUCT
style
;
BOOL
ok
;
BOOL
ok
;
LONG_PTR
retval
=
0
;
LONG_PTR
retval
=
0
;
WND
*
wndPtr
;
WND
*
wndPtr
;
TRACE
(
"%p %d %lx %
x
\n
"
,
hwnd
,
offset
,
newval
,
type
);
TRACE
(
"%p %d %lx %
c
\n
"
,
hwnd
,
offset
,
newval
,
unicode
?
'W'
:
'A'
);
if
(
is_broadcast
(
hwnd
))
if
(
is_broadcast
(
hwnd
))
{
{
...
@@ -1992,8 +1991,8 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval,
...
@@ -1992,8 +1991,8 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval,
case
GWLP_WNDPROC
:
case
GWLP_WNDPROC
:
{
{
UINT
old_flags
=
wndPtr
->
flags
;
UINT
old_flags
=
wndPtr
->
flags
;
retval
=
(
ULONG_PTR
)
WINPROC_GetProc
(
wndPtr
->
winproc
,
typ
e
);
retval
=
(
ULONG_PTR
)
WINPROC_GetProc
(
wndPtr
->
winproc
,
unicod
e
);
wndPtr
->
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
newval
,
typ
e
);
wndPtr
->
winproc
=
WINPROC_AllocProc
(
(
WNDPROC
)
newval
,
unicod
e
);
if
(
WINPROC_GetProcType
(
wndPtr
->
winproc
)
==
WIN_PROC_32W
)
wndPtr
->
flags
|=
WIN_ISUNICODE
;
if
(
WINPROC_GetProcType
(
wndPtr
->
winproc
)
==
WIN_PROC_32W
)
wndPtr
->
flags
|=
WIN_ISUNICODE
;
else
wndPtr
->
flags
&=
~
WIN_ISUNICODE
;
else
wndPtr
->
flags
&=
~
WIN_ISUNICODE
;
if
(
!
((
old_flags
^
wndPtr
->
flags
)
&
WIN_ISUNICODE
))
if
(
!
((
old_flags
^
wndPtr
->
flags
)
&
WIN_ISUNICODE
))
...
@@ -2012,8 +2011,8 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval,
...
@@ -2012,8 +2011,8 @@ static LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, LONG_PTR newval,
if
((
wndPtr
->
cbWndExtra
-
sizeof
(
LONG_PTR
)
>=
DWLP_DLGPROC
)
&&
(
wndPtr
->
flags
&
WIN_ISDIALOG
))
if
((
wndPtr
->
cbWndExtra
-
sizeof
(
LONG_PTR
)
>=
DWLP_DLGPROC
)
&&
(
wndPtr
->
flags
&
WIN_ISDIALOG
))
{
{
WNDPROC
*
ptr
=
(
WNDPROC
*
)((
char
*
)
wndPtr
->
wExtra
+
DWLP_DLGPROC
);
WNDPROC
*
ptr
=
(
WNDPROC
*
)((
char
*
)
wndPtr
->
wExtra
+
DWLP_DLGPROC
);
retval
=
(
ULONG_PTR
)
WINPROC_GetProc
(
*
ptr
,
typ
e
);
retval
=
(
ULONG_PTR
)
WINPROC_GetProc
(
*
ptr
,
unicod
e
);
*
ptr
=
WINPROC_AllocProc
(
(
WNDPROC
)
newval
,
typ
e
);
*
ptr
=
WINPROC_AllocProc
(
(
WNDPROC
)
newval
,
unicod
e
);
WIN_ReleasePtr
(
wndPtr
);
WIN_ReleasePtr
(
wndPtr
);
return
retval
;
return
retval
;
}
}
...
@@ -2178,7 +2177,7 @@ LONG WINAPI GetWindowLong16( HWND16 hwnd, INT16 offset )
...
@@ -2178,7 +2177,7 @@ LONG WINAPI GetWindowLong16( HWND16 hwnd, INT16 offset )
*/
*/
LONG
WINAPI
GetWindowLongA
(
HWND
hwnd
,
INT
offset
)
LONG
WINAPI
GetWindowLongA
(
HWND
hwnd
,
INT
offset
)
{
{
return
WIN_GetWindowLong
(
hwnd
,
offset
,
WIN_PROC_32A
);
return
WIN_GetWindowLong
(
hwnd
,
offset
,
FALSE
);
}
}
...
@@ -2187,7 +2186,7 @@ LONG WINAPI GetWindowLongA( HWND hwnd, INT offset )
...
@@ -2187,7 +2186,7 @@ LONG WINAPI GetWindowLongA( HWND hwnd, INT offset )
*/
*/
LONG
WINAPI
GetWindowLongW
(
HWND
hwnd
,
INT
offset
)
LONG
WINAPI
GetWindowLongW
(
HWND
hwnd
,
INT
offset
)
{
{
return
WIN_GetWindowLong
(
hwnd
,
offset
,
WIN_PROC_32W
);
return
WIN_GetWindowLong
(
hwnd
,
offset
,
TRUE
);
}
}
...
@@ -2231,7 +2230,7 @@ LONG WINAPI SetWindowLong16( HWND16 hwnd, INT16 offset, LONG newval )
...
@@ -2231,7 +2230,7 @@ LONG WINAPI SetWindowLong16( HWND16 hwnd, INT16 offset, LONG newval )
*/
*/
LONG
WINAPI
SetWindowLongA
(
HWND
hwnd
,
INT
offset
,
LONG
newval
)
LONG
WINAPI
SetWindowLongA
(
HWND
hwnd
,
INT
offset
,
LONG
newval
)
{
{
return
WIN_SetWindowLong
(
hwnd
,
offset
,
newval
,
WIN_PROC_32A
);
return
WIN_SetWindowLong
(
hwnd
,
offset
,
newval
,
FALSE
);
}
}
...
@@ -2306,7 +2305,7 @@ LONG WINAPI SetWindowLongW(
...
@@ -2306,7 +2305,7 @@ LONG WINAPI SetWindowLongW(
INT
offset
,
/* [in] offset, in bytes, of location to alter */
INT
offset
,
/* [in] offset, in bytes, of location to alter */
LONG
newval
/* [in] new value of location */
LONG
newval
/* [in] new value of location */
)
{
)
{
return
WIN_SetWindowLong
(
hwnd
,
offset
,
newval
,
WIN_PROC_32W
);
return
WIN_SetWindowLong
(
hwnd
,
offset
,
newval
,
TRUE
);
}
}
...
...
dlls/user/winproc.c
View file @
a9e5e94b
...
@@ -119,13 +119,14 @@ static inline WINDOWPROC *find_winproc16( WNDPROC16 func )
...
@@ -119,13 +119,14 @@ static inline WINDOWPROC *find_winproc16( WNDPROC16 func )
/* find an existing winproc for a given function and type */
/* find an existing winproc for a given function and type */
/* FIXME: probably should do something more clever than a linear search */
/* FIXME: probably should do something more clever than a linear search */
static
inline
WINDOWPROC
*
find_winproc
(
WNDPROC
func
,
WINDOWPROCTYPE
typ
e
)
static
inline
WINDOWPROC
*
find_winproc
(
WNDPROC
func
,
BOOL
unicod
e
)
{
{
unsigned
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
winproc_used
;
i
++
)
for
(
i
=
0
;
i
<
winproc_used
;
i
++
)
{
{
if
(
winproc_array
[
i
].
type
==
type
&&
winproc_array
[
i
].
thunk
.
proc
==
func
)
if
(
winproc_array
[
i
].
thunk
.
proc
==
func
&&
winproc_array
[
i
].
type
==
(
unicode
?
WIN_PROC_32W
:
WIN_PROC_32A
))
return
&
winproc_array
[
i
];
return
&
winproc_array
[
i
];
}
}
return
NULL
;
return
NULL
;
...
@@ -139,7 +140,7 @@ static inline void set_winproc16( WINDOWPROC *proc, WNDPROC16 func )
...
@@ -139,7 +140,7 @@ static inline void set_winproc16( WINDOWPROC *proc, WNDPROC16 func )
}
}
/* initialize a new winproc */
/* initialize a new winproc */
static
inline
void
set_winproc
(
WINDOWPROC
*
proc
,
WNDPROC
func
,
WINDOWPROCTYPE
typ
e
)
static
inline
void
set_winproc
(
WINDOWPROC
*
proc
,
WNDPROC
func
,
BOOL
unicod
e
)
{
{
#ifdef __i386__
#ifdef __i386__
static
FARPROC16
relay_32A
,
relay_32W
;
static
FARPROC16
relay_32A
,
relay_32W
;
...
@@ -148,29 +149,24 @@ static inline void set_winproc( WINDOWPROC *proc, WNDPROC func, WINDOWPROCTYPE t
...
@@ -148,29 +149,24 @@ static inline void set_winproc( WINDOWPROC *proc, WNDPROC func, WINDOWPROCTYPE t
proc
->
thunk
.
pushl_func
=
0x68
;
/* pushl $proc */
proc
->
thunk
.
pushl_func
=
0x68
;
/* pushl $proc */
proc
->
thunk
.
pushl_eax
=
0x50
;
/* pushl %eax */
proc
->
thunk
.
pushl_eax
=
0x50
;
/* pushl %eax */
proc
->
thunk
.
ljmp
=
0xea
;
/* ljmp relay*/
proc
->
thunk
.
ljmp
=
0xea
;
/* ljmp relay*/
switch
(
typ
e
)
if
(
!
unicod
e
)
{
{
case
WIN_PROC_32A
:
if
(
!
relay_32A
)
relay_32A
=
GetProcAddress16
(
GetModuleHandle16
(
"user"
),
if
(
!
relay_32A
)
relay_32A
=
GetProcAddress16
(
GetModuleHandle16
(
"user"
),
"__wine_call_wndproc_32A"
);
"__wine_call_wndproc_32A"
);
proc
->
thunk
.
relay_offset
=
OFFSETOF
(
relay_32A
);
proc
->
thunk
.
relay_offset
=
OFFSETOF
(
relay_32A
);
proc
->
thunk
.
relay_sel
=
SELECTOROF
(
relay_32A
);
proc
->
thunk
.
relay_sel
=
SELECTOROF
(
relay_32A
);
break
;
}
case
WIN_PROC_32W
:
else
{
if
(
!
relay_32W
)
relay_32W
=
GetProcAddress16
(
GetModuleHandle16
(
"user"
),
if
(
!
relay_32W
)
relay_32W
=
GetProcAddress16
(
GetModuleHandle16
(
"user"
),
"__wine_call_wndproc_32W"
);
"__wine_call_wndproc_32W"
);
proc
->
thunk
.
relay_offset
=
OFFSETOF
(
relay_32W
);
proc
->
thunk
.
relay_offset
=
OFFSETOF
(
relay_32W
);
proc
->
thunk
.
relay_sel
=
SELECTOROF
(
relay_32W
);
proc
->
thunk
.
relay_sel
=
SELECTOROF
(
relay_32W
);
break
;
default:
/* Should not happen */
assert
(
0
);
break
;
}
}
#endif
/* __i386__ */
#endif
/* __i386__ */
proc
->
thunk
.
proc
=
func
;
proc
->
thunk
.
proc
=
func
;
proc
->
proc16
=
0
;
proc
->
proc16
=
0
;
proc
->
type
=
type
;
proc
->
type
=
unicode
?
WIN_PROC_32W
:
WIN_PROC_32A
;
}
}
static
WORD
get_winproc_selector
(
void
)
static
WORD
get_winproc_selector
(
void
)
...
@@ -479,11 +475,11 @@ WNDPROC16 WINPROC_GetProc16( WNDPROC proc )
...
@@ -479,11 +475,11 @@ WNDPROC16 WINPROC_GetProc16( WNDPROC proc )
*
*
* Get a window procedure pointer that can be passed to the Windows program.
* Get a window procedure pointer that can be passed to the Windows program.
*/
*/
WNDPROC
WINPROC_GetProc
(
WNDPROC
proc
,
WINDOWPROCTYPE
typ
e
)
WNDPROC
WINPROC_GetProc
(
WNDPROC
proc
,
BOOL
unicod
e
)
{
{
WINDOWPROC
*
ptr
=
handle_to_proc
(
proc
);
WINDOWPROC
*
ptr
=
handle_to_proc
(
proc
);
if
(
!
ptr
||
type
!=
ptr
->
type
)
return
proc
;
if
(
!
ptr
||
ptr
->
type
!=
(
unicode
?
WIN_PROC_32W
:
WIN_PROC_32A
)
)
return
proc
;
return
ptr
->
thunk
.
proc
;
/* we can return the original proc in that case */
return
ptr
->
thunk
.
proc
;
/* we can return the original proc in that case */
}
}
...
@@ -538,34 +534,35 @@ WNDPROC WINPROC_AllocProc16( WNDPROC16 func )
...
@@ -538,34 +534,35 @@ WNDPROC WINPROC_AllocProc16( WNDPROC16 func )
* lot of windows, it will usually only have a limited number of window procedures, so the
* 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.
* array won't grow too large, and this way we avoid the need to track allocations per window.
*/
*/
WNDPROC
WINPROC_AllocProc
(
WNDPROC
func
,
WINDOWPROCTYPE
typ
e
)
WNDPROC
WINPROC_AllocProc
(
WNDPROC
func
,
BOOL
unicod
e
)
{
{
WINDOWPROC
*
proc
;
WINDOWPROC
*
proc
;
if
(
!
func
)
return
NULL
;
if
(
!
func
)
return
NULL
;
EnterCriticalSection
(
&
winproc_cs
);
/* check if the function is already a win proc */
/* check if the function is already a win proc */
if
(
!
(
proc
=
handle_to_proc
(
func
)))
if
(
!
(
proc
=
handle_to_proc
(
func
)))
{
{
EnterCriticalSection
(
&
winproc_cs
);
/* then check if we already have a winproc for that function */
/* then check if we already have a winproc for that function */
if
(
!
(
proc
=
find_winproc
(
func
,
typ
e
)))
if
(
!
(
proc
=
find_winproc
(
func
,
unicod
e
)))
{
{
if
(
winproc_used
>=
MAX_WINPROCS
)
if
(
winproc_used
>=
MAX_WINPROCS
)
FIXME
(
"too many winprocs, cannot allocate one for %p
/%d
\n
"
,
func
,
type
);
FIXME
(
"too many winprocs, cannot allocate one for %p
%c
\n
"
,
func
,
unicode
?
'W'
:
'A'
);
else
else
{
{
proc
=
&
winproc_array
[
winproc_used
++
];
proc
=
&
winproc_array
[
winproc_used
++
];
set_winproc
(
proc
,
func
,
typ
e
);
set_winproc
(
proc
,
func
,
unicod
e
);
TRACE
(
"allocated %p for %p
/%d
(%d/%d used)
\n
"
,
TRACE
(
"allocated %p for %p
%c
(%d/%d used)
\n
"
,
proc_to_handle
(
proc
),
func
,
type
,
winproc_used
,
MAX_WINPROCS
);
proc_to_handle
(
proc
),
func
,
unicode
?
'W'
:
'A'
,
winproc_used
,
MAX_WINPROCS
);
}
}
}
}
else
TRACE
(
"reusing %p for %p/%d
\n
"
,
proc_to_handle
(
proc
),
func
,
type
);
else
TRACE
(
"reusing %p for %p %c
\n
"
,
proc_to_handle
(
proc
),
func
,
unicode
?
'W'
:
'A'
);
LeaveCriticalSection
(
&
winproc_cs
);
}
}
LeaveCriticalSection
(
&
winproc_cs
);
return
proc_to_handle
(
proc
);
return
proc_to_handle
(
proc
);
}
}
...
...
dlls/user/winproc.h
View file @
a9e5e94b
...
@@ -54,8 +54,8 @@ struct tagWINDOWPROC;
...
@@ -54,8 +54,8 @@ struct tagWINDOWPROC;
extern
WNDPROC16
WINPROC_GetProc16
(
WNDPROC
proc
);
extern
WNDPROC16
WINPROC_GetProc16
(
WNDPROC
proc
);
extern
WNDPROC
WINPROC_AllocProc16
(
WNDPROC16
func
);
extern
WNDPROC
WINPROC_AllocProc16
(
WNDPROC16
func
);
extern
WNDPROC
WINPROC_GetProc
(
WNDPROC
proc
,
WINDOWPROCTYPE
typ
e
);
extern
WNDPROC
WINPROC_GetProc
(
WNDPROC
proc
,
BOOL
unicod
e
);
extern
WNDPROC
WINPROC_AllocProc
(
WNDPROC
func
,
WINDOWPROCTYPE
typ
e
);
extern
WNDPROC
WINPROC_AllocProc
(
WNDPROC
func
,
BOOL
unicod
e
);
extern
WINDOWPROCTYPE
WINPROC_GetProcType
(
WNDPROC
proc
);
extern
WINDOWPROCTYPE
WINPROC_GetProcType
(
WNDPROC
proc
);
extern
INT
WINPROC_MapMsg32ATo32W
(
HWND
hwnd
,
UINT
msg
,
WPARAM
*
pwparam
,
extern
INT
WINPROC_MapMsg32ATo32W
(
HWND
hwnd
,
UINT
msg
,
WPARAM
*
pwparam
,
...
...
dlls/user/wnd16.c
View file @
a9e5e94b
...
@@ -1357,7 +1357,7 @@ BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInst16, SEGPTR name, WNDCLASSEX16 *
...
@@ -1357,7 +1357,7 @@ BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInst16, SEGPTR name, WNDCLASSEX16 *
if
(
ret
)
if
(
ret
)
{
{
WNDPROC
proc
=
WINPROC_AllocProc
(
wc32
.
lpfnWndProc
,
WIN_PROC_32A
);
WNDPROC
proc
=
WINPROC_AllocProc
(
wc32
.
lpfnWndProc
,
FALSE
);
wc
->
lpfnWndProc
=
WINPROC_GetProc16
(
proc
);
wc
->
lpfnWndProc
=
WINPROC_GetProc16
(
proc
);
wc
->
style
=
wc32
.
style
;
wc
->
style
=
wc32
.
style
;
wc
->
cbClsExtra
=
wc32
.
cbClsExtra
;
wc
->
cbClsExtra
=
wc32
.
cbClsExtra
;
...
...
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