Patch: keyboard accelerator bug

jeff-lists at tanner.com jeff-lists at tanner.com
Tue Nov 25 19:37:19 CST 2003


Changelog: Change keyboard accelerator behavior to resolve bugs in some apps

Description:
The 0x80 bit in the accelerator table entry field fVirt is used by Wine to mark
the end of the table.  Some windows apps send entries with this bit set before 
the end of the table, and this patch unsets that bit.  The symptom of this bug 
is that the application will have some, but not all of its accelerator keys 
work.

Jeff Miller
Tanner Research
jeff-lists at tanner.com
-------------- next part --------------
--- wine-20030813/dlls/user/resource.c.orig	2002-12-02 10:10:58.000000000 -0800
+++ wine-20030813/dlls/user/resource.c	2003-08-14 12:06:37.000000000 -0700
@@ -226,14 +226,17 @@
   }
   accel = GlobalLock16(HACCEL_16(hAccel));
   for (i=0;i<cEntries;i++) {
-  	accel[i].fVirt = lpaccel[i].fVirt;
+      if( ((lpaccel[i].fVirt & 0x80) > 0) && (cEntries - 1 > i) ){
+        WARN_(accel)("Application sent fVirt 0x80 bit before end of table.\n");
+      }
+      accel[i].fVirt = lpaccel[i].fVirt & 0xFF7F;
   	accel[i].key = lpaccel[i].key;
   	accel[i].cmd = lpaccel[i].cmd;
   }
   /* Set the end-of-table terminator. */
   accel[cEntries-1].fVirt |= 0x80;
 
-  TRACE_(accel)("Allocated accelerator handle %p\n", hAccel);
+  TRACE_(accel)("Allocated accelerator handle %p with %d entries\n", hAccel,cEntries);
   return hAccel;
 }
 


More information about the wine-patches mailing list