[1/2] winehid.sys: Add HID minidriver. (v2)

Sebastian Lackner sebastian at fds-team.de
Wed Oct 12 10:46:13 CDT 2016


From: Aric Stewart <aricstewart at gmail.com>

Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---

Changes in v2:
* Avoid unnecessary ntoskrnl import.
* Remove unnecessary NONAMELESSUNION define.
* Change debug channel to "hid". I don't think we really need
  a separate one just for two or three functions related to HID handling.
* Actually TRACE both arguments passed to DriverEntry.
* Return STATUS_SUCCESS (otherwise the driver fails loading).
* Rename service name "WineHIDMinidriver" -> "WineHID".

 MAINTAINERS                       |    1 +
 configure.ac                      |    1 +
 dlls/winehid.sys/Makefile.in      |    5 +++++
 dlls/winehid.sys/main.c           |   38 ++++++++++++++++++++++++++++++++++++++
 dlls/winehid.sys/winehid.sys.spec |    1 +
 loader/wine.inf.in                |   14 ++++++++++++++
 6 files changed, 60 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4a7191c..55a7834 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -122,6 +122,7 @@ HID support
 M:	Aric Stewart <aric at codeweavers.com>
 F:	dlls/hid/
 F:	dlls/hidclass.sys/
+F:	dlls/winehid.sys/
 
 HTML rendering (Gecko)
 M:	Jacek Caban <jacek at codeweavers.com>
diff --git a/configure.ac b/configure.ac
index 78c5a02..964c593 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3425,6 +3425,7 @@ WINE_CONFIG_DLL(winecoreaudio.drv)
 WINE_CONFIG_LIB(winecrt0)
 WINE_CONFIG_DLL(wined3d,,[implib])
 WINE_CONFIG_DLL(winegstreamer)
+WINE_CONFIG_DLL(winehid.sys)
 WINE_CONFIG_DLL(winejoystick.drv)
 WINE_CONFIG_DLL(winemac.drv,,[clean])
 WINE_CONFIG_DLL(winemapi)
diff --git a/dlls/winehid.sys/Makefile.in b/dlls/winehid.sys/Makefile.in
new file mode 100644
index 0000000..d4ca3dd
--- /dev/null
+++ b/dlls/winehid.sys/Makefile.in
@@ -0,0 +1,5 @@
+MODULE    = winehid.sys
+EXTRADLLFLAGS = -Wb,--subsystem,native
+
+C_SRCS = \
+	main.c
diff --git a/dlls/winehid.sys/main.c b/dlls/winehid.sys/main.c
new file mode 100644
index 0000000..7ab9267
--- /dev/null
+++ b/dlls/winehid.sys/main.c
@@ -0,0 +1,38 @@
+/*
+ * WINE Hid minidriver
+ *
+ * Copyright 2016 Aric Stewart
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "winternl.h"
+#include "ddk/wdm.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(hid);
+
+NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *path)
+{
+    TRACE("(%p, %s)\n", driver, debugstr_w(path->Buffer));
+
+    return STATUS_SUCCESS;
+}
diff --git a/dlls/winehid.sys/winehid.sys.spec b/dlls/winehid.sys/winehid.sys.spec
new file mode 100644
index 0000000..76421d7
--- /dev/null
+++ b/dlls/winehid.sys/winehid.sys.spec
@@ -0,0 +1 @@
+# nothing to export
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index a92a9fe..fcf9c4a 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -131,6 +131,7 @@ AddService=LanmanServer,0,LanmanServerService
 AddService=FontCache,0,FontCacheService
 AddService=Schedule,0,TaskSchedulerService
 AddService=WineBus,0,WineBusService
+AddService=WineHID,0,WineHIDService
 
 [DefaultInstall.NT.Services]
 AddService=BITS,0,BITSService
@@ -146,6 +147,7 @@ AddService=LanmanServer,0,LanmanServerService
 AddService=FontCache,0,FontCacheService
 AddService=Schedule,0,TaskSchedulerService
 AddService=WineBus,0,WineBusService
+AddService=WineHID,0,WineHIDService
 
 [DefaultInstall.ntamd64.Services]
 AddService=BITS,0,BITSService
@@ -161,6 +163,7 @@ AddService=LanmanServer,0,LanmanServerService
 AddService=FontCache,0,FontCacheService
 AddService=Schedule,0,TaskSchedulerService
 AddService=WineBus,0,WineBusService
+AddService=WineHID,0,WineHIDService
 
 [Strings]
 MciExtStr="Software\Microsoft\Windows NT\CurrentVersion\MCI Extensions"
@@ -2530,6 +2533,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
 12,,ndis.sys,-
 12,,tdi.sys,-
 12,,winebus.sys,-
+12,,winehid.sys,-
 ; skip .NET fake dlls in Wine Mono package
 11,,aspnet_regiis.exe,-
 11,,ngen.exe,-
@@ -2573,6 +2577,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
 12,,ndis.sys
 12,,tdi.sys
 12,,winebus.sys
+12,,winehid.sys
 ; skip .NET fake dlls in Wine Mono package
 11,,aspnet_regiis.exe,-
 11,,ngen.exe,-
@@ -3198,6 +3203,15 @@ ServiceType=1
 StartType=3
 ErrorControl=1
 
+[WineHIDService]
+Description="Wine HID Minidriver"
+DisplayName="Wine HID"
+ServiceBinary="%12%\winehid.sys"
+LoadOrderGroup="WinePlugPlay"
+ServiceType=1
+StartType=3
+ErrorControl=1
+
 [SpoolerService]
 Description="Loads files to memory for later printing"
 DisplayName="Print Spooler"
-- 
2.9.0



More information about the wine-patches mailing list