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
066e0d5b
Commit
066e0d5b
authored
Jul 29, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Jul 31, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user: Set buffer to '\0' in GetKeyNameTextA too.
parent
88aeeb9f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
input.c
dlls/user/input.c
+3
-0
input.c
dlls/user/tests/input.c
+14
-0
No files found.
dlls/user/input.c
View file @
066e0d5b
...
@@ -595,7 +595,10 @@ INT WINAPI GetKeyNameTextA(LONG lParam, LPSTR lpBuffer, INT nSize)
...
@@ -595,7 +595,10 @@ INT WINAPI GetKeyNameTextA(LONG lParam, LPSTR lpBuffer, INT nSize)
INT
ret
;
INT
ret
;
if
(
!
GetKeyNameTextW
(
lParam
,
buf
,
256
))
if
(
!
GetKeyNameTextW
(
lParam
,
buf
,
256
))
{
lpBuffer
[
0
]
=
0
;
return
0
;
return
0
;
}
ret
=
WideCharToMultiByte
(
CP_ACP
,
0
,
buf
,
-
1
,
lpBuffer
,
nSize
,
NULL
,
NULL
);
ret
=
WideCharToMultiByte
(
CP_ACP
,
0
,
buf
,
-
1
,
lpBuffer
,
nSize
,
NULL
,
NULL
);
if
(
!
ret
&&
nSize
)
if
(
!
ret
&&
nSize
)
{
{
...
...
dlls/user/tests/input.c
View file @
066e0d5b
...
@@ -521,8 +521,22 @@ static void test_Input_blackbox(void)
...
@@ -521,8 +521,22 @@ static void test_Input_blackbox(void)
DestroyWindow
(
window
);
DestroyWindow
(
window
);
}
}
static
void
test_keynames
(
void
)
{
int
i
,
len
;
char
buff
[
256
];
for
(
i
=
0
;
i
<
512
;
i
++
)
{
strcpy
(
buff
,
"----"
);
len
=
GetKeyNameTextA
(
i
<<
16
,
buff
,
sizeof
(
buff
));
ok
(
len
||
!
buff
[
0
],
"%d: Buffer is not zeroed
\n
"
,
i
);
}
}
START_TEST
(
input
)
START_TEST
(
input
)
{
{
test_Input_whitebox
();
test_Input_whitebox
();
test_Input_blackbox
();
test_Input_blackbox
();
test_keynames
();
}
}
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