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
992d69b9
Commit
992d69b9
authored
Jun 21, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Reimplement GetMenuStringA on top of NtUserThunkedMenuItemInfo.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
7099c8d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
33 deletions
+12
-33
menu.c
dlls/user32/menu.c
+12
-33
No files found.
dlls/user32/menu.c
View file @
992d69b9
...
...
@@ -476,42 +476,21 @@ BOOL WINAPI ChangeMenuW( HMENU hMenu, UINT pos, LPCWSTR data,
/*******************************************************************
* GetMenuStringA (USER32.@)
*/
INT
WINAPI
GetMenuStringA
(
HMENU
hMenu
,
/* [in] menuhandle */
UINT
wItemID
,
/* [in] menu item (dep. on wFlags) */
LPSTR
str
,
/* [out] outbuffer. If NULL, func returns entry length*/
INT
nMaxSiz
,
/* [in] length of buffer. if 0, func returns entry len*/
UINT
wFlags
/* [in] MF_ flags */
)
INT
WINAPI
GetMenuStringA
(
HMENU
menu
,
UINT
item
,
char
*
str
,
INT
count
,
UINT
flags
)
{
POPUPMENU
*
menu
;
MENUITEM
*
item
;
UINT
pos
;
INT
ret
;
TRACE
(
"menu=%p item=%04x ptr=%p len=%d flags=%04x
\n
"
,
hMenu
,
wItemID
,
str
,
nMaxSiz
,
wFlags
);
if
(
str
&&
nMaxSiz
)
str
[
0
]
=
'\0'
;
if
(
!
(
menu
=
find_menu_item
(
hMenu
,
wItemID
,
wFlags
,
&
pos
)))
{
SetLastError
(
ERROR_MENU_ITEM_NOT_FOUND
);
return
0
;
}
item
=
&
menu
->
items
[
pos
];
MENUITEMINFOA
info
;
int
ret
;
if
(
!
item
->
text
)
ret
=
0
;
else
if
(
!
str
||
!
nMaxSiz
)
ret
=
WideCharToMultiByte
(
CP_ACP
,
0
,
item
->
text
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
else
{
if
(
!
WideCharToMultiByte
(
CP_ACP
,
0
,
item
->
text
,
-
1
,
str
,
nMaxSiz
,
NULL
,
NULL
))
str
[
nMaxSiz
-
1
]
=
0
;
ret
=
strlen
(
str
);
}
release_menu_ptr
(
menu
);
TRACE
(
"menu=%p item=%04x ptr=%p len=%d flags=%04x
\n
"
,
menu
,
item
,
str
,
count
,
flags
);
TRACE
(
"returning %s
\n
"
,
debugstr_a
(
str
));
info
.
cbSize
=
sizeof
(
info
);
info
.
fMask
=
MIIM_STRING
;
info
.
dwTypeData
=
str
;
info
.
cch
=
count
;
ret
=
NtUserThunkedMenuItemInfo
(
menu
,
item
,
flags
,
NtUserGetMenuItemInfoA
,
(
MENUITEMINFOW
*
)
&
info
,
NULL
);
if
(
ret
)
ret
=
info
.
cch
;
TRACE
(
"returning %s %d
\n
"
,
debugstr_a
(
str
),
ret
);
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