From 80bba3bd61d92a8914a82db2188827c85553d1f6 Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Wed, 1 Sep 2004 22:47:48 +0000
Subject: [PATCH] Moved keyboard.c to dlls/user/kbd16.c. Keyboard, mouse and
 display drivers are 16-bit only.

---
 dlls/user/Makefile.in                   |  6 +++---
 windows/keyboard.c => dlls/user/kbd16.c | 24 ++++--------------------
 dlls/user/keyboard.drv.spec             |  2 +-
 dlls/user/message.c                     | 12 ++++++++++++
 dlls/user/{mouse.c => mouse16.c}        |  0
 windows/input.c                         |  9 +++++++++
 6 files changed, 29 insertions(+), 24 deletions(-)
 rename windows/keyboard.c => dlls/user/kbd16.c (91%)
 rename dlls/user/{mouse.c => mouse16.c} (100%)

diff --git a/dlls/user/Makefile.in b/dlls/user/Makefile.in
index c37f2069a39..8053bbf3265 100644
--- a/dlls/user/Makefile.in
+++ b/dlls/user/Makefile.in
@@ -24,7 +24,6 @@ C_SRCS = \
 	$(TOPOBJDIR)/windows/dialog.c \
 	$(TOPOBJDIR)/windows/driver.c \
 	$(TOPOBJDIR)/windows/input.c \
-	$(TOPOBJDIR)/windows/keyboard.c \
 	$(TOPOBJDIR)/windows/mdi.c \
 	$(TOPOBJDIR)/windows/message.c \
 	$(TOPOBJDIR)/windows/msgbox.c \
@@ -53,7 +52,6 @@ C_SRCS = \
 	dde/server.c \
 	desktop.c \
 	dialog16.c \
-	display.c \
 	edit.c \
 	exticon.c \
 	focus.c \
@@ -64,7 +62,6 @@ C_SRCS = \
 	menu.c \
 	message.c \
 	misc.c \
-	mouse.c \
 	msg16.c \
 	painting.c \
 	property.c \
@@ -79,7 +76,10 @@ C_SRCS = \
 C_SRCS16 = \
 	bidi16.c \
 	comm16.c \
+	display.c \
 	hook16.c \
+	kbd16.c \
+	mouse16.c \
 	network.c \
 	user16.c \
 	wnd16.c
diff --git a/windows/keyboard.c b/dlls/user/kbd16.c
similarity index 91%
rename from windows/keyboard.c
rename to dlls/user/kbd16.c
index 976ced0e024..396b29b0c15 100644
--- a/windows/keyboard.c
+++ b/dlls/user/kbd16.c
@@ -31,11 +31,9 @@
 #include "winbase.h"
 #include "wingdi.h"
 #include "winuser.h"
-#include "win.h"
-#include "user.h"
-#include "message.h"
-#include "wine/debug.h"
 #include "winerror.h"
+#include "wine/winuser16.h"
+#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(keyboard);
 
@@ -107,13 +105,10 @@ VOID WINAPI ScreenSwitchEnable16(WORD unused)
 
 /**********************************************************************
  *		OemKeyScan (KEYBOARD.128)
- *		OemKeyScan (USER32.@)
  */
-DWORD WINAPI OemKeyScan(WORD wOemChar)
+DWORD WINAPI OemKeyScan16(WORD wOemChar)
 {
-  TRACE("(%d)\n", wOemChar);
-
-  return wOemChar;
+    return OemKeyScan( wOemChar );
 }
 
 /**********************************************************************
@@ -189,14 +184,3 @@ void WINAPI MessageBeep16( UINT16 i )
 {
     MessageBeep( i );
 }
-
-/***********************************************************************
- *		MessageBeep (USER32.@)
- */
-BOOL WINAPI MessageBeep( UINT i )
-{
-    BOOL active = TRUE;
-    SystemParametersInfoA( SPI_GETBEEP, 0, &active, FALSE );
-    if (active) USER_Driver.pBeep();
-    return TRUE;
-}
diff --git a/dlls/user/keyboard.drv.spec b/dlls/user/keyboard.drv.spec
index 97fea909d0f..b1a9183af29 100644
--- a/dlls/user/keyboard.drv.spec
+++ b/dlls/user/keyboard.drv.spec
@@ -16,7 +16,7 @@
 100	pascal	ScreenSwitchEnable(word) ScreenSwitchEnable16
 #126	pascal	GetTableSeg
 #127	pascal	NewTable
-128 pascal   OemKeyScan(word) OemKeyScan
+128 pascal OemKeyScan(word) OemKeyScan16
 129 pascal -ret16 VkKeyScan(word) VkKeyScan16
 130 pascal -ret16 GetKeyboardType(word) GetKeyboardType16
 131 pascal -ret16 MapVirtualKey(word word) MapVirtualKey16
diff --git a/dlls/user/message.c b/dlls/user/message.c
index 50fc162fe3f..dcc1f2a54fb 100644
--- a/dlls/user/message.c
+++ b/dlls/user/message.c
@@ -2413,6 +2413,18 @@ BOOL WINAPI SetMessageQueue( INT size )
 }
 
 
+/***********************************************************************
+ *		MessageBeep (USER32.@)
+ */
+BOOL WINAPI MessageBeep( UINT i )
+{
+    BOOL active = TRUE;
+    SystemParametersInfoA( SPI_GETBEEP, 0, &active, FALSE );
+    if (active) USER_Driver.pBeep();
+    return TRUE;
+}
+
+
 /**********************************************************************
  *		AttachThreadInput (USER32.@)
  *
diff --git a/dlls/user/mouse.c b/dlls/user/mouse16.c
similarity index 100%
rename from dlls/user/mouse.c
rename to dlls/user/mouse16.c
diff --git a/windows/input.c b/windows/input.c
index 63adb588d44..42617c1d149 100644
--- a/windows/input.c
+++ b/windows/input.c
@@ -689,6 +689,15 @@ WORD WINAPI VkKeyScanExW(WCHAR cChar, HKL dwhkl)
     return -1;
 }
 
+/**********************************************************************
+ *		OemKeyScan (USER32.@)
+ */
+DWORD WINAPI OemKeyScan(WORD wOemChar)
+{
+    TRACE("(%d)\n", wOemChar);
+    return wOemChar;
+}
+
 /******************************************************************************
  *		GetKeyboardType (USER32.@)
  */
-- 
GitLab