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
ce505590
Commit
ce505590
authored
Dec 21, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Send all CreateWindow calls through the WoW wrapper to allow mapping 16-bit instances.
parent
6fd93a6c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
70 deletions
+81
-70
controls.h
dlls/user32/controls.h
+3
-0
msg16.c
dlls/user32/msg16.c
+14
-67
win.c
dlls/user32/win.c
+3
-3
winproc.c
dlls/user32/winproc.c
+1
-0
wnd16.c
dlls/user32/wnd16.c
+60
-0
No files found.
dlls/user32/controls.h
View file @
ce505590
...
@@ -96,6 +96,7 @@ struct wow_handlers16
...
@@ -96,6 +96,7 @@ struct wow_handlers16
LRESULT
(
*
mdiclient_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
);
LRESULT
(
*
mdiclient_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
);
LRESULT
(
*
scrollbar_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
);
LRESULT
(
*
scrollbar_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
);
LRESULT
(
*
static_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
);
LRESULT
(
*
static_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
);
HWND
(
*
create_window
)(
CREATESTRUCTW
*
,
LPCWSTR
,
HINSTANCE
,
UINT
);
LRESULT
(
*
call_window_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
LRESULT
*
,
void
*
);
LRESULT
(
*
call_window_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
LRESULT
*
,
void
*
);
LRESULT
(
*
call_dialog_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
LRESULT
*
,
void
*
);
LRESULT
(
*
call_dialog_proc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
LRESULT
*
,
void
*
);
};
};
...
@@ -123,6 +124,8 @@ extern LRESULT MDIClientWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HI
...
@@ -123,6 +124,8 @@ extern LRESULT MDIClientWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HI
extern
LRESULT
ScrollBarWndProc_common
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
)
DECLSPEC_HIDDEN
;
extern
LRESULT
ScrollBarWndProc_common
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
)
DECLSPEC_HIDDEN
;
extern
LRESULT
StaticWndProc_common
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
)
DECLSPEC_HIDDEN
;
extern
LRESULT
StaticWndProc_common
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
)
DECLSPEC_HIDDEN
;
/* 16-bit support */
extern
HWND
create_window16
(
CREATESTRUCTW
*
,
LPCWSTR
,
HINSTANCE
,
UINT
)
DECLSPEC_HIDDEN
;
extern
void
register_wow_handlers
(
void
)
DECLSPEC_HIDDEN
;
extern
void
register_wow_handlers
(
void
)
DECLSPEC_HIDDEN
;
extern
void
WINAPI
UserRegisterWowHandlers
(
const
struct
wow_handlers16
*
new
,
extern
void
WINAPI
UserRegisterWowHandlers
(
const
struct
wow_handlers16
*
new
,
struct
wow_handlers32
*
orig
);
struct
wow_handlers32
*
orig
);
...
...
dlls/user32/msg16.c
View file @
ce505590
...
@@ -2000,73 +2000,6 @@ BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg )
...
@@ -2000,73 +2000,6 @@ BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg )
/***********************************************************************
/***********************************************************************
* CreateWindowEx (USER.452)
*/
HWND16
WINAPI
CreateWindowEx16
(
DWORD
exStyle
,
LPCSTR
className
,
LPCSTR
windowName
,
DWORD
style
,
INT16
x
,
INT16
y
,
INT16
width
,
INT16
height
,
HWND16
parent
,
HMENU16
menu
,
HINSTANCE16
instance
,
LPVOID
data
)
{
CREATESTRUCTA
cs
;
char
buffer
[
256
];
HWND
hwnd
;
/* Fix the coordinates */
cs
.
x
=
(
x
==
CW_USEDEFAULT16
)
?
CW_USEDEFAULT
:
(
INT
)
x
;
cs
.
y
=
(
y
==
CW_USEDEFAULT16
)
?
CW_USEDEFAULT
:
(
INT
)
y
;
cs
.
cx
=
(
width
==
CW_USEDEFAULT16
)
?
CW_USEDEFAULT
:
(
INT
)
width
;
cs
.
cy
=
(
height
==
CW_USEDEFAULT16
)
?
CW_USEDEFAULT
:
(
INT
)
height
;
/* Create the window */
cs
.
lpCreateParams
=
data
;
cs
.
hInstance
=
HINSTANCE_32
(
instance
);
cs
.
hMenu
=
HMENU_32
(
menu
);
cs
.
hwndParent
=
WIN_Handle32
(
parent
);
cs
.
style
=
style
;
cs
.
lpszName
=
windowName
;
cs
.
lpszClass
=
className
;
cs
.
dwExStyle
=
exStyle
;
/* map to module handle */
if
(
instance
)
instance
=
GetExePtr
(
instance
);
/* load the menu */
if
(
!
menu
&&
(
style
&
(
WS_CHILD
|
WS_POPUP
))
!=
WS_CHILD
)
{
WNDCLASSA
class
;
if
(
GetClassInfoA
(
HINSTANCE_32
(
instance
),
className
,
&
class
))
cs
.
hMenu
=
HMENU_32
(
LoadMenu16
(
instance
,
class
.
lpszMenuName
));
}
if
(
!
IS_INTRESOURCE
(
className
))
{
WCHAR
bufferW
[
256
];
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
className
,
-
1
,
bufferW
,
sizeof
(
bufferW
)
/
sizeof
(
WCHAR
)
))
return
0
;
hwnd
=
wow_handlers32
.
create_window
(
(
CREATESTRUCTW
*
)
&
cs
,
bufferW
,
HINSTANCE_32
(
instance
),
0
);
}
else
{
if
(
!
GlobalGetAtomNameA
(
LOWORD
(
className
),
buffer
,
sizeof
(
buffer
)
))
{
ERR
(
"bad atom %x
\n
"
,
LOWORD
(
className
));
return
0
;
}
cs
.
lpszClass
=
buffer
;
hwnd
=
wow_handlers32
.
create_window
(
(
CREATESTRUCTW
*
)
&
cs
,
(
LPCWSTR
)
className
,
HINSTANCE_32
(
instance
),
0
);
}
return
HWND_16
(
hwnd
);
}
/***********************************************************************
* button_proc16
* button_proc16
*/
*/
static
LRESULT
button_proc16
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
static
LRESULT
button_proc16
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
...
@@ -2642,6 +2575,19 @@ static LRESULT static_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
...
@@ -2642,6 +2575,19 @@ static LRESULT static_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
}
}
/***********************************************************************
* create_window16
*/
HWND
create_window16
(
CREATESTRUCTW
*
cs
,
LPCWSTR
className
,
HINSTANCE
instance
,
UINT
flags
)
{
/* map to module handle */
if
(
instance
&&
!
((
ULONG_PTR
)
instance
>>
16
))
instance
=
HINSTANCE_32
(
GetExePtr
(
HINSTANCE_16
(
instance
)
));
return
wow_handlers32
.
create_window
(
cs
,
className
,
instance
,
flags
);
}
void
register_wow_handlers
(
void
)
void
register_wow_handlers
(
void
)
{
{
static
const
struct
wow_handlers16
handlers16
=
static
const
struct
wow_handlers16
handlers16
=
...
@@ -2653,6 +2599,7 @@ void register_wow_handlers(void)
...
@@ -2653,6 +2599,7 @@ void register_wow_handlers(void)
mdiclient_proc16
,
mdiclient_proc16
,
scrollbar_proc16
,
scrollbar_proc16
,
static_proc16
,
static_proc16
,
create_window16
,
call_window_proc_Ato16
,
call_window_proc_Ato16
,
call_dialog_proc_Ato16
call_dialog_proc_Ato16
};
};
...
...
dlls/user32/win.c
View file @
ce505590
...
@@ -1465,11 +1465,11 @@ HWND WINAPI CreateWindowExA( DWORD exStyle, LPCSTR className,
...
@@ -1465,11 +1465,11 @@ HWND WINAPI CreateWindowExA( DWORD exStyle, LPCSTR className,
WCHAR
bufferW
[
256
];
WCHAR
bufferW
[
256
];
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
className
,
-
1
,
bufferW
,
sizeof
(
bufferW
)
/
sizeof
(
WCHAR
)
))
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
className
,
-
1
,
bufferW
,
sizeof
(
bufferW
)
/
sizeof
(
WCHAR
)
))
return
0
;
return
0
;
return
WIN_CreateWindowEx
(
(
CREATESTRUCTW
*
)
&
cs
,
bufferW
,
instance
,
WIN_ISWIN32
);
return
wow_handlers
.
create_window
(
(
CREATESTRUCTW
*
)
&
cs
,
bufferW
,
instance
,
WIN_ISWIN32
);
}
}
/* Note: we rely on the fact that CREATESTRUCTA and */
/* Note: we rely on the fact that CREATESTRUCTA and */
/* CREATESTRUCTW have the same layout. */
/* CREATESTRUCTW have the same layout. */
return
WIN_CreateWindowEx
(
(
CREATESTRUCTW
*
)
&
cs
,
(
LPCWSTR
)
className
,
instance
,
WIN_ISWIN32
);
return
wow_handlers
.
create_window
(
(
CREATESTRUCTW
*
)
&
cs
,
(
LPCWSTR
)
className
,
instance
,
WIN_ISWIN32
);
}
}
...
@@ -1497,7 +1497,7 @@ HWND WINAPI CreateWindowExW( DWORD exStyle, LPCWSTR className,
...
@@ -1497,7 +1497,7 @@ HWND WINAPI CreateWindowExW( DWORD exStyle, LPCWSTR className,
cs
.
lpszClass
=
className
;
cs
.
lpszClass
=
className
;
cs
.
dwExStyle
=
exStyle
;
cs
.
dwExStyle
=
exStyle
;
return
WIN_CreateWindowEx
(
&
cs
,
className
,
instance
,
WIN_ISWIN32
|
WIN_ISUNICODE
);
return
wow_handlers
.
create_window
(
&
cs
,
className
,
instance
,
WIN_ISWIN32
|
WIN_ISUNICODE
);
}
}
...
...
dlls/user32/winproc.c
View file @
ce505590
...
@@ -1152,6 +1152,7 @@ struct wow_handlers16 wow_handlers =
...
@@ -1152,6 +1152,7 @@ struct wow_handlers16 wow_handlers =
MDIClientWndProc_common
,
MDIClientWndProc_common
,
ScrollBarWndProc_common
,
ScrollBarWndProc_common
,
StaticWndProc_common
,
StaticWndProc_common
,
WIN_CreateWindowEx
,
NULL
,
/* call_window_proc */
NULL
,
/* call_window_proc */
NULL
/* call_dialog_proc */
NULL
/* call_dialog_proc */
};
};
dlls/user32/wnd16.c
View file @
ce505590
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "wine/winuser16.h"
#include "wine/winuser16.h"
#include "wownt32.h"
#include "wownt32.h"
#include "win.h"
#include "win.h"
#include "controls.h"
#include "user_private.h"
#include "user_private.h"
#include "wine/server.h"
#include "wine/server.h"
...
@@ -1789,6 +1790,65 @@ BOOL16 WINAPI DrawAnimatedRects16( HWND16 hwnd, INT16 idAni,
...
@@ -1789,6 +1790,65 @@ BOOL16 WINAPI DrawAnimatedRects16( HWND16 hwnd, INT16 idAni,
/***********************************************************************
/***********************************************************************
* CreateWindowEx (USER.452)
*/
HWND16
WINAPI
CreateWindowEx16
(
DWORD
exStyle
,
LPCSTR
className
,
LPCSTR
windowName
,
DWORD
style
,
INT16
x
,
INT16
y
,
INT16
width
,
INT16
height
,
HWND16
parent
,
HMENU16
menu
,
HINSTANCE16
instance
,
LPVOID
data
)
{
CREATESTRUCTA
cs
;
char
buffer
[
256
];
HWND
hwnd
;
/* Fix the coordinates */
cs
.
x
=
(
x
==
CW_USEDEFAULT16
)
?
CW_USEDEFAULT
:
(
INT
)
x
;
cs
.
y
=
(
y
==
CW_USEDEFAULT16
)
?
CW_USEDEFAULT
:
(
INT
)
y
;
cs
.
cx
=
(
width
==
CW_USEDEFAULT16
)
?
CW_USEDEFAULT
:
(
INT
)
width
;
cs
.
cy
=
(
height
==
CW_USEDEFAULT16
)
?
CW_USEDEFAULT
:
(
INT
)
height
;
/* Create the window */
cs
.
lpCreateParams
=
data
;
cs
.
hInstance
=
HINSTANCE_32
(
instance
);
cs
.
hMenu
=
HMENU_32
(
menu
);
cs
.
hwndParent
=
WIN_Handle32
(
parent
);
cs
.
style
=
style
;
cs
.
lpszName
=
windowName
;
cs
.
lpszClass
=
className
;
cs
.
dwExStyle
=
exStyle
;
/* load the menu */
if
(
!
menu
&&
(
style
&
(
WS_CHILD
|
WS_POPUP
))
!=
WS_CHILD
)
{
WNDCLASSA
class
;
HINSTANCE16
module
=
GetExePtr
(
instance
);
if
(
GetClassInfoA
(
HINSTANCE_32
(
module
),
className
,
&
class
))
cs
.
hMenu
=
HMENU_32
(
LoadMenu16
(
module
,
class
.
lpszMenuName
));
}
if
(
!
IS_INTRESOURCE
(
className
))
{
WCHAR
bufferW
[
256
];
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
className
,
-
1
,
bufferW
,
sizeof
(
bufferW
)
/
sizeof
(
WCHAR
)
))
return
0
;
hwnd
=
create_window16
(
(
CREATESTRUCTW
*
)
&
cs
,
bufferW
,
HINSTANCE_32
(
instance
),
0
);
}
else
{
if
(
!
GlobalGetAtomNameA
(
LOWORD
(
className
),
buffer
,
sizeof
(
buffer
)
))
return
0
;
cs
.
lpszClass
=
buffer
;
hwnd
=
create_window16
(
(
CREATESTRUCTW
*
)
&
cs
,
(
LPCWSTR
)
className
,
HINSTANCE_32
(
instance
),
0
);
}
return
HWND_16
(
hwnd
);
}
/***********************************************************************
* GetInternalWindowPos (USER.460)
* GetInternalWindowPos (USER.460)
*/
*/
UINT16
WINAPI
GetInternalWindowPos16
(
HWND16
hwnd
,
LPRECT16
rectWnd
,
LPPOINT16
ptIcon
)
UINT16
WINAPI
GetInternalWindowPos16
(
HWND16
hwnd
,
LPRECT16
rectWnd
,
LPPOINT16
ptIcon
)
...
...
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