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
f9340ff9
Commit
f9340ff9
authored
Mar 20, 2002
by
Duane Clark
Committed by
Alexandre Julliard
Mar 20, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
On WM_GETTEXT, terminate the lparam buffer even if string is empty.
parent
b4994d18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
defwnd.c
windows/defwnd.c
+12
-4
No files found.
windows/defwnd.c
View file @
f9340ff9
...
...
@@ -794,15 +794,19 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
break
;
case
WM_GETTEXT
:
if
(
wParam
)
{
LPSTR
dest
=
(
LPSTR
)
lParam
;
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
wParam
&&
wndPtr
&&
wndPtr
->
text
)
if
(
!
wndPtr
)
break
;
if
(
wndPtr
->
text
)
{
LPSTR
dest
=
(
LPSTR
)
lParam
;
if
(
!
WideCharToMultiByte
(
CP_ACP
,
0
,
wndPtr
->
text
,
-
1
,
dest
,
wParam
,
NULL
,
NULL
))
dest
[
wParam
-
1
]
=
0
;
result
=
strlen
(
dest
);
}
else
dest
[
0
]
=
'\0'
;
WIN_ReleasePtr
(
wndPtr
);
}
break
;
...
...
@@ -928,14 +932,18 @@ LRESULT WINAPI DefWindowProcW(
break
;
case
WM_GETTEXT
:
if
(
wParam
)
{
LPWSTR
dest
=
(
LPWSTR
)
lParam
;
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
wParam
&&
wndPtr
&&
wndPtr
->
text
)
if
(
!
wndPtr
)
break
;
if
(
wndPtr
->
text
)
{
LPWSTR
dest
=
(
LPWSTR
)
lParam
;
lstrcpynW
(
dest
,
wndPtr
->
text
,
wParam
);
result
=
strlenW
(
dest
);
}
else
dest
[
0
]
=
'\0'
;
WIN_ReleasePtr
(
wndPtr
);
}
break
;
...
...
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