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
d5a36778
Commit
d5a36778
authored
Apr 12, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Perform Unicode conversion in SetMenuItemInfoA.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c7a07f73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
menu.c
dlls/user32/menu.c
+13
-1
No files found.
dlls/user32/menu.c
View file @
d5a36778
...
...
@@ -4824,6 +4824,7 @@ static BOOL MENU_NormalizeMenuItemInfoStruct( const MENUITEMINFOW *pmii_in,
BOOL
WINAPI
SetMenuItemInfoA
(
HMENU
hmenu
,
UINT
item
,
BOOL
bypos
,
const
MENUITEMINFOA
*
lpmii
)
{
WCHAR
*
strW
=
NULL
;
MENUITEMINFOW
mii
;
POPUPMENU
*
menu
;
UINT
pos
;
...
...
@@ -4833,14 +4834,25 @@ BOOL WINAPI SetMenuItemInfoA(HMENU hmenu, UINT item, BOOL bypos,
if
(
!
MENU_NormalizeMenuItemInfoStruct
(
(
const
MENUITEMINFOW
*
)
lpmii
,
&
mii
))
return
FALSE
;
if
((
mii
.
fMask
&
MIIM_STRING
)
&&
mii
.
dwTypeData
)
{
const
char
*
str
=
(
const
char
*
)
mii
.
dwTypeData
;
UINT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
if
(
!
(
strW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
FALSE
;
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
strW
,
len
);
mii
.
dwTypeData
=
strW
;
}
if
(
!
(
menu
=
find_menu_item
(
hmenu
,
item
,
bypos
?
MF_BYPOSITION
:
0
,
&
pos
)))
{
/* workaround for Word 95: pretend that SC_TASKLIST item exists */
HeapFree
(
GetProcessHeap
(),
0
,
strW
);
if
(
item
==
SC_TASKLIST
&&
!
bypos
)
return
TRUE
;
return
FALSE
;
}
ret
=
SetMenuItemInfo_common
(
&
menu
->
items
[
pos
],
&
mii
,
FALS
E
);
ret
=
SetMenuItemInfo_common
(
&
menu
->
items
[
pos
],
&
mii
,
TRU
E
);
release_menu_ptr
(
menu
);
HeapFree
(
GetProcessHeap
(),
0
,
strW
);
return
ret
;
}
...
...
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