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
September 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
1030 discussions
Start a n
N
ew thread
Rémi Bernon : dinput8/tests: Make ret_length optional in struct hid_expect.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: e293db88a81bb364a773aaba5be4bc568f332f22 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e293db88a81bb364a773aaba…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 17 09:06:23 2021 +0200 dinput8/tests: Make ret_length optional in struct hid_expect. So that we don't have to specify it explicitely every time. Input reports length is now enforced, and we don't mean to test the length every time we inject input. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput8/tests/driver_hid.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/dlls/dinput8/tests/driver_hid.c b/dlls/dinput8/tests/driver_hid.c index 28694e5a4c6..f484710e498 100644 --- a/dlls/dinput8/tests/driver_hid.c +++ b/dlls/dinput8/tests/driver_hid.c @@ -225,11 +225,15 @@ static void input_queue_cleanup( struct input_queue *queue ) static BOOL input_queue_read_locked( struct input_queue *queue, IRP *irp ) { + IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation( irp ); + ULONG out_size = stack->Parameters.DeviceIoControl.OutputBufferLength; struct hid_expect *tmp = queue->pos; + if (tmp >= queue->end) return FALSE; + if (tmp->ret_length) out_size = tmp->ret_length; - memcpy( irp->UserBuffer, tmp->report_buf, tmp->ret_length ); - irp->IoStatus.Information = tmp->ret_length; + memcpy( irp->UserBuffer, tmp->report_buf, out_size ); + irp->IoStatus.Information = out_size; irp->IoStatus.Status = tmp->ret_status; if (tmp < queue->end) queue->pos = tmp + 1; @@ -464,7 +468,7 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp ) "unexpected data\n" ); winetest_pop_context(); - irp->IoStatus.Information = expect.ret_length; + irp->IoStatus.Information = expect.ret_length ? expect.ret_length : expect.report_len; ret = expect.ret_status; break; } @@ -487,8 +491,8 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp ) ok( packet->reportBufferLen == expect.report_len, "got len %u\n", packet->reportBufferLen ); winetest_pop_context(); - memcpy( packet->reportBuffer, expect.report_buf, expect.ret_length ); - irp->IoStatus.Information = expect.ret_length; + irp->IoStatus.Information = expect.ret_length ? expect.ret_length : expect.report_len; + memcpy( packet->reportBuffer, expect.report_buf, irp->IoStatus.Information ); ret = expect.ret_status; break; } @@ -513,7 +517,7 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp ) "unexpected data\n" ); winetest_pop_context(); - irp->IoStatus.Information = expect.ret_length; + irp->IoStatus.Information = expect.ret_length ? expect.ret_length : expect.report_len; ret = expect.ret_status; break; } @@ -536,8 +540,8 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp ) ok( packet->reportBufferLen == expect.report_len, "got len %u\n", packet->reportBufferLen ); winetest_pop_context(); - memcpy( packet->reportBuffer, expect.report_buf, expect.ret_length ); - irp->IoStatus.Information = expect.ret_length; + irp->IoStatus.Information = expect.ret_length ? expect.ret_length : expect.report_len; + memcpy( packet->reportBuffer, expect.report_buf, irp->IoStatus.Information ); ret = expect.ret_status; break; } @@ -562,7 +566,7 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp ) "unexpected data\n" ); winetest_pop_context(); - irp->IoStatus.Information = expect.ret_length; + irp->IoStatus.Information = expect.ret_length ? expect.ret_length : expect.report_len; ret = expect.ret_status; break; }
1
0
0
0
Rémi Bernon : dinput: Fire the notification only after all events have been queued.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 91d9819c95b19ca983656f157c9a6cf399063127 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=91d9819c95b19ca983656f15…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 17 09:06:22 2021 +0200 dinput: Fire the notification only after all events have been queued. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/device.c | 3 --- dlls/dinput/joystick_hid.c | 2 ++ dlls/dinput/joystick_linux.c | 3 +++ dlls/dinput/joystick_linuxinput.c | 3 +++ dlls/dinput/joystick_osx.c | 6 ++++++ dlls/dinput/keyboard.c | 1 + dlls/dinput/mouse.c | 16 ++++++++++++++++ 7 files changed, 31 insertions(+), 3 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index e04d40e5a7c..17eaff69d50 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -986,9 +986,6 @@ void queue_event( IDirectInputDevice8W *iface, int inst_id, DWORD data, DWORD ti int next_pos, ofs = id_to_offset(&This->data_format, inst_id); ULONGLONG time_ms = GetTickCount64(); - /* Event is being set regardless of the queue state */ - if (This->hEvent) SetEvent(This->hEvent); - if (time_ms - notify_ms > 1000) { PostMessageW(GetDesktopWindow(), WM_WINE_NOTIFY_ACTIVITY, 0, 0); diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 3ef6f0db9cc..709953be8f0 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -908,6 +908,8 @@ static HRESULT hid_joystick_read_state( IDirectInputDevice8W *iface ) enum_value_objects( impl, &filter, DIDFT_ALL, read_device_state_value, ¶ms ); enum_button_objects( impl, &filter, DIDFT_ALL, check_device_state_button, ¶ms ); + if (memcmp( ¶ms.old_state, &impl->state, sizeof(impl->state) ) && impl->base.hEvent) + SetEvent( impl->base.hEvent ); } memset( &impl->read_ovl, 0, sizeof(impl->read_ovl) ); diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index 3a8b0f07704..c439cca81c3 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -777,7 +777,10 @@ static void joy_polldev( IDirectInputDevice8W *iface ) } } if (inst_id >= 0) + { queue_event(iface, inst_id, value, GetCurrentTime(), This->generic.base.dinput->evsequence++); + if (This->generic.base.hEvent) SetEvent( This->generic.base.hEvent ); + } } } diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 27dd75a8b55..8279ffbf74a 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -806,8 +806,11 @@ static void joy_polldev( IDirectInputDevice8W *iface ) break; } if (inst_id >= 0) + { queue_event(iface, inst_id, value, GetCurrentTime(), This->generic.base.dinput->evsequence++); + if (This->generic.base.hEvent) SetEvent( This->generic.base.hEvent ); + } } } diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c index 62a063b6da1..e8732bd696c 100644 --- a/dlls/dinput/joystick_osx.c +++ b/dlls/dinput/joystick_osx.c @@ -840,6 +840,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface ) { inst_id = DIDFT_MAKEINSTANCE(button_idx) | DIDFT_PSHBUTTON; queue_event(iface,inst_id,newVal,GetCurrentTime(),device->generic.base.dinput->evsequence++); + if (device->generic.base.hEvent) + SetEvent( device->generic.base.hEvent ); } button_idx ++; } @@ -870,6 +872,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface ) { inst_id = DIDFT_MAKEINSTANCE(pov_idx) | DIDFT_POV; queue_event(iface,inst_id,newVal,GetCurrentTime(),device->generic.base.dinput->evsequence++); + if (device->generic.base.hEvent) + SetEvent( device->generic.base.hEvent ); } pov_idx ++; break; @@ -947,6 +951,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface ) { inst_id = DIDFT_MAKEINSTANCE(wine_obj) | DIDFT_ABSAXIS; queue_event(iface,inst_id,newVal,GetCurrentTime(),device->generic.base.dinput->evsequence++); + if (device->generic.base.hEvent) + SetEvent( device->generic.base.hEvent ); } break; diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index 5d532ab8059..3e1cac1733f 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -127,6 +127,7 @@ int dinput_keyboard_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lpa EnterCriticalSection(&This->base.crit); queue_event(iface, DIDFT_MAKEINSTANCE(dik_code) | DIDFT_PSHBUTTON, new_diks, GetCurrentTime(), This->base.dinput->evsequence++); + if (This->base.hEvent) SetEvent( This->base.hEvent ); LeaveCriticalSection(&This->base.crit); return ret; diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index 9f696cb414a..0ab791c69a5 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -234,6 +234,7 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA POINT rel, pt; DWORD seq; int i, wdata = 0; + BOOL notify = FALSE; static const USHORT mouse_button_flags[] = { @@ -277,12 +278,18 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA } if (rel.x) + { queue_event( iface, DIDFT_MAKEINSTANCE(WINE_MOUSE_X_AXIS_INSTANCE) | DIDFT_RELAXIS, pt.x, GetCurrentTime(), seq ); + notify = TRUE; + } if (rel.y) + { queue_event( iface, DIDFT_MAKEINSTANCE(WINE_MOUSE_Y_AXIS_INSTANCE) | DIDFT_RELAXIS, pt.y, GetCurrentTime(), seq ); + notify = TRUE; + } if (rel.x || rel.y) { @@ -296,6 +303,7 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA This->m_state.lZ += (wdata = (SHORT)ri->data.mouse.usButtonData); queue_event( iface, DIDFT_MAKEINSTANCE(WINE_MOUSE_Z_AXIS_INSTANCE) | DIDFT_RELAXIS, wdata, GetCurrentTime(), seq ); + notify = TRUE; } for (i = 0; i < ARRAY_SIZE(mouse_button_flags); ++i) @@ -305,9 +313,11 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA This->m_state.rgbButtons[i / 2] = 0x80 - (i % 2) * 0x80; queue_event( iface, DIDFT_MAKEINSTANCE(WINE_MOUSE_BUTTONS_INSTANCE +(i / 2) ) | DIDFT_PSHBUTTON, This->m_state.rgbButtons[i / 2], GetCurrentTime(), seq ); + notify = TRUE; } } + if (notify && This->base.hEvent) SetEvent( This->base.hEvent ); LeaveCriticalSection( &This->base.crit ); } @@ -317,6 +327,7 @@ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam MSLLHOOKSTRUCT *hook = (MSLLHOOKSTRUCT *)lparam; SysMouseImpl *This = impl_from_IDirectInputDevice8W( iface ); int wdata = 0, inst_id = -1, ret = 0; + BOOL notify = FALSE; TRACE("msg %lx @ (%d %d)\n", wparam, hook->pt.x, hook->pt.y); @@ -347,8 +358,11 @@ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam { /* Already have X, need to queue it */ if (inst_id != -1) + { queue_event(iface, inst_id, wdata, GetCurrentTime(), This->base.dinput->evsequence); + notify = TRUE; + } inst_id = DIDFT_MAKEINSTANCE(WINE_MOUSE_Y_AXIS_INSTANCE) | DIDFT_RELAXIS; wdata = pt1.y; } @@ -408,8 +422,10 @@ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam _dump_mouse_state(&This->m_state); queue_event(iface, inst_id, wdata, GetCurrentTime(), This->base.dinput->evsequence++); + notify = TRUE; } + if (notify && This->base.hEvent) SetEvent( This->base.hEvent ); LeaveCriticalSection(&This->base.crit); return ret; }
1
0
0
0
Rémi Bernon : winebus.sys: Use wide character strings literals.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 334d89a253e12aacb729e8eecf1692cb4bef9d3e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=334d89a253e12aacb729e8ee…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 17 08:50:35 2021 +0200 winebus.sys: Use wide character strings literals. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/main.c | 61 +++++++++++++++++-------------------------------- 1 file changed, 21 insertions(+), 40 deletions(-) diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index 6ba3e7c73ce..d3f40806e73 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -196,30 +196,28 @@ static DWORD get_device_index(struct device_desc *desc) static WCHAR *get_instance_id(DEVICE_OBJECT *device) { - static const WCHAR formatW[] = {'%','i','&','%','s','&','%','x','&','%','i',0}; struct device_extension *ext = (struct device_extension *)device->DeviceExtension; DWORD len = wcslen(ext->serialnumber) + 33; WCHAR *dst; if ((dst = ExAllocatePool(PagedPool, len * sizeof(WCHAR)))) - swprintf(dst, len, formatW, ext->desc.version, ext->serialnumber, ext->desc.uid, ext->index); + swprintf(dst, len, L"%i&%s&%x&%i", ext->desc.version, ext->serialnumber, ext->desc.uid, ext->index); return dst; } static WCHAR *get_device_id(DEVICE_OBJECT *device) { - static const WCHAR input_formatW[] = {'&','M','I','_','%','0','2','u',0}; - static const WCHAR formatW[] = {'%','s','\\','v','i','d','_','%','0','4','x', - '&','p','i','d','_','%','0','4','x',0}; + static const WCHAR input_format[] = L"&MI_%02u"; + static const WCHAR format[] = L"%s\\vid_%04x&pid_%04x"; struct device_extension *ext = (struct device_extension *)device->DeviceExtension; DWORD pos = 0, len = wcslen(ext->desc.busid) + 34; WCHAR *dst; if ((dst = ExAllocatePool(PagedPool, len * sizeof(WCHAR)))) { - pos += swprintf(dst + pos, len - pos, formatW, ext->desc.busid, ext->desc.vid, ext->desc.pid); - if (ext->desc.input != -1) pos += swprintf(dst + pos, len - pos, input_formatW, ext->desc.input); + pos += swprintf(dst + pos, len - pos, format, ext->desc.busid, ext->desc.vid, ext->desc.pid); + if (ext->desc.input != -1) pos += swprintf(dst + pos, len - pos, input_format, ext->desc.input); } return dst; @@ -241,14 +239,8 @@ static WCHAR *get_hardware_ids(DEVICE_OBJECT *device) static WCHAR *get_compatible_ids(DEVICE_OBJECT *device) { - static const WCHAR xinput_compat[] = - { - 'W','I','N','E','B','U','S','\\','W','I','N','E','_','C','O','M','P','_','X','I','N','P','U','T',0 - }; - static const WCHAR hid_compat[] = - { - 'W','I','N','E','B','U','S','\\','W','I','N','E','_','C','O','M','P','_','H','I','D',0 - }; + static const WCHAR xinput_compat[] = L"WINEBUS\\WINE_COMP_XINPUT"; + static const WCHAR hid_compat[] = L"WINEBUS\\WINE_COMP_HID"; struct device_extension *ext = (struct device_extension *)device->DeviceExtension; DWORD size = sizeof(hid_compat); WCHAR *dst; @@ -281,7 +273,6 @@ static void remove_pending_irps(DEVICE_OBJECT *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; DEVICE_OBJECT *device; UNICODE_STRING nameW; @@ -290,7 +281,7 @@ static DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, struct uni TRACE("desc %s, unix_device %p\n", debugstr_device_desc(desc), unix_device); - swprintf(dev_name, ARRAY_SIZE(dev_name), device_name_fmtW, desc->busid, unix_device); + swprintf(dev_name, ARRAY_SIZE(dev_name), L"\\Device\\%s#%p", desc->busid, unix_device); RtlInitUnicodeString(&nameW, dev_name); status = IoCreateDevice(driver_obj, sizeof(struct device_extension), &nameW, 0, 0, FALSE, &device); if (status) @@ -381,13 +372,16 @@ static NTSTATUS build_device_relations(DEVICE_RELATIONS **devices) return STATUS_SUCCESS; } -static DWORD check_bus_option(const UNICODE_STRING *option, DWORD default_value) +static DWORD check_bus_option(const WCHAR *option, DWORD default_value) { char buffer[FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[sizeof(DWORD)])]; KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)buffer; + UNICODE_STRING str; DWORD size; - if (NtQueryValueKey(driver_key, option, KeyValuePartialInformation, info, sizeof(buffer), &size) == STATUS_SUCCESS) + RtlInitUnicodeString(&str, option); + + if (NtQueryValueKey(driver_key, &str, KeyValuePartialInformation, info, sizeof(buffer), &size) == STATUS_SUCCESS) { if (info->Type == REG_DWORD) return *(DWORD *)info->Data; } @@ -645,8 +639,6 @@ static void sdl_bus_free_mappings(struct sdl_bus_options *options) static void sdl_bus_load_mappings(struct sdl_bus_options *options) { - static const WCHAR szPath[] = {'m','a','p',0}; - ULONG idx = 0, len, count = 0, capacity, info_size, info_max_size; KEY_VALUE_FULL_INFORMATION *info; OBJECT_ATTRIBUTES attr = {0}; @@ -658,7 +650,7 @@ static void sdl_bus_load_mappings(struct sdl_bus_options *options) options->mappings_count = 0; options->mappings = NULL; - RtlInitUnicodeString(&path, szPath); + RtlInitUnicodeString(&path, L"map"); InitializeObjectAttributes(&attr, &path, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, driver_key, NULL); status = NtOpenKey(&key, KEY_ALL_ACCESS, &attr); if (status) return; @@ -715,20 +707,17 @@ done: static NTSTATUS sdl_driver_init(void) { - static const WCHAR bus_name[] = {'S','D','L',0}; - static const WCHAR controller_modeW[] = {'M','a','p',' ','C','o','n','t','r','o','l','l','e','r','s',0}; - static const UNICODE_STRING controller_mode = {sizeof(controller_modeW) - sizeof(WCHAR), sizeof(controller_modeW), (WCHAR*)controller_modeW}; struct sdl_bus_options bus_options; struct bus_main_params bus = { - .name = bus_name, + .name = L"SDL", .init_args = &bus_options, .init_code = sdl_init, .wait_code = sdl_wait, }; NTSTATUS status; - bus_options.map_controllers = check_bus_option(&controller_mode, 1); + bus_options.map_controllers = check_bus_option(L"Map Controllers", 1); if (!bus_options.map_controllers) TRACE("SDL controller to XInput HID gamepad mapping disabled\n"); sdl_bus_load_mappings(&bus_options); @@ -739,23 +728,18 @@ static NTSTATUS sdl_driver_init(void) static NTSTATUS udev_driver_init(void) { - static const WCHAR bus_name[] = {'U','D','E','V',0}; - static const WCHAR hidraw_disabledW[] = {'D','i','s','a','b','l','e','H','i','d','r','a','w',0}; - static const UNICODE_STRING hidraw_disabled = {sizeof(hidraw_disabledW) - sizeof(WCHAR), sizeof(hidraw_disabledW), (WCHAR*)hidraw_disabledW}; - static const WCHAR input_disabledW[] = {'D','i','s','a','b','l','e','I','n','p','u','t',0}; - static const UNICODE_STRING input_disabled = {sizeof(input_disabledW) - sizeof(WCHAR), sizeof(input_disabledW), (WCHAR*)input_disabledW}; struct udev_bus_options bus_options; struct bus_main_params bus = { - .name = bus_name, + .name = L"UDEV", .init_args = &bus_options, .init_code = udev_init, .wait_code = udev_wait, }; - bus_options.disable_hidraw = check_bus_option(&hidraw_disabled, 0); + bus_options.disable_hidraw = check_bus_option(L"DisableHidraw", 0); if (bus_options.disable_hidraw) TRACE("UDEV hidraw devices disabled in registry\n"); - bus_options.disable_input = check_bus_option(&input_disabled, 0); + bus_options.disable_input = check_bus_option(L"DisableInput", 0); if (bus_options.disable_input) TRACE("UDEV input devices disabled in registry\n"); return bus_main_thread_start(&bus); @@ -763,11 +747,10 @@ static NTSTATUS udev_driver_init(void) static NTSTATUS iohid_driver_init(void) { - static const WCHAR bus_name[] = {'I','O','H','I','D'}; struct iohid_bus_options bus_options; struct bus_main_params bus = { - .name = bus_name, + .name = L"IOHID", .init_args = &bus_options, .init_code = iohid_init, .wait_code = iohid_wait, @@ -778,8 +761,6 @@ static NTSTATUS iohid_driver_init(void) static NTSTATUS fdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) { - static const WCHAR SDL_enabledW[] = {'E','n','a','b','l','e',' ','S','D','L',0}; - static const UNICODE_STRING SDL_enabled = {sizeof(SDL_enabledW) - sizeof(WCHAR), sizeof(SDL_enabledW), (WCHAR*)SDL_enabledW}; IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation(irp); NTSTATUS ret; @@ -792,7 +773,7 @@ static NTSTATUS fdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) mouse_device_create(); keyboard_device_create(); - if (!check_bus_option(&SDL_enabled, 1) || sdl_driver_init()) + if (!check_bus_option(L"Enable SDL", 1) || sdl_driver_init()) { udev_driver_init(); iohid_driver_init();
1
0
0
0
Rémi Bernon : winebus.sys: Use new unixlib subsystem.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 5bbf1d1095e77fcd202b00ecfa1805bda6b7a1a6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5bbf1d1095e77fcd202b00ec…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 17 08:50:34 2021 +0200 winebus.sys: Use new unixlib subsystem. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/Makefile.in | 2 +- dlls/winebus.sys/bus_iohid.c | 12 ++++++------ dlls/winebus.sys/bus_sdl.c | 12 ++++++------ dlls/winebus.sys/bus_udev.c | 12 ++++++------ dlls/winebus.sys/main.c | 7 ++++--- dlls/winebus.sys/unix_private.h | 18 +++++++++--------- dlls/winebus.sys/unixlib.c | 25 +++++++++---------------- dlls/winebus.sys/unixlib.h | 2 -- 8 files changed, 41 insertions(+), 49 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=5bbf1d1095e77fcd202b…
1
0
0
0
Rémi Bernon : winebus.sys: Use a pthread_mutex_t instead of CRITICAL_SECTION.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: cc2f669390c051f972c8eea48dee9f8d0a820d84 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cc2f669390c051f972c8eea4…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 17 08:50:33 2021 +0200 winebus.sys: Use a pthread_mutex_t instead of CRITICAL_SECTION. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/Makefile.in | 2 +- dlls/winebus.sys/bus_iohid.c | 19 +++++++------------ dlls/winebus.sys/bus_sdl.c | 20 +++++++------------- dlls/winebus.sys/bus_udev.c | 35 +++++++++++++++-------------------- 4 files changed, 30 insertions(+), 46 deletions(-) diff --git a/dlls/winebus.sys/Makefile.in b/dlls/winebus.sys/Makefile.in index 1675bf1951c..ec731c2b85c 100644 --- a/dlls/winebus.sys/Makefile.in +++ b/dlls/winebus.sys/Makefile.in @@ -1,6 +1,6 @@ MODULE = winebus.sys IMPORTS = ntoskrnl advapi32 -EXTRALIBS = $(IOKIT_LIBS) $(UDEV_LIBS) +EXTRALIBS = $(IOKIT_LIBS) $(UDEV_LIBS) $(PTHREAD_LIBS) EXTRAINCL = $(UDEV_CFLAGS) $(SDL2_CFLAGS) EXTRADLLFLAGS = -mno-cygwin -Wl,--subsystem,native diff --git a/dlls/winebus.sys/bus_iohid.c b/dlls/winebus.sys/bus_iohid.c index 70a7cd0b005..8dc9e6c3df1 100644 --- a/dlls/winebus.sys/bus_iohid.c +++ b/dlls/winebus.sys/bus_iohid.c @@ -83,6 +83,8 @@ #undef PAGE_SHIFT #endif /* HAVE_IOKIT_HID_IOHIDLIB_H */ +#include <pthread.h> + #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -98,14 +100,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(plugplay); #ifdef HAVE_IOHIDMANAGERCREATE -static CRITICAL_SECTION iohid_cs; -static CRITICAL_SECTION_DEBUG iohid_cs_debug = -{ - 0, 0, &iohid_cs, - { &iohid_cs_debug.ProcessLocksList, &iohid_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": iohid_cs") } -}; -static CRITICAL_SECTION iohid_cs = { &iohid_cs_debug, -1, 0, 0, 0, 0 }; +static pthread_mutex_t iohid_cs = PTHREAD_MUTEX_INITIALIZER; static IOHIDManagerRef hid_manager; static CFRunLoopRef run_loop; @@ -184,9 +179,9 @@ static void iohid_device_stop(struct unix_device *iface) IOHIDDeviceRegisterInputReportCallback(private->device, NULL, 0, NULL, NULL); - RtlEnterCriticalSection(&iohid_cs); + pthread_mutex_lock(&iohid_cs); list_remove(&private->unix_device.entry); - RtlLeaveCriticalSection(&iohid_cs); + pthread_mutex_unlock(&iohid_cs); } static NTSTATUS iohid_device_get_report_descriptor(struct unix_device *iface, BYTE *buffer, @@ -407,9 +402,9 @@ NTSTATUS WINAPI iohid_bus_wait(void *args) do { if (bus_event_queue_pop(&event_queue, result)) return STATUS_PENDING; - RtlEnterCriticalSection(&iohid_cs); + pthread_mutex_lock(&iohid_cs); ret = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 10, TRUE); - RtlLeaveCriticalSection(&iohid_cs); + pthread_mutex_unlock(&iohid_cs); } while (ret != kCFRunLoopRunStopped); TRACE("IOHID main loop exiting\n"); diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 956340faf02..b7c3b28ba4e 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -35,6 +35,8 @@ # include <SDL.h> #endif +#include <pthread.h> + #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -62,15 +64,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(plugplay); WINE_DECLARE_DEBUG_CHANNEL(hid_report); -static CRITICAL_SECTION sdl_cs; -static CRITICAL_SECTION_DEBUG sdl_cs_debug = -{ - 0, 0, &sdl_cs, - { &sdl_cs_debug.ProcessLocksList, &sdl_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": sdl_cs") } -}; -static CRITICAL_SECTION sdl_cs = { &sdl_cs_debug, -1, 0, 0, 0, 0 }; - +static pthread_mutex_t sdl_cs = PTHREAD_MUTEX_INITIALIZER; static const WCHAR sdl_busidW[] = {'S','D','L','J','O','Y',0}; static struct sdl_bus_options options; @@ -513,9 +507,9 @@ static void sdl_device_stop(struct unix_device *iface) if (private->sdl_controller) pSDL_GameControllerClose(private->sdl_controller); if (private->sdl_haptic) pSDL_HapticClose(private->sdl_haptic); - RtlEnterCriticalSection(&sdl_cs); + pthread_mutex_lock(&sdl_cs); list_remove(&private->unix_device.entry); - RtlLeaveCriticalSection(&sdl_cs); + pthread_mutex_unlock(&sdl_cs); } static NTSTATUS sdl_device_get_reportdescriptor(struct unix_device *iface, BYTE *buffer, @@ -787,7 +781,7 @@ static void process_device_event(SDL_Event *event) TRACE_(hid_report)("Received action %x\n", event->type); - RtlEnterCriticalSection(&sdl_cs); + pthread_mutex_lock(&sdl_cs); if (event->type == SDL_JOYDEVICEADDED) sdl_add_device(((SDL_JoyDeviceEvent *)event)->which); @@ -813,7 +807,7 @@ static void process_device_event(SDL_Event *event) else WARN("failed to find device with id %d\n", id); } - RtlLeaveCriticalSection(&sdl_cs); + pthread_mutex_unlock(&sdl_cs); } NTSTATUS WINAPI sdl_bus_init(void *args) diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 928548b8893..c73a6dd2259 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -58,6 +58,8 @@ # endif #endif +#include <pthread.h> + #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -91,14 +93,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(plugplay); WINE_DECLARE_DEBUG_CHANNEL(hid_report); -static CRITICAL_SECTION udev_cs; -static CRITICAL_SECTION_DEBUG udev_cs_debug = -{ - 0, 0, &udev_cs, - { &udev_cs_debug.ProcessLocksList, &udev_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": udev_cs") } -}; -static CRITICAL_SECTION udev_cs = { &udev_cs_debug, -1, 0, 0, 0, 0 }; +static pthread_mutex_t udev_cs = PTHREAD_MUTEX_INITIALIZER; static struct udev *udev_context = NULL; static struct udev_monitor *udev_monitor; @@ -622,9 +617,9 @@ static void hidraw_device_destroy(struct unix_device *iface) static NTSTATUS hidraw_device_start(struct unix_device *iface) { - RtlEnterCriticalSection(&udev_cs); + pthread_mutex_lock(&udev_cs); start_polling_device(iface); - RtlLeaveCriticalSection(&udev_cs); + pthread_mutex_unlock(&udev_cs); return STATUS_SUCCESS; } @@ -632,10 +627,10 @@ static void hidraw_device_stop(struct unix_device *iface) { struct platform_private *private = impl_from_unix_device(iface); - RtlEnterCriticalSection(&udev_cs); + pthread_mutex_lock(&udev_cs); stop_polling_device(iface); list_remove(&private->unix_device.entry); - RtlLeaveCriticalSection(&udev_cs); + pthread_mutex_unlock(&udev_cs); } static NTSTATUS hidraw_device_get_report_descriptor(struct unix_device *iface, BYTE *buffer, @@ -824,9 +819,9 @@ static NTSTATUS lnxev_device_start(struct unix_device *iface) if ((status = build_report_descriptor(ext, ext->base.udev_device))) return status; - RtlEnterCriticalSection(&udev_cs); + pthread_mutex_lock(&udev_cs); start_polling_device(iface); - RtlLeaveCriticalSection(&udev_cs); + pthread_mutex_unlock(&udev_cs); return STATUS_SUCCESS; } @@ -834,10 +829,10 @@ static void lnxev_device_stop(struct unix_device *iface) { struct wine_input_private *ext = input_impl_from_unix_device(iface); - RtlEnterCriticalSection(&udev_cs); + pthread_mutex_lock(&udev_cs); stop_polling_device(iface); list_remove(&ext->base.unix_device.entry); - RtlLeaveCriticalSection(&udev_cs); + pthread_mutex_unlock(&udev_cs); } static NTSTATUS lnxev_device_get_report_descriptor(struct unix_device *iface, BYTE *buffer, @@ -1246,16 +1241,16 @@ NTSTATUS WINAPI udev_bus_wait(void *args) { if (bus_event_queue_pop(&event_queue, result)) return STATUS_PENDING; - RtlEnterCriticalSection(&udev_cs); + pthread_mutex_lock(&udev_cs); while (close_count--) close(close_fds[close_count]); memcpy(pfd, poll_fds, poll_count * sizeof(*pfd)); count = poll_count; close_count = 0; - RtlLeaveCriticalSection(&udev_cs); + pthread_mutex_unlock(&udev_cs); while (poll(pfd, count, -1) <= 0) {} - RtlEnterCriticalSection(&udev_cs); + pthread_mutex_lock(&udev_cs); if (pfd[0].revents) process_monitor_event(udev_monitor); if (pfd[1].revents) read(deviceloop_control[0], &ctrl, 1); for (i = 2; i < count; ++i) @@ -1264,7 +1259,7 @@ NTSTATUS WINAPI udev_bus_wait(void *args) device = find_device_from_fd(pfd[i].fd); if (device) device->read_report(&device->unix_device); } - RtlLeaveCriticalSection(&udev_cs); + pthread_mutex_unlock(&udev_cs); } TRACE("UDEV main loop exiting\n");
1
0
0
0
Rémi Bernon : winebus.sys: Avoid process heap allocations on the unix side.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: 8f6932fd3510a8d939102e1c451e4175533e5e14 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8f6932fd3510a8d939102e1c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 17 08:50:32 2021 +0200 winebus.sys: Avoid process heap allocations on the unix side. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_iohid.c | 2 +- dlls/winebus.sys/bus_sdl.c | 10 ++++------ dlls/winebus.sys/bus_udev.c | 14 ++++++-------- dlls/winebus.sys/hid.c | 8 ++++---- dlls/winebus.sys/unixlib.c | 16 +++++++++------- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/dlls/winebus.sys/bus_iohid.c b/dlls/winebus.sys/bus_iohid.c index 0e36eac880c..70a7cd0b005 100644 --- a/dlls/winebus.sys/bus_iohid.c +++ b/dlls/winebus.sys/bus_iohid.c @@ -172,7 +172,7 @@ static NTSTATUS iohid_device_start(struct unix_device *iface) num = IOHIDDeviceGetProperty(private->device, CFSTR(kIOHIDMaxInputReportSizeKey)); length = CFNumberToDWORD(num); - private->buffer = RtlAllocateHeap(GetProcessHeap(), 0, length); + private->buffer = malloc(length); IOHIDDeviceRegisterInputReportCallback(private->device, private->buffer, length, handle_IOHIDDeviceIOHIDReportCallback, iface); return STATUS_SUCCESS; diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 79dff5007c0..956340faf02 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -374,8 +374,7 @@ static NTSTATUS build_report_descriptor(struct platform_private *ext) return STATUS_NO_MEMORY; ext->buffer_length = report_size; - if (!(ext->report_buffer = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, report_size))) - goto failed; + if (!(ext->report_buffer = calloc(1, report_size))) goto failed; /* Initialize axis in the report */ for (i = 0; i < axis_count; i++) @@ -386,7 +385,7 @@ static NTSTATUS build_report_descriptor(struct platform_private *ext) return STATUS_SUCCESS; failed: - RtlFreeHeap(GetProcessHeap(), 0, ext->report_buffer); + free(ext->report_buffer); hid_descriptor_free(&ext->desc); return STATUS_NO_MEMORY; } @@ -475,8 +474,7 @@ static NTSTATUS build_mapped_report_descriptor(struct platform_private *ext) if (!hid_descriptor_end(&ext->desc)) return STATUS_NO_MEMORY; - if (!(ext->report_buffer = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, ext->buffer_length))) - goto failed; + if (!(ext->report_buffer = calloc(1, ext->buffer_length))) goto failed; /* Initialize axis in the report */ for (i = SDL_CONTROLLER_AXIS_LEFTX; i < SDL_CONTROLLER_AXIS_MAX; i++) @@ -491,7 +489,7 @@ static NTSTATUS build_mapped_report_descriptor(struct platform_private *ext) return STATUS_SUCCESS; failed: - RtlFreeHeap(GetProcessHeap(), 0, ext->report_buffer); + free(ext->report_buffer); hid_descriptor_free(&ext->desc); return STATUS_NO_MEMORY; } diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index c859d5df546..928548b8893 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -548,10 +548,8 @@ static NTSTATUS build_report_descriptor(struct wine_input_private *ext, struct u TRACE("Report will be %i bytes\n", report_size); ext->buffer_length = report_size; - if (!(ext->current_report_buffer = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, report_size))) - goto failed; - if (!(ext->last_report_buffer = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, report_size))) - goto failed; + if (!(ext->current_report_buffer = calloc(1, report_size))) goto failed; + if (!(ext->last_report_buffer = calloc(1, report_size))) goto failed; ext->report_state = FIRST; /* Initialize axis in the report */ @@ -562,8 +560,8 @@ static NTSTATUS build_report_descriptor(struct wine_input_private *ext, struct u return STATUS_SUCCESS; failed: - RtlFreeHeap(GetProcessHeap(), 0, ext->current_report_buffer); - RtlFreeHeap(GetProcessHeap(), 0, ext->last_report_buffer); + free(ext->current_report_buffer); + free(ext->last_report_buffer); hid_descriptor_free(&ext->desc); return STATUS_NO_MEMORY; } @@ -811,8 +809,8 @@ static void lnxev_device_destroy(struct unix_device *iface) { struct wine_input_private *ext = input_impl_from_unix_device(iface); - RtlFreeHeap(GetProcessHeap(), 0, ext->current_report_buffer); - RtlFreeHeap(GetProcessHeap(), 0, ext->last_report_buffer); + free(ext->current_report_buffer); + free(ext->last_report_buffer); hid_descriptor_free(&ext->desc); udev_device_unref(ext->base.udev_device); diff --git a/dlls/winebus.sys/hid.c b/dlls/winebus.sys/hid.c index 959cbf7c428..0ad5efa2775 100644 --- a/dlls/winebus.sys/hid.c +++ b/dlls/winebus.sys/hid.c @@ -23,6 +23,7 @@ #endif #include <stdarg.h> +#include <stdlib.h> #include "ntstatus.h" #define WIN32_NO_STATUS @@ -40,13 +41,12 @@ static BOOL hid_descriptor_append(struct hid_descriptor *desc, const BYTE *buffe if (desc->size + size > desc->max_size) { desc->max_size = max(desc->max_size * 3 / 2, desc->size + size); - if (!desc->data) desc->data = RtlAllocateHeap(GetProcessHeap(), 0, desc->max_size); - else desc->data = RtlReAllocateHeap(GetProcessHeap(), 0, tmp, desc->max_size); + desc->data = realloc(tmp, desc->max_size); } if (!desc->data) { - RtlFreeHeap(GetProcessHeap(), 0, tmp); + free(tmp); return FALSE; } @@ -93,7 +93,7 @@ BOOL hid_descriptor_end(struct hid_descriptor *desc) void hid_descriptor_free(struct hid_descriptor *desc) { - RtlFreeHeap(GetProcessHeap(), 0, desc->data); + free(desc->data); } BOOL hid_descriptor_add_buttons(struct hid_descriptor *desc, USAGE usage_page, diff --git a/dlls/winebus.sys/unixlib.c b/dlls/winebus.sys/unixlib.c index f21b5a25b04..f33b7cacfe3 100644 --- a/dlls/winebus.sys/unixlib.c +++ b/dlls/winebus.sys/unixlib.c @@ -23,6 +23,8 @@ #include "config.h" #include <stdarg.h> +#include <stdlib.h> + #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -257,7 +259,7 @@ void *unix_device_create(const struct unix_device_vtbl *vtbl, SIZE_T size) { struct unix_device *iface; - if (!(iface = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, size))) return NULL; + if (!(iface = calloc(1, size))) return NULL; iface->vtbl = vtbl; iface->ref = 1; @@ -269,7 +271,7 @@ static void unix_device_decref(struct unix_device *iface) if (!InterlockedDecrement(&iface->ref)) { iface->vtbl->destroy(iface); - RtlFreeHeap(GetProcessHeap(), 0, iface); + free(iface); } } @@ -357,14 +359,14 @@ void bus_event_queue_destroy(struct list *queue) LIST_FOR_EACH_ENTRY_SAFE(event, next, queue, struct bus_event, entry) { bus_event_cleanup(event); - RtlFreeHeap(GetProcessHeap(), 0, event); + free(event); } } BOOL bus_event_queue_device_removed(struct list *queue, struct unix_device *device) { ULONG size = sizeof(struct bus_event); - struct bus_event *event = RtlAllocateHeap(GetProcessHeap(), 0, size); + struct bus_event *event = malloc(size); if (!event) return FALSE; if (unix_device_incref(device) == 1) return FALSE; /* being destroyed */ @@ -379,7 +381,7 @@ BOOL bus_event_queue_device_removed(struct list *queue, struct unix_device *devi BOOL bus_event_queue_device_created(struct list *queue, struct unix_device *device, struct device_desc *desc) { ULONG size = sizeof(struct bus_event); - struct bus_event *event = RtlAllocateHeap(GetProcessHeap(), 0, size); + struct bus_event *event = malloc(size); if (!event) return FALSE; if (unix_device_incref(device) == 1) return FALSE; /* being destroyed */ @@ -395,7 +397,7 @@ BOOL bus_event_queue_device_created(struct list *queue, struct unix_device *devi BOOL bus_event_queue_input_report(struct list *queue, struct unix_device *device, BYTE *report, USHORT length) { ULONG size = offsetof(struct bus_event, input_report.buffer[length]); - struct bus_event *event = RtlAllocateHeap(GetProcessHeap(), 0, size); + struct bus_event *event = malloc(size); if (!event) return FALSE; if (unix_device_incref(device) == 1) return FALSE; /* being destroyed */ @@ -424,7 +426,7 @@ BOOL bus_event_queue_pop(struct list *queue, struct bus_event *event) else size = offsetof(struct bus_event, input_report.buffer[event->input_report.length]); memcpy(event, tmp, size); - RtlFreeHeap(GetProcessHeap(), 0, tmp); + free(tmp); return TRUE; }
1
0
0
0
Rémi Bernon : winebus.sys: Build with msvcrt.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: e54ff70e5d910063c4183761873f0f432c9c0069 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e54ff70e5d910063c4183761…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 17 08:50:31 2021 +0200 winebus.sys: Build with msvcrt. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/Makefile.in | 2 +- dlls/winebus.sys/bus_iohid.c | 16 +++++++++------ dlls/winebus.sys/bus_sdl.c | 16 +++++++++------ dlls/winebus.sys/bus_udev.c | 16 +++++++++------ dlls/winebus.sys/hid.c | 4 ++++ dlls/winebus.sys/main.c | 43 +++++++++++++++++++++++++---------------- dlls/winebus.sys/unix_private.h | 18 ++++++++--------- dlls/winebus.sys/unixlib.c | 29 ++++++++++++++++++--------- dlls/winebus.sys/unixlib.h | 3 +-- 9 files changed, 91 insertions(+), 56 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=e54ff70e5d910063c418…
1
0
0
0
Derek Lesho : winegstreamer: Fix return code in init_gst failure case.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: wine Branch: master Commit: b9a7e961cdd39203866be38e90b1d901595d54ba URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b9a7e961cdd39203866be38e…
Author: Derek Lesho <dlesho(a)codeweavers.com> Date: Thu Sep 16 17:00:45 2021 -0400 winegstreamer: Fix return code in init_gst failure case. Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/quartz_parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 5299f4dc2ed..a8e7e3d979f 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -982,7 +982,10 @@ static HRESULT parser_sink_connect(struct strmbase_sink *iface, IPin *peer, cons goto err; if (!filter->init_gst(filter)) + { + hr = E_FAIL; goto err; + } for (i = 0; i < filter->source_count; ++i) {
1
0
0
0
Zebediah Figura : vkd3d-shader: Factor out a vkd3d_shader_trace_text() helper and use it in vkd3d_spirv_dump() (Valgrind).
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: vkd3d Branch: master Commit: 75a1a24d63f8e7ddca244968eb966574ad8d2c22 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=75a1a24d63f8e7ddca24496…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Sep 16 22:36:35 2021 -0500 vkd3d-shader: Factor out a vkd3d_shader_trace_text() helper and use it in vkd3d_spirv_dump() (Valgrind). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/spirv.c | 8 +------- libs/vkd3d-shader/vkd3d_shader_main.c | 9 +++++++-- libs/vkd3d-shader/vkd3d_shader_private.h | 3 +++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 6f948c3..f604b8e 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -127,13 +127,7 @@ static void vkd3d_spirv_dump(const struct vkd3d_shader_code *spirv, if (!vkd3d_spirv_binary_to_text(spirv, environment, options, &text)) { - const char *str, *current = text.code; - while ((str = strchr(current, '\n'))) - { - TRACE("%.*s\n", (int)(str - current), current); - current = str + 1; - } - + vkd3d_shader_trace_text(text.code, text.size); vkd3d_shader_free_shader_code(&text); } } diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 5d7cdf0..e38261b 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -98,12 +98,17 @@ int vkd3d_string_buffer_printf(struct vkd3d_string_buffer *buffer, const char *f void vkd3d_string_buffer_trace_(const struct vkd3d_string_buffer *buffer, const char *function) { - const char *p, *q, *end = buffer->buffer + buffer->content_size; + vkd3d_shader_trace_text_(buffer->buffer, buffer->content_size, function); +} + +void vkd3d_shader_trace_text_(const char *text, size_t size, const char *function) +{ + const char *p, *q, *end = text + size; if (!TRACE_ON()) return; - for (p = buffer->buffer; p < end; p = q) + for (p = text; p < end; p = q) { if (!(q = memchr(p, '\n', end - p))) q = end; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index b9c2cce..b02315a 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -984,6 +984,9 @@ void vkd3d_shader_vwarning(struct vkd3d_shader_message_context *context, const s void vkd3d_shader_dump_shader(enum vkd3d_shader_source_type source_type, enum vkd3d_shader_type shader_type, const struct vkd3d_shader_code *shader); +void vkd3d_shader_trace_text_(const char *text, size_t size, const char *function); +#define vkd3d_shader_trace_text(text, size) \ + vkd3d_shader_trace_text_(text, size, __FUNCTION__) int shader_extract_from_dxbc(const void *dxbc, size_t dxbc_length, struct vkd3d_shader_message_context *message_context, const char *source_name, struct vkd3d_shader_desc *desc);
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Write SM4 saturate instructions.
by Alexandre Julliard
17 Sep '21
17 Sep '21
Module: vkd3d Branch: master Commit: 155812b1249ce3a3a0b21fc281baedae0c802b2f URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=155812b1249ce3a3a0b21fc…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Sep 15 17:43:32 2021 -0500 vkd3d-shader/hlsl: Write SM4 saturate instructions. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- Makefile.am | 1 - libs/vkd3d-shader/hlsl_sm4.c | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 45db1a1..c9ad388 100644 --- a/Makefile.am +++ b/Makefile.am @@ -296,7 +296,6 @@ XFAIL_TESTS = \ tests/hlsl-vector-indexing-uniform.shader_test \ tests/math.shader_test \ tests/max.shader_test \ - tests/saturate.shader_test \ tests/trigonometry.shader_test \ tests/writemask-assignop-1.shader_test endif diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c index 24c586c..8a1d363 100644 --- a/libs/vkd3d-shader/hlsl_sm4.c +++ b/libs/vkd3d-shader/hlsl_sm4.c @@ -1023,6 +1023,12 @@ static void write_sm4_expr(struct hlsl_ctx *ctx, write_sm4_unary_op(buffer, VKD3D_SM4_OP_MOV, &expr->node, arg1, VKD3D_SM4_REGISTER_MODIFIER_NEGATE); break; + case HLSL_OP1_SAT: + write_sm4_unary_op(buffer, VKD3D_SM4_OP_MOV + | (VKD3D_SM4_INSTRUCTION_FLAG_SATURATE << VKD3D_SM4_INSTRUCTION_FLAGS_SHIFT), + &expr->node, arg1, 0); + break; + case HLSL_OP2_ADD: write_sm4_binary_op(buffer, VKD3D_SM4_OP_ADD, &expr->node, arg1, arg2); break;
1
0
0
0
← Newer
1
...
46
47
48
49
50
51
52
...
103
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
Results per page:
10
25
50
100
200