[CMAKE]
[reactos.git] / subsystems / win32 / win32k / ntuser / keyboard.c
index 70e9054..49a6545 100644 (file)
@@ -58,7 +58,10 @@ BYTE gQueueKeyStateTable[256];
 /* FUNCTIONS *****************************************************************/
 
 /* Initialization -- Right now, just zero the key state and init the lock */
-NTSTATUS FASTCALL InitKeyboardImpl(VOID)
+INIT_FUNCTION
+NTSTATUS
+NTAPI
+InitKeyboardImpl(VOID)
 {
    RtlZeroMemory(&gQueueKeyStateTable,0x100);
    return STATUS_SUCCESS;
@@ -430,7 +433,6 @@ IntTranslateKbdMessage(LPMSG lpMsg,
    MSG NewMsg = { 0 };
    PKBDTABLES keyLayout;
    BOOL Result = FALSE;
-   DWORD ScanCode = 0;
 
    pti = PsGetCurrentThreadWin32Thread();
    keyLayout = pti->KeyboardLayout->KBTables;
@@ -456,8 +458,6 @@ IntTranslateKbdMessage(LPMSG lpMsg,
         return TRUE;
     }
 
-   ScanCode = (lpMsg->lParam >> 16) & 0xff;
-
    UState = ToUnicodeInner(lpMsg->wParam, HIWORD(lpMsg->lParam) & 0xff,
                            gQueueKeyStateTable, wp, 2, 0,
                            keyLayout );
@@ -944,6 +944,12 @@ W32kKeyProcessMessage(LPMSG Msg,
          VscVkTable = KeyboardLayout->pVSCtoVK_E1;
       }
 
+      if (!VscVkTable)
+      {
+          DPRINT1("somethings wrong, Prefix=0x%x", Prefix);
+          return;
+      }
+
       RawVk = 0xff;
       while (VscVkTable->Vsc)
       {