dinput: Convert keyboard buffer from internal data format to user data format.
This commit is contained in:
parent
e66b15c204
commit
e850b4f13d
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue