[.01] Some Problems with the Mousdriver (4.xx)

Listing issues addressed in beta version 4.07
JayJayX
Posts: 49
Joined: Tue Aug 30, 2011 6:58 am

[.01] Some Problems with the Mousdriver (4.xx)

Post by JayJayX » Thu Aug 01, 2013 8:32 am

Hi,

I used a long time Sandboxie V3.76. after the upgrade to V4. I have Problems with the Mouse at many Games:
L4D2, Team Fortress and also Beat Hazard. The Mouse works here like an analog stick.
In Valves Games I can switch in the Options to direct Mode without any Mousedriver but in Beat Hazard there is no option for this.
Roll back to V3.76 let me use the Mouse normal.

Any Ideas?
Best Regards
JayJay

BUCKAROO
Posts: 206
Joined: Sun Oct 24, 2010 3:13 am

Post by BUCKAROO » Thu Aug 01, 2013 8:49 am

You need to put OpenWinClass=* setting into each of your games Sandboxes' configuration section in "Sandboxie.ini".
Or you can add an asterisk * to Window Access in the respective Sandbox Settings from Sandboxie Control.

There are downsides to this setting:
(1) Maybe can't run multiple instances of the same game.
(2) No tray icons for these sandboxed processes.

Decreased security? Not that I've found. This setting is purported to allow "full communication with all windows outside the sandbox" but Sandboxie v4 processes can't so much as (directly) show/hide an existing window outside... I don't know if that's a bug.

JayJayX
Posts: 49
Joined: Tue Aug 30, 2011 6:58 am

Post by JayJayX » Fri Aug 02, 2013 5:01 am

Hi,

thx for the hint.
No Multiple Instances is no Problem for me, but the Tray Icons are needed. So I will stay on the 3.76 'til it is fixed.

My Question: Why don't work only for some games?
Best Regards
JayJay

tzuk
Sandboxie Founder
Sandboxie Founder
Posts: 16076
Joined: Tue Jun 22, 2004 12:57 pm

Post by tzuk » Fri Aug 02, 2013 5:14 am

Good point BUCKAROO. I am posting my answer in the topic about OpenWinClass=*, here:

http://www.sandboxie.com/phpbb/viewtopic.php?t=15837
tzuk

JayJayX
Posts: 49
Joined: Tue Aug 30, 2011 6:58 am

Post by JayJayX » Fri Aug 09, 2013 5:15 am

Hi,

but it makes Steam or many of it's games unuseable. I have to choose between not working Games or an not useable Steam.
In Steam I have no TrayIcon anymore and so I can't open it's windows. In steamchat the Returnkey doesn't work anymore.

Is there no way to get back the behaviour of V3.76?
Best Regards
JayJay

tzuk
Sandboxie Founder
Sandboxie Founder
Posts: 16076
Joined: Tue Jun 22, 2004 12:57 pm

Post by tzuk » Fri Aug 09, 2013 7:45 am

Ideally the reason for the mouse going crazy would eventually become clear and once I fix that, you wouldn't need to use the OpenWinClass=* workaround anymore. Perhaps you can produce a Resource Access Monitor log and if we see that you have any third party mouse DLLs, I could try to install those and see what happens.

http://www.sandboxie.com/index.php?Reso ... essMonitor
tzuk

JayJayX
Posts: 49
Joined: Tue Aug 30, 2011 6:58 am

Post by JayJayX » Fri Aug 09, 2013 8:11 am

I attached the whole output made with 3.76 for one of the not working games. Do you need another output with the latest 4.x?
very long please delete if you read it :)

snipped. --tzuk
Best Regards
JayJay

tzuk
Sandboxie Founder
Sandboxie Founder
Posts: 16076
Joined: Tue Jun 22, 2004 12:57 pm

Post by tzuk » Fri Aug 09, 2013 8:42 am

Thank you for the log. Please try the following after upgrading to version 4.05.04 and getting rid of OpenWinClass=*.

Can you try to get rid of some of your third party DLLs to see if it makes any difference?

c:\program files (x86)\autosizer\autosizer.dll
c:\program files (x86)\fraps\fraps32.dll
c:\program files\filebx\filebxh32.dll

You should be able to do that easily by going into Sandbox Settings > Resource Access > File Access > Blocked Access
and adding with Edit/Add, one by one:
*\autosizer.dll
*\fraps32.dll
*\filebxh32.dll

Also try adding in > Resource Access > IPC Access > Direct Access:
*\BaseNamedObjects*\DirectInput*
for the DirectInput stuff

I won't be able to respond immediately but thank you in advance for doing this :)
tzuk

JayJayX
Posts: 49
Joined: Tue Aug 30, 2011 6:58 am

Post by JayJayX » Fri Aug 09, 2013 1:56 pm

Hi,
ok I installed the latest beta and tested this things but it doesn't change anything :(
I also tried OpenWinClass=* only for the beathazard.exe but it doesn't work, too.
I have to enter OpenWinClass=* for the whole sandbox.
Best Regards
JayJay

tzuk
Sandboxie Founder
Sandboxie Founder
Posts: 16076
Joined: Tue Jun 22, 2004 12:57 pm

Post by tzuk » Sat Aug 10, 2013 3:07 pm

If I understand the problem correctly (as described by other posts) then the mouse overreacts to movement and even a small movement is treated like you made a very large movement. If this is correct then I have the following questions:

First, do you know if you use a high definition mouse?

Second, what do you see in Mouse Properties in Control Panel in the Pointer Options tab?

I have a speed setting roughly in the center of the range.
Enhance pointer precision is checked.
The other settings there do not seem relevant.
tzuk

JayJayX
Posts: 49
Joined: Tue Aug 30, 2011 6:58 am

Post by JayJayX » Sat Aug 10, 2013 4:03 pm

I'am not sure I understand you right, my pointer overreacts too,
but it's more an behavior like an analog stick.
There is an centerpoint (not at start, i have to search for this point) and I can move the pointer with very small movements of my mouse.
For examble:
If I found the centerpoint, the pointer stand still. When I move the mouse a little bit to the right, the pointer moves to the right until I move the mouse back, it did not stand still like an mouse pointer. I move the mouse more to the right, the pointer moves faster to the right until I move the mouse back.

I hope you can understand what I mean.

Yes I think I have an high definition mouse 5700 DPI set to 2000DPI (Logitech G500 with the Logitech Gaming Software 8.45.88 )


I have also the speedsetting in the center.
the checkbox for Enhance Pointer Precision is unchecked here.

The Problem in not generally, most of the Software/Games are working.
Best Regards
JayJay

tzuk
Sandboxie Founder
Sandboxie Founder
Posts: 16076
Joined: Tue Jun 22, 2004 12:57 pm

Post by tzuk » Sun Aug 11, 2013 3:32 am

I saw some discussion by Microsoft about how programs that want high resolution mouse tracking must use a special approach to talking to the mouse. Maybe it's just these handful of games that are aware of your high res mouse, and all the others do the regular thing.

As for the enhance pointer precision feature, it should have something to do with how quickly the mouse accelerates.

I suggest first to turn on enhance pointer precision and see if it makes a difference.

If not, I suggest next to check your mouse if there is any way to make it normal/low resolution. This doesn't have to be the long term solution, but I would like to know if has anything to do with the problem in the first place.
tzuk

BUCKAROO
Posts: 206
Joined: Sun Oct 24, 2010 3:13 am

Post by BUCKAROO » Sat Oct 19, 2013 12:46 pm

Nothing so complicated, tzuk. :)

It's like mouse deltas are not discrete anymore. It has a delta but the bug made it seem cumulative (whether in the negative or positive direction).

Anyway, here's the problem:
SetCursorPos ERROR_ACCESS_DENIED

Image

Code: Select all

/*
"MouseLock" adapted from Torque3D source
x86 & x64 compatible AutoHotkey_L script

AutoHotkey_L => http://l.autohotkey.net/

Save as "MouseLock.ahk" & drop onto exe.
*/

Gui,1:-AlwaysOnTop +Caption +OwnDialogs +Resize 
Gui,1:+LastFound
Global Gui1:=WinExist()
Gui,1:Margin,0,0
Global Gui1_Edit1_hWnd
Gui,1:Add,Edit,R35 W240 HwndGui1_Edit1_hWnd VGui1_Edit1
Gui,1:Show,W640 H480

OnMessage(0x0200,"WM_MOUSEMOVE")

return

~Esc::ExitApp

GuiClose:
GuiEscape:
ExitApp

WM_MOUSEMOVE(wParam,lParam)
{
	; AutoHotkey drops messages without this line.
	; Unfortunately it makes other messages dodgy.
	; Actually, it'll deteriorate after some time.
	Critical,-1
	
	Edit:=""
	
	VarSetCapacity(POINT,8)
	NumPut(cursorX:=lParam&0xFFFF,POINT,0,"Int")
	NumPut(cursorY:=lParam>>16,POINT,4,"Int")
	; subsequent coordinates unaffected by sibling windows
	DllCall("SetCapture","UPtr",Gui1,"UPtr")
	
	VarSetCapacity(RECT,16)
	DllCall("GetClientRect","UPtr",Gui1,"UPtr",&RECT,"Int")
	DllCall("ClientToScreen","UPtr",Gui1,"UPtr",&RECT,"Int")
	DllCall("ClientToScreen","UPtr",Gui1,"UPtr",&RECT+8,"Int")
	RECT_left:=NumGet(RECT,0,"Int"),RECT_top:=NumGet(RECT,4,"Int")
	RECT_right:=NumGet(RECT,8,"Int"),RECT_bottom:=NumGet(RECT,12,"Int")
	DllCall("ClipCursor","UPtr",&RECT,"Int")
	
	;// Convert the incoming client pos into a screen pos, so we can
	;// accurately convert to relative coordinates.
	DllCall("ClientToScreen","UPtr",Gui1,"UPtr",&POINT,"Int")
	mouseX:=NumGet(POINT,0,"Int"),mouseY:=NumGet(POINT,4,"Int")
	
	;// Hide the cursor before it's moved
;	DllCall("ShowCursor","Int",FALSE,"Int")
	
	;// Recenter the mouse if necessary (don't flood the message pump)
	centerX:=(RECT_right+RECT_left)//2,centerY:=(RECT_bottom+RECT_top)//2
	if(mouseX!=centerX||mouseY!=centerY)
	{
		DllCall("SetLastError","UInt",0)
		BOOL:=DllCall("SetCursorPos","Int",centerX,"Int",centerY,"Int")
		Edit.="SetCursorPos() returned " BOOL "`r`n" "GetLastError() returned " A_LastError "`r`n" """" FormatMessage(A_LastError) """" "`r`n"
	}
	
	;// Now we can calculate the position relative to the center we set.
	deltaX:=mouseX-centerX
	deltaY:=mouseY-centerY
	
;do_something_useful_with(deltaX,deltaY)
	
	Text=mouseX=%mouseX% mouseY=%mouseY%`r`ncenterX=%centerX% centerY=%centerY%`r`ndeltaX=%deltaX% deltaY=%deltaY%
	Edit.=Text "`r`n`r`n"
	
	if(deltaX||deltaY)
	{
		PrependEdit(Edit)
	}
	
	ToolTip,%Text%
	
	return 0
}

PrependEdit(ByRef Text)
{
	DllCall("SendMessage","UPtr",Gui1_Edit1_hWnd,"UInt",0x00B1,"UPtr",0,"Ptr",0,"Ptr") ; EM_SETSEL
	DllCall("SendMessage","UPtr",Gui1_Edit1_hWnd,"UInt",0x00C2,"UPtr",FALSE,"Ptr",&Text,"Ptr") ; EM_REPLACESEL
}

FormatMessage(dwMessageId)
{
	static Buffer
	VarSetCapacity(Buffer,nSize:=3000)
	DllCall("FormatMessage","UInt",0x00001000,"UPtr",0,"UInt",dwMessageId,"UInt",0,"Str",Buffer,"UInt",nSize//2,"UPtr",0)
	return RegExReplace(Buffer,"(.*)[`r`n]*$","$1")
}

tzuk
Sandboxie Founder
Sandboxie Founder
Posts: 16076
Joined: Tue Jun 22, 2004 12:57 pm

Post by tzuk » Sun Oct 20, 2013 2:29 am

BUCKAROO wrote:Anyway, here's the problem: SetCursorPos ERROR_ACCESS_DENIED
Interesting! Great job picking up on that.
Let me add support for SetCursorPos API and let's see if it works!
tzuk

tzuk
Sandboxie Founder
Sandboxie Founder
Posts: 16076
Joined: Tue Jun 22, 2004 12:57 pm

Post by tzuk » Sun Oct 20, 2013 3:49 pm

I added support for this API today, and the script now says SetCursorPos() returned 1, both in the sandbox and outside the sandbox.
Hopefully this will have the desired effect on those games where the mouse behaves strange.
I want to get to a few more fixes before I release another beta version, so I will ask for your patience for a few more days.
tzuk

Locked

Who is online

Users browsing this forum: No registered users and 1 guest