Re: [patch 1/3] user32: put some repeated code for checking and extending of a MENUITEMINFO structure in a separate function.
Rein Klazes <wijn(a)online.nl> writes:
- if( lpmii->cbSize != sizeof( mii) && - lpmii->cbSize != sizeof( mii) - sizeof ( mii.hbmpItem)) { - SetLastError( ERROR_INVALID_PARAMETER); - return FALSE; - } - memcpy( &mii, lpmii, lpmii->cbSize); - if( lpmii->cbSize != sizeof( mii)) { - mii.cbSize = sizeof( mii); - mii.hbmpItem = NULL; - } - item = MENU_InsertItem(hMenu, uItem, bypos ? MF_BYPOSITION : 0 ); - return SetMenuItemInfo_common(item, (const MENUITEMINFOW *)&mii, FALSE); + if( MENU_NormalizeMenuItemInfoStruct( (MENUITEMINFOW *)lpmii, &mii)) + return SetMenuItemInfo_common(item, &mii, FALSE); + return FALSE;
You should do the check before the item insertion, like the existing code does. -- Alexandre Julliard julliard(a)winehq.org
participants (1)
-
Alexandre Julliard