Commit e850b4f1 authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

dinput: Convert keyboard buffer from internal data format to user data format.

parent e66b15c2
...@@ -270,7 +270,7 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState( ...@@ -270,7 +270,7 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState(
if (!This->base.acquired) return DIERR_NOTACQUIRED; if (!This->base.acquired) return DIERR_NOTACQUIRED;
if (len != WINE_DINPUT_KEYBOARD_MAX_KEYS) if (len != This->base.data_format.user_df->dwDataSize )
return DIERR_INVALIDPARAM; return DIERR_INVALIDPARAM;
EnterCriticalSection(&This->base.crit); EnterCriticalSection(&This->base.crit);
...@@ -283,7 +283,7 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState( ...@@ -283,7 +283,7 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState(
} }
} }
memcpy(ptr, This->DInputKeyState, WINE_DINPUT_KEYBOARD_MAX_KEYS); fill_DataFormat(ptr, This->DInputKeyState, &This->base.data_format);
LeaveCriticalSection(&This->base.crit); LeaveCriticalSection(&This->base.crit);
return DI_OK; return DI_OK;
......
...@@ -116,13 +116,10 @@ static void acquire_tests(LPDIRECTINPUT pDI, HWND hwnd) ...@@ -116,13 +116,10 @@ static void acquire_tests(LPDIRECTINPUT pDI, HWND hwnd)
ok(SUCCEEDED(hr), "IDirectInputDevice_SetDataFormat() failed: %s\n", DXGetErrorString8(hr)); ok(SUCCEEDED(hr), "IDirectInputDevice_SetDataFormat() failed: %s\n", DXGetErrorString8(hr));
hr = IDirectInputDevice_Acquire(pKeyboard); hr = IDirectInputDevice_Acquire(pKeyboard);
ok(SUCCEEDED(hr), "IDirectInputDevice_Acquire() failed: %s\n", DXGetErrorString8(hr)); ok(SUCCEEDED(hr), "IDirectInputDevice_Acquire() failed: %s\n", DXGetErrorString8(hr));
todo_wine
{
hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(custom_state), custom_state); hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(custom_state), custom_state);
ok(SUCCEEDED(hr), "IDirectInputDevice_GetDeviceState(4,) failed: %s\n", DXGetErrorString8(hr)); ok(SUCCEEDED(hr), "IDirectInputDevice_GetDeviceState(4,) failed: %s\n", DXGetErrorString8(hr));
hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(kbd_state), kbd_state); hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(kbd_state), kbd_state);
ok(hr == DIERR_INVALIDPARAM, "IDirectInputDevice_GetDeviceState(256,) should have failed: %s\n", DXGetErrorString8(hr)); ok(hr == DIERR_INVALIDPARAM, "IDirectInputDevice_GetDeviceState(256,) should have failed: %s\n", DXGetErrorString8(hr));
}
if (pKeyboard) IUnknown_Release(pKeyboard); if (pKeyboard) IUnknown_Release(pKeyboard);
} }
......
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