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 : winebus.sys: Report WINEBUS\WINE_COMP_HID compatible id.
by Alexandre Julliard
02 Sep '21
02 Sep '21
Module: wine Branch: master Commit: 06ab0d5405f126efc25a38e02b26318896752694 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=06ab0d5405f126efc25a38e0…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Sep 1 07:47:25 2021 +0200 winebus.sys: Report WINEBUS\WINE_COMP_HID compatible id. And match it in winehid.sys instead of individual bus ids. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/main.c | 22 ++++++++++++++++++++-- dlls/winehid.sys/winehid.inf | 7 +------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index e9c85deb846..49385576d62 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -226,7 +226,7 @@ static WCHAR *get_device_id(DEVICE_OBJECT *device) return dst; } -static WCHAR *get_compatible_ids(DEVICE_OBJECT *device) +static WCHAR *get_hardware_ids(DEVICE_OBJECT *device) { struct device_extension *ext = (struct device_extension *)device->DeviceExtension; WCHAR *dst; @@ -240,6 +240,24 @@ static WCHAR *get_compatible_ids(DEVICE_OBJECT *device) return dst; } +static WCHAR *get_compatible_ids(DEVICE_OBJECT *device) +{ + static const WCHAR hid_compat[] = + { + 'W','I','N','E','B','U','S','\\','W','I','N','E','_','C','O','M','P','_','H','I','D',0 + }; + DWORD size = sizeof(hid_compat); + WCHAR *dst; + + if ((dst = ExAllocatePool(PagedPool, size + sizeof(WCHAR)))) + { + memcpy(dst, hid_compat, sizeof(hid_compat)); + dst[size / sizeof(WCHAR)] = 0; + } + + return dst; +} + static void remove_pending_irps(DEVICE_OBJECT *device) { struct device_extension *ext = device->DeviceExtension; @@ -444,7 +462,7 @@ static NTSTATUS handle_IRP_MN_QUERY_ID(DEVICE_OBJECT *device, IRP *irp) { case BusQueryHardwareIDs: TRACE("BusQueryHardwareIDs\n"); - irp->IoStatus.Information = (ULONG_PTR)get_compatible_ids(device); + irp->IoStatus.Information = (ULONG_PTR)get_hardware_ids(device); break; case BusQueryCompatibleIDs: TRACE("BusQueryCompatibleIDs\n"); diff --git a/dlls/winehid.sys/winehid.inf b/dlls/winehid.sys/winehid.inf index f9ed4091217..c1d8a1cf999 100644 --- a/dlls/winehid.sys/winehid.inf +++ b/dlls/winehid.sys/winehid.inf @@ -7,12 +7,7 @@ Class=HIDClass Wine=mfg_section [mfg_section] -Wine hidraw device=device_section,HIDRAW -Wine IOHID device=device_section,IOHID -Wine libevent device=device_section,LNXEV -Wine SDL HID device=device_section,SDLJOY -Wine mouse device=device_section,WINEMOUSE -Wine keyboard device=device_section,WINEKEYBOARD +Wine HID compatible device=device_section,WINEBUS\WINE_COMP_HID [device_section.Services] AddService = winehid,0x2,svc_section
1
0
0
0
Gijs Vermeulen : avicap32: Partially implement capCreateCaptureWindowW.
by Alexandre Julliard
02 Sep '21
02 Sep '21
Module: wine Branch: master Commit: b755d58b13e7c5b61ba7c78b9402b2c919d57b58 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b755d58b13e7c5b61ba7c78b…
Author: Gijs Vermeulen <gijsvrm(a)gmail.com> Date: Wed Sep 1 15:56:47 2021 -0500 avicap32: Partially implement capCreateCaptureWindowW. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=38011
Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/avicap32/Makefile.in | 1 + dlls/avicap32/avicap32_main.c | 76 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 61 insertions(+), 16 deletions(-) diff --git a/dlls/avicap32/Makefile.in b/dlls/avicap32/Makefile.in index a899a6207b0..b74c4726e8b 100644 --- a/dlls/avicap32/Makefile.in +++ b/dlls/avicap32/Makefile.in @@ -1,5 +1,6 @@ MODULE = avicap32.dll IMPORTLIB = avicap32 +IMPORTS = user32 EXTRALIBS = -Wl,--subsystem,unixlib EXTRADLLFLAGS = -mno-cygwin diff --git a/dlls/avicap32/avicap32_main.c b/dlls/avicap32/avicap32_main.c index d4608138d8b..3ce9d5240b8 100644 --- a/dlls/avicap32/avicap32_main.c +++ b/dlls/avicap32/avicap32_main.c @@ -30,37 +30,74 @@ WINE_DEFAULT_DEBUG_CHANNEL(avicap); +static HINSTANCE avicap_instance; static unixlib_handle_t unix_handle; +static const WCHAR class_name[] = L"wine_avicap_class"; + +static LRESULT CALLBACK avicap_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + switch (msg) + { + default: + if (msg >= WM_CAP_START && msg <= WM_CAP_END) + FIXME("Unhandled message %#x.\n", msg); + return DefWindowProcW(hwnd, msg, wparam, lparam); + } +} + +static void register_class(void) +{ + WNDCLASSEXW class = + { + .cbSize = sizeof(WNDCLASSEXW), + .lpfnWndProc = avicap_wndproc, + .hInstance = avicap_instance, + .hCursor = LoadCursorW(NULL, (LPWSTR)IDC_ARROW), + .hbrBackground = (HBRUSH)(COLOR_BTNFACE+1), + .lpszClassName = class_name, + }; + + if (!RegisterClassExW(&class) && GetLastError() != ERROR_CLASS_ALREADY_EXISTS) + ERR("Failed to register class, error %u.\n", GetLastError()); +} + +static void unregister_class(void) +{ + if (!UnregisterClassW(class_name, avicap_instance) && GetLastError() != ERROR_CLASS_DOES_NOT_EXIST) + ERR("Failed to unregister class, error %u.\n", GetLastError()); +} + /*********************************************************************** * capCreateCaptureWindowW (AVICAP32.@) */ -HWND VFWAPI capCreateCaptureWindowW(LPCWSTR lpszWindowName, DWORD dwStyle, INT x, - INT y, INT nWidth, INT nHeight, HWND hWnd, - INT nID) +HWND VFWAPI capCreateCaptureWindowW(const WCHAR *window_name, DWORD style, + int x, int y, int width, int height, HWND parent, int id) { - FIXME("(%s, %08x, %08x, %08x, %08x, %08x, %p, %08x): stub\n", - debugstr_w(lpszWindowName), dwStyle, x, y, nWidth, nHeight, hWnd, nID); - return 0; + TRACE("window_name %s, style %#x, x %d, y %d, width %d, height %d, parent %p, id %#x.\n", + debugstr_w(window_name), style, x, y, width, height, parent, id); + + return CreateWindowW(class_name, window_name, style, x, y, width, height, parent, NULL, avicap_instance, NULL); } /*********************************************************************** * capCreateCaptureWindowA (AVICAP32.@) */ -HWND VFWAPI capCreateCaptureWindowA(LPCSTR lpszWindowName, DWORD dwStyle, INT x, - INT y, INT nWidth, INT nHeight, HWND hWnd, - INT nID) -{ UNICODE_STRING nameW; - HWND retW; +HWND VFWAPI capCreateCaptureWindowA(const char *window_name, DWORD style, + int x, int y, int width, int height, HWND parent, int id) +{ + UNICODE_STRING nameW; + HWND window; - if (lpszWindowName) RtlCreateUnicodeStringFromAsciiz(&nameW, lpszWindowName); - else nameW.Buffer = NULL; + if (window_name) + RtlCreateUnicodeStringFromAsciiz(&nameW, window_name); + else + nameW.Buffer = NULL; - retW = capCreateCaptureWindowW(nameW.Buffer, dwStyle, x, y, nWidth, nHeight, - hWnd, nID); + window = capCreateCaptureWindowW(nameW.Buffer, style, x, y, width, height, parent, id); RtlFreeUnicodeString(&nameW); - return retW; + return window; } /*********************************************************************** @@ -105,6 +142,13 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) NtQueryVirtualMemory(GetCurrentProcess(), instance, MemoryWineUnixFuncs, &unix_handle, sizeof(unix_handle), NULL); DisableThreadLibraryCalls(instance); + register_class(); + avicap_instance = instance; + break; + + case DLL_PROCESS_DETACH: + if (!reserved) + unregister_class(); break; }
1
0
0
0
Zebediah Figura : avicap32: Build with msvcrt.
by Alexandre Julliard
02 Sep '21
02 Sep '21
Module: wine Branch: master Commit: abb17573ce52274387ff6e4d5015d5212f215321 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=abb17573ce52274387ff6e4d…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Sep 1 15:56:46 2021 -0500 avicap32: Build with msvcrt. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/avicap32/Makefile.in | 7 ++- dlls/avicap32/avicap32_main.c | 135 ++++++++--------------------------------- dlls/avicap32/unixlib.h | 33 ++++++++++ dlls/avicap32/v4l.c | 137 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 201 insertions(+), 111 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=abb17573ce52274387ff…
1
0
0
0
Zebediah Figura : server: Move the STATUS_ALERTED logic from async_request_complete() to async_terminate().
by Alexandre Julliard
02 Sep '21
02 Sep '21
Module: wine Branch: master Commit: 298a1b296baebf33df08c3dc3dbc0893a7d90d65 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=298a1b296baebf33df08c3dc…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Sep 1 17:28:41 2021 -0500 server: Move the STATUS_ALERTED logic from async_request_complete() to async_terminate(). In particular, don't mark asyncs with output data as "alerted", i.e. restartable. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 48 ++++++++++++++++++++++++-------------- server/async.c | 17 +++++++++----- 2 files changed, 41 insertions(+), 24 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=298a1b296baebf33df08…
1
0
0
0
Zebediah Figura : server: Use async_request_complete() in message_queue_read().
by Alexandre Julliard
02 Sep '21
02 Sep '21
Module: wine Branch: master Commit: 19d39239756342c6cba3a615db848c636cde64f7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=19d39239756342c6cba3a615…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Sep 1 17:28:40 2021 -0500 server: Use async_request_complete() in message_queue_read(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/named_pipe.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/server/named_pipe.c b/server/named_pipe.c index da3485dd2bc..20407badc4c 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -763,16 +763,20 @@ static int pipe_end_get_volume_info( struct fd *fd, struct async *async, unsigne return 0; } -static void message_queue_read( struct pipe_end *pipe_end, struct iosb *iosb ) +static void message_queue_read( struct pipe_end *pipe_end, struct async *async ) { + struct iosb *iosb = async_get_iosb( async ); + unsigned int status = STATUS_SUCCESS; struct pipe_message *message; + data_size_t out_size; if (pipe_end->flags & NAMED_PIPE_MESSAGE_STREAM_READ) { message = LIST_ENTRY( list_head(&pipe_end->message_queue), struct pipe_message, entry ); - iosb->out_size = min( iosb->out_size, message->iosb->in_size - message->read_pos ); - iosb->status = message->read_pos + iosb->out_size < message->iosb->in_size - ? STATUS_BUFFER_OVERFLOW : STATUS_SUCCESS; + out_size = min( iosb->out_size, message->iosb->in_size - message->read_pos ); + + if (message->read_pos + out_size < message->iosb->in_size) + status = STATUS_BUFFER_OVERFLOW; } else { @@ -782,14 +786,13 @@ static void message_queue_read( struct pipe_end *pipe_end, struct iosb *iosb ) avail += message->iosb->in_size - message->read_pos; if (avail >= iosb->out_size) break; } - iosb->out_size = min( iosb->out_size, avail ); - iosb->status = STATUS_SUCCESS; + out_size = min( iosb->out_size, avail ); } message = LIST_ENTRY( list_head(&pipe_end->message_queue), struct pipe_message, entry ); if (!message->read_pos && message->iosb->in_size == iosb->out_size) /* fast path */ { - iosb->out_data = message->iosb->in_data; + async_request_complete( async, status, out_size, out_size, message->iosb->in_data ); message->iosb->in_data = NULL; wake_message( message, message->iosb->in_size ); free_message( message ); @@ -799,17 +802,17 @@ static void message_queue_read( struct pipe_end *pipe_end, struct iosb *iosb ) data_size_t write_pos = 0, writing; char *buf = NULL; - if (iosb->out_size && !(buf = iosb->out_data = malloc( iosb->out_size ))) + if (out_size && !(buf = malloc( out_size ))) { - iosb->out_size = 0; - iosb->status = STATUS_NO_MEMORY; + async_terminate( async, STATUS_NO_MEMORY ); + release_object( iosb ); return; } do { message = LIST_ENTRY( list_head(&pipe_end->message_queue), struct pipe_message, entry ); - writing = min( iosb->out_size - write_pos, message->iosb->in_size - message->read_pos ); + writing = min( out_size - write_pos, message->iosb->in_size - message->read_pos ); if (writing) memcpy( buf + write_pos, (const char *)message->iosb->in_data + message->read_pos, writing ); write_pos += writing; message->read_pos += writing; @@ -818,9 +821,12 @@ static void message_queue_read( struct pipe_end *pipe_end, struct iosb *iosb ) wake_message(message, message->iosb->in_size); free_message(message); } - } while (write_pos < iosb->out_size); + } while (write_pos < out_size); + + async_request_complete( async, status, out_size, out_size, buf ); } - iosb->result = iosb->out_size; + + release_object( iosb ); } /* We call async_terminate in our reselect implementation, which causes recursive reselect. @@ -832,16 +838,12 @@ static void reselect_write_queue( struct pipe_end *pipe_end ); static void reselect_read_queue( struct pipe_end *pipe_end, int reselect_write ) { struct async *async; - struct iosb *iosb; ignore_reselect = 1; while (!list_empty( &pipe_end->message_queue ) && (async = find_pending_async( &pipe_end->read_q ))) { - iosb = async_get_iosb( async ); - message_queue_read( pipe_end, iosb ); - async_terminate( async, iosb->result ? STATUS_ALERTED : iosb->status ); + message_queue_read( pipe_end, async ); release_object( async ); - release_object( iosb ); reselect_write = 1; } ignore_reselect = 0;
1
0
0
0
Zebediah Figura : server: Add a helper to call async_request_complete() while allocating new memory.
by Alexandre Julliard
02 Sep '21
02 Sep '21
Module: wine Branch: master Commit: 559a8cea57053eff0b6c32d4e1c138a7e0fd0e38 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=559a8cea57053eff0b6c32d4…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Sep 1 17:28:39 2021 -0500 server: Add a helper to call async_request_complete() while allocating new memory. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/async.c | 15 +++++++++++++++ server/console.c | 7 +------ server/device.c | 6 +----- server/file.h | 2 ++ server/sock.c | 6 +----- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/server/async.c b/server/async.c index e71dceb201b..17ef709f89e 100644 --- a/server/async.c +++ b/server/async.c @@ -361,6 +361,21 @@ void async_request_complete( struct async *async, unsigned int status, data_size async_terminate( async, status ); } +/* complete a request-based async */ +void async_request_complete_alloc( struct async *async, unsigned int status, data_size_t result, + data_size_t out_size, const void *out_data ) +{ + void *out_data_copy = NULL; + + if (out_size && !(out_data_copy = memdup( out_data, out_size ))) + { + async_terminate( async, STATUS_NO_MEMORY ); + return; + } + + async_request_complete( async, status, result, out_size, out_data_copy ); +} + /* set the timeout of an async operation */ void async_set_timeout( struct async *async, timeout_t timeout, unsigned int status ) { diff --git a/server/console.c b/server/console.c index 94f7c37e7c5..3360f680448 100644 --- a/server/console.c +++ b/server/console.c @@ -1500,12 +1500,7 @@ DECL_HANDLER(get_next_console_request) { data_size_t out_size = min( iosb->out_size, get_req_data_size() ); data_size_t result = ioctl->code == IOCTL_CONDRV_WRITE_FILE ? iosb->in_size : out_size; - void *out_data; - - if (!out_size || (out_data = memdup( get_req_data(), out_size ))) - async_request_complete( async, status, result, out_size, out_data ); - else - async_terminate( async, STATUS_NO_MEMORY ); + async_request_complete_alloc( async, status, result, out_size, get_req_data() ); } release_object( async ); diff --git a/server/device.c b/server/device.c index 96389a1459b..29b36845e68 100644 --- a/server/device.c +++ b/server/device.c @@ -385,12 +385,8 @@ static void set_irp_result( struct irp_call *irp, unsigned int status, irp->file = NULL; if (irp->async) { - void *out_data; - out_size = min( irp->iosb->out_size, out_size ); - if (out_size && !(out_data = memdup( out_data, out_size ))) - out_size = 0; - async_request_complete( irp->async, status, result, out_size, out_data ); + async_request_complete_alloc( irp->async, status, result, out_size, out_data ); release_object( irp->async ); irp->async = NULL; } diff --git a/server/file.h b/server/file.h index 1c019a0667e..8e42cd3704e 100644 --- a/server/file.h +++ b/server/file.h @@ -229,6 +229,8 @@ extern int async_waiting( struct async_queue *queue ); extern void async_terminate( struct async *async, unsigned int status ); extern void async_request_complete( struct async *async, unsigned int status, data_size_t result, data_size_t out_size, void *out_data ); +extern void async_request_complete_alloc( struct async *async, unsigned int status, data_size_t result, + data_size_t out_size, const void *out_data ); extern void async_wake_up( struct async_queue *queue, unsigned int status ); extern struct completion *fd_get_completion( struct fd *fd, apc_param_t *p_key ); extern void fd_copy_completion( struct fd *src, struct fd *dst ); diff --git a/server/sock.c b/server/sock.c index 00d5d47edff..1e31b806986 100644 --- a/server/sock.c +++ b/server/sock.c @@ -710,7 +710,6 @@ static void complete_async_accept( struct sock *sock, struct accept_req *req ) else { obj_handle_t handle; - void *out_data; if (!(acceptsock = accept_socket( sock ))) { @@ -727,10 +726,7 @@ static void complete_async_accept( struct sock *sock, struct accept_req *req ) return; } - if (!(out_data = malloc( sizeof(handle) ))) return; - - memcpy( out_data, &handle, sizeof(handle) ); - async_request_complete( req->async, STATUS_SUCCESS, 0, sizeof(handle), out_data ); + async_request_complete_alloc( req->async, STATUS_SUCCESS, 0, sizeof(handle), &handle ); } }
1
0
0
0
Zebediah Figura : server: Introduce a helper to fill an iosb and terminate the async.
by Alexandre Julliard
02 Sep '21
02 Sep '21
Module: wine Branch: master Commit: 96593370cd7b1ec127270a1c4a95d055baf532c8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=96593370cd7b1ec127270a1c…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Sep 1 17:28:38 2021 -0500 server: Introduce a helper to fill an iosb and terminate the async. For convenience, and to centralize the STATUS_ALERTED logic into one place. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/async.c | 29 +++++++++++++ server/console.c | 51 ++++++++-------------- server/device.c | 14 +++--- server/file.h | 2 + server/named_pipe.c | 4 +- server/sock.c | 121 ++++++++++++++++++++++------------------------------ 6 files changed, 105 insertions(+), 116 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=96593370cd7b1ec12727…
1
0
0
0
Zebediah Figura : server: Do not create an iosb for IRP calls not associated with an async.
by Alexandre Julliard
02 Sep '21
02 Sep '21
Module: wine Branch: master Commit: fd4e7703e97fef65d809cde9125b45db3381c499 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fd4e7703e97fef65d809cde9…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Sep 1 17:28:37 2021 -0500 server: Do not create an iosb for IRP calls not associated with an async. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/async.c | 54 +++++++++++++++++++++++++++--------------------------- server/device.c | 36 +++++++++++++++++++----------------- server/file.h | 1 - 3 files changed, 46 insertions(+), 45 deletions(-) diff --git a/server/async.c b/server/async.c index 5deaf04d686..d45f234144d 100644 --- a/server/async.c +++ b/server/async.c @@ -282,32 +282,6 @@ void set_async_pending( struct async *async, int signal ) } } -/* create an async associated with iosb for async-based requests - * returned async must be passed to async_handoff */ -struct async *create_request_async( struct fd *fd, unsigned int comp_flags, const async_data_t *data ) -{ - struct async *async; - struct iosb *iosb; - - if (!(iosb = create_iosb( get_req_data(), get_req_data_size(), get_reply_max_size() ))) - return NULL; - - async = create_async( fd, current, data, iosb ); - release_object( iosb ); - if (async) - { - if (!(async->wait_handle = alloc_handle( current->process, async, SYNCHRONIZE, 0 ))) - { - release_object( async ); - return NULL; - } - async->pending = 0; - async->direct_result = 1; - async->comp_flags = comp_flags; - } - return async; -} - /* return async object status and wait handle to client */ obj_handle_t async_handoff( struct async *async, int success, data_size_t *result, int force_blocking ) { @@ -536,7 +510,7 @@ static void iosb_destroy( struct object *obj ) } /* allocate iosb struct */ -struct iosb *create_iosb( const void *in_data, data_size_t in_size, data_size_t out_size ) +static struct iosb *create_iosb( const void *in_data, data_size_t in_size, data_size_t out_size ) { struct iosb *iosb; @@ -558,6 +532,32 @@ struct iosb *create_iosb( const void *in_data, data_size_t in_size, data_size_t return iosb; } +/* create an async associated with iosb for async-based requests + * returned async must be passed to async_handoff */ +struct async *create_request_async( struct fd *fd, unsigned int comp_flags, const async_data_t *data ) +{ + struct async *async; + struct iosb *iosb; + + if (!(iosb = create_iosb( get_req_data(), get_req_data_size(), get_reply_max_size() ))) + return NULL; + + async = create_async( fd, current, data, iosb ); + release_object( iosb ); + if (async) + { + if (!(async->wait_handle = alloc_handle( current->process, async, SYNCHRONIZE, 0 ))) + { + release_object( async ); + return NULL; + } + async->pending = 0; + async->direct_result = 1; + async->comp_flags = comp_flags; + } + return async; +} + struct iosb *async_get_iosb( struct async *async ) { return async->iosb ? (struct iosb *)grab_object( async->iosb ) : NULL; diff --git a/server/device.c b/server/device.c index ef93a0a9024..a89c03f0fb0 100644 --- a/server/device.c +++ b/server/device.c @@ -369,11 +369,6 @@ static struct irp_call *create_irp( struct device_file *file, const irp_params_t irp->user_ptr = 0; if (async) irp->iosb = async_get_iosb( async ); - if (!irp->iosb && !(irp->iosb = create_iosb( NULL, 0, 0 ))) - { - release_object( irp ); - irp = NULL; - } } return irp; } @@ -382,21 +377,22 @@ static void set_irp_result( struct irp_call *irp, unsigned int status, const void *out_data, data_size_t out_size, data_size_t result ) { struct device_file *file = irp->file; - struct iosb *iosb = irp->iosb; if (!file) return; /* already finished */ - iosb->status = status; - iosb->result = result; - iosb->out_size = min( iosb->out_size, out_size ); - if (iosb->out_size && !(iosb->out_data = memdup( out_data, iosb->out_size ))) - iosb->out_size = 0; - /* remove it from the device queue */ list_remove( &irp->dev_entry ); irp->file = NULL; if (irp->async) { + struct iosb *iosb = irp->iosb; + + iosb->status = status; + iosb->result = result; + iosb->out_size = min( iosb->out_size, out_size ); + if (iosb->out_size && !(iosb->out_data = memdup( out_data, iosb->out_size ))) + iosb->out_size = 0; + if (result) status = STATUS_ALERTED; async_terminate( irp->async, status ); release_object( irp->async ); @@ -993,15 +989,21 @@ DECL_HANDLER(get_next_device_request) reply->client_tid = get_thread_id( thread ); iosb = irp->iosb; - reply->in_size = iosb->in_size; - if (iosb->in_size > get_reply_max_size()) set_error( STATUS_BUFFER_OVERFLOW ); + if (iosb) + reply->in_size = iosb->in_size; + + if (iosb && iosb->in_size > get_reply_max_size()) + set_error( STATUS_BUFFER_OVERFLOW ); else if (!irp->file || (reply->next = alloc_handle( current->process, irp, 0, 0 ))) { if (fill_irp_params( manager, irp, &reply->params )) { - set_reply_data_ptr( iosb->in_data, iosb->in_size ); - iosb->in_data = NULL; - iosb->in_size = 0; + if (iosb) + { + set_reply_data_ptr( iosb->in_data, iosb->in_size ); + iosb->in_data = NULL; + iosb->in_size = 0; + } list_remove( &irp->mgr_entry ); list_init( &irp->mgr_entry ); /* we already own the object if it's only on manager queue */ diff --git a/server/file.h b/server/file.h index 10b5c0d0493..f6c5832a733 100644 --- a/server/file.h +++ b/server/file.h @@ -230,7 +230,6 @@ extern void async_terminate( struct async *async, unsigned int status ); extern void async_wake_up( struct async_queue *queue, unsigned int status ); extern struct completion *fd_get_completion( struct fd *fd, apc_param_t *p_key ); extern void fd_copy_completion( struct fd *src, struct fd *dst ); -extern struct iosb *create_iosb( const void *in_data, data_size_t in_size, data_size_t out_size ); extern struct iosb *async_get_iosb( struct async *async ); extern struct thread *async_get_thread( struct async *async ); extern struct async *find_pending_async( struct async_queue *queue );
1
0
0
0
Zebediah Figura : server: Allow completing non-alerted asyncs with STATUS_PENDING.
by Alexandre Julliard
02 Sep '21
02 Sep '21
Module: wine Branch: master Commit: c4682cd928eacc923c9fbaaa5fb3c9101fa254b7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c4682cd928eacc923c9fbaaa…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Sep 1 17:28:36 2021 -0500 server: Allow completing non-alerted asyncs with STATUS_PENDING. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/async.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/server/async.c b/server/async.c index b414604fcd4..5deaf04d686 100644 --- a/server/async.c +++ b/server/async.c @@ -390,14 +390,11 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota assert( async->terminated ); /* it must have been woken up if we get a result */ - if (status == STATUS_PENDING) /* restart it */ + if (async->alerted && status == STATUS_PENDING) /* restart it */ { - if (async->alerted) - { - async->terminated = 0; - async->alerted = 0; - async_reselect( async ); - } + async->terminated = 0; + async->alerted = 0; + async_reselect( async ); } else {
1
0
0
0
Zebediah Figura : server: Allow calling async_terminate() with STATUS_PENDING.
by Alexandre Julliard
02 Sep '21
02 Sep '21
Module: wine Branch: master Commit: 0f332fc0393e5d89b0fb676c06890085fb5fae18 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0f332fc0393e5d89b0fb676c…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Sep 1 17:28:35 2021 -0500 server: Allow calling async_terminate() with STATUS_PENDING. We still don't quite handle this completely correctly, but we should at least avoid crashing the server due to a failed assertion. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/async.c | 2 -- server/device.c | 1 - 2 files changed, 3 deletions(-) diff --git a/server/async.c b/server/async.c index 1c3082083ed..b414604fcd4 100644 --- a/server/async.c +++ b/server/async.c @@ -156,8 +156,6 @@ static void async_destroy( struct object *obj ) /* notifies client thread of new status of its async request */ void async_terminate( struct async *async, unsigned int status ) { - assert( status != STATUS_PENDING ); - if (async->terminated) return; async->terminated = 1; diff --git a/server/device.c b/server/device.c index b669921a003..ef93a0a9024 100644 --- a/server/device.c +++ b/server/device.c @@ -386,7 +386,6 @@ static void set_irp_result( struct irp_call *irp, unsigned int status, if (!file) return; /* already finished */ - /* FIXME: handle the STATUS_PENDING case */ iosb->status = status; iosb->result = result; iosb->out_size = min( iosb->out_size, out_size );
1
0
0
0
← Newer
1
...
95
96
97
98
99
100
101
102
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