Commit af2b2d04 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

hidclass.sys: Call IoInvalidateDeviceRelations before IoSetDevicePropertyData.

Otherwise setupapi may fail to find the device on which to set the property. This triggers messages like the following the first time a device is created (on prefix creation for mouse and keyboard devices): IoSetDevicePropertyData Failed to open device, error 0xe000020b. Some IoSetDevicePropertyData implementation detail makes it always return successfully but it's not doing anything and user32 will then ignore the device when it enumerates rawinput devices. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent caa5f68e
...@@ -245,6 +245,8 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo) ...@@ -245,6 +245,8 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
else else
pdo_ext->u.pdo.rawinput_handle = alloc_rawinput_handle(); pdo_ext->u.pdo.rawinput_handle = alloc_rawinput_handle();
IoInvalidateDeviceRelations(fdo_ext->u.fdo.hid_ext.PhysicalDeviceObject, BusRelations);
if ((status = IoSetDevicePropertyData(child_pdo, &DEVPROPKEY_HID_HANDLE, LOCALE_NEUTRAL, if ((status = IoSetDevicePropertyData(child_pdo, &DEVPROPKEY_HID_HANDLE, LOCALE_NEUTRAL,
PLUGPLAY_PROPERTY_PERSISTENT, DEVPROP_TYPE_UINT32, PLUGPLAY_PROPERTY_PERSISTENT, DEVPROP_TYPE_UINT32,
sizeof(pdo_ext->u.pdo.rawinput_handle), &pdo_ext->u.pdo.rawinput_handle))) sizeof(pdo_ext->u.pdo.rawinput_handle), &pdo_ext->u.pdo.rawinput_handle)))
...@@ -254,8 +256,6 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo) ...@@ -254,8 +256,6 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
return; return;
} }
IoInvalidateDeviceRelations(fdo_ext->u.fdo.hid_ext.PhysicalDeviceObject, BusRelations);
pdo_ext->u.pdo.poll_interval = DEFAULT_POLL_INTERVAL; pdo_ext->u.pdo.poll_interval = DEFAULT_POLL_INTERVAL;
pdo_ext->u.pdo.ring_buffer = RingBuffer_Create( pdo_ext->u.pdo.ring_buffer = RingBuffer_Create(
......
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