DInput patch

Lionel Ulmer lionel.ulmer at free.fr
Mon Aug 5 05:52:31 CDT 2002


Hi all,

Some dumb game seems to forgot to acquire the Keyboard (but does so when we
return an error saying 'not acquired' on first try). So I added some TRACEs
to help debugging and the acquire-status checking.

This fixes bug 941. By the way, could I have more 'bugzilla' power, I hate
not being able to move bugs out of Unconfirmed state or to not being able to
close them (/me thinks that all Wine developpers should have these rights).

Changelog:
  Handle 'not acquired' error messages on keyboard GetDeviceData.

-- 
		 Lionel Ulmer - http://www.bbrox.org/
-------------- next part --------------
? dlls/dinput/PATCH_DINPUT
Index: dlls/dinput/keyboard/main.c
===================================================================
RCS file: /home/wine/wine/dlls/dinput/keyboard/main.c,v
retrieving revision 1.16
diff -u -r1.16 main.c
--- dlls/dinput/keyboard/main.c	22 Jul 2002 21:53:32 -0000	1.16
+++ dlls/dinput/keyboard/main.c	5 Aug 2002 10:49:12 -0000
@@ -78,6 +78,8 @@
 
 LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam )
 {
+  TRACE("(%d,%d,%ld)\n", code, wparam, lparam);
+
   if (code == HC_ACTION)
     {
       BYTE dik_code;
@@ -112,6 +114,9 @@
               current->buffer[n].dwTimeStamp = timestamp;
               current->buffer[n].dwSequence = current->dinput->evsequence++;
 
+	      TRACE("Adding event at offset %d : %ld - %ld - %ld - %ld\n", n,
+		    current->buffer[n].dwOfs, current->buffer[n].dwData, current->buffer[n].dwTimeStamp, current->buffer[n].dwSequence);
+	      
               if (current->count == current->buffersize)
                 {
                   current->start++;
@@ -246,6 +251,9 @@
 	TRACE("(this=%p,%ld,%p,%p(%ld)),0x%08lx)\n",
 	      This,dodsize,dod,entries,entries?*entries:0,flags);
 
+	if (This->acquired == 0)
+	  return DIERR_NOTACQUIRED;
+	
         if (This->buffer == NULL)
           return DIERR_NOTBUFFERED;
 
@@ -285,6 +293,8 @@
 
         LeaveCriticalSection(&(This->crit));
 
+	TRACE("Returning %ld events queued\n", *entries);
+	
         return ret;
 }
 


More information about the wine-patches mailing list