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
1899cd2a
Commit
1899cd2a
authored
Apr 14, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move GetMenuState implementation from user32.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d366ef51
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
30 deletions
+38
-30
menu.c
dlls/user32/menu.c
+2
-30
menu.c
dlls/win32u/menu.c
+34
-0
ntuser.h
include/ntuser.h
+2
-0
No files found.
dlls/user32/menu.c
View file @
1899cd2a
...
...
@@ -3687,37 +3687,9 @@ BOOL WINAPI HiliteMenuItem( HWND hWnd, HMENU hMenu, UINT wItemID,
/**********************************************************************
* GetMenuState (USER32.@)
*/
UINT
WINAPI
GetMenuState
(
HMENU
hMenu
,
UINT
wItemID
,
UINT
wF
lags
)
UINT
WINAPI
GetMenuState
(
HMENU
menu
,
UINT
item
,
UINT
f
lags
)
{
POPUPMENU
*
menu
;
UINT
state
,
pos
;
MENUITEM
*
item
;
TRACE
(
"(menu=%p, id=%04x, flags=%04x);
\n
"
,
hMenu
,
wItemID
,
wFlags
);
if
(
!
(
menu
=
find_menu_item
(
hMenu
,
wItemID
,
wFlags
,
&
pos
)))
return
-
1
;
item
=
&
menu
->
items
[
pos
];
debug_print_menuitem
(
" item: "
,
item
,
""
);
if
(
item
->
fType
&
MF_POPUP
)
{
POPUPMENU
*
submenu
=
grab_menu_ptr
(
item
->
hSubMenu
);
if
(
submenu
)
state
=
(
submenu
->
nItems
<<
8
)
|
((
item
->
fState
|
item
->
fType
)
&
0xff
);
else
state
=
-
1
;
release_menu_ptr
(
submenu
);
}
else
{
/* We used to (from way back then) mask the result to 0xff. */
/* I don't know why and it seems wrong as the documented */
/* return flag MF_SEPARATOR is outside that mask. */
state
=
(
item
->
fType
|
item
->
fState
);
}
release_menu_ptr
(
menu
);
return
state
;
return
NtUserThunkedMenuItemInfo
(
menu
,
item
,
flags
,
NtUserGetMenuState
,
NULL
,
NULL
);
}
...
...
dlls/win32u/menu.c
View file @
1899cd2a
...
...
@@ -772,6 +772,37 @@ static BOOL set_menu_item_info( MENUITEM *menu, const MENUITEMINFOW *info )
return
TRUE
;
}
/* see GetMenuState */
static
UINT
get_menu_state
(
HMENU
handle
,
UINT
item_id
,
UINT
flags
)
{
POPUPMENU
*
menu
;
UINT
state
,
pos
;
MENUITEM
*
item
;
TRACE
(
"(menu=%p, id=%04x, flags=%04x);
\n
"
,
handle
,
item_id
,
flags
);
if
(
!
(
menu
=
find_menu_item
(
handle
,
item_id
,
flags
,
&
pos
)))
return
-
1
;
item
=
&
menu
->
items
[
pos
];
TRACE
(
" item: %s
\n
"
,
debugstr_menuitem
(
item
));
if
(
item
->
fType
&
MF_POPUP
)
{
POPUPMENU
*
submenu
=
grab_menu_ptr
(
item
->
hSubMenu
);
if
(
submenu
)
state
=
(
submenu
->
nItems
<<
8
)
|
((
item
->
fState
|
item
->
fType
)
&
0xff
);
else
state
=
-
1
;
release_menu_ptr
(
submenu
);
}
else
{
state
=
item
->
fType
|
item
->
fState
;
}
release_menu_ptr
(
menu
);
return
state
;
}
/**********************************************************************
* NtUserThunkedMenuItemInfo (win32u.@)
*/
...
...
@@ -822,6 +853,9 @@ UINT WINAPI NtUserThunkedMenuItemInfo( HMENU handle, UINT pos, UINT flags, UINT
release_menu_ptr
(
menu
);
break
;
case
NtUserGetMenuState
:
return
get_menu_state
(
handle
,
pos
,
flags
);
default:
FIXME
(
"unsupported method %u
\n
"
,
method
);
return
FALSE
;
...
...
include/ntuser.h
View file @
1899cd2a
...
...
@@ -183,6 +183,8 @@ enum
{
NtUserSetMenuItemInfo
,
NtUserInsertMenuItem
,
/* Wine extensions */
NtUserGetMenuState
,
};
struct
send_message_timeout_params
...
...
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