Commit b33bece8 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dinput: Stub hid_joystick force feedback methods.

parent f264ba76
...@@ -780,6 +780,77 @@ static HRESULT WINAPI hid_joystick_GetDeviceInfo( IDirectInputDevice8W *iface, D ...@@ -780,6 +780,77 @@ static HRESULT WINAPI hid_joystick_GetDeviceInfo( IDirectInputDevice8W *iface, D
return S_OK; return S_OK;
} }
static HRESULT WINAPI hid_joystick_CreateEffect( IDirectInputDevice8W *iface, const GUID *guid,
const DIEFFECT *params, IDirectInputEffect **out,
IUnknown *outer )
{
FIXME( "iface %p, guid %s, params %p, out %p, outer %p stub!\n", iface, debugstr_guid( guid ),
params, out, outer );
if (!out) return E_POINTER;
return DIERR_UNSUPPORTED;
}
static HRESULT WINAPI hid_joystick_EnumEffects( IDirectInputDevice8W *iface, LPDIENUMEFFECTSCALLBACKW callback,
void *context, DWORD type )
{
FIXME( "iface %p, callback %p, context %p, type %#x stub!\n", iface, callback, context, type );
if (!callback) return DIERR_INVALIDPARAM;
return DI_OK;
}
static HRESULT WINAPI hid_joystick_GetEffectInfo( IDirectInputDevice8W *iface, DIEFFECTINFOW *info,
const GUID *guid )
{
FIXME( "iface %p, info %p, guid %s stub!\n", iface, info, debugstr_guid( guid ) );
if (!info) return E_POINTER;
if (info->dwSize != sizeof(DIEFFECTINFOW)) return DIERR_INVALIDPARAM;
return DIERR_DEVICENOTREG;
}
static HRESULT WINAPI hid_joystick_GetForceFeedbackState( IDirectInputDevice8W *iface, DWORD *out )
{
FIXME( "iface %p, out %p stub!\n", iface, out );
if (!out) return E_POINTER;
return DIERR_UNSUPPORTED;
}
static HRESULT WINAPI hid_joystick_SendForceFeedbackCommand( IDirectInputDevice8W *iface, DWORD command )
{
FIXME( "iface %p, command %x stub!\n", iface, command );
switch (command)
{
case DISFFC_RESET:
case DISFFC_STOPALL:
case DISFFC_PAUSE:
case DISFFC_CONTINUE:
case DISFFC_SETACTUATORSON:
case DISFFC_SETACTUATORSOFF:
return DIERR_UNSUPPORTED;
}
return DIERR_INVALIDPARAM;
}
static HRESULT WINAPI hid_joystick_EnumCreatedEffectObjects( IDirectInputDevice8W *iface,
LPDIENUMCREATEDEFFECTOBJECTSCALLBACK callback,
void *context, DWORD flags )
{
FIXME( "iface %p, callback %p, context %p, flags %#x stub!\n", iface, callback, context, flags );
if (!callback) return DIERR_INVALIDPARAM;
return DIERR_UNSUPPORTED;
}
static HRESULT WINAPI hid_joystick_Poll( IDirectInputDevice8W *iface ) static HRESULT WINAPI hid_joystick_Poll( IDirectInputDevice8W *iface )
{ {
struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface );
...@@ -837,12 +908,12 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl = ...@@ -837,12 +908,12 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl =
IDirectInputDevice2WImpl_RunControlPanel, IDirectInputDevice2WImpl_RunControlPanel,
IDirectInputDevice2WImpl_Initialize, IDirectInputDevice2WImpl_Initialize,
/*** IDirectInputDevice2 methods ***/ /*** IDirectInputDevice2 methods ***/
IDirectInputDevice2WImpl_CreateEffect, hid_joystick_CreateEffect,
IDirectInputDevice2WImpl_EnumEffects, hid_joystick_EnumEffects,
IDirectInputDevice2WImpl_GetEffectInfo, hid_joystick_GetEffectInfo,
IDirectInputDevice2WImpl_GetForceFeedbackState, hid_joystick_GetForceFeedbackState,
IDirectInputDevice2WImpl_SendForceFeedbackCommand, hid_joystick_SendForceFeedbackCommand,
IDirectInputDevice2WImpl_EnumCreatedEffectObjects, hid_joystick_EnumCreatedEffectObjects,
IDirectInputDevice2WImpl_Escape, IDirectInputDevice2WImpl_Escape,
hid_joystick_Poll, hid_joystick_Poll,
IDirectInputDevice2WImpl_SendDeviceData, IDirectInputDevice2WImpl_SendDeviceData,
......
...@@ -4038,7 +4038,6 @@ static void test_simple_joystick(void) ...@@ -4038,7 +4038,6 @@ static void test_simple_joystick(void)
check_member( objinst, expect_objects[5], "%u", wReportId ); check_member( objinst, expect_objects[5], "%u", wReportId );
hr = IDirectInputDevice8_EnumEffects( device, NULL, NULL, DIEFT_ALL ); hr = IDirectInputDevice8_EnumEffects( device, NULL, NULL, DIEFT_ALL );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumEffects returned %#x\n", hr ); ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_EnumEffects returned %#x\n", hr );
res = 0; res = 0;
hr = IDirectInputDevice8_EnumEffects( device, check_effect_count, &res, 0xfe ); hr = IDirectInputDevice8_EnumEffects( device, check_effect_count, &res, 0xfe );
...@@ -4054,18 +4053,14 @@ static void test_simple_joystick(void) ...@@ -4054,18 +4053,14 @@ static void test_simple_joystick(void)
check_effects_params.expect_count - check_effects_params.index ); check_effects_params.expect_count - check_effects_params.index );
hr = IDirectInputDevice8_GetEffectInfo( device, NULL, &GUID_Sine ); hr = IDirectInputDevice8_GetEffectInfo( device, NULL, &GUID_Sine );
todo_wine
ok( hr == E_POINTER, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); ok( hr == E_POINTER, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
effectinfo.dwSize = sizeof(DIEFFECTINFOW) + 1; effectinfo.dwSize = sizeof(DIEFFECTINFOW) + 1;
hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine ); hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
effectinfo.dwSize = sizeof(DIEFFECTINFOW); effectinfo.dwSize = sizeof(DIEFFECTINFOW);
hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_NULL ); hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_NULL );
todo_wine
ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine ); hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine );
todo_wine
ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); ok( hr == DIERR_DEVICENOTREG, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
hr = IDirectInputDevice8_SetDataFormat( device, NULL ); hr = IDirectInputDevice8_SetDataFormat( device, NULL );
...@@ -4645,18 +4640,14 @@ static void test_simple_joystick(void) ...@@ -4645,18 +4640,14 @@ static void test_simple_joystick(void)
winetest_pop_context(); winetest_pop_context();
hr = IDirectInputDevice8_GetForceFeedbackState( device, NULL ); hr = IDirectInputDevice8_GetForceFeedbackState( device, NULL );
todo_wine
ok( hr == E_POINTER, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr ); ok( hr == E_POINTER, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr );
res = 0xdeadbeef; res = 0xdeadbeef;
hr = IDirectInputDevice8_GetForceFeedbackState( device, &res ); hr = IDirectInputDevice8_GetForceFeedbackState( device, &res );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, 0xdeadbeef ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, 0xdeadbeef );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_RESET ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, DISFFC_RESET );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
objdata[0].dwOfs = 0xd; objdata[0].dwOfs = 0xd;
...@@ -5713,6 +5704,7 @@ static void test_force_feedback_joystick( void ) ...@@ -5713,6 +5704,7 @@ static void test_force_feedback_joystick( void )
effectinfo.dwSize = sizeof(DIEFFECTINFOW); effectinfo.dwSize = sizeof(DIEFFECTINFOW);
hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine ); hr = IDirectInputDevice8_GetEffectInfo( device, &effectinfo, &GUID_Sine );
todo_wine
ok( hr == DI_OK, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr ); ok( hr == DI_OK, "IDirectInputDevice8_GetEffectInfo returned %#x\n", hr );
todo_wine todo_wine
check_member_guid( effectinfo, expect_effects[0], guid ); check_member_guid( effectinfo, expect_effects[0], guid );
...@@ -5802,7 +5794,6 @@ static void test_force_feedback_joystick( void ) ...@@ -5802,7 +5794,6 @@ static void test_force_feedback_joystick( void )
ok( hr == 0x80040301, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr ); ok( hr == 0x80040301, "IDirectInputDevice8_GetForceFeedbackState returned %#x\n", hr );
hr = IDirectInputDevice8_SendForceFeedbackCommand( device, 0xdeadbeef ); hr = IDirectInputDevice8_SendForceFeedbackCommand( device, 0xdeadbeef );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr ); ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SendForceFeedbackCommand returned %#x\n", hr );
set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) ); set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) );
......
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