hidclass.sys: Register GUID_DEVINTERFACE_KEYBOARD interface.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-04-22 21:26:51 +02:00 committed by Alexandre Julliard
parent bcc24d69da
commit 8e4d668e34
3 changed files with 14 additions and 0 deletions

View File

@ -32,6 +32,7 @@
#include "ddk/wdm.h"
#include "devguid.h"
#include "ntddmou.h"
#include "ntddkbd.h"
WINE_DEFAULT_DEBUG_CHANNEL(hid);
WINE_DECLARE_DEBUG_CHANNEL(hid_report);

View File

@ -69,6 +69,8 @@ typedef struct _BASE_DEVICE_EXTENSION
BOOL is_mouse;
UNICODE_STRING mouse_link_name;
BOOL is_keyboard;
UNICODE_STRING keyboard_link_name;
} pdo;
} u;

View File

@ -23,6 +23,7 @@
#include <stdarg.h>
#include "hid.h"
#include "ntddmou.h"
#include "ntddkbd.h"
#include "ddk/hidtypes.h"
#include "ddk/wdm.h"
#include "regstr.h"
@ -399,10 +400,18 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device, IRP *irp)
if (!IoRegisterDeviceInterface(device, &GUID_DEVINTERFACE_MOUSE, NULL, &ext->u.pdo.mouse_link_name))
ext->u.pdo.is_mouse = TRUE;
}
if (ext->u.pdo.preparsed_data->caps.UsagePage == HID_USAGE_PAGE_GENERIC
&& ext->u.pdo.preparsed_data->caps.Usage == HID_USAGE_GENERIC_KEYBOARD)
{
if (!IoRegisterDeviceInterface(device, &GUID_DEVINTERFACE_KEYBOARD, NULL, &ext->u.pdo.keyboard_link_name))
ext->u.pdo.is_keyboard = TRUE;
}
IoSetDeviceInterfaceState(&ext->u.pdo.link_name, TRUE);
if (ext->u.pdo.is_mouse)
IoSetDeviceInterfaceState(&ext->u.pdo.mouse_link_name, TRUE);
if (ext->u.pdo.is_keyboard)
IoSetDeviceInterfaceState(&ext->u.pdo.keyboard_link_name, TRUE);
status = STATUS_SUCCESS;
break;
@ -413,6 +422,8 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device, IRP *irp)
IoSetDeviceInterfaceState(&ext->u.pdo.link_name, FALSE);
if (ext->u.pdo.is_mouse)
IoSetDeviceInterfaceState(&ext->u.pdo.mouse_link_name, FALSE);
if (ext->u.pdo.is_keyboard)
IoSetDeviceInterfaceState(&ext->u.pdo.keyboard_link_name, TRUE);
if (ext->u.pdo.thread)
{