winehid.sys: Register as a HID minidriver.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Aric Stewart 2016-10-12 17:46:17 +02:00 committed by Alexandre Julliard
parent 769cc264e0
commit 45b651e213
2 changed files with 21 additions and 3 deletions

View File

@ -1,4 +1,5 @@
MODULE = winehid.sys
IMPORTS = hidclass
EXTRADLLFLAGS = -Wb,--subsystem,native
C_SRCS = \

View File

@ -26,13 +26,30 @@
#include "winbase.h"
#include "winternl.h"
#include "ddk/wdm.h"
#include "ddk/hidport.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(hid);
NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *path)
static NTSTATUS WINAPI add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *device)
{
TRACE("(%p, %s)\n", driver, debugstr_w(path->Buffer));
TRACE("(%p, %p)\n", driver, device);
return STATUS_SUCCESS;
}
NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *path)
{
HID_MINIDRIVER_REGISTRATION registration;
TRACE("(%p, %s)\n", driver, debugstr_w(path->Buffer));
driver->DriverExtension->AddDevice = add_device;
memset(&registration, 0, sizeof(registration));
registration.DriverObject = driver;
registration.RegistryPath = path;
registration.DeviceExtensionSize = sizeof(HID_DEVICE_EXTENSION);
registration.DevicesArePolled = FALSE;
return HidRegisterMinidriver(&registration);
}