mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:02:59 +00:00
Fixing two user mode crash for menu.
Do not try reading from NULL pointer and compare the value. This let me come bit futer with user32_winetest.exe, but we still have some user mode crash with menu. svn path=/trunk/; revision=23003
This commit is contained in:
parent
fa1e866a00
commit
06f4494f85
1 changed files with 17 additions and 10 deletions
|
@ -4488,11 +4488,14 @@ ModifyMenuA(
|
|||
HeapFree(GetProcessHeap(),0, mii.dwTypeData);
|
||||
}
|
||||
/* Item beginning with a backspace is a help item */
|
||||
if (lpNewItem != NULL)
|
||||
{
|
||||
if (*lpNewItem == '\b')
|
||||
{
|
||||
mii.fType |= MF_HELP;
|
||||
lpNewItem++;
|
||||
}
|
||||
}
|
||||
mii.fMask |= MIIM_TYPE;
|
||||
mii.dwTypeData = (LPSTR)lpNewItem;
|
||||
mii.cch = (NULL == lpNewItem ? 0 : strlen(lpNewItem));
|
||||
|
@ -4579,15 +4582,19 @@ ModifyMenuW(
|
|||
}
|
||||
else
|
||||
{
|
||||
/*if(mii.dwTypeData != NULL)
|
||||
/*
|
||||
if(mii.dwTypeData != NULL)
|
||||
{
|
||||
HeapFree(GetProcessHeap(),0, mii.dwTypeData);
|
||||
}*/
|
||||
} */
|
||||
if (lpNewItem != NULL)
|
||||
{
|
||||
if (*lpNewItem == '\b')
|
||||
{
|
||||
mii.fType |= MF_HELP;
|
||||
lpNewItem++;
|
||||
}
|
||||
}
|
||||
mii.fMask |= MIIM_TYPE;
|
||||
mii.dwTypeData = (LPWSTR)lpNewItem;
|
||||
mii.cch = (NULL == lpNewItem ? 0 : wcslen(lpNewItem));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue