winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
October 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1165 discussions
Start a n
N
ew thread
Rémi Bernon : xinput1_3: Register for device notifications to update controller list.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: ebc70f78fba85309108a4396a7e6801d7d878839 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ebc70f78fba85309108a4396…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 8 13:02:26 2021 +0200 xinput1_3: Register for device notifications to update controller list. Based on a patch from Andrew Eikum <aeikum(a)codeweavers.com>. Dark Souls Remasters checks for xinput devices when it receives a WM_DEVICECHANGE message. We would only poll for new devices if it had been at least 2 seconds since the last check. So often, DS would receive the message, but we would refuse to poll for devices, so the game would think no controller was present. This commit fixes that by also subscribing to event notifications and triggering a poll. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/xinput1_1/Makefile.in | 2 +- dlls/xinput1_2/Makefile.in | 2 +- dlls/xinput1_3/Makefile.in | 2 +- dlls/xinput1_3/main.c | 38 +++++++++++++++++++++++++++++++++++++- dlls/xinput1_4/Makefile.in | 2 +- dlls/xinput9_1_0/Makefile.in | 2 +- 6 files changed, 42 insertions(+), 6 deletions(-) diff --git a/dlls/xinput1_1/Makefile.in b/dlls/xinput1_1/Makefile.in index 864b976f7e0..cc2825d0d19 100644 --- a/dlls/xinput1_1/Makefile.in +++ b/dlls/xinput1_1/Makefile.in @@ -1,5 +1,5 @@ MODULE = xinput1_1.dll -IMPORTS = hid setupapi advapi32 +IMPORTS = hid setupapi advapi32 user32 PARENTSRC = ../xinput1_3 C_SRCS = \ diff --git a/dlls/xinput1_2/Makefile.in b/dlls/xinput1_2/Makefile.in index 4dfcab040ee..1c4b48cdbda 100644 --- a/dlls/xinput1_2/Makefile.in +++ b/dlls/xinput1_2/Makefile.in @@ -1,5 +1,5 @@ MODULE = xinput1_2.dll -IMPORTS = hid setupapi advapi32 +IMPORTS = hid setupapi advapi32 user32 PARENTSRC = ../xinput1_3 C_SRCS = \ diff --git a/dlls/xinput1_3/Makefile.in b/dlls/xinput1_3/Makefile.in index 105d29f3300..a1c58a7452a 100644 --- a/dlls/xinput1_3/Makefile.in +++ b/dlls/xinput1_3/Makefile.in @@ -1,6 +1,6 @@ MODULE = xinput1_3.dll IMPORTLIB = xinput -IMPORTS = hid setupapi advapi32 +IMPORTS = hid setupapi advapi32 user32 C_SRCS = \ main.c diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index f49e74dc4b1..506802d142a 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -33,6 +33,7 @@ #include "winnls.h" #include "winternl.h" +#include "dbt.h" #include "setupapi.h" #include "devpkey.h" #include "hidusage.h" @@ -118,6 +119,7 @@ static struct xinput_controller controllers[XUSER_MAX_COUNT] = {{ &controller_critsect_debug[3], -1, 0, 0, 0, 0 }}, }; +static HMODULE xinput_instance; static HANDLE start_event; static HANDLE stop_event; static HANDLE done_event; @@ -641,17 +643,45 @@ static void read_controller_state(struct xinput_controller *controller) LeaveCriticalSection(&controller->crit); } +static LRESULT CALLBACK xinput_devnotify_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_DEVICECHANGE && wparam == DBT_DEVICEARRIVAL) update_controller_list(); + return DefWindowProcW(hwnd, msg, wparam, lparam); +} + static DWORD WINAPI hid_update_thread_proc(void *param) { struct xinput_controller *devices[XUSER_MAX_COUNT + 2]; HANDLE events[XUSER_MAX_COUNT + 2]; DWORD i, count = 2, ret = WAIT_TIMEOUT; + DEV_BROADCAST_DEVICEINTERFACE_W filter = + { + .dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE_W), + .dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE, + .dbcc_classguid = GUID_DEVINTERFACE_WINEXINPUT, + }; + WNDCLASSEXW cls = + { + .cbSize = sizeof(WNDCLASSEXW), + .hInstance = xinput_instance, + .lpszClassName = L"__wine_xinput_devnotify", + .lpfnWndProc = xinput_devnotify_wndproc, + }; + HDEVNOTIFY notif; + HWND hwnd; + MSG msg; + + RegisterClassExW(&cls); + hwnd = CreateWindowExW(0, cls.lpszClassName, NULL, 0, 0, 0, 0, 0, + HWND_MESSAGE, NULL, NULL, NULL); + notif = RegisterDeviceNotificationW(hwnd, &filter, DEVICE_NOTIFY_WINDOW_HANDLE); update_controller_list(); SetEvent(start_event); do { + if (ret == count) while (PeekMessageW(&msg, hwnd, 0, 0, PM_REMOVE)) DispatchMessageW(&msg); if (ret == WAIT_TIMEOUT) update_controller_list(); if (ret < count - 2) read_controller_state(devices[ret]); @@ -671,7 +701,12 @@ static DWORD WINAPI hid_update_thread_proc(void *param) events[count++] = update_event; events[count++] = stop_event; } - while ((ret = WaitForMultipleObjectsEx( count, events, FALSE, 2000, TRUE )) < count - 1 || ret == WAIT_TIMEOUT); + while ((ret = MsgWaitForMultipleObjectsEx(count, events, 2000, QS_ALLINPUT, MWMO_ALERTABLE)) < count - 1 || + ret == count || ret == WAIT_TIMEOUT); + + UnregisterDeviceNotification(notif); + DestroyWindow(hwnd); + UnregisterClassW(cls.lpszClassName, xinput_instance); if (ret != count - 1) ERR("update thread exited unexpectedly, ret %u\n", ret); SetEvent(done_event); @@ -733,6 +768,7 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) switch (reason) { case DLL_PROCESS_ATTACH: + xinput_instance = inst; DisableThreadLibraryCalls(inst); break; case DLL_PROCESS_DETACH: diff --git a/dlls/xinput1_4/Makefile.in b/dlls/xinput1_4/Makefile.in index 2e243d8b268..393a416af9e 100644 --- a/dlls/xinput1_4/Makefile.in +++ b/dlls/xinput1_4/Makefile.in @@ -1,5 +1,5 @@ MODULE = xinput1_4.dll -IMPORTS = hid setupapi advapi32 +IMPORTS = hid setupapi advapi32 user32 PARENTSRC = ../xinput1_3 C_SRCS = \ diff --git a/dlls/xinput9_1_0/Makefile.in b/dlls/xinput9_1_0/Makefile.in index dc97909914d..55ea44ba666 100644 --- a/dlls/xinput9_1_0/Makefile.in +++ b/dlls/xinput9_1_0/Makefile.in @@ -1,5 +1,5 @@ MODULE = xinput9_1_0.dll -IMPORTS = hid setupapi advapi32 +IMPORTS = hid setupapi advapi32 user32 PARENTSRC = ../xinput1_3 C_SRCS = \
1
0
0
0
Rémi Bernon : xinput1_3: Initialize the controller list in the update thread.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 65ba91d44302675bab17edeeaa30c06399806302 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=65ba91d44302675bab17edee…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 8 13:02:25 2021 +0200 xinput1_3: Initialize the controller list in the update thread. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/xinput1_3/main.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index 36c02acb855..f49e74dc4b1 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -85,16 +85,6 @@ struct xinput_controller } hid; }; -/* xinput_crit guards controllers array */ -static CRITICAL_SECTION xinput_crit; -static CRITICAL_SECTION_DEBUG xinput_critsect_debug = -{ - 0, 0, &xinput_crit, - { &xinput_critsect_debug.ProcessLocksList, &xinput_critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": xinput_crit") } -}; -static CRITICAL_SECTION xinput_crit = { &xinput_critsect_debug, -1, 0, 0, 0, 0 }; - static struct xinput_controller controllers[XUSER_MAX_COUNT]; static CRITICAL_SECTION_DEBUG controller_critsect_debug[XUSER_MAX_COUNT] = { @@ -128,6 +118,7 @@ static struct xinput_controller controllers[XUSER_MAX_COUNT] = {{ &controller_critsect_debug[3], -1, 0, 0, 0, 0 }}, }; +static HANDLE start_event; static HANDLE stop_event; static HANDLE done_event; static HANDLE update_event; @@ -531,6 +522,7 @@ static void stop_update_thread(void) SetEvent(stop_event); WaitForSingleObject(done_event, INFINITE); + CloseHandle(start_event); CloseHandle(stop_event); CloseHandle(done_event); CloseHandle(update_event); @@ -655,9 +647,11 @@ static DWORD WINAPI hid_update_thread_proc(void *param) HANDLE events[XUSER_MAX_COUNT + 2]; DWORD i, count = 2, ret = WAIT_TIMEOUT; + update_controller_list(); + SetEvent(start_event); + do { - EnterCriticalSection(&xinput_crit); if (ret == WAIT_TIMEOUT) update_controller_list(); if (ret < count - 2) read_controller_state(devices[ret]); @@ -676,7 +670,6 @@ static DWORD WINAPI hid_update_thread_proc(void *param) } events[count++] = update_event; events[count++] = stop_event; - LeaveCriticalSection(&xinput_crit); } while ((ret = WaitForMultipleObjectsEx( count, events, FALSE, 2000, TRUE )) < count - 1 || ret == WAIT_TIMEOUT); @@ -689,11 +682,14 @@ static BOOL WINAPI start_update_thread_once( INIT_ONCE *once, void *param, void { HANDLE thread; + start_event = CreateEventA(NULL, FALSE, FALSE, NULL); + if (!start_event) ERR("failed to create start event, error %u\n", GetLastError()); + stop_event = CreateEventA(NULL, FALSE, FALSE, NULL); if (!stop_event) ERR("failed to create stop event, error %u\n", GetLastError()); done_event = CreateEventA(NULL, FALSE, FALSE, NULL); - if (!done_event) ERR("failed to create stop event, error %u\n", GetLastError()); + if (!done_event) ERR("failed to create done event, error %u\n", GetLastError()); update_event = CreateEventA(NULL, FALSE, FALSE, NULL); if (!update_event) ERR("failed to create update event, error %u\n", GetLastError()); @@ -702,11 +698,7 @@ static BOOL WINAPI start_update_thread_once( INIT_ONCE *once, void *param, void if (!thread) ERR("failed to create update thread, error %u\n", GetLastError()); CloseHandle(thread); - /* do it once now, to resolve delayed imports and populate the initial list */ - EnterCriticalSection(&xinput_crit); - update_controller_list(); - LeaveCriticalSection(&xinput_crit); - + WaitForSingleObject(start_event, INFINITE); return TRUE; }
1
0
0
0
Rémi Bernon : xinput1_3: Do not use delay loaded imports.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 986f88bf21a5e3214d07d45958b87f1230c35106 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=986f88bf21a5e3214d07d459…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 8 13:02:24 2021 +0200 xinput1_3: Do not use delay loaded imports. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/xinput1_1/Makefile.in | 2 +- dlls/xinput1_2/Makefile.in | 2 +- dlls/xinput1_3/Makefile.in | 2 +- dlls/xinput1_4/Makefile.in | 2 +- dlls/xinput9_1_0/Makefile.in | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/xinput1_1/Makefile.in b/dlls/xinput1_1/Makefile.in index 328435a110f..864b976f7e0 100644 --- a/dlls/xinput1_1/Makefile.in +++ b/dlls/xinput1_1/Makefile.in @@ -1,6 +1,6 @@ MODULE = xinput1_1.dll +IMPORTS = hid setupapi advapi32 PARENTSRC = ../xinput1_3 -DELAYIMPORTS = hid setupapi advapi32 C_SRCS = \ main.c diff --git a/dlls/xinput1_2/Makefile.in b/dlls/xinput1_2/Makefile.in index e66b6e67261..4dfcab040ee 100644 --- a/dlls/xinput1_2/Makefile.in +++ b/dlls/xinput1_2/Makefile.in @@ -1,6 +1,6 @@ MODULE = xinput1_2.dll +IMPORTS = hid setupapi advapi32 PARENTSRC = ../xinput1_3 -DELAYIMPORTS = hid setupapi advapi32 C_SRCS = \ main.c diff --git a/dlls/xinput1_3/Makefile.in b/dlls/xinput1_3/Makefile.in index 15ce3a691dd..105d29f3300 100644 --- a/dlls/xinput1_3/Makefile.in +++ b/dlls/xinput1_3/Makefile.in @@ -1,6 +1,6 @@ MODULE = xinput1_3.dll IMPORTLIB = xinput -DELAYIMPORTS = hid setupapi advapi32 +IMPORTS = hid setupapi advapi32 C_SRCS = \ main.c diff --git a/dlls/xinput1_4/Makefile.in b/dlls/xinput1_4/Makefile.in index b21a3d3ce53..2e243d8b268 100644 --- a/dlls/xinput1_4/Makefile.in +++ b/dlls/xinput1_4/Makefile.in @@ -1,6 +1,6 @@ MODULE = xinput1_4.dll +IMPORTS = hid setupapi advapi32 PARENTSRC = ../xinput1_3 -DELAYIMPORTS = hid setupapi advapi32 C_SRCS = \ main.c diff --git a/dlls/xinput9_1_0/Makefile.in b/dlls/xinput9_1_0/Makefile.in index f014e67dea3..dc97909914d 100644 --- a/dlls/xinput9_1_0/Makefile.in +++ b/dlls/xinput9_1_0/Makefile.in @@ -1,6 +1,6 @@ MODULE = xinput9_1_0.dll +IMPORTS = hid setupapi advapi32 PARENTSRC = ../xinput1_3 -DELAYIMPORTS = hid setupapi advapi32 C_SRCS = \ main.c
1
0
0
0
Rémi Bernon : xinput1_3: Destroy controllers when ReadFile fails and I/O is not pending.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 60db3898321fe40a2aef32f09891724724fe1570 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=60db3898321fe40a2aef32f0…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 8 13:02:23 2021 +0200 xinput1_3: Destroy controllers when ReadFile fails and I/O is not pending. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/xinput1_3/main.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index 1f9d4881751..36c02acb855 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -331,9 +331,14 @@ static DWORD HID_set_state(struct xinput_controller *controller, XINPUT_VIBRATIO return ERROR_SUCCESS; } +static void controller_destroy(struct xinput_controller *controller, BOOL already_removed); + static void controller_enable(struct xinput_controller *controller) { + ULONG report_len = controller->hid.caps.InputReportByteLength; + char *report_buf = controller->hid.input_report_buf; XINPUT_VIBRATION state = controller->vibration; + BOOL ret; if (controller->enabled) return; if (controller->caps.Flags & XINPUT_CAPS_FFB_SUPPORTED) HID_set_state(controller, &state); @@ -341,8 +346,9 @@ static void controller_enable(struct xinput_controller *controller) memset(&controller->hid.read_ovl, 0, sizeof(controller->hid.read_ovl)); controller->hid.read_ovl.hEvent = controller->hid.read_event; - ReadFile(controller->device, controller->hid.input_report_buf, controller->hid.caps.InputReportByteLength, NULL, &controller->hid.read_ovl); - SetEvent(update_event); + ret = ReadFile(controller->device, report_buf, report_len, NULL, &controller->hid.read_ovl); + if (!ret && GetLastError() != ERROR_IO_PENDING) controller_destroy(controller, TRUE); + else SetEvent(update_event); } static void controller_disable(struct xinput_controller *controller) @@ -498,13 +504,13 @@ static void update_controller_list(void) SetupDiDestroyDeviceInfoList(set); } -static void controller_destroy(struct xinput_controller *controller) +static void controller_destroy(struct xinput_controller *controller, BOOL already_removed) { EnterCriticalSection(&controller->crit); if (controller->device) { - controller_disable(controller); + if (!already_removed) controller_disable(controller); CloseHandle(controller->device); controller->device = NULL; @@ -529,7 +535,7 @@ static void stop_update_thread(void) CloseHandle(done_event); CloseHandle(update_event); - for (i = 0; i < XUSER_MAX_COUNT; i++) controller_destroy(&controllers[i]); + for (i = 0; i < XUSER_MAX_COUNT; i++) controller_destroy(&controllers[i], FALSE); } static LONG sign_extend(ULONG value, const HIDP_VALUE_CAPS *caps) @@ -555,11 +561,12 @@ static void read_controller_state(struct xinput_controller *controller) NTSTATUS status; USAGE buttons[11]; ULONG i, button_length, value; + BOOL ret; if (!GetOverlappedResult(controller->device, &controller->hid.read_ovl, &read_len, TRUE)) { if (GetLastError() == ERROR_OPERATION_ABORTED) return; - if (GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == ERROR_INVALID_HANDLE) controller_destroy(controller); + if (GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == ERROR_INVALID_HANDLE) controller_destroy(controller, TRUE); else ERR("Failed to read input report, GetOverlappedResult failed with error %u\n", GetLastError()); return; } @@ -636,7 +643,8 @@ static void read_controller_state(struct xinput_controller *controller) controller->state = state; memset(&controller->hid.read_ovl, 0, sizeof(controller->hid.read_ovl)); controller->hid.read_ovl.hEvent = controller->hid.read_event; - ReadFile(controller->device, controller->hid.input_report_buf, controller->hid.caps.InputReportByteLength, NULL, &controller->hid.read_ovl); + ret = ReadFile(controller->device, report_buf, report_len, NULL, &controller->hid.read_ovl); + if (!ret && GetLastError() != ERROR_IO_PENDING) controller_destroy(controller, TRUE); } LeaveCriticalSection(&controller->crit); }
1
0
0
0
Rémi Bernon : xinput1_3: Wait for CancelIoEx completion when disabling controllers.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 54db76104085b4edba11f0f1f255547005f9667a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=54db76104085b4edba11f0f1…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 8 13:02:22 2021 +0200 xinput1_3: Wait for CancelIoEx completion when disabling controllers. Otherwise we may later write the cancelled status to invalid memory. Also use a manual-reset event, as it should be for overlapped I/O, so all waiters are waken up on cancel. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/xinput1_3/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index 81d11e5d38f..1f9d4881751 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -354,6 +354,7 @@ static void controller_disable(struct xinput_controller *controller) controller->enabled = FALSE; CancelIoEx(controller->device, &controller->hid.read_ovl); + WaitForSingleObject(controller->hid.read_ovl.hEvent, INFINITE); SetEvent(update_event); } @@ -365,7 +366,7 @@ static BOOL controller_init(struct xinput_controller *controller, PHIDP_PREPARSE controller->hid.caps = *caps; if (!(controller->hid.feature_report_buf = calloc(1, controller->hid.caps.FeatureReportByteLength))) goto failed; if (!controller_check_caps(controller, device, preparsed)) goto failed; - if (!(event = CreateEventA(NULL, FALSE, FALSE, NULL))) goto failed; + if (!(event = CreateEventW(NULL, TRUE, FALSE, NULL))) goto failed; TRACE("Found gamepad %s\n", debugstr_w(device_path));
1
0
0
0
Ivo Ivanov : winebus.sys: Fix incorrect length when parsing uevent "HID_NAME=".
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 5d022fd0dceb00f9dfc0360c992911c953f903e7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5d022fd0dceb00f9dfc0360c…
Author: Ivo Ivanov <logos128(a)gmail.com> Date: Fri Oct 8 12:38:46 2021 +0200 winebus.sys: Fix incorrect length when parsing uevent "HID_NAME=". Signed-off-by: Ivo Ivanov <logos128(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_udev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index cc54d6490be..2ed9a031af6 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -1108,7 +1108,7 @@ static void get_device_subsystem_info(struct udev_device *dev, char const *subsy if (sscanf(ptr, "HID_UNIQ=%256s\n", buffer) == 1) ntdll_umbstowcs(buffer, strlen(buffer) + 1, desc->serialnumber, ARRAY_SIZE(desc->serialnumber)); } - if (!strncmp(ptr, "HID_NAME=", 7)) + if (!strncmp(ptr, "HID_NAME=", 9)) { if (desc->product[0]) continue; if (sscanf(ptr, "HID_NAME=%256s\n", buffer) == 1)
1
0
0
0
Ivo Ivanov : winebus.sys: Fix memory leaks in bus_event_queue functions.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 8f37de5149e2440c7da831c083ac54bdbd166b83 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8f37de5149e2440c7da831c0…
Author: Ivo Ivanov <logos128(a)gmail.com> Date: Fri Oct 8 12:36:44 2021 +0200 winebus.sys: Fix memory leaks in bus_event_queue functions. Signed-off-by: Ivo Ivanov <logos128(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/unixlib.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/dlls/winebus.sys/unixlib.c b/dlls/winebus.sys/unixlib.c index ea26094049e..f66fd78d176 100644 --- a/dlls/winebus.sys/unixlib.c +++ b/dlls/winebus.sys/unixlib.c @@ -329,7 +329,11 @@ BOOL bus_event_queue_device_removed(struct list *queue, struct unix_device *devi struct bus_event *event = malloc(size); if (!event) return FALSE; - if (unix_device_incref(device) == 1) return FALSE; /* being destroyed */ + if (unix_device_incref(device) == 1) /* being destroyed */ + { + free(event); + return FALSE; + } event->type = BUS_EVENT_TYPE_DEVICE_REMOVED; event->device = device; @@ -344,7 +348,11 @@ BOOL bus_event_queue_device_created(struct list *queue, struct unix_device *devi struct bus_event *event = malloc(size); if (!event) return FALSE; - if (unix_device_incref(device) == 1) return FALSE; /* being destroyed */ + if (unix_device_incref(device) == 1) /* being destroyed */ + { + free(event); + return FALSE; + } event->type = BUS_EVENT_TYPE_DEVICE_CREATED; event->device = device; @@ -360,7 +368,11 @@ BOOL bus_event_queue_input_report(struct list *queue, struct unix_device *device struct bus_event *event = malloc(size); if (!event) return FALSE; - if (unix_device_incref(device) == 1) return FALSE; /* being destroyed */ + if (unix_device_incref(device) == 1) /* being destroyed */ + { + free(event); + return FALSE; + } event->type = BUS_EVENT_TYPE_INPUT_REPORT; event->device = device;
1
0
0
0
Huw Davies : ntdll: Return a failure if the unix call funcs don't exist.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 5689ec7bbaecaefde3f7cce9f3408ad607fc3375 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5689ec7bbaecaefde3f7cce9…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Oct 8 11:10:52 2021 +0100 ntdll: Return a failure if the unix call funcs don't exist. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/virtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 924aa78b306..6db08de6473 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -642,7 +642,7 @@ static NTSTATUS get_builtin_unix_funcs( void *module, BOOL wow, void **funcs ) { if (builtin->module != module) continue; *funcs = dlsym( builtin->unix_handle, ptr_name ); - status = STATUS_SUCCESS; + status = *funcs ? STATUS_SUCCESS : STATUS_ENTRYPOINT_NOT_FOUND; break; } server_leave_uninterrupted_section( &virtual_mutex, &sigset );
1
0
0
0
Jacek Caban : win32u: Use syscall interface for brush functions.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 33dddc84cf84f73d83635b3bb8cde105500c50e6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=33dddc84cf84f73d83635b3b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Oct 8 13:35:41 2021 +0200 win32u: Use syscall interface for brush functions. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/win32u/gdiobj.c | 4 --- dlls/win32u/syscall.c | 4 +++ dlls/win32u/win32u.spec | 8 ++--- dlls/win32u/win32u_private.h | 5 --- dlls/win32u/wrappers.c | 21 ------------ dlls/wow64win/Makefile.in | 1 + dlls/wow64win/gdi.c | 71 ++++++++++++++++++++++++++++++++++++++++ dlls/wow64win/syscall.c | 7 ---- dlls/wow64win/syscall.h | 4 +++ dlls/wow64win/wow64win_private.h | 4 +++ 10 files changed, 88 insertions(+), 41 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=33dddc84cf84f73d8363…
1
0
0
0
Jacek Caban : gdi32: Use DLL forwarding for D3DKMT functions.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 2cc52c6e454ffa5846f8e5bdd1979ee2a8844467 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2cc52c6e454ffa5846f8e5bd…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Oct 8 13:34:55 2021 +0200 gdi32: Use DLL forwarding for D3DKMT functions. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/gdi32.spec | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index c6fe436b7c9..d0ffe827539 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -73,20 +73,20 @@ @ stdcall CreateScalableFontResourceA(long str str str) @ stdcall CreateScalableFontResourceW(long wstr wstr wstr) @ stdcall CreateSolidBrush(long) -@ stdcall D3DKMTCheckVidPnExclusiveOwnership(ptr) NtGdiDdDDICheckVidPnExclusiveOwnership -@ stdcall D3DKMTCloseAdapter(ptr) NtGdiDdDDICloseAdapter -@ stdcall D3DKMTCreateDCFromMemory(ptr) NtGdiDdDDICreateDCFromMemory -@ stdcall D3DKMTCreateDevice(ptr) NtGdiDdDDICreateDevice -@ stdcall D3DKMTDestroyDCFromMemory(ptr) NtGdiDdDDIDestroyDCFromMemory -@ stdcall D3DKMTDestroyDevice(ptr) NtGdiDdDDIDestroyDevice -@ stdcall D3DKMTEscape(ptr) NtGdiDdDDIEscape -@ stdcall D3DKMTOpenAdapterFromDeviceName(ptr) NtGdiDdDDIOpenAdapterFromDeviceName +@ stdcall D3DKMTCheckVidPnExclusiveOwnership(ptr) win32u.NtGdiDdDDICheckVidPnExclusiveOwnership +@ stdcall D3DKMTCloseAdapter(ptr) win32u.NtGdiDdDDICloseAdapter +@ stdcall D3DKMTCreateDCFromMemory(ptr) win32u.NtGdiDdDDICreateDCFromMemory +@ stdcall D3DKMTCreateDevice(ptr) win32u.NtGdiDdDDICreateDevice +@ stdcall D3DKMTDestroyDCFromMemory(ptr) win32u.NtGdiDdDDIDestroyDCFromMemory +@ stdcall D3DKMTDestroyDevice(ptr) win32u.NtGdiDdDDIDestroyDevice +@ stdcall D3DKMTEscape(ptr) win32u.NtGdiDdDDIEscape +@ stdcall D3DKMTOpenAdapterFromDeviceName(ptr) win32u.NtGdiDdDDIOpenAdapterFromDeviceName @ stdcall D3DKMTOpenAdapterFromGdiDisplayName(ptr) -@ stdcall D3DKMTOpenAdapterFromHdc(ptr) NtGdiDdDDIOpenAdapterFromHdc -@ stdcall D3DKMTOpenAdapterFromLuid(ptr) NtGdiDdDDIOpenAdapterFromLuid -@ stdcall D3DKMTQueryStatistics(ptr) NtGdiDdDDIQueryStatistics -@ stdcall D3DKMTSetQueuedLimit(ptr) NtGdiDdDDISetQueuedLimit -@ stdcall D3DKMTSetVidPnSourceOwner(ptr) NtGdiDdDDISetVidPnSourceOwner +@ stdcall D3DKMTOpenAdapterFromHdc(ptr) win32u.NtGdiDdDDIOpenAdapterFromHdc +@ stdcall D3DKMTOpenAdapterFromLuid(ptr) win32u.NtGdiDdDDIOpenAdapterFromLuid +@ stdcall D3DKMTQueryStatistics(ptr) win32u.NtGdiDdDDIQueryStatistics +@ stdcall D3DKMTSetQueuedLimit(ptr) win32u.NtGdiDdDDISetQueuedLimit +@ stdcall D3DKMTSetVidPnSourceOwner(ptr) win32u.NtGdiDdDDISetVidPnSourceOwner @ stdcall DPtoLP(long ptr long) @ stdcall DeleteColorSpace(long) @ stdcall DeleteDC(long)
1
0
0
0
← Newer
1
...
78
79
80
81
82
83
84
...
117
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200