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
9b7f9f2d
Commit
9b7f9f2d
authored
Nov 04, 2017
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use the given string length when converting strings in WM_GETTEXT.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c4ac2d28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
win.c
dlls/user32/tests/win.c
+0
-4
winproc.c
dlls/user32/winproc.c
+2
-2
No files found.
dlls/user32/tests/win.c
View file @
9b7f9f2d
...
...
@@ -6932,10 +6932,8 @@ static void test_gettext(void)
memset
(
bufW
,
0x1c
,
sizeof
(
bufW
)
);
g_wm_gettext_override
.
dont_terminate
=
TRUE
;
buf_len
=
GetWindowTextW
(
hwnd
,
bufW
,
sizeof
(
bufW
)
/
sizeof
(
bufW
[
0
])
);
todo_wine
ok
(
buf_len
==
4
,
"Unexpected text length, %d
\n
"
,
buf_len
);
ok
(
!
memcmp
(
bufW
,
textW
,
4
*
sizeof
(
WCHAR
)),
"Unexpected window text, %s
\n
"
,
wine_dbgstr_w
(
bufW
)
);
todo_wine
ok
(
bufW
[
4
]
==
0
,
"Unexpected buffer contents, %#x
\n
"
,
bufW
[
4
]
);
g_wm_gettext_override
.
dont_terminate
=
FALSE
;
...
...
@@ -6945,10 +6943,8 @@ todo_wine
memset
(
buf
,
0x1c
,
sizeof
(
buf
)
);
g_wm_gettext_override
.
dont_terminate
=
TRUE
;
buf_len
=
GetWindowTextA
(
hwnd2
,
buf
,
sizeof
(
buf
)
);
todo_wine
ok
(
buf_len
==
4
,
"Unexpected text length, %d
\n
"
,
buf_len
);
ok
(
!
memcmp
(
buf
,
"text"
,
4
),
"Unexpected window text, '%s'
\n
"
,
buf
);
todo_wine
ok
(
buf
[
4
]
==
0
,
"Unexpected buffer contents, %#x
\n
"
,
buf
[
4
]
);
g_wm_gettext_override
.
dont_terminate
=
FALSE
;
...
...
dlls/user32/winproc.c
View file @
9b7f9f2d
...
...
@@ -460,7 +460,7 @@ LRESULT WINPROC_CallProcAtoW( winproc_callback_t callback, HWND hwnd, UINT msg,
{
len
=
0
;
if
(
*
result
)
RtlUnicodeToMultiByteN
(
str
,
wParam
-
1
,
&
len
,
ptr
,
strlenW
(
ptr
)
*
sizeof
(
WCHAR
)
);
RtlUnicodeToMultiByteN
(
str
,
wParam
-
1
,
&
len
,
ptr
,
ret
*
sizeof
(
WCHAR
)
);
str
[
len
]
=
0
;
*
result
=
len
;
}
...
...
@@ -682,7 +682,7 @@ static LRESULT WINPROC_CallProcWtoA( winproc_callback_t callback, HWND hwnd, UIN
{
if
(
*
result
)
{
RtlMultiByteToUnicodeN
(
(
LPWSTR
)
lParam
,
wParam
*
sizeof
(
WCHAR
),
&
len
,
ptr
,
strlen
(
ptr
)
+
1
);
RtlMultiByteToUnicodeN
(
(
LPWSTR
)
lParam
,
wParam
*
sizeof
(
WCHAR
),
&
len
,
ptr
,
ret
+
1
);
*
result
=
len
/
sizeof
(
WCHAR
)
-
1
;
/* do not count terminating null */
}
((
LPWSTR
)
lParam
)[
*
result
]
=
0
;
...
...
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