Rémi Bernon (@rbernon) commented about dlls/winmm/joystick.c:
- if (!(event = CreateEventW( NULL, FALSE, FALSE, NULL )))
ERR( "failed to create event, error %lu\n", GetLastError() );
- if (FAILED(hr = IDirectInputDevice8_SetEventNotification( device, event )))
ERR( "failed to set event notification, hr %#lx\n", hr );
- if (FAILED(hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND )))
ERR( "failed to set cooperative level, hr %#lx\n", hr );
- if (FAILED(hr = IDirectInputDevice8_SetDataFormat( device, &data_format )))
ERR( "failed to set data format, hr %#lx\n", hr );
- if (FAILED(hr = IDirectInputDevice8_Acquire( device )))
- {
WARN( "failed to acquire, hr %#lx\n", hr );
IDirectInputDevice8_Release( device );
CloseHandle( event );
return false;
- }
Why change the logic? I don't think we want to add a joystick if any of these calls fail.
Same question with the error levels. I don't know precisely what we consider to deserve ERR vs WARN but I had the impression that ERR is reserved for critical failures that will prevent Wine from working. Most if not all of these failures aren't and are possibly completely acceptable.
Fwiw looking at the next commit, I think you could instead just have a `set_joystick_data_format` helper replacing the `IDirectInputDevice8_SetDataFormat` call.