Commit in reactos/subsys/win32k/ntuser on MAIN
accelerator.c+14-131.10 -> 1.11
- Check for a valid hwnd.
- passing Key Up messages  as a parameter always returns 0;
- WM_SYSCHAR IS used however.
- Get rid of an odd debug print message.
- Changed the Window parameter name to hWnd.

reactos/subsys/win32k/ntuser
accelerator.c 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- accelerator.c	10 May 2004 17:07:18 -0000	1.10
+++ accelerator.c	13 Nov 2004 01:52:56 -0000	1.11
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: accelerator.c,v 1.10 2004/05/10 17:07:18 weiden Exp $
+/* $Id: accelerator.c,v 1.11 2004/11/13 01:52:56 rcampbell Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -435,7 +435,7 @@
 int
 STDCALL
 NtUserTranslateAccelerator(
-  HWND Window,
+  HWND hWnd,
   HACCEL Table,
   LPMSG Message)
 {
@@ -444,8 +444,11 @@
   NTSTATUS Status;
   ULONG i;
 
-  DPRINT("NtUserTranslateAccelerator(Window %x, Table %x, Message %p)\n",
-    Window, Table, Message);
+  DPRINT("NtUserTranslateAccelerator(hWnd %x, Table %x, Message %p)\n",
+    hWnd, Table, Message);
+
+  if (hWnd == NULL)
+	 return 0;
 
   if (Message == NULL)
     {
@@ -462,12 +465,10 @@
     }
 
   if ((Message->message != WM_KEYDOWN) &&
-	  (Message->message != WM_KEYUP) &&
 	  (Message->message != WM_SYSKEYDOWN) &&
-	  (Message->message != WM_SYSKEYUP) &&
+	  (Message->message != WM_SYSCHAR) &&
 	  (Message->message != WM_CHAR))
   {
-    DPRINT1("E0c\n");
     return 0;
   }
 
@@ -496,17 +497,17 @@
 
   /* FIXME: Associate AcceleratorTable with the current thread */
 
-  /* FIXME: If Window is active and no window has focus, translate WM_SYSKEYUP and WM_SYSKEY_DOWN instead */
+  /* FIXME: If hWnd is active and no hWnd has focus, translate WM_SYSKEYUP and WM_SYSKEY_DOWN instead */
 
   for (i = 0; i < AcceleratorTable->Count; i++)
     {
-      if (IntTranslateAccelerator(Window, Message->message, Message->wParam, Message->lParam,
+      if (IntTranslateAccelerator(hWnd, Message->message, Message->wParam, Message->lParam,
 		  AcceleratorTable->Table[i].fVirt, AcceleratorTable->Table[i].key,
 		  AcceleratorTable->Table[i].cmd))
         {
           ObDereferenceObject(WindowStation);
-          DPRINT("NtUserTranslateAccelerator(Window %x, Table %x, Message %p) = %i end\n",
-                 Window, Table, Message, 1);
+          DPRINT("NtUserTranslateAccelerator(hWnd %x, Table %x, Message %p) = %i end\n",
+                 hWnd, Table, Message, 1);
           return 1;
         }
       if (((AcceleratorTable->Table[i].fVirt & 0x80) > 0))
@@ -517,8 +518,8 @@
 
   ObDereferenceObject(WindowStation);
 
-  DPRINT("NtUserTranslateAccelerator(Window %x, Table %x, Message %p) = %i end\n",
-    Window, Table, Message, 0);
+  DPRINT("NtUserTranslateAccelerator(hWnd %x, Table %x, Message %p) = %i end\n",
+    hWnd, Table, Message, 0);
 
   return 0;
 }
CVSspam 0.2.8