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
June 2020
----- 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
1 participants
947 discussions
Start a n
N
ew thread
Nikolay Sivov : evr: Implement MFT_MESSAGE_SET_D3D_MANAGER for default mixer.
by Alexandre Julliard
24 Jun '20
24 Jun '20
Module: wine Branch: master Commit: 3ba3d228fb20d35ebd04dbf7f8e223228228a6c8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3ba3d228fb20d35ebd04dbf7…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jun 24 16:25:35 2020 +0300 evr: Implement MFT_MESSAGE_SET_D3D_MANAGER for default mixer. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/evr/mixer.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index eaea037b69..931554b547 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -21,6 +21,7 @@ #include "wine/debug.h" #include "evr.h" #include "d3d9.h" +#include "dxva2api.h" #include "mfapi.h" #include "mferror.h" @@ -47,6 +48,9 @@ struct video_mixer struct input_stream inputs[MAX_MIXER_INPUT_STREAMS]; unsigned int input_ids[MAX_MIXER_INPUT_STREAMS]; unsigned int input_count; + + IDirect3DDeviceManager9 *device_manager; + CRITICAL_SECTION cs; }; @@ -151,6 +155,8 @@ static ULONG WINAPI video_mixer_transform_Release(IMFTransform *iface) if (mixer->inputs[i].attributes) IMFAttributes_Release(mixer->inputs[i].attributes); } + if (mixer->device_manager) + IDirect3DDeviceManager9_Release(mixer->device_manager); DeleteCriticalSection(&mixer->cs); free(mixer); } @@ -444,9 +450,32 @@ static HRESULT WINAPI video_mixer_transform_ProcessEvent(IMFTransform *iface, DW static HRESULT WINAPI video_mixer_transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param) { - FIXME("%p, %u, %#lx.\n", iface, message, param); + struct video_mixer *mixer = impl_from_IMFTransform(iface); + HRESULT hr = S_OK; - return E_NOTIMPL; + TRACE("%p, %u, %#lx.\n", iface, message, param); + + switch (message) + { + case MFT_MESSAGE_SET_D3D_MANAGER: + + EnterCriticalSection(&mixer->cs); + + if (mixer->device_manager) + IDirect3DDeviceManager9_Release(mixer->device_manager); + mixer->device_manager = NULL; + if (param) + hr = IUnknown_QueryInterface((IUnknown *)param, &IID_IDirect3DDeviceManager9, (void **)&mixer->device_manager); + + LeaveCriticalSection(&mixer->cs); + + break; + default: + WARN("Message not handled %d.\n", message); + hr = E_NOTIMPL; + } + + return hr; } static HRESULT WINAPI video_mixer_transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags)
1
0
0
0
Paul Gofman : netio.sys: Fill socket addresses when accepting connection.
by Alexandre Julliard
24 Jun '20
24 Jun '20
Module: wine Branch: master Commit: 290e1a11b38fd417b9a1c6f55b7c5e3270dbfaa9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=290e1a11b38fd417b9a1c6f5…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Jun 24 15:09:02 2020 +0300 netio.sys: Fill socket addresses when accepting connection. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/netio.sys/netio.c | 35 +++++++++++++++++++++++++---------- dlls/ntoskrnl.exe/tests/driver4.c | 18 ++++++++++++++++-- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/dlls/netio.sys/netio.c b/dlls/netio.sys/netio.c index 09f09f1e98..b0ca680179 100644 --- a/dlls/netio.sys/netio.c +++ b/dlls/netio.sys/netio.c @@ -46,6 +46,7 @@ struct _WSK_CLIENT struct listen_socket_callback_context { + SOCKADDR *local_address; SOCKADDR *remote_address; const void *client_dispatch; void *client_context; @@ -53,15 +54,6 @@ struct listen_socket_callback_context SOCKET acceptor; }; -struct connect_socket_callback_context -{ - struct wsk_socket_internal *socket; - SOCKADDR *remote_address; - const void *client_dispatch; - void *client_context; - IRP *pending_irp; -}; - #define MAX_PENDING_IO 10 struct wsk_pending_io @@ -96,6 +88,7 @@ struct wsk_socket_internal }; static LPFN_ACCEPTEX pAcceptEx; +static LPFN_GETACCEPTEXSOCKADDRS pGetAcceptExSockaddrs; static LPFN_CONNECTEX pConnectEx; static const WSK_PROVIDER_CONNECTION_DISPATCH wsk_provider_connection_dispatch; @@ -319,6 +312,8 @@ static void create_accept_socket(struct wsk_socket_internal *socket, struct wsk_ { struct listen_socket_callback_context *context = &socket->callback_context.listen_socket_callback_context; + INT local_address_len, remote_address_len; + SOCKADDR *local_address, *remote_address; struct wsk_socket_internal *accept_socket; if (!(accept_socket = heap_alloc_zero(sizeof(*accept_socket)))) @@ -338,7 +333,17 @@ static void create_accept_socket(struct wsk_socket_internal *socket, struct wsk_ accept_socket->protocol = socket->protocol; accept_socket->flags = WSK_FLAG_CONNECTION_SOCKET; socket_init(accept_socket); - /* TODO: fill local and remote addresses. */ + + pGetAcceptExSockaddrs(context->addr_buffer, 0, sizeof(SOCKADDR) + 16, sizeof(SOCKADDR) + 16, + &local_address, &local_address_len, &remote_address, &remote_address_len); + + if (context->local_address) + memcpy(context->local_address, local_address, + min(sizeof(*context->local_address), local_address_len)); + + if (context->remote_address) + memcpy(context->remote_address, remote_address, + min(sizeof(*context->remote_address), remote_address_len)); dispatch_pending_io(io, STATUS_SUCCESS, (ULONG_PTR)&accept_socket->wsk_socket); } @@ -373,6 +378,7 @@ static void WINAPI accept_callback(TP_CALLBACK_INSTANCE *instance, void *socket_ static BOOL WINAPI init_accept_functions(INIT_ONCE *once, void *param, void **context) { + GUID get_acceptex_guid = WSAID_GETACCEPTEXSOCKADDRS; GUID acceptex_guid = WSAID_ACCEPTEX; SOCKET s = (SOCKET)param; DWORD size; @@ -383,6 +389,14 @@ static BOOL WINAPI init_accept_functions(INIT_ONCE *once, void *param, void **co ERR("Could not get AcceptEx address, error %u.\n", WSAGetLastError()); return FALSE; } + + if (WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &get_acceptex_guid, sizeof(get_acceptex_guid), + &pGetAcceptExSockaddrs, sizeof(pGetAcceptExSockaddrs), &size, NULL, NULL)) + { + ERR("Could not get AcceptEx address, error %u.\n", WSAGetLastError()); + return FALSE; + } + return TRUE; } @@ -430,6 +444,7 @@ static NTSTATUS WINAPI wsk_accept(WSK_SOCKET *listen_socket, ULONG flags, void * return STATUS_PENDING; } + context->local_address = local_address; context->remote_address = remote_address; context->client_dispatch = accept_socket_dispatch; context->client_context = accept_socket_context; diff --git a/dlls/ntoskrnl.exe/tests/driver4.c b/dlls/ntoskrnl.exe/tests/driver4.c index dad1d6a04f..48de151f31 100644 --- a/dlls/ntoskrnl.exe/tests/driver4.c +++ b/dlls/ntoskrnl.exe/tests/driver4.c @@ -177,10 +177,10 @@ static void test_wsk_listen_socket(void) static const WSK_CLIENT_LISTEN_DISPATCH client_listen_dispatch; const WSK_PROVIDER_CONNECTION_DISPATCH *accept_dispatch; WSK_SOCKET *tcp_socket, *udp_socket, *accept_socket; + struct sockaddr_in addr, local_addr, remote_addr; struct socket_context context; WSK_BUF wsk_buf1, wsk_buf2; void *buffer1, *buffer2; - struct sockaddr_in addr; LARGE_INTEGER timeout; MDL *mdl1, *mdl2; NTSTATUS status; @@ -287,7 +287,10 @@ static void test_wsk_listen_socket(void) IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL); IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE); - status = tcp_dispatch->WskAccept(tcp_socket, 0, NULL, NULL, NULL, NULL, wsk_irp); + memset(&local_addr, 0, sizeof(local_addr)); + memset(&remote_addr, 0, sizeof(remote_addr)); + status = tcp_dispatch->WskAccept(tcp_socket, 0, NULL, NULL, + (SOCKADDR *)&local_addr, (SOCKADDR *)&remote_addr, wsk_irp); ok(status == STATUS_PENDING, "Got unexpected status %#x.\n", status); if (0) @@ -306,6 +309,17 @@ static void test_wsk_listen_socket(void) if (status == STATUS_SUCCESS && wsk_irp->IoStatus.Status == STATUS_SUCCESS) { + ok(local_addr.sin_family == AF_INET, "Got unexpected sin_family %u.\n", local_addr.sin_family); + ok(local_addr.sin_port == htons(SERVER_LISTEN_PORT), "Got unexpected sin_port %u.\n", + ntohs(local_addr.sin_port)); + ok(local_addr.sin_addr.s_addr == htonl(0x7f000001), "Got unexpected sin_addr %#x.\n", + ntohl(local_addr.sin_addr.s_addr)); + + ok(remote_addr.sin_family == AF_INET, "Got unexpected sin_family %u.\n", remote_addr.sin_family); + ok(remote_addr.sin_port, "Got zero sin_port.\n"); + ok(remote_addr.sin_addr.s_addr == htonl(0x7f000001), "Got unexpected sin_addr %#x.\n", + ntohl(remote_addr.sin_addr.s_addr)); + accept_socket = (WSK_SOCKET *)wsk_irp->IoStatus.Information; accept_dispatch = accept_socket->Dispatch;
1
0
0
0
Huw Davies : server: Don't allow an empty desktop name.
by Alexandre Julliard
24 Jun '20
24 Jun '20
Module: wine Branch: master Commit: aec5ccfc0666db2d9c9b65694c5e63b9b7d99066 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=aec5ccfc0666db2d9c9b6569…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Jun 24 11:37:22 2020 +0100 server: Don't allow an empty desktop name. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/winstation.c | 2 -- server/winstation.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/user32/tests/winstation.c b/dlls/user32/tests/winstation.c index d239ead6e9..76aa8a533b 100644 --- a/dlls/user32/tests/winstation.c +++ b/dlls/user32/tests/winstation.c @@ -296,9 +296,7 @@ static void test_handles(void) SetLastError( 0xdeadbeef ); d2 = CreateDesktopA( "", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ); - todo_wine ok( !d2, "create empty desktop succeeded\n" ); - todo_wine ok( GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError() ); SetLastError( 0xdeadbeef ); diff --git a/server/winstation.c b/server/winstation.c index 43d112334d..2962ea0df4 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -513,6 +513,11 @@ DECL_HANDLER(create_desktop) struct unicode_str name = get_req_unicode_str(); reply->handle = 0; + if (!name.len) + { + set_error( STATUS_INVALID_HANDLE ); + return; + } if ((winstation = get_process_winstation( current->process, WINSTA_CREATEDESKTOP ))) { if ((desktop = create_desktop( &name, req->attributes, req->flags, winstation )))
1
0
0
0
Huw Davies : user32: Don't call CreateDesktop() with an empty desktop name.
by Alexandre Julliard
24 Jun '20
24 Jun '20
Module: wine Branch: master Commit: 42e50e44f416a9d610d09af4cabb2675d2053412 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=42e50e44f416a9d610d09af4…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Jun 24 11:37:21 2020 +0100 user32: Don't call CreateDesktop() with an empty desktop name. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/user_main.c | 5 +++-- programs/explorer/desktop.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 9e45835e3a..6b70db4978 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -196,7 +196,8 @@ static const WCHAR *get_default_desktop(void) len = sizeof(buffer); if (!RegQueryValueExW( appkey, desktopW, 0, NULL, (LPBYTE)buffer, &len )) ret = buffer; RegCloseKey( appkey ); - if (ret) return ret; + if (ret && *ret) return ret; + ret = NULL; } } @@ -209,7 +210,7 @@ static const WCHAR *get_default_desktop(void) len = sizeof(buffer); if (!RegQueryValueExW( appkey, desktopW, 0, NULL, (LPBYTE)buffer, &len )) ret = buffer; RegCloseKey( appkey ); - if (ret) return ret; + if (ret && *ret) return ret; } return defaultW; } diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index e7acb2db77..691db5c8bd 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -732,7 +732,7 @@ static const WCHAR *get_default_desktop_name(void) /* @@ Wine registry key: HKCU\Software\Wine\Explorer */ if (!RegOpenKeyW( HKEY_CURRENT_USER, explorer_keyW, &hkey )) { - if (!RegQueryValueExW( hkey, desktopW, 0, NULL, (LPBYTE)buffer, &size )) ret = buffer; + if (!RegQueryValueExW( hkey, desktopW, 0, NULL, (LPBYTE)buffer, &size ) && *buffer) ret = buffer; RegCloseKey( hkey ); } return ret; @@ -974,7 +974,7 @@ void manage_desktop( WCHAR *arg ) /* parse the desktop option */ /* the option is of the form /desktop=name[,widthxheight[,driver]] */ - if (*arg == '=' || *arg == ',') + if ((arg[0] == '=' || arg[0] == ',') && arg[1] && arg[1] != ',') { arg++; name = arg;
1
0
0
0
Huw Davies : user32: Allow the app specific desktop to be "Default".
by Alexandre Julliard
24 Jun '20
24 Jun '20
Module: wine Branch: master Commit: 01ac2e48b10469a45d8e371634110d3baab55e2a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=01ac2e48b10469a45d8e3716…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Jun 24 11:37:20 2020 +0100 user32: Allow the app specific desktop to be "Default". Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/user_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 31a6168108..9e45835e3a 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -175,12 +175,12 @@ static const WCHAR *get_default_desktop(void) 'A','p','p','D','e','f','a','u','l','t','s',0}; static WCHAR buffer[MAX_PATH + ARRAY_SIZE(explorerW)]; WCHAR *p, *appname = buffer; - const WCHAR *ret = defaultW; + const WCHAR *ret = NULL; DWORD len; HKEY tmpkey, appkey; len = (GetModuleFileNameW( 0, buffer, MAX_PATH )); - if (!len || len >= MAX_PATH) return ret; + if (!len || len >= MAX_PATH) return defaultW; if ((p = strrchrW( appname, '/' ))) appname = p + 1; if ((p = strrchrW( appname, '\\' ))) appname = p + 1; p = appname + strlenW(appname); @@ -196,8 +196,7 @@ static const WCHAR *get_default_desktop(void) len = sizeof(buffer); if (!RegQueryValueExW( appkey, desktopW, 0, NULL, (LPBYTE)buffer, &len )) ret = buffer; RegCloseKey( appkey ); - if (ret && strcmpiW( ret, defaultW )) return ret; - ret = defaultW; + if (ret) return ret; } } @@ -210,8 +209,9 @@ static const WCHAR *get_default_desktop(void) len = sizeof(buffer); if (!RegQueryValueExW( appkey, desktopW, 0, NULL, (LPBYTE)buffer, &len )) ret = buffer; RegCloseKey( appkey ); + if (ret) return ret; } - return ret; + return defaultW; }
1
0
0
0
Huw Davies : user32/tests: Use skip() to skip tests when using a non-US keyboard.
by Alexandre Julliard
24 Jun '20
24 Jun '20
Module: wine Branch: master Commit: afe3e698c57c75ecf91903f8ffc72888491d4ca0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=afe3e698c57c75ecf91903f8…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Jun 24 10:00:32 2020 +0100 user32/tests: Use skip() to skip tests when using a non-US keyboard. Otherwise, under Wine, win_skip() counts as a failure. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 9ec829860a..3dde3ce3c0 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -286,7 +286,7 @@ static BOOL TestASet( HWND hWnd, int nrkev, const KEV kevdwn[], const KEV kevup[ BOOL us_kbd = (GetKeyboardLayout(0) == (HKL)(ULONG_PTR)0x04090409); if (!us_kbd) { - win_skip( "skipping test with inconsistent results on non-us keyboard\n" ); + skip( "skipping test with inconsistent results on non-us keyboard\n" ); return TRUE; } @@ -1193,7 +1193,7 @@ static void test_Input_unicode(void) BOOL us_kbd = (GetKeyboardLayout(0) == (HKL)(ULONG_PTR)0x04090409); if (!us_kbd) { - win_skip( "skipping test with inconsistent results on non-us keyboard\n" ); + skip( "skipping test with inconsistent results on non-us keyboard\n" ); return; }
1
0
0
0
Hans Leidekker : winhttp/tests: Add more WebSocket tests.
by Alexandre Julliard
24 Jun '20
24 Jun '20
Module: wine Branch: master Commit: e3ab70b82ac590e117dca4158041357541a8b23a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e3ab70b82ac590e117dca415…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jun 24 10:33:10 2020 +0200 winhttp/tests: Add more WebSocket tests. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/tests/winhttp.c | 156 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 148 insertions(+), 8 deletions(-) diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index be02bbe250..12f5136973 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -27,7 +27,6 @@ #include <winhttp.h> #include <wincrypt.h> #include <winreg.h> -#include <stdio.h> #include <initguid.h> #include <httprequest.h> #include <httprequestid.h> @@ -37,7 +36,12 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); +static DWORD (WINAPI *pWinHttpWebSocketClose)(HINTERNET,USHORT,void*,DWORD); static HINTERNET (WINAPI *pWinHttpWebSocketCompleteUpgrade)(HINTERNET,DWORD_PTR); +static DWORD (WINAPI *pWinHttpWebSocketQueryCloseStatus)(HINTERNET,USHORT*,void*,DWORD,DWORD*); +static DWORD (WINAPI *pWinHttpWebSocketReceive)(HINTERNET,void*,DWORD,DWORD*,WINHTTP_WEB_SOCKET_BUFFER_TYPE*); +static DWORD (WINAPI *pWinHttpWebSocketSend)(HINTERNET,WINHTTP_WEB_SOCKET_BUFFER_TYPE,void*,DWORD); +static DWORD (WINAPI *pWinHttpWebSocketShutdown)(HINTERNET,USHORT,void*,DWORD); static BOOL proxy_active(void) { @@ -2440,9 +2444,9 @@ static DWORD CALLBACK server_thread(LPVOID param) strcat(headers, "\r\n\r\n"); send(c, headers, strlen(headers), 0); + continue; } else send(c, notokmsg, sizeof(notokmsg) - 1, 0); - continue; } if (strstr(buffer, "GET /quit")) { @@ -3097,11 +3101,13 @@ static void test_head_request(int port) static void test_websocket(int port) { - HINTERNET session, connection, request, socket; + HINTERNET session, connection, request, socket, socket2; DWORD size, len, count, status, index, error; DWORD_PTR ctx; + WINHTTP_WEB_SOCKET_BUFFER_TYPE type; WCHAR header[32]; - char buf[128]; + char buf[128], *large_buf; + USHORT close_status; BOOL ret; if (!pWinHttpWebSocketCompleteUpgrade) @@ -3215,7 +3221,7 @@ static void test_websocket(int port) len = 0xdeadbeef; size = sizeof(len); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CONTENT_LENGTH | WINHTTP_QUERY_FLAG_NUMBER, NULL, &len, - &size, 0); + &size, NULL); ok(!ret, "success\n"); index = 0; @@ -3226,6 +3232,12 @@ static void test_websocket(int port) socket = pWinHttpWebSocketCompleteUpgrade(request, 0); ok(socket != NULL, "got %u\n", GetLastError()); + size = sizeof(header); + ret = WinHttpQueryHeaders(socket, WINHTTP_QUERY_UPGRADE, NULL, &header, &size, NULL); + error = GetLastError(); + ok(!ret, "success\n"); + ok(error == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "got %u\n", error); + header[0] = 0; size = sizeof(header); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_UPGRADE, NULL, &header, &size, NULL); @@ -3243,16 +3255,24 @@ static void test_websocket(int port) ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM, L"Sec-WebSocket-Accept", buf, &size, &index); ok(ret, "got %u\n", GetLastError()); - /* Send/Receive on websock */ - - ret = WinHttpCloseHandle(connection); + /* sending request again generates new key */ + ret = WinHttpSendRequest(request, NULL, 0, NULL, 0, 0, 0); ok(ret, "got %u\n", GetLastError()); + /* and creates a new websocket */ + socket2 = pWinHttpWebSocketCompleteUpgrade(request, 0); + ok(socket2 != NULL, "got %u\n", GetLastError()); + ok(socket2 != socket, "got same socket\n"); + + WinHttpCloseHandle(connection); /* request handle is still valid */ size = sizeof(ctx); ret = WinHttpQueryOption(request, WINHTTP_OPTION_CONTEXT_VALUE, &ctx, &size); ok(ret, "got %u\n", GetLastError()); + ret = WinHttpCloseHandle(socket2); + ok(ret, "got %u\n", GetLastError()); + ret = WinHttpCloseHandle(socket); ok(ret, "got %u\n", GetLastError()); @@ -3267,6 +3287,121 @@ static void test_websocket(int port) ret = WinHttpCloseHandle(request); ok(ret, "got %u\n", GetLastError()); + + session = WinHttpOpen(L"winetest", 0, NULL, NULL, 0); + ok(session != NULL, "got %u\n", GetLastError()); + + connection = WinHttpConnect(session, L"
echo.websocket.org
", 0, 0); + ok(connection != NULL, "got %u\n", GetLastError()); + + request = WinHttpOpenRequest(connection, L"GET", L"/", NULL, NULL, NULL, 0); + ok(request != NULL, "got %u\n", GetLastError()); + + ret = WinHttpSetOption(request, WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET, NULL, 0); + ok(ret, "got %u\n", GetLastError()); + + ret = WinHttpSendRequest(request, NULL, 0, NULL, 0, 0, 0); + ok(ret, "got %u\n", GetLastError()); + + ret = WinHttpReceiveResponse(request, NULL); + ok(ret, "got %u\n", GetLastError()); + + status = 0xdeadbeef; + size = sizeof(status); + ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, + &size, NULL); + ok(ret, "got %u\n", GetLastError()); + ok(status == HTTP_STATUS_SWITCH_PROTOCOLS, "got %u\n", status); + + socket = pWinHttpWebSocketCompleteUpgrade(request, 0); + ok(socket != NULL, "got %u\n", GetLastError()); + + error = pWinHttpWebSocketSend(socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, NULL, 1); + ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + + large_buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(buf) * 2); + memcpy(large_buf, "hello", sizeof("hello")); + memcpy(large_buf + sizeof(buf), "world", sizeof("world")); + error = pWinHttpWebSocketSend(socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, large_buf, sizeof(buf) * 2); + ok(!error, "got %u\n", error); + HeapFree(GetProcessHeap(), 0, large_buf); + + error = pWinHttpWebSocketReceive(socket, NULL, 0, NULL, NULL); + ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + + error = pWinHttpWebSocketReceive(socket, buf, 0, NULL, NULL); + ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + + error = pWinHttpWebSocketReceive(socket, NULL, 1, NULL, NULL); + ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + + buf[0] = 0; + count = 0; + type = 0xdeadbeef; + error = pWinHttpWebSocketReceive(socket, buf, sizeof(buf), &count, &type); + ok(!error, "got %u\n", error); + ok(buf[0] == 'h', "got %c\n", buf[0]); + ok(count == sizeof(buf), "got %u\n", count); + ok(type == WINHTTP_WEB_SOCKET_BINARY_FRAGMENT_BUFFER_TYPE, "got %u\n", type); + + buf[0] = 0; + count = 0; + type = 0xdeadbeef; + error = pWinHttpWebSocketReceive(socket, buf, sizeof(buf), &count, &type); + ok(!error, "got %u\n", error); + ok(buf[0] == 'w', "got %c\n", buf[0]); + ok(count == sizeof(buf), "got %u\n", count); + ok(type == WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, "got %u\n", type); + + error = pWinHttpWebSocketShutdown(socket, WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS, NULL, 1); + ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + + error = pWinHttpWebSocketShutdown(socket, WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS, (void *)"success", + sizeof("success")); + ok(!error, "got %u\n", error); + + error = pWinHttpWebSocketClose(socket, WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS, NULL, 1); + ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + + error = pWinHttpWebSocketClose(socket, WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS, (void *)"success2", + sizeof("success2")); + ok(!error, "got %u\n", error); + + error = pWinHttpWebSocketQueryCloseStatus(socket, NULL, NULL, 0, NULL); + ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + + error = pWinHttpWebSocketQueryCloseStatus(socket, &close_status, NULL, 0, NULL); + ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + + error = pWinHttpWebSocketQueryCloseStatus(socket, &close_status, buf, 0, NULL); + ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + + error = pWinHttpWebSocketQueryCloseStatus(socket, &close_status, buf, sizeof(buf), NULL); + ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + + error = pWinHttpWebSocketQueryCloseStatus(socket, NULL, NULL, 0, &len); + ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + + len = 0; + error = pWinHttpWebSocketQueryCloseStatus(socket, &close_status, NULL, 0, &len); + ok(error == ERROR_INSUFFICIENT_BUFFER, "got %u\n", error); + ok(len, "len not set\n"); + + error = pWinHttpWebSocketQueryCloseStatus(socket, &close_status, NULL, 1, &len); + ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + + close_status = 0xdead; + len = 0xdeadbeef; + memset(buf, 0, sizeof(buf)); + error = pWinHttpWebSocketQueryCloseStatus(socket, &close_status, buf, sizeof(buf), &len); + ok(!error, "got %u\n", error); + ok(close_status == 1000, "got %08x\n", close_status); + ok(len == sizeof("success"), "got %u\n", len); + + WinHttpCloseHandle(socket); + WinHttpCloseHandle(request); + WinHttpCloseHandle(connection); + WinHttpCloseHandle(session); } static void test_not_modified(int port) @@ -4942,7 +5077,12 @@ START_TEST (winhttp) DWORD ret; HMODULE mod = GetModuleHandleA("winhttp.dll"); + pWinHttpWebSocketClose = (void *)GetProcAddress(mod, "WinHttpWebSocketClose"); pWinHttpWebSocketCompleteUpgrade = (void *)GetProcAddress(mod, "WinHttpWebSocketCompleteUpgrade"); + pWinHttpWebSocketQueryCloseStatus = (void *)GetProcAddress(mod, "WinHttpWebSocketQueryCloseStatus"); + pWinHttpWebSocketSend = (void *)GetProcAddress(mod, "WinHttpWebSocketSend"); + pWinHttpWebSocketShutdown = (void *)GetProcAddress(mod, "WinHttpWebSocketShutdown"); + pWinHttpWebSocketReceive = (void *)GetProcAddress(mod, "WinHttpWebSocketReceive"); test_WinHttpOpenRequest(); test_WinHttpSendRequest();
1
0
0
0
Hans Leidekker : winhttp: Add support for WebSocket fragment buffers.
by Alexandre Julliard
24 Jun '20
24 Jun '20
Module: wine Branch: master Commit: 6d564bd53e047654fd8e5b0265ad9eb485452e34 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6d564bd53e047654fd8e5b02…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jun 24 10:33:09 2020 +0200 winhttp: Add support for WebSocket fragment buffers. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/request.c | 73 +++++++++++++++++------------------------- dlls/winhttp/winhttp_private.h | 19 ++++++++++- 2 files changed, 48 insertions(+), 44 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 631fbb004f..457abb9f84 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -3156,33 +3156,16 @@ static DWORD send_bytes( struct netconn *netconn, char *bytes, int len ) return (count == len) ? ERROR_SUCCESS : ERROR_INTERNAL_ERROR; } -/* rfc6455 */ -enum opcode -{ - OPCODE_CONTINUE = 0x00, - OPCODE_TEXT = 0x01, - OPCODE_BINARY = 0x02, - OPCODE_RESERVED3 = 0x03, - OPCODE_RESERVED4 = 0x04, - OPCODE_RESERVED5 = 0x05, - OPCODE_RESERVED6 = 0x06, - OPCODE_RESERVED7 = 0x07, - OPCODE_CLOSE = 0x08, - OPCODE_PING = 0x09, - OPCODE_PONG = 0x0a, - OPCODE_INVALID = 0xff, -}; - -static enum opcode map_buffer_type( WINHTTP_WEB_SOCKET_BUFFER_TYPE type ) +static enum socket_opcode map_buffer_type( WINHTTP_WEB_SOCKET_BUFFER_TYPE type ) { switch (type) { - case WINHTTP_WEB_SOCKET_UTF8_MESSAGE_BUFFER_TYPE: return OPCODE_TEXT; - case WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE: return OPCODE_BINARY; - case WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE: return OPCODE_CLOSE; + case WINHTTP_WEB_SOCKET_UTF8_MESSAGE_BUFFER_TYPE: return SOCKET_OPCODE_TEXT; + case WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE: return SOCKET_OPCODE_BINARY; + case WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE: return SOCKET_OPCODE_CLOSE; default: FIXME("buffer type %u not supported\n", type); - return OPCODE_INVALID; + return SOCKET_OPCODE_INVALID; } } @@ -3194,10 +3177,10 @@ static DWORD send_frame( struct netconn *netconn, WINHTTP_WEB_SOCKET_BUFFER_TYPE DWORD buflen, BOOL final ) { DWORD i = 0, j, ret, offset = 2, len = buflen; - enum opcode opcode = map_buffer_type( type ); + enum socket_opcode opcode = map_buffer_type( type ); char hdr[14], byte, *mask; - if (opcode == OPCODE_CLOSE) len += sizeof(status); + if (opcode == SOCKET_OPCODE_CLOSE) len += sizeof(status); hdr[0] = final ? (char)FIN_BIT : 0; hdr[0] |= opcode; @@ -3224,7 +3207,7 @@ static DWORD send_frame( struct netconn *netconn, WINHTTP_WEB_SOCKET_BUFFER_TYPE RtlGenRandom( mask, 4 ); if ((ret = send_bytes( netconn, hdr, offset + 4 ))) return ret; - if (opcode == OPCODE_CLOSE) /* prepend status code */ + if (opcode == SOCKET_OPCODE_CLOSE) /* prepend status code */ { byte = (status >> 8) ^ mask[i++ % 4]; if ((ret = send_bytes( netconn, &byte, 1 ))) return ret; @@ -3331,34 +3314,39 @@ static DWORD receive_bytes( struct netconn *netconn, char *buf, DWORD len, DWORD return ERROR_SUCCESS; } -static WINHTTP_WEB_SOCKET_BUFFER_TYPE map_opcode( enum opcode opcode ) +static WINHTTP_WEB_SOCKET_BUFFER_TYPE map_opcode( enum socket_opcode opcode, BOOL fragment ) { switch (opcode) { - case OPCODE_TEXT: return WINHTTP_WEB_SOCKET_UTF8_MESSAGE_BUFFER_TYPE; - case OPCODE_BINARY: return WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE; - case OPCODE_CLOSE: return WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE; + case SOCKET_OPCODE_TEXT: + if (fragment) return WINHTTP_WEB_SOCKET_UTF8_FRAGMENT_BUFFER_TYPE; + return WINHTTP_WEB_SOCKET_UTF8_MESSAGE_BUFFER_TYPE; + + case SOCKET_OPCODE_BINARY: + if (fragment) return WINHTTP_WEB_SOCKET_BINARY_FRAGMENT_BUFFER_TYPE; + return WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE; + + case SOCKET_OPCODE_CLOSE: + return WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE; + default: - ERR("opcode %u not handled\n", opcode); + FIXME("opcode %u not handled\n", opcode); return ~0u; } } -static DWORD receive_frame( struct netconn *netconn, DWORD *ret_len, WINHTTP_WEB_SOCKET_BUFFER_TYPE *ret_type ) +static DWORD receive_frame( struct netconn *netconn, DWORD *ret_len, enum socket_opcode *opcode ) { - WINHTTP_WEB_SOCKET_BUFFER_TYPE type; DWORD ret, len, count; - enum opcode opcode; char hdr[2]; if ((ret = receive_bytes( netconn, hdr, sizeof(hdr), &count ))) return ret; - if (count != sizeof(hdr) || (hdr[0] & RESERVED_BIT) || (hdr[1] & MASK_BIT)) + if (count != sizeof(hdr) || (hdr[0] & RESERVED_BIT) || (hdr[1] & MASK_BIT) || + (map_opcode( hdr[0] & 0xf, FALSE ) == ~0u)) { return ERROR_WINHTTP_INVALID_SERVER_RESPONSE; } - - opcode = hdr[0] & 0xf; - type = map_opcode( opcode ); + *opcode = hdr[0] & 0xf; len = hdr[1] & ~MASK_BIT; if (len == 126) @@ -3378,7 +3366,6 @@ static DWORD receive_frame( struct netconn *netconn, DWORD *ret_len, WINHTTP_WEB } *ret_len = len; - *ret_type = type; return ERROR_SUCCESS; } @@ -3387,7 +3374,7 @@ static DWORD socket_receive( struct socket *socket, void *buf, DWORD len, DWORD { DWORD count, ret = ERROR_SUCCESS; - if (!socket->read_size) ret = receive_frame( socket->request->netconn, &socket->read_size, &socket->buf_type ); + if (!socket->read_size) ret = receive_frame( socket->request->netconn, &socket->read_size, &socket->opcode ); if (!ret) ret = receive_bytes( socket->request->netconn, buf, min(len, socket->read_size), &count ); if (!ret) { @@ -3395,7 +3382,7 @@ static DWORD socket_receive( struct socket *socket, void *buf, DWORD len, DWORD if (!async) { *ret_len = count; - *ret_type = socket->buf_type; + *ret_type = map_opcode( socket->opcode, socket->read_size != 0 ); } } @@ -3405,7 +3392,7 @@ static DWORD socket_receive( struct socket *socket, void *buf, DWORD len, DWORD { WINHTTP_WEB_SOCKET_STATUS status; status.dwBytesTransferred = count; - status.eBufferType = socket->buf_type; + status.eBufferType = map_opcode( socket->opcode, socket->read_size != 0 ); send_callback( &socket->hdr, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, &status, sizeof(status) ); } else @@ -3558,8 +3545,8 @@ static DWORD socket_close( struct socket *socket, USHORT status, const void *rea socket->state = SOCKET_STATE_SHUTDOWN; } - if ((ret = receive_frame( netconn, &count, &socket->buf_type ))) goto done; - if (socket->buf_type != WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE || (count && count > sizeof(socket->reason))) + if ((ret = receive_frame( netconn, &count, &socket->opcode ))) goto done; + if (socket->opcode != SOCKET_OPCODE_CLOSE || (count && count > sizeof(socket->reason))) { ret = ERROR_WINHTTP_INVALID_SERVER_RESPONSE; goto done; diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index 41ada14c0c..4a94375006 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -221,6 +221,23 @@ enum socket_state SOCKET_STATE_CLOSED = 2, }; +/* rfc6455 */ +enum socket_opcode +{ + SOCKET_OPCODE_CONTINUE = 0x00, + SOCKET_OPCODE_TEXT = 0x01, + SOCKET_OPCODE_BINARY = 0x02, + SOCKET_OPCODE_RESERVED3 = 0x03, + SOCKET_OPCODE_RESERVED4 = 0x04, + SOCKET_OPCODE_RESERVED5 = 0x05, + SOCKET_OPCODE_RESERVED6 = 0x06, + SOCKET_OPCODE_RESERVED7 = 0x07, + SOCKET_OPCODE_CLOSE = 0x08, + SOCKET_OPCODE_PING = 0x09, + SOCKET_OPCODE_PONG = 0x0a, + SOCKET_OPCODE_INVALID = 0xff, +}; + struct socket { struct object_header hdr; @@ -228,7 +245,7 @@ struct socket enum socket_state state; struct queue send_q; struct queue recv_q; - WINHTTP_WEB_SOCKET_BUFFER_TYPE buf_type; + enum socket_opcode opcode; DWORD read_size; USHORT status; char reason[128];
1
0
0
0
Hans Leidekker : winhttp/tests: Add asynchronous WebSocket tests.
by Alexandre Julliard
24 Jun '20
24 Jun '20
Module: wine Branch: master Commit: 938b3e5771671795397d94a84f14151e5fa390cd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=938b3e5771671795397d94a8…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jun 24 10:33:08 2020 +0200 winhttp/tests: Add asynchronous WebSocket tests. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/tests/notification.c | 206 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=938b3e5771671795397d…
1
0
0
0
Hans Leidekker : winhttp: Implement WinHttpWebSocketQueryCloseStatus.
by Alexandre Julliard
24 Jun '20
24 Jun '20
Module: wine Branch: master Commit: 3b1d18fd6e61e5d27bc2b45c92bae58874626908 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3b1d18fd6e61e5d27bc2b45c…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jun 24 10:33:07 2020 +0200 winhttp: Implement WinHttpWebSocketQueryCloseStatus. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/request.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 60a9585d0d..631fbb004f 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -3642,10 +3642,38 @@ DWORD WINAPI WinHttpWebSocketClose( HINTERNET hsocket, USHORT status, void *reas } DWORD WINAPI WinHttpWebSocketQueryCloseStatus( HINTERNET hsocket, USHORT *status, void *reason, DWORD len, - DWORD *consumed ) + DWORD *ret_len ) { - FIXME("%p, %p, %p, %u, %p\n", hsocket, status, reason, len, consumed); - return ERROR_INVALID_PARAMETER; + struct socket *socket; + DWORD ret; + + TRACE("%p, %p, %p, %u, %p\n", hsocket, status, reason, len, ret_len); + + if (!status || (len && !reason) || !ret_len) return ERROR_INVALID_PARAMETER; + + if (!(socket = (struct socket *)grab_object( hsocket ))) return ERROR_INVALID_HANDLE; + if (socket->hdr.type != WINHTTP_HANDLE_TYPE_SOCKET) + { + release_object( &socket->hdr ); + return ERROR_WINHTTP_INCORRECT_HANDLE_TYPE; + } + if (socket->state < SOCKET_STATE_CLOSED) + { + release_object( &socket->hdr ); + return ERROR_WINHTTP_INCORRECT_HANDLE_STATE; + } + + *status = socket->status; + *ret_len = socket->reason_len; + if (socket->reason_len > len) ret = ERROR_INSUFFICIENT_BUFFER; + else + { + memcpy( reason, socket->reason, socket->reason_len ); + ret = ERROR_SUCCESS; + } + + release_object( &socket->hdr ); + return ret; } enum request_state
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
95
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
Results per page:
10
25
50
100
200