Drop mailing-list-patches patchset

This commit is contained in:
Alistair Leslie-Hughes 2019-08-26 16:14:56 +10:00
parent 2da5f18812
commit fcfeaf092c
8 changed files with 1 additions and 739 deletions

View File

@ -1,2 +1,2 @@
Fixes: Fixes compile warnings.
Depends: mailing-list-patches
#Depends: mailing-list-patches

View File

@ -1,311 +0,0 @@
From cefe28f14b32726d67fcc17e0c5195c1f8d3f61e Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 8 Jul 2019 11:32:27 -0500
Subject: [PATCH] user32: Also scan for mouse devices in
GetRawInputDeviceList().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
---
dlls/user32/rawinput.c | 124 ++++++++++++++++++++++----------------
dlls/user32/tests/input.c | 2 +-
2 files changed, 74 insertions(+), 52 deletions(-)
diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c
index 49cf9f73a0..e83da29009 100644
--- a/dlls/user32/rawinput.c
+++ b/dlls/user32/rawinput.c
@@ -36,27 +36,30 @@
#include "user_private.h"
+#include "initguid.h"
+#include "ntddmou.h"
+
WINE_DEFAULT_DEBUG_CHANNEL(rawinput);
-struct hid_device
+struct device
{
WCHAR *path;
HANDLE file;
- RID_DEVICE_INFO_HID info;
+ RID_DEVICE_INFO info;
PHIDP_PREPARSED_DATA data;
};
-static struct hid_device *hid_devices;
-static unsigned int hid_devices_count, hid_devices_max;
+static struct device *rawinput_devices;
+static unsigned int rawinput_devices_count, rawinput_devices_max;
-static CRITICAL_SECTION hid_devices_cs;
-static CRITICAL_SECTION_DEBUG hid_devices_cs_debug =
+static CRITICAL_SECTION rawinput_devices_cs;
+static CRITICAL_SECTION_DEBUG rawinput_devices_cs_debug =
{
- 0, 0, &hid_devices_cs,
- { &hid_devices_cs_debug.ProcessLocksList, &hid_devices_cs_debug.ProcessLocksList },
- 0, 0, { (DWORD_PTR)(__FILE__ ": hid_devices_cs") }
+ 0, 0, &rawinput_devices_cs,
+ { &rawinput_devices_cs_debug.ProcessLocksList, &rawinput_devices_cs_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": rawinput_devices_cs") }
};
-static CRITICAL_SECTION hid_devices_cs = { &hid_devices_cs_debug, -1, 0, 0, 0, 0 };
+static CRITICAL_SECTION rawinput_devices_cs = { &rawinput_devices_cs_debug, -1, 0, 0, 0, 0 };
static BOOL array_reserve(void **elements, unsigned int *capacity, unsigned int count, unsigned int size)
{
@@ -85,10 +88,10 @@ static BOOL array_reserve(void **elements, unsigned int *capacity, unsigned int
return TRUE;
}
-static struct hid_device *add_device(HDEVINFO set, SP_DEVICE_INTERFACE_DATA *iface)
+static struct device *add_device(HDEVINFO set, SP_DEVICE_INTERFACE_DATA *iface)
{
SP_DEVICE_INTERFACE_DETAIL_DATA_W *detail;
- struct hid_device *device;
+ struct device *device;
HANDLE file;
WCHAR *path;
DWORD size;
@@ -126,7 +129,8 @@ static struct hid_device *add_device(HDEVINFO set, SP_DEVICE_INTERFACE_DATA *ifa
return NULL;
}
- if (!array_reserve((void **)&hid_devices, &hid_devices_max, hid_devices_count + 1, sizeof(*hid_devices)))
+ if (!array_reserve((void **)&rawinput_devices, &rawinput_devices_max,
+ rawinput_devices_count + 1, sizeof(*rawinput_devices)))
{
ERR("Failed to allocate memory.\n");
CloseHandle(file);
@@ -134,19 +138,20 @@ static struct hid_device *add_device(HDEVINFO set, SP_DEVICE_INTERFACE_DATA *ifa
return NULL;
}
- device = &hid_devices[hid_devices_count++];
+ device = &rawinput_devices[rawinput_devices_count++];
device->path = path;
device->file = file;
+ device->info.cbSize = sizeof(RID_DEVICE_INFO);
return device;
}
-static void find_hid_devices(void)
+static void find_devices(void)
{
static ULONGLONG last_check;
SP_DEVICE_INTERFACE_DATA iface = { sizeof(iface) };
- struct hid_device *device;
+ struct device *device;
HIDD_ATTRIBUTES attr;
HIDP_CAPS caps;
GUID hid_guid;
@@ -159,18 +164,18 @@ static void find_hid_devices(void)
HidD_GetHidGuid(&hid_guid);
- set = SetupDiGetClassDevsW(&hid_guid, NULL, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT);
-
- EnterCriticalSection(&hid_devices_cs);
+ EnterCriticalSection(&rawinput_devices_cs);
/* destroy previous list */
- for (idx = 0; idx < hid_devices_count; ++idx)
+ for (idx = 0; idx < rawinput_devices_count; ++idx)
{
- CloseHandle(hid_devices[idx].file);
- heap_free(hid_devices[idx].path);
+ CloseHandle(rawinput_devices[idx].file);
+ heap_free(rawinput_devices[idx].path);
}
+ rawinput_devices_count = 0;
+
+ set = SetupDiGetClassDevsW(&hid_guid, NULL, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT);
- hid_devices_count = 0;
for (idx = 0; SetupDiEnumDeviceInterfaces(set, NULL, &hid_guid, idx, &iface); ++idx)
{
if (!(device = add_device(set, &iface)))
@@ -179,9 +184,11 @@ static void find_hid_devices(void)
attr.Size = sizeof(HIDD_ATTRIBUTES);
if (!HidD_GetAttributes(device->file, &attr))
WARN("Failed to get attributes.\n");
- device->info.dwVendorId = attr.VendorID;
- device->info.dwProductId = attr.ProductID;
- device->info.dwVersionNumber = attr.VersionNumber;
+
+ device->info.dwType = RIM_TYPEHID;
+ device->info.u.hid.dwVendorId = attr.VendorID;
+ device->info.u.hid.dwProductId = attr.ProductID;
+ device->info.u.hid.dwVersionNumber = attr.VersionNumber;
if (!HidD_GetPreparsedData(device->file, &device->data))
WARN("Failed to get preparsed data.\n");
@@ -189,12 +196,28 @@ static void find_hid_devices(void)
if (!HidP_GetCaps(device->data, &caps))
WARN("Failed to get caps.\n");
- device->info.usUsagePage = caps.UsagePage;
- device->info.usUsage = caps.Usage;
+ device->info.u.hid.usUsagePage = caps.UsagePage;
+ device->info.u.hid.usUsage = caps.Usage;
}
- LeaveCriticalSection(&hid_devices_cs);
SetupDiDestroyDeviceInfoList(set);
+
+ set = SetupDiGetClassDevsW(&GUID_DEVINTERFACE_MOUSE, NULL, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT);
+
+ for (idx = 0; SetupDiEnumDeviceInterfaces(set, NULL, &GUID_DEVINTERFACE_MOUSE, idx, &iface); ++idx)
+ {
+ static const RID_DEVICE_INFO_MOUSE mouse_info = {1, 5, 0, FALSE};
+
+ if (!(device = add_device(set, &iface)))
+ continue;
+
+ device->info.dwType = RIM_TYPEMOUSE;
+ device->info.u.mouse = mouse_info;
+ }
+
+ SetupDiDestroyDeviceInfoList(set);
+
+ LeaveCriticalSection(&rawinput_devices_cs);
}
/***********************************************************************
@@ -218,18 +241,18 @@ UINT WINAPI GetRawInputDeviceList(RAWINPUTDEVICELIST *devices, UINT *device_coun
return ~0U;
}
- find_hid_devices();
+ find_devices();
if (!devices)
{
- *device_count = 2 + hid_devices_count;
+ *device_count = 2 + rawinput_devices_count;
return 0;
}
- if (*device_count < 2 + hid_devices_count)
+ if (*device_count < 2 + rawinput_devices_count)
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
- *device_count = 2 + hid_devices_count;
+ *device_count = 2 + rawinput_devices_count;
return ~0U;
}
@@ -238,13 +261,13 @@ UINT WINAPI GetRawInputDeviceList(RAWINPUTDEVICELIST *devices, UINT *device_coun
devices[1].hDevice = WINE_KEYBOARD_HANDLE;
devices[1].dwType = RIM_TYPEKEYBOARD;
- for (i = 0; i < hid_devices_count; ++i)
+ for (i = 0; i < rawinput_devices_count; ++i)
{
- devices[2 + i].hDevice = &hid_devices[i];
- devices[2 + i].dwType = RIM_TYPEHID;
+ devices[2 + i].hDevice = &rawinput_devices[i];
+ devices[2 + i].dwType = rawinput_devices[i].info.dwType;
}
- return 2 + hid_devices_count;
+ return 2 + rawinput_devices_count;
}
/***********************************************************************
@@ -386,41 +409,41 @@ UINT WINAPI GetRawInputDeviceInfoA(HANDLE device, UINT command, void *data, UINT
/***********************************************************************
* GetRawInputDeviceInfoW (USER32.@)
*/
-UINT WINAPI GetRawInputDeviceInfoW(HANDLE device, UINT command, void *data, UINT *data_size)
+UINT WINAPI GetRawInputDeviceInfoW(HANDLE handle, UINT command, void *data, UINT *data_size)
{
/* FIXME: Most of this is made up. */
static const WCHAR keyboard_name[] = {'\\','\\','?','\\','W','I','N','E','_','K','E','Y','B','O','A','R','D',0};
static const WCHAR mouse_name[] = {'\\','\\','?','\\','W','I','N','E','_','M','O','U','S','E',0};
static const RID_DEVICE_INFO_KEYBOARD keyboard_info = {0, 0, 1, 12, 3, 101};
static const RID_DEVICE_INFO_MOUSE mouse_info = {1, 5, 0, FALSE};
- struct hid_device *hid_device;
const WCHAR *name = NULL;
RID_DEVICE_INFO *info;
+ struct device *device;
UINT s;
- TRACE("device %p, command %#x, data %p, data_size %p.\n",
- device, command, data, data_size);
+ TRACE("handle %p, command %#x, data %p, data_size %p.\n",
+ handle, command, data, data_size);
if (!data_size) return ~0U;
switch (command)
{
case RIDI_DEVICENAME:
- if (device == WINE_MOUSE_HANDLE)
+ if (handle == WINE_MOUSE_HANDLE)
{
s = ARRAY_SIZE(mouse_name);
name = mouse_name;
}
- else if (device == WINE_KEYBOARD_HANDLE)
+ else if (handle == WINE_KEYBOARD_HANDLE)
{
s = ARRAY_SIZE(keyboard_name);
name = keyboard_name;
}
else
{
- hid_device = device;
- s = strlenW(hid_device->path) + 1;
- name = hid_device->path;
+ device = handle;
+ s = strlenW(device->path) + 1;
+ name = device->path;
}
break;
case RIDI_DEVICEINFO:
@@ -450,21 +473,20 @@ UINT WINAPI GetRawInputDeviceInfoW(HANDLE device, UINT command, void *data, UINT
info = data;
info->cbSize = sizeof(*info);
- if (device == WINE_MOUSE_HANDLE)
+ if (handle == WINE_MOUSE_HANDLE)
{
info->dwType = RIM_TYPEMOUSE;
info->u.mouse = mouse_info;
}
- else if (device == WINE_KEYBOARD_HANDLE)
+ else if (handle == WINE_KEYBOARD_HANDLE)
{
info->dwType = RIM_TYPEKEYBOARD;
info->u.keyboard = keyboard_info;
}
else
{
- hid_device = device;
- info->dwType = RIM_TYPEHID;
- info->u.hid = hid_device->info;
+ device = handle;
+ *info = device->info;
}
return s;
}
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index d0dc4a8bcf..78f46bb6ba 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -1670,7 +1670,7 @@ static void test_GetRawInputDeviceList(void)
* understand that; so use the \\?\ prefix instead */
name[1] = '\\';
file = CreateFileW(name, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
- todo_wine_if(info.dwType != RIM_TYPEHID)
+ todo_wine_if(i == 0 || i == 1)
ok(file != INVALID_HANDLE_VALUE, "Failed to open %s, error %u\n", wine_dbgstr_w(name), GetLastError());
CloseHandle(file);
}
--
2.17.1

View File

@ -1,157 +0,0 @@
From a4fda32d2dc0115017f3fa87413d84a08d193328 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 9 Jul 2019 11:12:07 +0200
Subject: [PATCH] winebus.sys: Report the native product string for some Xbox
gamepads
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Some games are checking the hid product string of connected gamepads in
order to decide whether or not to activate rumble.
Wine usually delegates these queries to the backend driver, but they
don't always report the same product strings as on Windows. This will
allow to override backend strings with the actual strings as reported
by native drivers.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
---
dlls/winebus.sys/main.c | 98 ++++++++++++++++++++++++++++++++++-------
1 file changed, 81 insertions(+), 17 deletions(-)
diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index 26200bde3e..12ff0b3e15 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -49,22 +49,39 @@ WINE_DECLARE_DEBUG_CHANNEL(hid_report);
static const WCHAR backslashW[] = {'\\',0};
+struct product_desc
+{
+ WORD vid;
+ WORD pid;
+ const WCHAR* manufacturer;
+ const WCHAR* product;
+ const WCHAR* serialnumber;
+};
+
#define VID_MICROSOFT 0x045e
-static const WORD PID_XBOX_CONTROLLERS[] = {
- 0x0202, /* Xbox Controller */
- 0x0285, /* Xbox Controller S */
- 0x0289, /* Xbox Controller S */
- 0x028e, /* Xbox360 Controller */
- 0x028f, /* Xbox360 Wireless Controller */
- 0x02d1, /* Xbox One Controller */
- 0x02dd, /* Xbox One Controller (Covert Forces/Firmware 2015) */
- 0x02e0, /* Xbox One X Controller */
- 0x02e3, /* Xbox One Elite Controller */
- 0x02e6, /* Wireless XBox Controller Dongle */
- 0x02ea, /* Xbox One S Controller */
- 0x02fd, /* Xbox One S Controller (Firmware 2017) */
- 0x0719, /* Xbox 360 Wireless Adapter */
+static const WCHAR xbox360_product_string[] = {
+ 'C','o','n','t','r','o','l','l','e','r',' ','(','X','B','O','X',' ','3','6','0',' ','F','o','r',' ','W','i','n','d','o','w','s',')',0
+};
+
+static const WCHAR xboxone_product_string[] = {
+ 'C','o','n','t','r','o','l','l','e','r',' ','(','X','B','O','X',' ','O','n','e',' ','F','o','r',' ','W','i','n','d','o','w','s',')',0
+};
+
+static const struct product_desc XBOX_CONTROLLERS[] = {
+ {VID_MICROSOFT, 0x0202, NULL, NULL, NULL}, /* Xbox Controller */
+ {VID_MICROSOFT, 0x0285, NULL, NULL, NULL}, /* Xbox Controller S */
+ {VID_MICROSOFT, 0x0289, NULL, NULL, NULL}, /* Xbox Controller S */
+ {VID_MICROSOFT, 0x028e, NULL, xbox360_product_string, NULL}, /* Xbox360 Controller */
+ {VID_MICROSOFT, 0x028f, NULL, xbox360_product_string, NULL}, /* Xbox360 Wireless Controller */
+ {VID_MICROSOFT, 0x02d1, NULL, xboxone_product_string, NULL}, /* Xbox One Controller */
+ {VID_MICROSOFT, 0x02dd, NULL, xboxone_product_string, NULL}, /* Xbox One Controller (Covert Forces/Firmware 2015) */
+ {VID_MICROSOFT, 0x02e0, NULL, NULL, NULL}, /* Xbox One X Controller */
+ {VID_MICROSOFT, 0x02e3, NULL, xboxone_product_string, NULL}, /* Xbox One Elite Controller */
+ {VID_MICROSOFT, 0x02e6, NULL, NULL, NULL}, /* Wireless XBox Controller Dongle */
+ {VID_MICROSOFT, 0x02ea, NULL, xboxone_product_string, NULL}, /* Xbox One S Controller */
+ {VID_MICROSOFT, 0x02fd, NULL, xboxone_product_string, NULL}, /* Xbox One S Controller (Firmware 2017) */
+ {VID_MICROSOFT, 0x0719, NULL, xbox360_product_string, NULL}, /* Xbox 360 Wireless Adapter */
};
static DRIVER_OBJECT *driver_obj;
@@ -565,6 +582,51 @@ static NTSTATUS deliver_last_report(struct device_extension *ext, DWORD buffer_l
}
}
+static NTSTATUS hid_get_native_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buffer, DWORD length)
+{
+ struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
+ int i;
+
+ if (ext->vid == VID_MICROSOFT)
+ {
+ for (i = 0; i < ARRAY_SIZE(XBOX_CONTROLLERS); i++)
+ {
+ if (ext->pid == XBOX_CONTROLLERS[i].pid)
+ break;
+ }
+
+ if (i >= ARRAY_SIZE(XBOX_CONTROLLERS))
+ return STATUS_UNSUCCESSFUL;
+
+ switch (index)
+ {
+ case HID_STRING_ID_IPRODUCT:
+ if (XBOX_CONTROLLERS[i].product)
+ {
+ strcpyW(buffer, XBOX_CONTROLLERS[i].product);
+ return STATUS_SUCCESS;
+ }
+ break;
+ case HID_STRING_ID_IMANUFACTURER:
+ if (XBOX_CONTROLLERS[i].manufacturer)
+ {
+ strcpyW(buffer, XBOX_CONTROLLERS[i].manufacturer);
+ return STATUS_SUCCESS;
+ }
+ break;
+ case HID_STRING_ID_ISERIALNUMBER:
+ if (XBOX_CONTROLLERS[i].serialnumber)
+ {
+ strcpyW(buffer, XBOX_CONTROLLERS[i].serialnumber);
+ return STATUS_SUCCESS;
+ }
+ break;
+ }
+ }
+
+ return STATUS_UNSUCCESSFUL;
+}
+
static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
{
NTSTATUS status = irp->IoStatus.u.Status;
@@ -650,7 +712,9 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
DWORD index = (ULONG_PTR)irpsp->Parameters.DeviceIoControl.Type3InputBuffer;
TRACE("IOCTL_HID_GET_STRING[%08x]\n", index);
- irp->IoStatus.u.Status = status = ext->vtbl->get_string(device, index, (WCHAR *)irp->UserBuffer, length);
+ irp->IoStatus.u.Status = status = hid_get_native_string(device, index, (WCHAR *)irp->UserBuffer, length);
+ if (status != STATUS_SUCCESS)
+ irp->IoStatus.u.Status = status = ext->vtbl->get_string(device, index, (WCHAR *)irp->UserBuffer, length);
if (status == STATUS_SUCCESS)
irp->IoStatus.Information = (strlenW((WCHAR *)irp->UserBuffer) + 1) * sizeof(WCHAR);
break;
@@ -815,8 +879,8 @@ BOOL is_xbox_gamepad(WORD vid, WORD pid)
if (vid != VID_MICROSOFT)
return FALSE;
- for (i = 0; i < ARRAY_SIZE(PID_XBOX_CONTROLLERS); i++)
- if (pid == PID_XBOX_CONTROLLERS[i]) return TRUE;
+ for (i = 0; i < ARRAY_SIZE(XBOX_CONTROLLERS); i++)
+ if (pid == XBOX_CONTROLLERS[i].pid) return TRUE;
return FALSE;
}
--
2.17.1

View File

@ -1,50 +0,0 @@
From 280871d857de266e36e5ddbbe71acb4672fd40ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Mon, 22 Jul 2019 16:55:01 +0200
Subject: [PATCH] winex11.drv: Ignore XGrabPointer-induced warp events as well
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sometimes the last of the induced PointerMotion events slips through the
warp_serial filter and trigger spurious mouse motion. This is the case
in Fallout 4, which alternates between fullscreen and smaller cursor
clip rectangles.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
---
dlls/winex11.drv/mouse.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index b9eaaab2098..4fd265b9816 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -415,11 +415,6 @@ static BOOL grab_clipping_window( const RECT *clip )
max( 1, clip->right - clip->left ), max( 1, clip->bottom - clip->top ) );
XMapWindow( data->display, clip_window );
- /* if the rectangle is shrinking we may get a pointer warp */
- if (!data->clip_hwnd || clip->left > clip_rect.left || clip->top > clip_rect.top ||
- clip->right < clip_rect.right || clip->bottom < clip_rect.bottom)
- data->warp_serial = NextRequest( data->display );
-
if (!XGrabPointer( data->display, clip_window, False,
PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
GrabModeAsync, GrabModeAsync, clip_window, None, CurrentTime ))
@@ -431,6 +426,12 @@ static BOOL grab_clipping_window( const RECT *clip )
DestroyWindow( msg_hwnd );
return FALSE;
}
+
+ /* if the rectangle is shrinking we may get a pointer warp */
+ if (!data->clip_hwnd || clip->left > clip_rect.left || clip->top > clip_rect.top ||
+ clip->right < clip_rect.right || clip->bottom < clip_rect.bottom)
+ data->warp_serial = NextRequest( data->display );
+
clip_rect = *clip;
if (!data->clip_hwnd) sync_window_cursor( clip_window );
InterlockedExchangePointer( (void **)&cursor_window, msg_hwnd );
--
2.17.1

View File

@ -1,74 +0,0 @@
From 81132a69914175ad0d9d275327ebb2dfce248bb6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Thu, 25 Jul 2019 16:23:51 +0200
Subject: [PATCH 2/3] ntoskrnl: Update the interface if it is already in the
device_interfaces tree
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
As we are going to reuse the same device id when re-plugging a
previously plugged SDL controller, the device interfaces are still
present in the tree and IoRegisterDeviceInterface was not updating the
device pointer.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
---
dlls/ntoskrnl.exe/pnp.c | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c
index c618885d427..32274533c36 100644
--- a/dlls/ntoskrnl.exe/pnp.c
+++ b/dlls/ntoskrnl.exe/pnp.c
@@ -688,7 +688,9 @@ NTSTATUS WINAPI IoRegisterDeviceInterface(DEVICE_OBJECT *device, const GUID *cla
WCHAR device_instance_id[MAX_DEVICE_ID_LEN];
SP_DEVICE_INTERFACE_DETAIL_DATA_W *data;
NTSTATUS status = STATUS_SUCCESS;
+ UNICODE_STRING device_path;
struct device_interface *iface;
+ struct wine_rb_entry *entry;
DWORD required;
HDEVINFO set;
@@ -726,19 +728,32 @@ NTSTATUS WINAPI IoRegisterDeviceInterface(DEVICE_OBJECT *device, const GUID *cla
data->DevicePath[1] = '?';
TRACE("Returning path %s.\n", debugstr_w(data->DevicePath));
+ RtlCreateUnicodeString( &device_path, data->DevicePath);
+
+ entry = wine_rb_get( &device_interfaces, &device_path );
+ if (entry)
+ {
+ iface = WINE_RB_ENTRY_VALUE( entry, struct device_interface, entry );
+ if (iface->enabled)
+ ERR("Device interface %s is still enabled.\n", debugstr_us(&iface->symbolic_link));
+ }
+ else
+ {
+ iface = heap_alloc_zero( sizeof(struct device_interface) );
+ RtlCreateUnicodeString(&iface->symbolic_link, data->DevicePath);
+ if (wine_rb_put( &device_interfaces, &iface->symbolic_link, &iface->entry ))
+ ERR("Failed to insert interface %s into tree.\n", debugstr_us(&iface->symbolic_link));
+ }
- iface = heap_alloc_zero( sizeof(struct device_interface) );
iface->device = device;
iface->interface_class = *class_guid;
- RtlCreateUnicodeString(&iface->symbolic_link, data->DevicePath);
if (symbolic_link)
RtlCreateUnicodeString( symbolic_link, data->DevicePath);
- if (wine_rb_put( &device_interfaces, &iface->symbolic_link, &iface->entry ))
- ERR("Failed to insert interface %s into tree.\n", debugstr_us(&iface->symbolic_link));
-
HeapFree( GetProcessHeap(), 0, data );
+ RtlFreeUnicodeString( &device_path );
+
return status;
}
--
2.17.1

View File

@ -1,102 +0,0 @@
From f074fb7a491d062a31fdb67d84ebfb454495a1d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Thu, 25 Jul 2019 16:23:52 +0200
Subject: [PATCH 3/3] winebus: Use the SDL joystick index as device id instead
of instance id
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Some games are using the HID device id as the gamepad index for xinput
API. When hotplugging devices, SDL increases its instances id and it
doesn't match anymore with xinput gamepad numbers.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
---
dlls/winebus.sys/bus_sdl.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c
index 781deda7670..3bd27ca5bf0 100644
--- a/dlls/winebus.sys/bus_sdl.c
+++ b/dlls/winebus.sys/bus_sdl.c
@@ -744,17 +744,21 @@ static const platform_vtbl sdl_vtbl =
set_feature_report,
};
+static int compare_joystick_id(DEVICE_OBJECT *device, void* context)
+{
+ return impl_from_DEVICE_OBJECT(device)->id - PtrToUlong(context);
+}
+
static BOOL set_report_from_event(SDL_Event *event)
{
DEVICE_OBJECT *device;
struct platform_private *private;
/* All the events coming in will have 'which' as a 3rd field */
- SDL_JoystickID index = ((SDL_JoyButtonEvent*)event)->which;
-
- device = bus_find_hid_device(&sdl_vtbl, ULongToPtr(index));
+ SDL_JoystickID id = ((SDL_JoyButtonEvent*)event)->which;
+ device = bus_enumerate_hid_devices(&sdl_vtbl, compare_joystick_id, ULongToPtr(id));
if (!device)
{
- ERR("Failed to find device at index %i\n",index);
+ ERR("Failed to find device at index %i\n",id);
return FALSE;
}
private = impl_from_DEVICE_OBJECT(device);
@@ -814,11 +818,11 @@ static BOOL set_mapped_report_from_event(SDL_Event *event)
DEVICE_OBJECT *device;
struct platform_private *private;
/* All the events coming in will have 'which' as a 3rd field */
- int index = ((SDL_ControllerButtonEvent*)event)->which;
- device = bus_find_hid_device(&sdl_vtbl, ULongToPtr(index));
+ SDL_JoystickID id = ((SDL_ControllerButtonEvent*)event)->which;
+ device = bus_enumerate_hid_devices(&sdl_vtbl, compare_joystick_id, ULongToPtr(id));
if (!device)
{
- ERR("Failed to find device at index %i\n",index);
+ ERR("Failed to find device at index %i\n",id);
return FALSE;
}
private = impl_from_DEVICE_OBJECT(device);
@@ -878,7 +882,7 @@ static BOOL set_mapped_report_from_event(SDL_Event *event)
return FALSE;
}
-static void try_remove_device(SDL_JoystickID index)
+static void try_remove_device(SDL_JoystickID id)
{
DEVICE_OBJECT *device = NULL;
struct platform_private *private;
@@ -886,7 +890,7 @@ static void try_remove_device(SDL_JoystickID index)
SDL_GameController *sdl_controller;
SDL_Haptic *sdl_haptic;
- device = bus_find_hid_device(&sdl_vtbl, ULongToPtr(index));
+ device = bus_enumerate_hid_devices(&sdl_vtbl, compare_joystick_id, ULongToPtr(id));
if (!device) return;
private = impl_from_DEVICE_OBJECT(device);
@@ -905,7 +909,7 @@ static void try_remove_device(SDL_JoystickID index)
pSDL_HapticClose(sdl_haptic);
}
-static void try_add_device(SDL_JoystickID index)
+static void try_add_device(unsigned int index)
{
DWORD vid = 0, pid = 0, version = 0;
DEVICE_OBJECT *device = NULL;
@@ -967,7 +971,7 @@ static void try_add_device(SDL_JoystickID index)
input = 0;
device = bus_create_hid_device(sdl_busidW, vid, pid,
- input, version, id, serial, is_xbox_gamepad, &GUID_DEVCLASS_SDL,
+ input, version, index, serial, is_xbox_gamepad, &GUID_DEVCLASS_SDL,
&sdl_vtbl, sizeof(struct platform_private));
if (device)
--
2.17.1

View File

@ -1,5 +0,0 @@
# These patches will either be dropped or moved to their own directories after the wine release 4.14.
Fixes: Mailing list patches
Fixes: [47411] shell32: Add SHMultiFileProperties stub
Fixes: [47445] Define AT_NO_AUTOMOUNT if needed.

View File

@ -171,7 +171,6 @@ patch_enable_all ()
enable_libs_Debug_Channel="$1"
enable_libs_Unicode_Collation="$1"
enable_loader_KeyboardLayouts="$1"
enable_mailing_list_patches="$1"
enable_mmsystem_dll16_MIDIHDR_Refcount="$1"
enable_mountmgr_DosDevices="$1"
enable_mscoree_CorValidateImage="$1"
@ -645,9 +644,6 @@ patch_enable ()
loader-KeyboardLayouts)
enable_loader_KeyboardLayouts="$2"
;;
mailing-list-patches)
enable_mailing_list_patches="$2"
;;
mmsystem.dll16-MIDIHDR_Refcount)
enable_mmsystem_dll16_MIDIHDR_Refcount="$2"
;;
@ -2027,13 +2023,6 @@ if test "$enable_advapi32_Token_Integrity_Level" -eq 1; then
enable_advapi32_CreateRestrictedToken=1
fi
if test "$enable_Compiler_Warnings" -eq 1; then
if test "$enable_mailing_list_patches" -gt 1; then
abort "Patchset mailing-list-patches disabled, but Compiler_Warnings depends on that."
fi
enable_mailing_list_patches=1
fi
# If autoupdate is enabled then create a tempfile to keep track of all patches
if test "$enable_patchlist" -eq 1; then
@ -2050,36 +2039,8 @@ if test "$enable_patchlist" -eq 1; then
fi
# Patchset mailing-list-patches
# |
# | This patchset fixes the following Wine bugs:
# | * [#47411] shell32: Add SHMultiFileProperties stub
# | * [#47445] Define AT_NO_AUTOMOUNT if needed.
# |
# | Modified files:
# | * dlls/ntoskrnl.exe/pnp.c, dlls/user32/rawinput.c, dlls/user32/tests/input.c, dlls/winebus.sys/bus_sdl.c,
# | dlls/winebus.sys/main.c, dlls/winex11.drv/mouse.c
# |
if test "$enable_mailing_list_patches" -eq 1; then
patch_apply mailing-list-patches/0017-user32-Also-scan-for-mouse-devices-in-GetRawInputDev.patch
patch_apply mailing-list-patches/0020-winebus.sys-Report-the-native-product-string-for-som.patch
patch_apply mailing-list-patches/0035-winex11.drv-Ignore-XGrabPointer-induced-warp-events-.patch
patch_apply mailing-list-patches/0037-ntoskrnl-Update-the-interface-if-it-is-already-in-th.patch
patch_apply mailing-list-patches/0038-winebus-Use-the-SDL-joystick-index-as-device-id-inst.patch
(
printf '%s\n' '+ { "Zebediah Figura", "user32: Also scan for mouse devices in GetRawInputDeviceList().", 1 },';
printf '%s\n' '+ { "Rémi Bernon", "winebus.sys: Report the native product string for some Xbox gamepads.", 1 },';
printf '%s\n' '+ { "Rémi Bernon", "winex11.drv: Ignore XGrabPointer-induced warp events as well.", 1 },';
printf '%s\n' '+ { "Rémi Bernon", "ntoskrnl: Update the interface if it is already in the device_interfaces tree.", 1 },';
printf '%s\n' '+ { "Rémi Bernon", "winebus: Use the SDL joystick index as device id instead of instance id.", 1 },';
) >> "$patchlist"
fi
# Patchset Compiler_Warnings
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * mailing-list-patches
# |
# | Modified files:
# | * dlls/d2d1/bitmap.c, dlls/d2d1/brush.c, dlls/d2d1/dc_render_target.c, dlls/d2d1/geometry.c,
# | dlls/d2d1/hwnd_render_target.c, dlls/d2d1/state_block.c, dlls/d3d11/view.c, dlls/d3d8/texture.c, dlls/d3d9/texture.c,