hidclass.sys: Create a mouse device interface for HID mouse devices.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
37d51cd157
commit
b84334d2bd
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
#include "initguid.h"
|
#include "initguid.h"
|
||||||
#include "devguid.h"
|
#include "devguid.h"
|
||||||
|
#include "ntddmou.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(hid);
|
WINE_DEFAULT_DEBUG_CHANNEL(hid);
|
||||||
WINE_DECLARE_DEBUG_CHANNEL(hid_report);
|
WINE_DECLARE_DEBUG_CHANNEL(hid_report);
|
||||||
|
@ -122,6 +123,14 @@ NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: This should probably be done in mouhid.sys. */
|
||||||
|
if (ext->preparseData->caps.UsagePage == HID_USAGE_PAGE_GENERIC
|
||||||
|
&& ext->preparseData->caps.Usage == HID_USAGE_GENERIC_MOUSE)
|
||||||
|
{
|
||||||
|
if (!IoRegisterDeviceInterface(device, &GUID_DEVINTERFACE_MOUSE, NULL, &ext->mouse_link_name))
|
||||||
|
ext->is_mouse = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
|
|
@ -55,6 +55,9 @@ typedef struct _BASE_DEVICE_EXTENSION {
|
||||||
KSPIN_LOCK irp_queue_lock;
|
KSPIN_LOCK irp_queue_lock;
|
||||||
LIST_ENTRY irp_queue;
|
LIST_ENTRY irp_queue;
|
||||||
|
|
||||||
|
BOOL is_mouse;
|
||||||
|
UNICODE_STRING mouse_link_name;
|
||||||
|
|
||||||
/* Minidriver Specific stuff will end up here */
|
/* Minidriver Specific stuff will end up here */
|
||||||
} BASE_DEVICE_EXTENSION;
|
} BASE_DEVICE_EXTENSION;
|
||||||
|
|
||||||
|
|
|
@ -215,6 +215,9 @@ NTSTATUS PNP_RemoveDevice(minidriver *minidriver, DEVICE_OBJECT *device, IRP *ir
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ext->is_mouse)
|
||||||
|
IoSetDeviceInterfaceState(&ext->mouse_link_name, FALSE);
|
||||||
|
|
||||||
if (irp)
|
if (irp)
|
||||||
rc = minidriver->PNPDispatch(device, irp);
|
rc = minidriver->PNPDispatch(device, irp);
|
||||||
HID_DeleteDevice(device);
|
HID_DeleteDevice(device);
|
||||||
|
@ -294,6 +297,8 @@ NTSTATUS WINAPI HID_PNP_Dispatch(DEVICE_OBJECT *device, IRP *irp)
|
||||||
rc = minidriver->PNPDispatch(device, irp);
|
rc = minidriver->PNPDispatch(device, irp);
|
||||||
|
|
||||||
IoSetDeviceInterfaceState(&ext->link_name, TRUE);
|
IoSetDeviceInterfaceState(&ext->link_name, TRUE);
|
||||||
|
if (ext->is_mouse)
|
||||||
|
IoSetDeviceInterfaceState(&ext->mouse_link_name, TRUE);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
case IRP_MN_REMOVE_DEVICE:
|
case IRP_MN_REMOVE_DEVICE:
|
||||||
|
|
Loading…
Reference in New Issue