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

dinput: Allow setting DIPROP_AUTOCENTER when exclusively acquired.

parent d9910197
...@@ -1009,6 +1009,8 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con ...@@ -1009,6 +1009,8 @@ static HRESULT check_property( struct dinput_device *impl, const GUID *guid, con
switch (LOWORD( guid )) switch (LOWORD( guid ))
{ {
case (DWORD_PTR)DIPROP_AUTOCENTER: case (DWORD_PTR)DIPROP_AUTOCENTER:
if (impl->status == STATUS_ACQUIRED && !is_exclusively_acquired( impl )) return DIERR_ACQUIRED;
break;
case (DWORD_PTR)DIPROP_AXISMODE: case (DWORD_PTR)DIPROP_AXISMODE:
case (DWORD_PTR)DIPROP_BUFFERSIZE: case (DWORD_PTR)DIPROP_BUFFERSIZE:
case (DWORD_PTR)DIPROP_PHYSICALRANGE: case (DWORD_PTR)DIPROP_PHYSICALRANGE:
......
...@@ -2924,6 +2924,9 @@ static BOOL test_force_feedback_joystick( DWORD version ) ...@@ -2924,6 +2924,9 @@ static BOOL test_force_feedback_joystick( DWORD version )
ok( hr == DI_OK, "Unacquire returned: %#lx\n", hr ); ok( hr == DI_OK, "Unacquire returned: %#lx\n", hr );
hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_BACKGROUND | DISCL_EXCLUSIVE ); hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_BACKGROUND | DISCL_EXCLUSIVE );
ok( hr == DI_OK, "SetCooperativeLevel returned: %#lx\n", hr ); ok( hr == DI_OK, "SetCooperativeLevel returned: %#lx\n", hr );
prop_dword.dwData = DIPROPAUTOCENTER_ON;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_AUTOCENTER, &prop_dword.diph );
ok( hr == DI_OK, "SetProperty DIPROP_AUTOCENTER returned %#lx\n", hr );
set_hid_expect( file, expect_acquire, sizeof(expect_acquire) ); set_hid_expect( file, expect_acquire, sizeof(expect_acquire) );
hr = IDirectInputDevice8_Acquire( device ); hr = IDirectInputDevice8_Acquire( device );
......
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