From 0f5231d980e181c4057e7049be4fa10eb0d52ab5 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Tue, 31 Oct 2000 01:02:43 +0000 Subject: [PATCH] Changed mouse UnAcquire to NOT unacquire it on multiple unacquires. Implemented DIPROP_AXISMODE for SysMouseAImpl_SetProperty. --- dlls/dinput/dinput_main.c | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index e958f2121a7..40eab386d9e 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -1125,7 +1125,7 @@ static ULONG WINAPI SysMouseAImpl_Release(LPDIRECTINPUTDEVICE2A iface) if (This->data_queue != NULL) HeapFree(GetProcessHeap(),0,This->data_queue); - /* Install the previous event handler (in case of releasing an aquired + /* Install the previous event handler (in case of releasing an acquired mouse device) */ if (This->prev_handler != NULL) MOUSE_Enable(This->prev_handler); @@ -1456,7 +1456,7 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface) This->acquired = 1; } - return 0; + return DI_OK; } /****************************************************************************** @@ -1464,21 +1464,26 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface) */ static HRESULT WINAPI SysMouseAImpl_Unacquire(LPDIRECTINPUTDEVICE2A iface) { - ICOM_THIS(SysMouseAImpl,iface); + ICOM_THIS(SysMouseAImpl,iface); - TRACE("(this=%p)\n",This); + TRACE("(this=%p)\n",This); - /* Reinstall previous mouse event handler */ - MOUSE_Enable(This->prev_handler); - This->prev_handler = NULL; + if (This->acquired) + { + /* Reinstall previous mouse event handler */ + MOUSE_Enable(This->prev_handler); + This->prev_handler = NULL; - /* No more locks */ - current_lock = NULL; + /* No more locks */ + current_lock = NULL; - /* Unacquire device */ - This->acquired = 0; + /* Unacquire device */ + This->acquired = 0; + } + else + ERR("Unacquiring a not-acquired device !!!\n"); - return 0; + return DI_OK; } /****************************************************************************** @@ -1610,6 +1615,12 @@ static HRESULT WINAPI SysMouseAImpl_SetProperty(LPDIRECTINPUTDEVICE2A iface, This->queue_len = pd->dwData; break; } + case (DWORD) DIPROP_AXISMODE: { + LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph; + This->absolute = !(pd->dwData); + TRACE("absolute mode: %d\n", This->absolute); + break; + } default: FIXME("Unknown type %ld (%s)\n",(DWORD)rguid,debugstr_guid(rguid)); break; @@ -1876,7 +1887,7 @@ static HRESULT WINAPI JoystickAImpl_Unacquire(LPDIRECTINPUTDEVICE2A iface) close(This->joyfd); This->joyfd = -1; } - return 0; + return DI_OK; } #define map_axis(val) ((val+32768)*(This->lMax-This->lMin)/65536+This->lMin) @@ -1944,7 +1955,7 @@ static HRESULT WINAPI JoystickAImpl_GetDeviceState( } /****************************************************************************** - * GetDeviceState : gets buffered input data. + * GetDeviceData : gets buffered input data. */ static HRESULT WINAPI JoystickAImpl_GetDeviceData(LPDIRECTINPUTDEVICE2A iface, DWORD dodsize,