[WIN32SS:NTUSER] Return NO_SELECTED_ITEM from NtUserMenuItemFromPoint() when no item is hit (#9121)

Fix the bug, where `NtUserMenuItemFromPoint()` returned `cItems` instead of `NO_SELECTED_ITEM`
when no item is under the point (`mi` is never NULL on a miss), so `MenuItemFromPoint()` callers
could have indexed one past the menu array.
This commit is contained in:
Ahmed Arif
2026-06-25 18:22:15 +02:00
committed by GitHub
parent ae0e4ee305
commit f17d904d2d
+1 -1
View File
@@ -6348,7 +6348,7 @@ NtUserMenuItemFromPoint(
}
}
Ret = (mi ? i : NO_SELECTED_ITEM);
Ret = (i < Menu->cItems ? i : NO_SELECTED_ITEM);
Exit:
UserLeave();