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
4a53c479
Commit
4a53c479
authored
Jun 21, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move WM_GETTEXT implementation from user32.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
9260d114
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
71 deletions
+34
-71
defwnd.c
dlls/user32/defwnd.c
+0
-71
defwnd.c
dlls/win32u/defwnd.c
+34
-0
No files found.
dlls/user32/defwnd.c
View file @
4a53c479
...
...
@@ -30,8 +30,6 @@
#include "win.h"
#include "user_private.h"
#include "controls.h"
#include "wine/server.h"
#include "wine/exception.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
win
);
...
...
@@ -73,28 +71,6 @@ HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType )
}
static
LPARAM
DEFWND_GetTextA
(
WND
*
wndPtr
,
LPSTR
dest
,
WPARAM
wParam
)
{
LPARAM
result
=
0
;
__TRY
{
if
(
wndPtr
->
text
)
{
if
(
!
WideCharToMultiByte
(
CP_ACP
,
0
,
wndPtr
->
text
,
-
1
,
dest
,
wParam
,
NULL
,
NULL
))
dest
[
wParam
-
1
]
=
0
;
result
=
strlen
(
dest
);
}
else
dest
[
0
]
=
'\0'
;
}
__EXCEPT_PAGE_FAULT
{
return
0
;
}
__ENDTRY
return
result
;
}
/***********************************************************************
* DefWindowProcA (USER32.@)
*
...
...
@@ -145,19 +121,6 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
result
=
NC_HandleSysCommand
(
hwnd
,
wParam
,
lParam
);
break
;
case
WM_GETTEXT
:
if
(
wParam
)
{
LPSTR
dest
=
(
LPSTR
)
lParam
;
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
)
break
;
result
=
DEFWND_GetTextA
(
wndPtr
,
dest
,
wParam
);
WIN_ReleasePtr
(
wndPtr
);
}
break
;
case
WM_IME_CHAR
:
if
(
HIBYTE
(
wParam
))
PostMessageA
(
hwnd
,
WM_CHAR
,
HIBYTE
(
wParam
),
lParam
);
PostMessageA
(
hwnd
,
WM_CHAR
,
LOBYTE
(
wParam
),
lParam
);
...
...
@@ -236,28 +199,6 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
}
static
LPARAM
DEFWND_GetTextW
(
WND
*
wndPtr
,
LPWSTR
dest
,
WPARAM
wParam
)
{
LPARAM
result
=
0
;
__TRY
{
if
(
wndPtr
->
text
)
{
lstrcpynW
(
dest
,
wndPtr
->
text
,
wParam
);
result
=
lstrlenW
(
dest
);
}
else
dest
[
0
]
=
'\0'
;
}
__EXCEPT_PAGE_FAULT
{
return
0
;
}
__ENDTRY
return
result
;
}
/***********************************************************************
* DefWindowProcW (USER32.@) Calls default window message handler
*
...
...
@@ -315,18 +256,6 @@ LRESULT WINAPI DefWindowProcW(
result
=
NC_HandleSysCommand
(
hwnd
,
wParam
,
lParam
);
break
;
case
WM_GETTEXT
:
if
(
wParam
)
{
LPWSTR
dest
=
(
LPWSTR
)
lParam
;
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
)
break
;
result
=
DEFWND_GetTextW
(
wndPtr
,
dest
,
wParam
);
WIN_ReleasePtr
(
wndPtr
);
}
break
;
case
WM_IME_CHAR
:
PostMessageW
(
hwnd
,
WM_CHAR
,
wParam
,
lParam
);
break
;
...
...
dlls/win32u/defwnd.c
View file @
4a53c479
...
...
@@ -2519,6 +2519,40 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
}
break
;
case
WM_GETTEXT
:
if
(
wparam
)
{
WND
*
win
;
if
(
!
(
win
=
get_win_ptr
(
hwnd
)))
break
;
__TRY
{
if
(
ansi
)
{
char
*
dest
=
(
char
*
)
lparam
;
if
(
win
->
text
)
result
=
win32u_wctomb
(
&
ansi_cp
,
dest
,
wparam
-
1
,
win
->
text
,
wcslen
(
win
->
text
));
dest
[
result
]
=
0
;
}
else
{
WCHAR
*
dest
=
(
WCHAR
*
)
lparam
;
if
(
win
->
text
)
result
=
min
(
wcslen
(
win
->
text
),
wparam
-
1
);
if
(
result
)
memcpy
(
dest
,
win
->
text
,
result
*
sizeof
(
WCHAR
)
);
dest
[
result
]
=
0
;
}
}
__EXCEPT
{
}
__ENDTRY
release_win_ptr
(
win
);
}
break
;
case
WM_SETICON
:
result
=
(
LRESULT
)
set_window_icon
(
hwnd
,
wparam
,
(
HICON
)
lparam
);
if
((
get_window_long
(
hwnd
,
GWL_STYLE
)
&
WS_CAPTION
)
==
WS_CAPTION
)
...
...
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