Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9260d114
Commit
9260d114
authored
Jun 20, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move WM_GETTEXTLENGTH implementation from user32.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
99e2f4ca
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
18 deletions
+46
-18
defwnd.c
dlls/user32/defwnd.c
+0
-18
defwnd.c
dlls/win32u/defwnd.c
+14
-0
font.c
dlls/win32u/font.c
+22
-0
win32u.c
dlls/win32u/tests/win32u.c
+9
-0
win32u_private.h
dlls/win32u/win32u_private.h
+1
-0
No files found.
dlls/user32/defwnd.c
View file @
9260d114
...
...
@@ -145,16 +145,6 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
result
=
NC_HandleSysCommand
(
hwnd
,
wParam
,
lParam
);
break
;
case
WM_GETTEXTLENGTH
:
{
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
wndPtr
&&
wndPtr
->
text
)
result
=
WideCharToMultiByte
(
CP_ACP
,
0
,
wndPtr
->
text
,
lstrlenW
(
wndPtr
->
text
),
NULL
,
0
,
NULL
,
NULL
);
WIN_ReleasePtr
(
wndPtr
);
}
break
;
case
WM_GETTEXT
:
if
(
wParam
)
{
...
...
@@ -325,14 +315,6 @@ LRESULT WINAPI DefWindowProcW(
result
=
NC_HandleSysCommand
(
hwnd
,
wParam
,
lParam
);
break
;
case
WM_GETTEXTLENGTH
:
{
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
wndPtr
&&
wndPtr
->
text
)
result
=
(
LRESULT
)
lstrlenW
(
wndPtr
->
text
);
WIN_ReleasePtr
(
wndPtr
);
}
break
;
case
WM_GETTEXT
:
if
(
wParam
)
{
...
...
dlls/win32u/defwnd.c
View file @
9260d114
...
...
@@ -2505,6 +2505,20 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
handle_nc_paint
(
hwnd
,
(
HRGN
)
1
);
/* repaint caption */
break
;
case
WM_GETTEXTLENGTH
:
{
WND
*
win
=
get_win_ptr
(
hwnd
);
if
(
win
&&
win
->
text
)
{
if
(
ansi
)
result
=
win32u_wctomb_size
(
&
ansi_cp
,
win
->
text
,
wcslen
(
win
->
text
));
else
result
=
wcslen
(
win
->
text
);
}
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
)
...
...
dlls/win32u/font.c
View file @
9260d114
...
...
@@ -3230,6 +3230,28 @@ DWORD win32u_wctomb( CPTABLEINFO *info, char *dst, DWORD dstlen, const WCHAR *sr
return
ret
;
}
DWORD
win32u_wctomb_size
(
CPTABLEINFO
*
info
,
const
WCHAR
*
src
,
DWORD
srclen
)
{
DWORD
ret
;
if
(
info
->
CodePage
==
CP_UTF8
)
{
RtlUnicodeToUTF8N
(
NULL
,
0
,
&
ret
,
src
,
srclen
*
sizeof
(
WCHAR
)
);
}
else
if
(
info
->
DBCSCodePage
)
{
WCHAR
*
uni2cp
=
info
->
WideCharTable
;
for
(
ret
=
srclen
;
srclen
;
srclen
--
,
src
++
)
if
(
uni2cp
[
*
src
]
&
0xff00
)
ret
++
;
}
else
{
ret
=
srclen
;
}
return
ret
;
}
DWORD
win32u_mbtowc
(
CPTABLEINFO
*
info
,
WCHAR
*
dst
,
DWORD
dstlen
,
const
char
*
src
,
DWORD
srclen
)
{
DWORD
ret
;
...
...
dlls/win32u/tests/win32u.c
View file @
9260d114
...
...
@@ -494,6 +494,12 @@ static void test_window_text(void)
ok
(
len
==
4
,
"len = %d
\n
"
,
len
);
ok
(
!
lstrcmpW
(
buf
,
L"test"
),
"buf = %s
\n
"
,
wine_dbgstr_w
(
buf
)
);
res
=
NtUserMessageCall
(
hwnd
,
WM_GETTEXTLENGTH
,
0
,
0
,
0
,
NtUserDefWindowProc
,
TRUE
);
ok
(
res
==
4
,
"res = %Id
\n
"
,
res
);
res
=
NtUserMessageCall
(
hwnd
,
WM_GETTEXTLENGTH
,
0
,
0
,
0
,
NtUserDefWindowProc
,
FALSE
);
ok
(
res
==
4
,
"res = %Id
\n
"
,
res
);
res
=
NtUserMessageCall
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
"TestA"
,
0
,
NtUserDefWindowProc
,
TRUE
);
ok
(
res
==
1
,
"res = %Id
\n
"
,
res
);
...
...
@@ -502,6 +508,9 @@ static void test_window_text(void)
ok
(
len
==
5
,
"len = %d
\n
"
,
len
);
ok
(
!
lstrcmpW
(
buf
,
L"TestA"
),
"buf = %s
\n
"
,
wine_dbgstr_w
(
buf
)
);
res
=
NtUserMessageCall
(
hwnd
,
WM_GETTEXTLENGTH
,
0
,
0
,
0
,
NtUserDefWindowProc
,
TRUE
);
ok
(
res
==
5
,
"res = %Id
\n
"
,
res
);
DestroyWindow
(
hwnd
);
}
...
...
dlls/win32u/win32u_private.h
View file @
9260d114
...
...
@@ -575,6 +575,7 @@ DWORD win32u_mbtowc( CPTABLEINFO *info, WCHAR *dst, DWORD dstlen, const char *sr
DWORD
srclen
)
DECLSPEC_HIDDEN
;
DWORD
win32u_wctomb
(
CPTABLEINFO
*
info
,
char
*
dst
,
DWORD
dstlen
,
const
WCHAR
*
src
,
DWORD
srclen
)
DECLSPEC_HIDDEN
;
DWORD
win32u_wctomb_size
(
CPTABLEINFO
*
info
,
const
WCHAR
*
src
,
DWORD
srclen
)
DECLSPEC_HIDDEN
;
static
inline
WCHAR
*
win32u_wcsdup
(
const
WCHAR
*
str
)
{
...
...
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