Commit 1215bc80 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wineusb.sys: Fully initialize the device before adding it to the device list.

Do not rely on IoInvalidateDeviceRelations() to initialize the device; it's supposed to be asynchronous.
parent 73284ea1
......@@ -255,11 +255,7 @@ static void add_unix_device(struct unix_device *unix_device)
device->device_obj = device_obj;
device->unix_device = unix_device;
InitializeListHead(&device->irp_list);
EnterCriticalSection(&wineusb_cs);
list_add_tail(&device_list, &device->entry);
device->removed = FALSE;
LeaveCriticalSection(&wineusb_cs);
device->class = device_desc.bDeviceClass;
device->subclass = device_desc.bDeviceSubClass;
......@@ -268,6 +264,10 @@ static void add_unix_device(struct unix_device *unix_device)
device->product = device_desc.idProduct;
device->revision = device_desc.bcdDevice;
EnterCriticalSection(&wineusb_cs);
list_add_tail(&device_list, &device->entry);
LeaveCriticalSection(&wineusb_cs);
if (!(ret = libusb_get_active_config_descriptor(libusb_device, &config_desc)))
{
/* Create new devices for interfaces of composite devices.
......
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