[bugzilla] Fix Bug 16822 - Mass Effect: Mouse input does not work (almost completely)

siro siro at das-labor.org
Wed May 18 13:03:39 CDT 2011


Hi,
this is a patch to fix bug 16822.

System specs:
Ubuntu 11.04 x64_86
2.6.38-8-generic
nvidia driver 270.41.06

Abstract:
Normal dinput mouse readings:

init_mouse();
dinput:IDirectInputDevice2WImpl_SetCooperativeLevel( DISCL_FOREGROUND| 
DISCL_NONEXCLUSIVE );
dinput:SysMouseWImpl_Acquire();

while(1){
dinput:IDirectInputDevice2WImpl_GetDeviceData();
..
}

dinput:SysMouseWImpl_Unacquire()


What UnrealEngine3 does:

init_mouse();
while(1){

dinput:IDirectInputDevice2WImpl_SetCooperativeLevel( 
DISCL_FOREGROUND|DISCL_NONEXCLUSIVE );

input:SysMouseWImpl_Acquire(); <- queue is cleaned here !

dinput:IDirectInputDevice2WImpl_GetDeviceData();  <- queue is empty, 
return nothing

dinput:LL_hook_proc calling  <- mouse hook, fills the queue
dinput:dinput_mouse_hook
dinput:queue_event

dinput:SysMouseWImpl_Unacquire();

}

The problem is that SysMouseWImpl_Acquire() clears the queue and it 
takes to long to fill the mouse queue (winex11.drv -> wineserver -> 
dinput mouse hook -> dinput queue). 
IDirectInputDevice2WImpl_GetDeviceData() will always return no data. 
Thats why the mouse isn't working.

This patch don't clear the dinput queue in 
IDirectInputDevice2WImpl_Acquire and only append messages to the dinput 
queue as long as IDirectInputDevice is acquired. This way the queue is 
only filled with data as long as the device is acquired. This patch was 
tested with Mass Effect and Frontlines (both UnrealEngine 3 mods), both 
are not working before this patch and are working after this patch.

Kind Regards,
Patrick
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Don-t-clear-the-dinput-queue-in-IDirectInputDevice2WIm.txt
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20110518/9d993539/attachment-0001.txt>


More information about the wine-patches mailing list