Commit cc5178fe authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

dinput: Factor out the dinput_device_init() call into dinput7_CreateDeviceEx().

parent 39f90348
......@@ -545,6 +545,13 @@ static HRESULT WINAPI dinput7_CreateDeviceEx( IDirectInput7W *iface, const GUID
else hr = hid_joystick_create_device( impl, guid, &device );
if (FAILED(hr)) return hr;
if (FAILED(hr = dinput_device_init( device )))
{
IDirectInputDevice8_Release( device );
return hr;
}
hr = IDirectInputDevice8_QueryInterface( device, iid, out );
IDirectInputDevice8_Release( device );
return hr;
......
......@@ -2138,8 +2138,6 @@ HRESULT hid_joystick_create_device( struct dinput *dinput, const GUID *guid, IDi
impl->base.caps.dwFFDriverVersion = 1;
}
if (FAILED(hr = dinput_device_init( &impl->base.IDirectInputDevice8W_iface ))) goto failed;
*out = &impl->base.IDirectInputDevice8W_iface;
return DI_OK;
......
......@@ -183,12 +183,6 @@ HRESULT keyboard_create_device( struct dinput *dinput, const GUID *guid, IDirect
impl->base.caps.dwFirmwareRevision = 100;
impl->base.caps.dwHardwareRevision = 100;
if (FAILED(hr = dinput_device_init( &impl->base.IDirectInputDevice8W_iface )))
{
IDirectInputDevice_Release( &impl->base.IDirectInputDevice8W_iface );
return hr;
}
*out = &impl->base.IDirectInputDevice8W_iface;
return DI_OK;
}
......
......@@ -122,12 +122,6 @@ HRESULT mouse_create_device( struct dinput *dinput, const GUID *guid, IDirectInp
if (appkey) RegCloseKey(appkey);
if (hkey) RegCloseKey(hkey);
if (FAILED(hr = dinput_device_init( &impl->base.IDirectInputDevice8W_iface )))
{
IDirectInputDevice_Release( &impl->base.IDirectInputDevice8W_iface );
return hr;
}
if (dinput->dwVersion >= 0x0800)
{
impl->base.use_raw_input = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment