dinput: Canonicalize code style of IDirectInput7WImpl_CreateDeviceEx.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
591be9d456
commit
8932f53947
|
@ -605,38 +605,36 @@ static HRESULT WINAPI IDirectInput2WImpl_FindDevice(LPDIRECTINPUT7W iface, REFGU
|
||||||
return DI_OK;
|
return DI_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IDirectInput7WImpl_CreateDeviceEx( IDirectInput7W *iface, REFGUID rguid, REFIID riid,
|
static HRESULT WINAPI IDirectInput7WImpl_CreateDeviceEx( IDirectInput7W *iface, const GUID *guid,
|
||||||
LPVOID *pvOut, LPUNKNOWN lpUnknownOuter )
|
const GUID *iid, void **out, IUnknown *outer )
|
||||||
{
|
{
|
||||||
|
IDirectInputImpl *impl = impl_from_IDirectInput7W( iface );
|
||||||
IDirectInputDevice8W *device;
|
IDirectInputDevice8W *device;
|
||||||
IDirectInputImpl *This = impl_from_IDirectInput7W( iface );
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE( "(%p)->(%s, %s, %p, %p)\n", This, debugstr_guid( rguid ), debugstr_guid( riid ), pvOut, lpUnknownOuter );
|
TRACE( "iface %p, guid %s, iid %s, out %p, outer %p\n", iface, debugstr_guid( guid ),
|
||||||
|
debugstr_guid( iid ), out, outer );
|
||||||
|
|
||||||
if (pvOut)
|
if (!out) return E_POINTER;
|
||||||
*pvOut = NULL;
|
*out = NULL;
|
||||||
|
|
||||||
if (!rguid || !pvOut)
|
if (!guid) return E_POINTER;
|
||||||
return E_POINTER;
|
if (!impl->initialized) return DIERR_NOTINITIALIZED;
|
||||||
|
|
||||||
if (!This->initialized)
|
|
||||||
return DIERR_NOTINITIALIZED;
|
|
||||||
|
|
||||||
/* Loop on all the devices to see if anyone matches the given GUID */
|
/* Loop on all the devices to see if anyone matches the given GUID */
|
||||||
for (i = 0; i < ARRAY_SIZE(dinput_devices); i++)
|
for (i = 0; i < ARRAY_SIZE(dinput_devices); i++)
|
||||||
{
|
{
|
||||||
if (!dinput_devices[i]->create_device) continue;
|
if (!dinput_devices[i]->create_device) continue;
|
||||||
if (SUCCEEDED(hr = dinput_devices[i]->create_device( This, rguid, &device )))
|
if (SUCCEEDED(hr = dinput_devices[i]->create_device( impl, guid, &device )))
|
||||||
{
|
{
|
||||||
hr = IDirectInputDevice8_QueryInterface( device, riid, pvOut );
|
hr = IDirectInputDevice8_QueryInterface( device, iid, out );
|
||||||
IDirectInputDevice8_Release( device );
|
IDirectInputDevice8_Release( device );
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WARN("invalid device GUID %s\n", debugstr_guid(rguid));
|
WARN( "invalid device GUID %s\n", debugstr_guid( guid ) );
|
||||||
return DIERR_DEVICENOTREG;
|
return DIERR_DEVICENOTREG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue