[PATCH] shell32: handle bad menu handle (Coverity)

Nikolay Sivov bunglehead at gmail.com
Sat Jan 9 16:50:36 CST 2010


On 1/9/2010 19:37, Marcus Meissner wrote:
>>> +static void
>>> +test_shlmenu(void) {
>>> +	HRESULT hres;
>>> +	hres = Shell_MergeMenus (0, 0, 0x42, 0x4242, 0x424242, 0);
>>> +	ok (hres == 0x4242, "expected 0x4242 but got %x\n", hres);
>>> +	hres = Shell_MergeMenus ((HMENU)42, 0, 0x42, 0x4242, 0x424242, 0);
>>> +	ok (hres == 0x4242, "expected 0x4242 but got %x\n", hres);
>>> +}
>>> +
>>>        
>> Use a valid empty menu handle here as first parameter. Also I'd like
>> to use more sane const values.
>>      
> Hm. What are valid empty menu handles? 0xffff ?
> Or create one? and more sane?
>    
I mean CreateMenu() - it creates valid handle to empty menu, you'll test 
for item count in call you are testing.
About const values I mean something like 1 will be enough here.

>>>   START_TEST(shlfileop)
>>>   {
>>>       InitFunctionPointers();
>>> @@ -2263,4 +2274,6 @@ START_TEST(shlfileop)
>>>       clean_after_shfo_tests();
>>>
>>>       test_unicode();
>>> +
>>> +    test_shlmenu();
>>>   }
>>>        
>> Function is available starting XP SP2 per msdn, so dynamic load
>> should be used.
>>      
> Testbot had no complaints for any version it tests, see
> https://winetestbot.geldorp.nl/JobDetails.pl?Key=279,
> but i can change it.
>    
Ok, still it doesn't have 9x VMs, it's better to try first. We could ask 
Paul maybe.
> Ciao, Marcus
>
>    




More information about the wine-devel mailing list