Author: dgorbachev
Date: Fri May 11 18:12:57 2007
New Revision: 26700
URL:
http://svn.reactos.org/svn/reactos?rev=26700&view=rev
Log:
- Terminate the string. NtUserMenuItemInfo() sometimes returns no string.
- Check if NtUserBuildMenuItemList() returns negative result.
Modified:
trunk/reactos/dll/win32/user32/windows/menu.c
Modified: trunk/reactos/dll/win32/user32/windows/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/menu.c (original)
+++ trunk/reactos/dll/win32/user32/windows/menu.c Fri May 11 18:12:57 2007
@@ -200,6 +200,7 @@
ItemInfo->fType = 0;
return FALSE;
}
+ ItemInfo->dwTypeData[ItemInfo->cch - 1] = UNICODE_NULL;
}
ItemInfo->fMask = Save_Mask;
return TRUE;
@@ -251,7 +252,7 @@
DWORD BufSize;
BufSize = NtUserBuildMenuItemList(Menu, (VOID *) 1, 0, 0);
- if (BufSize <= 0)
+ if (BufSize == (DWORD) -1 || BufSize == 0)
{
return -1;
}