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
57d439f4
Commit
57d439f4
authored
Dec 15, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Turn the combobox winproc into a Wow handler.
parent
02e74fa8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
79 deletions
+84
-79
combo.c
dlls/user32/combo.c
+3
-79
controls.h
dlls/user32/controls.h
+3
-0
msg16.c
dlls/user32/msg16.c
+76
-0
winproc.c
dlls/user32/winproc.c
+2
-0
No files found.
dlls/user32/combo.c
View file @
57d439f4
...
...
@@ -41,7 +41,6 @@
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "user_private.h"
#include "win.h"
...
...
@@ -1833,8 +1832,7 @@ static char *strdupA(LPCSTR str)
/***********************************************************************
* ComboWndProc_common
*/
static
LRESULT
ComboWndProc_common
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
LRESULT
ComboWndProc_common
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
{
LPHEADCOMBO
lphc
=
(
LPHEADCOMBO
)
GetWindowLongPtrW
(
hwnd
,
0
);
...
...
@@ -2222,80 +2220,6 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
}
/***********************************************************************
* ComboWndProc_wrapper16
*/
static
LRESULT
ComboWndProc_wrapper16
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
{
static
const
UINT
msg16_offset
=
CB_GETEDITSEL16
-
CB_GETEDITSEL
;
switch
(
msg
)
{
case
CB_INSERTSTRING16
:
case
CB_SELECTSTRING16
:
case
CB_FINDSTRING16
:
case
CB_FINDSTRINGEXACT16
:
wParam
=
(
INT
)(
INT16
)
wParam
;
/* fall through */
case
CB_ADDSTRING16
:
if
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
CBS_HASSTRINGS
)
lParam
=
(
LPARAM
)
MapSL
(
lParam
);
msg
-=
msg16_offset
;
break
;
case
CB_SETITEMHEIGHT16
:
case
CB_GETITEMHEIGHT16
:
case
CB_SETCURSEL16
:
case
CB_GETLBTEXTLEN16
:
case
CB_GETITEMDATA16
:
case
CB_SETITEMDATA16
:
wParam
=
(
INT
)(
INT16
)
wParam
;
/* signed integer */
msg
-=
msg16_offset
;
break
;
case
CB_GETDROPPEDCONTROLRECT16
:
lParam
=
(
LPARAM
)
MapSL
(
lParam
);
if
(
lParam
)
{
RECT
r
;
RECT16
*
r16
=
(
RECT16
*
)
lParam
;
ComboWndProc_common
(
hwnd
,
CB_GETDROPPEDCONTROLRECT
,
wParam
,
(
LPARAM
)
&
r
,
FALSE
);
r16
->
left
=
r
.
left
;
r16
->
top
=
r
.
top
;
r16
->
right
=
r
.
right
;
r16
->
bottom
=
r
.
bottom
;
}
return
CB_OKAY
;
case
CB_DIR16
:
if
(
wParam
&
DDL_DRIVES
)
wParam
|=
DDL_EXCLUSIVE
;
lParam
=
(
LPARAM
)
MapSL
(
lParam
);
msg
-=
msg16_offset
;
break
;
case
CB_GETLBTEXT16
:
wParam
=
(
INT
)(
INT16
)
wParam
;
lParam
=
(
LPARAM
)
MapSL
(
lParam
);
msg
-=
msg16_offset
;
break
;
case
CB_GETEDITSEL16
:
wParam
=
lParam
=
0
;
/* just in case */
msg
-=
msg16_offset
;
break
;
case
CB_LIMITTEXT16
:
case
CB_SETEDITSEL16
:
case
CB_DELETESTRING16
:
case
CB_RESETCONTENT16
:
case
CB_GETDROPPEDSTATE16
:
case
CB_SHOWDROPDOWN16
:
case
CB_GETCOUNT16
:
case
CB_GETCURSEL16
:
case
CB_SETEXTENDEDUI16
:
case
CB_GETEXTENDEDUI16
:
msg
-=
msg16_offset
;
break
;
default:
return
ComboWndProc_common
(
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
}
return
ComboWndProc_common
(
hwnd
,
msg
,
wParam
,
lParam
,
FALSE
);
}
/***********************************************************************
* ComboWndProcA
*
* This is just a wrapper for the real ComboWndProc which locks/unlocks
...
...
@@ -2304,7 +2228,7 @@ static LRESULT ComboWndProc_wrapper16( HWND hwnd, UINT msg, WPARAM wParam, LPARA
static
LRESULT
WINAPI
ComboWndProcA
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
if
(
!
IsWindow
(
hwnd
))
return
0
;
return
ComboWndProc_wrapper16
(
hwnd
,
message
,
wParam
,
lParam
,
FALSE
);
return
wow_handlers
.
combo_proc
(
hwnd
,
message
,
wParam
,
lParam
,
FALSE
);
}
/***********************************************************************
...
...
@@ -2313,7 +2237,7 @@ static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPA
static
LRESULT
WINAPI
ComboWndProcW
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
if
(
!
IsWindow
(
hwnd
))
return
0
;
return
ComboWndProc_wrapper16
(
hwnd
,
message
,
wParam
,
lParam
,
TRUE
);
return
wow_handlers
.
combo_proc
(
hwnd
,
message
,
wParam
,
lParam
,
TRUE
);
}
/*************************************************************************
...
...
dlls/user32/controls.h
View file @
57d439f4
...
...
@@ -62,16 +62,19 @@ extern const struct builtin_class_descr STATIC_builtin_class DECLSPEC_HIDDEN;
struct
wow_handlers16
{
LRESULT
(
*
button_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
);
LRESULT
(
*
combo_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
);
};
struct
wow_handlers32
{
LRESULT
(
*
button_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
);
LRESULT
(
*
combo_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
);
};
extern
struct
wow_handlers16
wow_handlers
DECLSPEC_HIDDEN
;
extern
LRESULT
ButtonWndProc_common
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
)
DECLSPEC_HIDDEN
;
extern
LRESULT
ComboWndProc_common
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
)
DECLSPEC_HIDDEN
;
extern
void
register_wow_handlers
(
void
)
DECLSPEC_HIDDEN
;
extern
void
WINAPI
UserRegisterWowHandlers
(
const
struct
wow_handlers16
*
new
,
...
...
dlls/user32/msg16.c
View file @
57d439f4
...
...
@@ -609,11 +609,87 @@ static LRESULT button_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
}
}
/***********************************************************************
* combo_proc16
*/
static
LRESULT
combo_proc16
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
{
static
const
UINT
msg16_offset
=
CB_GETEDITSEL16
-
CB_GETEDITSEL
;
switch
(
msg
)
{
case
CB_INSERTSTRING16
:
case
CB_SELECTSTRING16
:
case
CB_FINDSTRING16
:
case
CB_FINDSTRINGEXACT16
:
wParam
=
(
INT
)(
INT16
)
wParam
;
/* fall through */
case
CB_ADDSTRING16
:
if
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
CBS_HASSTRINGS
)
lParam
=
(
LPARAM
)
MapSL
(
lParam
);
msg
-=
msg16_offset
;
break
;
case
CB_SETITEMHEIGHT16
:
case
CB_GETITEMHEIGHT16
:
case
CB_SETCURSEL16
:
case
CB_GETLBTEXTLEN16
:
case
CB_GETITEMDATA16
:
case
CB_SETITEMDATA16
:
wParam
=
(
INT
)(
INT16
)
wParam
;
/* signed integer */
msg
-=
msg16_offset
;
break
;
case
CB_GETDROPPEDCONTROLRECT16
:
lParam
=
(
LPARAM
)
MapSL
(
lParam
);
if
(
lParam
)
{
RECT
r
;
RECT16
*
r16
=
(
RECT16
*
)
lParam
;
wow_handlers32
.
combo_proc
(
hwnd
,
CB_GETDROPPEDCONTROLRECT
,
wParam
,
(
LPARAM
)
&
r
,
FALSE
);
r16
->
left
=
r
.
left
;
r16
->
top
=
r
.
top
;
r16
->
right
=
r
.
right
;
r16
->
bottom
=
r
.
bottom
;
}
return
CB_OKAY
;
case
CB_DIR16
:
if
(
wParam
&
DDL_DRIVES
)
wParam
|=
DDL_EXCLUSIVE
;
lParam
=
(
LPARAM
)
MapSL
(
lParam
);
msg
-=
msg16_offset
;
break
;
case
CB_GETLBTEXT16
:
wParam
=
(
INT
)(
INT16
)
wParam
;
lParam
=
(
LPARAM
)
MapSL
(
lParam
);
msg
-=
msg16_offset
;
break
;
case
CB_GETEDITSEL16
:
wParam
=
lParam
=
0
;
/* just in case */
msg
-=
msg16_offset
;
break
;
case
CB_LIMITTEXT16
:
case
CB_SETEDITSEL16
:
case
CB_DELETESTRING16
:
case
CB_RESETCONTENT16
:
case
CB_GETDROPPEDSTATE16
:
case
CB_SHOWDROPDOWN16
:
case
CB_GETCOUNT16
:
case
CB_GETCURSEL16
:
case
CB_SETEXTENDEDUI16
:
case
CB_GETEXTENDEDUI16
:
msg
-=
msg16_offset
;
break
;
default:
return
wow_handlers32
.
combo_proc
(
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
}
return
wow_handlers32
.
combo_proc
(
hwnd
,
msg
,
wParam
,
lParam
,
FALSE
);
}
void
register_wow_handlers
(
void
)
{
static
const
struct
wow_handlers16
handlers16
=
{
button_proc16
,
combo_proc16
,
};
UserRegisterWowHandlers
(
&
handlers16
,
&
wow_handlers32
);
...
...
dlls/user32/winproc.c
View file @
57d439f4
...
...
@@ -2389,10 +2389,12 @@ INT_PTR WINPROC_CallDlgProcW( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam,
void
WINAPI
UserRegisterWowHandlers
(
const
struct
wow_handlers16
*
new
,
struct
wow_handlers32
*
orig
)
{
orig
->
button_proc
=
ButtonWndProc_common
;
orig
->
combo_proc
=
ComboWndProc_common
;
wow_handlers
=
*
new
;
}
struct
wow_handlers16
wow_handlers
=
{
ButtonWndProc_common
,
ComboWndProc_common
,
};
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