From 9a99dc14ebae208b75f522285cd02d6fcb7fa64c Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Tue, 15 Feb 2005 15:03:03 +0000 Subject: [PATCH] Implemented GetProperty method for keyboard device. --- dlls/dinput/joystick_linuxinput.c | 2 +- dlls/dinput/keyboard.c | 35 +++++++++++++++++++++++++++++-- dlls/dinput/mouse.c | 2 +- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 18f146716a0..4200abe6d83 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -978,7 +978,7 @@ static HRESULT WINAPI JoystickAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, { JoystickImpl *This = (JoystickImpl *)iface; - TRACE("(this=%p,%s,%p): stub!\n", + TRACE("(this=%p,%s,%p)\n", iface, debugstr_guid(rguid), pdiph); if (TRACE_ON(dinput)) diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index aa7d8df36d7..9ed1abf1481 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -356,6 +356,37 @@ static HRESULT WINAPI SysKeyboardAImpl_SetProperty( return DI_OK; } +static HRESULT WINAPI SysKeyboardAImpl_GetProperty( + LPDIRECTINPUTDEVICE8A iface,REFGUID rguid,LPDIPROPHEADER ph +) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + + TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(rguid),ph); + TRACE("(size=%ld,headersize=%ld,obj=%ld,how=%ld\n", + ph->dwSize,ph->dwHeaderSize,ph->dwObj,ph->dwHow); + if (!HIWORD(rguid)) { + switch ((DWORD)rguid) { + case (DWORD) DIPROP_BUFFERSIZE: { + LPDIPROPDWORD pd = (LPDIPROPDWORD)ph; + + TRACE("(buffersize=%ld)\n",pd->dwData); + + if (This->acquired) + return DIERR_INVALIDPARAM; + + pd->dwData = This->buffersize; + + break; + } + default: + WARN("Unknown type %ld\n",(DWORD)rguid); + break; + } + } + return DI_OK; +} + static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState( LPDIRECTINPUTDEVICE8A iface,DWORD len,LPVOID ptr ) @@ -712,7 +743,7 @@ static IDirectInputDevice8AVtbl SysKeyboardAvt = SysKeyboardAImpl_Release, SysKeyboardAImpl_GetCapabilities, SysKeyboardAImpl_EnumObjects, - IDirectInputDevice2AImpl_GetProperty, + SysKeyboardAImpl_GetProperty, SysKeyboardAImpl_SetProperty, SysKeyboardAImpl_Acquire, SysKeyboardAImpl_Unacquire, @@ -754,7 +785,7 @@ static IDirectInputDevice8WVtbl SysKeyboardWvt = XCAST(Release)SysKeyboardAImpl_Release, XCAST(GetCapabilities)SysKeyboardAImpl_GetCapabilities, SysKeyboardWImpl_EnumObjects, - XCAST(GetProperty)IDirectInputDevice2AImpl_GetProperty, + XCAST(GetProperty)SysKeyboardAImpl_GetProperty, XCAST(SetProperty)SysKeyboardAImpl_SetProperty, XCAST(Acquire)SysKeyboardAImpl_Acquire, XCAST(Unacquire)SysKeyboardAImpl_Unacquire, diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index c294d052c04..9086e1caf07 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -845,7 +845,7 @@ static HRESULT WINAPI SysMouseAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, { SysMouseImpl *This = (SysMouseImpl *)iface; - TRACE("(this=%p,%s,%p): stub!\n", + TRACE("(this=%p,%s,%p)\n", iface, debugstr_guid(rguid), pdiph); if (TRACE_ON(dinput))