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(
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;
EnterCriticalSection(&This->base.crit);
......@@ -282,8 +282,8 @@ static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState(
TRACE(" - %02X: %02x\n", i, This->DInputKeyState[i]);
}
}
memcpy(ptr, This->DInputKeyState, WINE_DINPUT_KEYBOARD_MAX_KEYS);
fill_DataFormat(ptr, This->DInputKeyState, &This->base.data_format);
LeaveCriticalSection(&This->base.crit);
return DI_OK;
......
......@@ -116,13 +116,10 @@ static void acquire_tests(LPDIRECTINPUT pDI, HWND hwnd)
ok(SUCCEEDED(hr), "IDirectInputDevice_SetDataFormat() failed: %s\n", DXGetErrorString8(hr));
hr = IDirectInputDevice_Acquire(pKeyboard);
ok(SUCCEEDED(hr), "IDirectInputDevice_Acquire() failed: %s\n", DXGetErrorString8(hr));
todo_wine
{
hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(custom_state), custom_state);
ok(SUCCEEDED(hr), "IDirectInputDevice_GetDeviceState(4,) failed: %s\n", DXGetErrorString8(hr));
hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(kbd_state), kbd_state);
ok(hr == DIERR_INVALIDPARAM, "IDirectInputDevice_GetDeviceState(256,) should have failed: %s\n", DXGetErrorString8(hr));
}
hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(custom_state), custom_state);
ok(SUCCEEDED(hr), "IDirectInputDevice_GetDeviceState(4,) failed: %s\n", DXGetErrorString8(hr));
hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(kbd_state), kbd_state);
ok(hr == DIERR_INVALIDPARAM, "IDirectInputDevice_GetDeviceState(256,) should have failed: %s\n", DXGetErrorString8(hr));
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