Agent crashes when sending article

Rein Klazes rklazes at xs4all.nl
Wed May 28 05:06:45 CDT 2003


On Fri, 23 May 2003 23:38:44 +0200, you wrote:

>   45 0x4081a6e8 (CallWindowProcA+0x88(func=0x413b0db8, hwnd=0x1003e,
> msg=0x105, wParam=0x12, lParam=0xc0380001) [winproc.c:2854] in user32.dll.so)
> (ebp=406b2904)
>   46 0x407fc1da (DispatchMessageA+0x12a(msg=0x406b2980) [message.c:794] in
> user32.dll.so) (ebp=406b2948)

Agent dies when handling a WM_SYSKEYUP message for the release of the
ALT key. 
I checked under real windows. There this message is not sent, but a
WM_KEYUP message instead.

The attached patch corrects the behaviour to what I see under Windows. 

Please give it a try.

Rein. 
-- 
Rein Klazes
rklazes at xs4all.nl
-------------- next part --------------
--- wine/windows/input.c	2003-05-11 08:27:59.000000000 +0200
+++ mywine/windows/input.c	2003-05-28 11:39:03.000000000 +0200
@@ -54,6 +54,7 @@
 
 BYTE InputKeyStateTable[256];
 BYTE AsyncKeyStateTable[256];
+BYTE SysCharacter = 0;
 
 /* Storage for the USER-maintained mouse positions */
 static DWORD PosX, PosY;
@@ -151,8 +152,12 @@
 
     if (ki->dwFlags & KEYEVENTF_KEYUP )
     {
-        BOOL sysKey = (InputKeyStateTable[VK_MENU] & 0x80) &&
-                      !(InputKeyStateTable[VK_CONTROL] & 0x80);
+        BOOL sysKey = FALSE;
+        if( (InputKeyStateTable[VK_MENU] & 0x80) && !(InputKeyStateTable[VK_CONTROL] & 0x80)) {
+            if(  SysCharacter == VK_MENU || (ki->wVk != VK_MENU))
+                sysKey = TRUE;
+                SysCharacter = 0; 
+        }
         InputKeyStateTable[ki->wVk] &= ~0x80;
         keylp.lp1.previous = 1;
         keylp.lp1.transition = 1;
@@ -166,8 +171,13 @@
         InputKeyStateTable[ki->wVk] |= 0x80;
         AsyncKeyStateTable[ki->wVk] |= 0x80;
 
-        message = (InputKeyStateTable[VK_MENU] & 0x80) && !(InputKeyStateTable[VK_CONTROL] & 0x80)
-              ? WM_SYSKEYDOWN : WM_KEYDOWN;
+        if( (InputKeyStateTable[VK_MENU] & 0x80) && !(InputKeyStateTable[VK_CONTROL] & 0x80)) {
+            message = WM_SYSKEYDOWN;
+            SysCharacter = ki->wVk;
+        } else {
+            message = WM_KEYDOWN;
+            /* SysCharacter = 0; */
+        }
     }
 
     keylp.lp1.context = (InputKeyStateTable[VK_MENU] & 0x80) != 0; /* 1 if alt */


More information about the wine-devel mailing list