winebus.sys: Return an event from IOHID bus wait on device creation.

Instead of calling bus_create_hid_device.

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-09-06 09:17:33 +02:00 committed by Alexandre Julliard
parent f7be0f5edf
commit 83f0de4487
3 changed files with 5 additions and 13 deletions

View File

@ -30,7 +30,6 @@
struct unix_device *get_unix_device(DEVICE_OBJECT *device) DECLSPEC_HIDDEN;
/* HID Plug and Play Bus */
DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, struct unix_device *unix_device) DECLSPEC_HIDDEN;
DEVICE_OBJECT *bus_find_hid_device(const WCHAR *bus_id, void *platform_dev) DECLSPEC_HIDDEN;
void process_hid_report(DEVICE_OBJECT *device, BYTE *report, DWORD length) DECLSPEC_HIDDEN;
@ -38,4 +37,3 @@ void process_hid_report(DEVICE_OBJECT *device, BYTE *report, DWORD length) DECLS
BOOL is_xbox_gamepad(WORD vid, WORD pid) DECLSPEC_HIDDEN;
extern HANDLE driver_key DECLSPEC_HIDDEN;
extern DEVICE_OBJECT *bus_pdo DECLSPEC_HIDDEN;

View File

@ -297,7 +297,6 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *
.serial = {'0','0','0','0',0},
};
struct platform_private *private;
DEVICE_OBJECT *device;
CFStringRef str = NULL;
desc.vid = CFNumberToDWORD(IOHIDDeviceGetProperty(IOHIDDevice, CFSTR(kIOHIDVendorIDKey)));
@ -364,15 +363,10 @@ static void handle_DeviceMatchingCallback(void *context, IOReturn result, void *
if (!(private = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct platform_private))))
return;
private->unix_device.vtbl = &iohid_device_vtbl;
private->device = IOHIDDevice;
private->buffer = NULL;
device = bus_create_hid_device(&desc, &private->unix_device);
if (!device) HeapFree(GetProcessHeap(), 0, private);
else
{
private->device = IOHIDDevice;
private->buffer = NULL;
IoInvalidateDeviceRelations(bus_pdo, BusRelations);
}
bus_event_queue_device_created(&event_queue, &private->unix_device, &desc);
}
static void handle_RemovalCallback(void *context, IOReturn result, void *sender, IOHIDDeviceRef IOHIDDevice)

View File

@ -98,7 +98,7 @@ static DEVICE_OBJECT *mouse_obj;
static DEVICE_OBJECT *keyboard_obj;
/* The root-enumerated device stack. */
DEVICE_OBJECT *bus_pdo;
static DEVICE_OBJECT *bus_pdo;
static DEVICE_OBJECT *bus_fdo;
HANDLE driver_key;
@ -341,7 +341,7 @@ static void remove_pending_irps(DEVICE_OBJECT *device)
}
}
DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, struct unix_device *unix_device)
static DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, struct unix_device *unix_device)
{
static const WCHAR device_name_fmtW[] = {'\\','D','e','v','i','c','e','\\','%','s','#','%','p',0};
struct device_extension *ext;