Created pnpmgr_cleanup branch. The purpose of this branch is to do
overall cleanup of the kernel mode part of PnP manager (particulary the
device tree functions) and address some long-standing bugs like #262.
Added: branches/pnpmgr_cleanup/reactos/
_____
Copied: branches/pnpmgr_cleanup/reactos (from rev 14331, trunk/reactos)
Fix a small bug I introdues and fix a old bug for tribes
Modified: trunk/reactos/lib/dinput/mouse.c
_____
Modified: trunk/reactos/lib/dinput/mouse.c
--- trunk/reactos/lib/dinput/mouse.c 2005-03-26 11:16:14 UTC (rev
14329)
+++ trunk/reactos/lib/dinput/mouse.c 2005-03-26 11:58:43 UTC (rev
14330)
@@ -898,17 +898,19 @@
if (This->acquired == 0) {
WARN(" application tries to get data from an unacquired device
!\n");
- return DIERR_NOTACQUIRED;
+ //return DIERR_NOTACQUIRED;
// windows does not get any data if
// we do not call manual to mouse Acquire
// this is only need if some apps calling on getdevice data
direcly
// in windows GetdeviceData does always update first the data
// then return it.
- // SysMouseAImpl_Acquire(iface);
- // we are reading the mouse before we reache here.
- // we do not need call on SysMouseAImpl_Acquire
- // for now.
+ if (last_event==0)
+ {
+ This->absolute = 0;
+ SysMouseAImpl_Acquire(iface);
+ FIXME("This make the mouse choppy in Tribes , need new center
code for calcuation of the mouse !!!!!!!!\n");
+ }
}
@@ -926,9 +928,7 @@
if (This->data_queue==NULL) {
WARN("No buffer have been set up !\n");
return DIERR_NOTINITIALIZED;
- }
-
- FIXME("This is broken in Tribes ??, need right implant of the
buffer!!!!!!!!\n");
+ }
if (GetTickCount()-time <50) {
*entries=0;
Fix some bugs for Tirbes in GetDeivceData
remove to call for geting mouse data. That
are not need it. rest are bugs fix for Tirbes.
Left Todo
The mouse are bit choppy. The mouse area you
can move the mouse are not being set up right.
Modified: trunk/reactos/lib/dinput/mouse.c
_____
Modified: trunk/reactos/lib/dinput/mouse.c
--- trunk/reactos/lib/dinput/mouse.c 2005-03-26 00:10:34 UTC (rev
14326)
+++ trunk/reactos/lib/dinput/mouse.c 2005-03-26 09:38:23 UTC (rev
14327)
@@ -880,7 +880,6 @@
if (flags != DIGDD_PEEK)
{
-getmousesvalue(iface);
b[0] = ((GetKeyState(VK_LBUTTON) & 0x80) ? 0xFF : 0x00);
b[1] = ((GetKeyState(VK_RBUTTON) & 0x80) ? 0xFF : 0x00);
b[2] = ((GetKeyState(VK_MBUTTON) & 0x80) ? 0xFF : 0x00);
@@ -899,14 +898,17 @@
if (This->acquired == 0) {
WARN(" application tries to get data from an unacquired device
!\n");
- //return DIERR_NOTACQUIRED;
+ return DIERR_NOTACQUIRED;
// windows does not get any data if
// we do not call manual to mouse Acquire
// this is only need if some apps calling on getdevice data
direcly
// in windows GetdeviceData does always update first the data
// then return it.
- SysMouseAImpl_Acquire(iface);
+ // SysMouseAImpl_Acquire(iface);
+ // we are reading the mouse before we reache here.
+ // we do not need call on SysMouseAImpl_Acquire
+ // for now.
}
always wake waiting threads when releasing the last recursion
Modified: trunk/reactos/lib/ntdll/rtl/critical.c
_____
Modified: trunk/reactos/lib/ntdll/rtl/critical.c
--- trunk/reactos/lib/ntdll/rtl/critical.c 2005-03-25 23:23:35 UTC
(rev 14325)
+++ trunk/reactos/lib/ntdll/rtl/critical.c 2005-03-26 00:10:34 UTC
(rev 14326)
@@ -136,7 +136,7 @@
HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread;
/* Try to Lock it */
- if (InterlockedIncrement(&CriticalSection->LockCount)) {
+ if (InterlockedIncrement(&CriticalSection->LockCount) != 0) {
/*
* We've failed to lock it! Does this thread
@@ -332,12 +332,10 @@
CriticalSection->OwningThread = 0;
/* Was someone wanting us? This needs to be done atomically. */
- if (InterlockedDecrement(&CriticalSection->LockCount) >= 0) {
+ InterlockedDecrement(&CriticalSection->LockCount);
- /* Let him have us */
- RtlpUnWaitCriticalSection(CriticalSection);
-
- }
+ /* Let him have us */
+ RtlpUnWaitCriticalSection(CriticalSection);
}
/* Sucessful! */