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
a823177c
Commit
a823177c
authored
Jan 20, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Jan 22, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Avoid truncating ToUnicodeEx result if there's room.
parent
0d137ddb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
input.c
dlls/win32u/input.c
+7
-9
No files found.
dlls/win32u/input.c
View file @
a823177c
...
...
@@ -1187,27 +1187,25 @@ INT WINAPI NtUserToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
WCHAR
*
str
,
int
size
,
UINT
flags
,
HKL
layout
)
{
const
KBDTABLES
*
kbd_tables
;
WCHAR
buffer
[
2
]
=
{
0
};
INT
len
;
TRACE_
(
keyboard
)(
"virt %#x, scan %#x, state %p, str %p, size %d, flags %#x, layout %p.
\n
"
,
virt
,
scan
,
state
,
str
,
size
,
flags
,
layout
);
if
(
!
state
)
return
0
;
if
(
!
state
||
!
size
)
return
0
;
if
((
len
=
user_driver
->
pToUnicodeEx
(
virt
,
scan
,
state
,
str
,
size
,
flags
,
layout
))
>=
-
1
)
return
len
;
if
(
!
(
kbd_tables
=
user_driver
->
pKbdLayerDescriptor
(
layout
)))
kbd_tables
=
&
kbdus_tables
;
if
(
scan
&
0x8000
)
buffer
[
0
]
=
0
;
/* key up */
else
buffer
[
0
]
=
kbd_tables_vkey_to_wchar
(
kbd_tables
,
virt
,
state
);
if
(
scan
&
0x8000
)
str
[
0
]
=
0
;
/* key up */
else
str
[
0
]
=
kbd_tables_vkey_to_wchar
(
kbd_tables
,
virt
,
state
);
if
(
size
>
1
)
str
[
1
]
=
0
;
if
(
buffer
[
0
]
!=
WCH_NONE
)
len
=
1
;
else
buffer
[
0
]
=
len
=
0
;
lstrcpynW
(
str
,
buffer
,
size
);
if
(
str
[
0
]
!=
WCH_NONE
)
len
=
1
;
else
str
[
0
]
=
len
=
0
;
if
(
kbd_tables
!=
&
kbdus_tables
)
user_driver
->
pReleaseKbdTables
(
kbd_tables
);
TRACE_
(
keyboard
)(
"ret %d, str %s.
\n
"
,
len
,
debugstr_w
(
str
)
);
TRACE_
(
keyboard
)(
"ret %d, str %s.
\n
"
,
len
,
debugstr_w
n
(
str
,
len
)
);
return
len
;
}
...
...
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