Commit f34b735e authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

hidclass.sys: Create separate parent FDO and child PDO objects.

parent 902696de
...@@ -37,28 +37,47 @@ ...@@ -37,28 +37,47 @@
/* Ring buffer functions */ /* Ring buffer functions */
struct ReportRingBuffer; struct ReportRingBuffer;
typedef struct _BASE_DEVICE_EXTENSION { typedef struct _BASE_DEVICE_EXTENSION
HID_DEVICE_EXTENSION deviceExtension; {
union
{
struct
{
/* this must be the first member */
HID_DEVICE_EXTENSION hid_ext;
HID_COLLECTION_INFORMATION information; DEVICE_OBJECT *child_pdo;
WINE_HIDP_PREPARSED_DATA *preparseData; } fdo;
ULONG poll_interval; struct
UNICODE_STRING link_name; {
WCHAR device_id[MAX_DEVICE_ID_LEN]; DEVICE_OBJECT *parent_fdo;
WCHAR instance_id[MAX_DEVICE_ID_LEN];
struct ReportRingBuffer *ring_buffer; HID_COLLECTION_INFORMATION information;
HANDLE halt_event; WINE_HIDP_PREPARSED_DATA *preparsed_data;
HANDLE thread;
UINT32 rawinput_handle; ULONG poll_interval;
struct ReportRingBuffer *ring_buffer;
HANDLE halt_event;
HANDLE thread;
UINT32 rawinput_handle;
KSPIN_LOCK irp_queue_lock; UNICODE_STRING link_name;
LIST_ENTRY irp_queue;
BOOL is_mouse; KSPIN_LOCK irp_queue_lock;
UNICODE_STRING mouse_link_name; LIST_ENTRY irp_queue;
/* Minidriver Specific stuff will end up here */ BOOL is_mouse;
UNICODE_STRING mouse_link_name;
} pdo;
} u;
/* These are unique to the parent FDO, but stored in the children as well
* for convenience. */
WCHAR device_id[MAX_DEVICE_ID_LEN];
WCHAR instance_id[MAX_DEVICE_ID_LEN];
BOOL is_fdo;
} BASE_DEVICE_EXTENSION; } BASE_DEVICE_EXTENSION;
void RingBuffer_Write(struct ReportRingBuffer *buffer, void *data) DECLSPEC_HIDDEN; void RingBuffer_Write(struct ReportRingBuffer *buffer, void *data) DECLSPEC_HIDDEN;
...@@ -87,16 +106,16 @@ typedef struct _minidriver ...@@ -87,16 +106,16 @@ typedef struct _minidriver
NTSTATUS call_minidriver(ULONG code, DEVICE_OBJECT *device, void *in_buff, ULONG in_size, void *out_buff, ULONG out_size) DECLSPEC_HIDDEN; NTSTATUS call_minidriver(ULONG code, DEVICE_OBJECT *device, void *in_buff, ULONG in_size, void *out_buff, ULONG out_size) DECLSPEC_HIDDEN;
/* Internal device functions */ /* Internal device functions */
NTSTATUS HID_CreateDevice(DEVICE_OBJECT *native_device, HID_MINIDRIVER_REGISTRATION *driver, DEVICE_OBJECT **device) DECLSPEC_HIDDEN;
NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device) DECLSPEC_HIDDEN; NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device) DECLSPEC_HIDDEN;
void HID_DeleteDevice(DEVICE_OBJECT *device) DECLSPEC_HIDDEN;
void HID_StartDeviceThread(DEVICE_OBJECT *device) DECLSPEC_HIDDEN; void HID_StartDeviceThread(DEVICE_OBJECT *device) DECLSPEC_HIDDEN;
NTSTATUS WINAPI HID_Device_ioctl(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN; IRP *pop_irp_from_queue(BASE_DEVICE_EXTENSION *ext) DECLSPEC_HIDDEN;
NTSTATUS WINAPI HID_Device_read(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN;
NTSTATUS WINAPI HID_Device_write(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN; NTSTATUS WINAPI pdo_ioctl(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN;
NTSTATUS WINAPI HID_Device_create(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN; NTSTATUS WINAPI pdo_read(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN;
NTSTATUS WINAPI HID_Device_close(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN; NTSTATUS WINAPI pdo_write(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN;
NTSTATUS WINAPI pdo_create(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN;
NTSTATUS WINAPI pdo_close(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN;
/* Parsing HID Report Descriptors into preparsed data */ /* Parsing HID Report Descriptors into preparsed data */
WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) DECLSPEC_HIDDEN; WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) DECLSPEC_HIDDEN;
...@@ -217,7 +217,7 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *f ...@@ -217,7 +217,7 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *f
ok(!!ext->PhysicalDeviceObject, "expected non-NULL pdo\n"); ok(!!ext->PhysicalDeviceObject, "expected non-NULL pdo\n");
todo_wine ok(ext->NextDeviceObject == ext->PhysicalDeviceObject, "got pdo %p, next %p\n", todo_wine ok(ext->NextDeviceObject == ext->PhysicalDeviceObject, "got pdo %p, next %p\n",
ext->PhysicalDeviceObject, ext->NextDeviceObject); ext->PhysicalDeviceObject, ext->NextDeviceObject);
ok(ext->NextDeviceObject->AttachedDevice == fdo, "wrong attached device\n"); todo_wine ok(ext->NextDeviceObject->AttachedDevice == fdo, "wrong attached device\n");
ret = IoRegisterDeviceInterface(ext->PhysicalDeviceObject, &control_class, NULL, &control_symlink); ret = IoRegisterDeviceInterface(ext->PhysicalDeviceObject, &control_class, NULL, &control_symlink);
ok(!ret, "got %#x\n", ret); ok(!ret, "got %#x\n", ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment