mirror of
https://github.com/reactos/reactos.git
synced 2025-04-26 16:40:27 +00:00
- Terminate the string. NtUserMenuItemInfo() sometimes returns no string.
- Check if NtUserBuildMenuItemList() returns negative result. svn path=/trunk/; revision=26700
This commit is contained in:
parent
5b30343d53
commit
852a223ab9
1 changed files with 2 additions and 1 deletions
|
@ -200,6 +200,7 @@ MenuGetRosMenuItemInfo(HMENU Menu, UINT Index, PROSMENUITEMINFO ItemInfo)
|
|||
ItemInfo->fType = 0;
|
||||
return FALSE;
|
||||
}
|
||||
ItemInfo->dwTypeData[ItemInfo->cch - 1] = UNICODE_NULL;
|
||||
}
|
||||
ItemInfo->fMask = Save_Mask;
|
||||
return TRUE;
|
||||
|
@ -251,7 +252,7 @@ MenuGetAllRosMenuItemInfo(HMENU Menu, PROSMENUITEMINFO *ItemInfo)
|
|||
DWORD BufSize;
|
||||
|
||||
BufSize = NtUserBuildMenuItemList(Menu, (VOID *) 1, 0, 0);
|
||||
if (BufSize <= 0)
|
||||
if (BufSize == (DWORD) -1 || BufSize == 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue