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
May 2017
----- 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
640 discussions
Start a n
N
ew thread
Jacek Caban : mshtmhst.idl: Added missing DOCHOSTUIFLAG values.
by Alexandre Julliard
31 May '17
31 May '17
Module: wine Branch: master Commit: 1fbb661ed1745bdfdcd1287c730f63503ee3f13f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1fbb661ed1745bdfdcd1287c7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 31 19:51:31 2017 +0200 mshtmhst.idl: Added missing DOCHOSTUIFLAG values. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/mshtmhst.idl | 54 +++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/include/mshtmhst.idl b/include/mshtmhst.idl index 344a88f..81b16ed 100644 --- a/include/mshtmhst.idl +++ b/include/mshtmhst.idl @@ -113,30 +113,36 @@ typedef enum tagDOCHOSTUIDBLCLK typedef enum tagDOCHOSTUIFLAG { - DOCHOSTUIFLAG_DIALOG = 0x00000001, - DOCHOSTUIFLAG_DISABLE_HELP_MENU = 0x00000002, - DOCHOSTUIFLAG_NO3DBORDER = 0x00000004, - DOCHOSTUIFLAG_SCROLL_NO = 0x00000008, - DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE = 0x00000010, - DOCHOSTUIFLAG_OPENNEWWIN = 0x00000020, - DOCHOSTUIFLAG_DISABLE_OFFSCREEN = 0x00000040, - DOCHOSTUIFLAG_FLAT_SCROLLBAR = 0x00000080, - DOCHOSTUIFLAG_DIV_BLOCKDEFAULT = 0x00000100, - DOCHOSTUIFLAG_ACTIVATE_CLIENTHIT_ONLY = 0x00000200, - DOCHOSTUIFLAG_OVERRIDEBEHAVIORFACTORY = 0x00000400, - DOCHOSTUIFLAG_CODEPAGELINKEDFONTS = 0x00000800, - DOCHOSTUIFLAG_URL_ENCODING_DISABLE_UTF8 = 0x00001000, - DOCHOSTUIFLAG_URL_ENCODING_ENABLE_UTF8 = 0x00002000, - DOCHOSTUIFLAG_ENABLE_FORMS_AUTOCOMPLETE = 0x00004000, - DOCHOSTUIFLAG_ENABLE_INPLACE_NAVIGATION = 0x00010000, - DOCHOSTUIFLAG_IME_ENABLE_RECONVERSION = 0x00020000, - DOCHOSTUIFLAG_THEME = 0x00040000, - DOCHOSTUIFLAG_NOTHEME = 0x00080000, - DOCHOSTUIFLAG_NOPICS = 0x00100000, - DOCHOSTUIFLAG_NO3DOUTERBORDER = 0x00200000, - DOCHOSTUIFLAG_DISABLE_EDIT_NS_FIXUP = 0x00400000, - DOCHOSTUIFLAG_LOCAL_MACHINE_ACCESS_CHECK = 0x00800000, - DOCHOSTUIFLAG_DISABLE_UNTRUSTEDPROTOCOL = 0x01000000 + DOCHOSTUIFLAG_DIALOG = 0x00000001, + DOCHOSTUIFLAG_DISABLE_HELP_MENU = 0x00000002, + DOCHOSTUIFLAG_NO3DBORDER = 0x00000004, + DOCHOSTUIFLAG_SCROLL_NO = 0x00000008, + DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE = 0x00000010, + DOCHOSTUIFLAG_OPENNEWWIN = 0x00000020, + DOCHOSTUIFLAG_DISABLE_OFFSCREEN = 0x00000040, + DOCHOSTUIFLAG_FLAT_SCROLLBAR = 0x00000080, + DOCHOSTUIFLAG_DIV_BLOCKDEFAULT = 0x00000100, + DOCHOSTUIFLAG_ACTIVATE_CLIENTHIT_ONLY = 0x00000200, + DOCHOSTUIFLAG_OVERRIDEBEHAVIORFACTORY = 0x00000400, + DOCHOSTUIFLAG_CODEPAGELINKEDFONTS = 0x00000800, + DOCHOSTUIFLAG_URL_ENCODING_DISABLE_UTF8 = 0x00001000, + DOCHOSTUIFLAG_URL_ENCODING_ENABLE_UTF8 = 0x00002000, + DOCHOSTUIFLAG_ENABLE_FORMS_AUTOCOMPLETE = 0x00004000, + DOCHOSTUIFLAG_ENABLE_INPLACE_NAVIGATION = 0x00010000, + DOCHOSTUIFLAG_IME_ENABLE_RECONVERSION = 0x00020000, + DOCHOSTUIFLAG_THEME = 0x00040000, + DOCHOSTUIFLAG_NOTHEME = 0x00080000, + DOCHOSTUIFLAG_NOPICS = 0x00100000, + DOCHOSTUIFLAG_NO3DOUTERBORDER = 0x00200000, + DOCHOSTUIFLAG_DISABLE_EDIT_NS_FIXUP = 0x00400000, + DOCHOSTUIFLAG_LOCAL_MACHINE_ACCESS_CHECK = 0x00800000, + DOCHOSTUIFLAG_DISABLE_UNTRUSTEDPROTOCOL = 0x01000000, + DOCHOSTUIFLAG_HOST_NAVIGATES = 0x02000000, + DOCHOSTUIFLAG_ENABLE_REDIRECT_NOTIFICATION = 0x04000000, + DOCHOSTUIFLAG_USE_WINDOWLESS_SELECTCONTROL = 0x08000000, + DOCHOSTUIFLAG_USE_WINDOWED_SELECTCONTROL = 0x10000000, + DOCHOSTUIFLAG_ENABLE_ACTIVEX_INACTIVATE_MODE = 0x20000000, + DOCHOSTUIFLAG_DPI_AWARE = 0x40000000 } DOCHOSTUIFLAG; [
1
0
0
0
Jacek Caban : urlmon.idl: Added IBindCallbackRedirect declaration.
by Alexandre Julliard
31 May '17
31 May '17
Module: wine Branch: master Commit: 83a9ed2a74ba6aa86872c543943fc5ae388ecfa7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=83a9ed2a74ba6aa86872c5439…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 31 19:22:48 2017 +0200 urlmon.idl: Added IBindCallbackRedirect declaration. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/urlmon.idl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/urlmon.idl b/include/urlmon.idl index 35dee40..1f7205d 100644 --- a/include/urlmon.idl +++ b/include/urlmon.idl @@ -2048,6 +2048,24 @@ interface IGetBindHandle : IUnknown [out] HANDLE *pRetHandle); } +/***************************************************************************** + * IBindCallbackRedirect interface + */ +[ + local, + object, + uuid(11c81bc2-121e-4ed5-b9c4-b430bd54f2c0), + pointer_default(unique) +] +interface IBindCallbackRedirect : IUnknown +{ + typedef [unique] IBindCallbackRedirect *LPBINDCALLBACKREDIRECT; + + HRESULT Redirect( + [in] LPCWSTR lpcUrl, + [out] VARIANT_BOOL *vbCancel); +} + cpp_quote("#define CONFIRMSAFETYACTION_LOADOBJECT 0x00000001") struct CONFIRMSAFETY
1
0
0
0
Jacek Caban : rpcrt4/tests: Added more server stopping tests.
by Alexandre Julliard
31 May '17
31 May '17
Module: wine Branch: master Commit: 18fb5d25f146c65f422ff03214d19ec7a3497487 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=18fb5d25f146c65f422ff0321…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 31 17:31:04 2017 +0200 rpcrt4/tests: Added more server stopping tests. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/tests/server.c | 113 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 110 insertions(+), 3 deletions(-) diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c index b42a78f..01a61ae 100644 --- a/dlls/rpcrt4/tests/server.c +++ b/dlls/rpcrt4/tests/server.c @@ -41,7 +41,7 @@ static const char *progname; static BOOL old_windows_version; -static HANDLE stop_event; +static HANDLE stop_event, stop_wait_event; static void (WINAPI *pNDRSContextMarshall2)(RPC_BINDING_HANDLE, NDR_SCONTEXT, void*, NDR_RUNDOWN, void*, ULONG); static NDR_SCONTEXT (WINAPI *pNDRSContextUnmarshall2)(RPC_BINDING_HANDLE, void*, ULONG, void*, ULONG); @@ -830,9 +830,18 @@ void __cdecl s_full_pointer_null_test(int *a, int *b) void __cdecl s_stop(void) { - ok(RPC_S_OK == RpcMgmtStopServerListening(NULL), "RpcMgmtStopServerListening\n"); - ok(RPC_S_OK == RpcServerUnregisterIf(NULL, NULL, FALSE), "RpcServerUnregisterIf\n"); + if (!stop_wait_event) + { + ok(RPC_S_OK == RpcMgmtStopServerListening(NULL), "RpcMgmtStopServerListening\n"); + ok(RPC_S_OK == RpcServerUnregisterIf(NULL, NULL, FALSE), "RpcServerUnregisterIf\n"); + } ok(SetEvent(stop_event), "SetEvent\n"); + if (stop_wait_event) + { + DWORD ret; + ret = WaitForSingleObject(stop_wait_event, 10000); + ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n"); + } } static void @@ -1759,10 +1768,87 @@ server(void) stop_event = NULL; } +static DWORD WINAPI listen_test_client_thread(void *binding) +{ + RPC_STATUS status; + + status = RpcBindingFromStringBindingA(binding, &IServer_IfHandle); + ok(status == RPC_S_OK, "RpcBindingFromStringBinding\n"); + + test_is_server_listening(IServer_IfHandle, RPC_S_OK); + stop(); + trace("stopped\n"); + + status = RpcBindingFree(&IServer_IfHandle); + ok(status == RPC_S_OK, "RpcBindingFree\n"); + return 0; +} + +static DWORD WINAPI wait_listen_proc(void *arg) +{ + RPC_STATUS status; + + trace("waiting\n"); + status = RpcMgmtWaitServerListen(); + ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %d\n", status); + trace("done\n"); + + return 0; +} + +static void test_stop_wait_for_call(unsigned char *binding) +{ + HANDLE client_thread, wait_listen_thread; + RPC_STATUS status; + DWORD ret; + + status = RpcServerListen(1, 20, TRUE); + ok(status == RPC_S_OK, "RpcServerListen failed with status %d\n", status); + test_is_server_listening(NULL, RPC_S_OK); + + stop_wait_event = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(stop_wait_event != NULL, "CreateEvent failed with error %d\n", GetLastError()); + stop_event = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(stop_event != NULL, "CreateEvent failed with error %d\n", GetLastError()); + + wait_listen_thread = CreateThread(NULL, 0, wait_listen_proc, 0, 0, NULL); + ok(wait_listen_thread != NULL, "CreateThread failed\n"); + + client_thread = CreateThread(NULL, 0, listen_test_client_thread, binding, 0, NULL); + ok(client_thread != NULL, "CreateThread failed\n"); + CloseHandle(client_thread); + + ret = WaitForSingleObject(stop_event, 10000); + ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n"); + + status = RpcMgmtStopServerListening(NULL); + ok(status == RPC_S_OK, "RpcMgmtStopServerListening\n"); + test_is_server_listening(NULL, RPC_S_NOT_LISTENING); + + ret = WaitForSingleObject(wait_listen_thread, 500); + ok(WAIT_TIMEOUT == ret, "WaitForSingleObject\n"); + + SetEvent(stop_wait_event); + + ret = WaitForSingleObject(wait_listen_thread, 10000); + ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject returned %u\n", ret); + + CloseHandle(wait_listen_thread); + + CloseHandle(stop_wait_event); + stop_wait_event = NULL; + CloseHandle(stop_event); + stop_event = NULL; +} + static void test_server_listening(void) { static unsigned char np[] = "ncacn_np"; + static unsigned char address_np[] = "\\\\."; static unsigned char pipe[] = PIPE "listen_test"; + static unsigned char ncalrpc[] = "ncalrpc"; + static unsigned char guid[] = "00000000-4114-0704-2302-000000000000"; + unsigned char *binding; RPC_STATUS status; status = RpcServerUseProtseqEpA(np, 0, pipe, NULL); @@ -1788,6 +1874,27 @@ static void test_server_listening(void) status = RpcMgmtWaitServerListen(); ok(status == RPC_S_NOT_LISTENING, "RpcMgmtWaitServerListening failed with status %d\n", status); + + /* test that server stop waits for a call in progress */ + status = RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding); + ok(status == RPC_S_OK, "RpcStringBindingCompose\n"); + + test_stop_wait_for_call(binding); + + status = RpcStringFreeA(&binding); + ok(status == RPC_S_OK, "RpcStringFree\n"); + + /* repeat the test using ncalrpc */ + status = RpcServerUseProtseqEpA(ncalrpc, 0, guid, NULL); + ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %d\n", status); + + status = RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding); + ok(status == RPC_S_OK, "RpcStringBindingCompose\n"); + + test_stop_wait_for_call(binding); + + status = RpcStringFreeA(&binding); + ok(status == RPC_S_OK, "RpcStringFree\n"); } static BOOL is_process_elevated(void)
1
0
0
0
Jacek Caban : rpcrt4: Wait for server threads to finish in RpcMgmtWaitServerListen.
by Alexandre Julliard
31 May '17
31 May '17
Module: wine Branch: master Commit: 09e98be24350a7a8306cc6cd7302f94eae770afc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=09e98be24350a7a8306cc6cd7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 31 17:30:52 2017 +0200 rpcrt4: Wait for server threads to finish in RpcMgmtWaitServerListen. This fixes races when stopping manual listen RPC servers. It should fix races in Office applications as well as our services.exe (visible as CS error on prefix shutdown). Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/rpc_server.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index bd47de6..c350c59 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -1542,7 +1542,8 @@ RPC_STATUS WINAPI RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, UINT */ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) { - HANDLE event; + RpcServerProtseq *protseq; + HANDLE event, wait_thread; TRACE("()\n"); @@ -1558,6 +1559,28 @@ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) TRACE( "done waiting\n" ); EnterCriticalSection(&listen_cs); + /* wait for server threads to finish */ + while(1) + { + if (listen_count) + break; + + wait_thread = NULL; + EnterCriticalSection(&server_cs); + LIST_FOR_EACH_ENTRY(protseq, &protseqs, RpcServerProtseq, entry) + { + if ((wait_thread = protseq->server_thread)) + break; + } + LeaveCriticalSection(&server_cs); + if (!wait_thread) + break; + + TRACE("waiting for thread %u\n", GetThreadId(wait_thread)); + LeaveCriticalSection(&listen_cs); + WaitForSingleObject(wait_thread, INFINITE); + EnterCriticalSection(&listen_cs); + } if (listen_done_event == event) { listen_done_event = NULL;
1
0
0
0
Jacek Caban : rpcrt4: Wait for all active connections to be released before quiting server thread.
by Alexandre Julliard
31 May '17
31 May '17
Module: wine Branch: master Commit: e98c7a59c26bdff7bad27e5864ee7f7ed8313a35 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e98c7a59c26bdff7bad27e586…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 31 17:30:40 2017 +0200 rpcrt4: Wait for all active connections to be released before quiting server thread. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/rpc_binding.h | 3 +++ dlls/rpcrt4/rpc_server.c | 18 ++++++++++++++++++ dlls/rpcrt4/rpc_transport.c | 18 ++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/dlls/rpcrt4/rpc_binding.h b/dlls/rpcrt4/rpc_binding.h index affc060..a679b0e 100644 --- a/dlls/rpcrt4/rpc_binding.h +++ b/dlls/rpcrt4/rpc_binding.h @@ -63,6 +63,7 @@ typedef struct _RpcConnection { LONG ref; BOOL server; + HANDLE wait_release; LPSTR NetworkAddr; LPSTR Endpoint; LPWSTR NetworkOptions; @@ -176,6 +177,8 @@ RPC_STATUS RPCRT4_OpenBinding(RpcBinding* Binding, RpcConnection** Connection, const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RPC_SYNTAX_IDENTIFIER *InterfaceId) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_CloseBinding(RpcBinding* Binding, RpcConnection* Connection) DECLSPEC_HIDDEN; +void rpcrt4_conn_release_and_wait(RpcConnection *connection) DECLSPEC_HIDDEN; + static inline const char *rpcrt4_conn_get_name(const RpcConnection *Connection) { return Connection->ops->name; diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index d8225f3..bd47de6 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -675,20 +675,38 @@ static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg) set_ready_event = TRUE; } + TRACE("closing connections\n"); + EnterCriticalSection(&cps->cs); LIST_FOR_EACH_ENTRY(conn, &cps->listeners, RpcConnection, protseq_entry) RPCRT4_CloseConnection(conn); LIST_FOR_EACH_ENTRY(conn, &cps->connections, RpcConnection, protseq_entry) + { + RPCRT4_GrabConnection(conn); rpcrt4_conn_close_read(conn); + } LeaveCriticalSection(&cps->cs); if (res == 0 && !std_listen) SetEvent(cps->server_ready_event); + TRACE("waiting for active connections to close\n"); + + EnterCriticalSection(&cps->cs); + while (!list_empty(&cps->connections)) + { + conn = LIST_ENTRY(list_head(&cps->connections), RpcConnection, protseq_entry); + LeaveCriticalSection(&cps->cs); + rpcrt4_conn_release_and_wait(conn); + EnterCriticalSection(&cps->cs); + } + LeaveCriticalSection(&cps->cs); + EnterCriticalSection(&listen_cs); CloseHandle(cps->server_thread); cps->server_thread = NULL; LeaveCriticalSection(&listen_cs); + TRACE("done\n"); return 0; } diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index 367bf2c..0ae7125 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -3357,6 +3357,22 @@ static RpcConnection *rpcrt4_spawn_connection(RpcConnection *old_connection) return connection; } +void rpcrt4_conn_release_and_wait(RpcConnection *connection) +{ + HANDLE event = NULL; + + if (connection->ref > 1) + event = connection->wait_release = CreateEventW(NULL, TRUE, FALSE, NULL); + + RPCRT4_ReleaseConnection(connection); + + if(event) + { + WaitForSingleObject(event, INFINITE); + CloseHandle(event); + } +} + RpcConnection *RPCRT4_GrabConnection( RpcConnection *conn ) { InterlockedIncrement( &conn->ref ); @@ -3387,6 +3403,8 @@ RPC_STATUS RPCRT4_ReleaseConnection(RpcConnection* Connection) LeaveCriticalSection(&Connection->protseq->cs); } + if (Connection->wait_release) SetEvent(Connection->wait_release); + HeapFree(GetProcessHeap(), 0, Connection); return RPC_S_OK; }
1
0
0
0
Jacek Caban : rpcrt4: Recreate listening pipe in rpcrt4_protseq_np_get_wait_array if needed.
by Alexandre Julliard
31 May '17
31 May '17
Module: wine Branch: master Commit: 10a6b33a93cd4ea33032077b8e0753ef61ea88ed URL:
http://source.winehq.org/git/wine.git/?a=commit;h=10a6b33a93cd4ea33032077b8…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 31 17:30:29 2017 +0200 rpcrt4: Recreate listening pipe in rpcrt4_protseq_np_get_wait_array if needed. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/rpc_transport.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index ca33c3e..367bf2c 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -655,6 +655,8 @@ static void *rpcrt4_protseq_np_get_wait_array(RpcServerProtseq *protseq, void *p *count = 1; LIST_FOR_EACH_ENTRY(conn, &protseq->listeners, RpcConnection_np, common.protseq_entry) { + if (!conn->pipe && rpcrt4_conn_create_pipe(&conn->common) != RPC_S_OK) + continue; if (!conn->listen_event) { NTSTATUS status;
1
0
0
0
Jacek Caban : rpcrt4: Store listening pipe name in RpcConnection_np.
by Alexandre Julliard
31 May '17
31 May '17
Module: wine Branch: master Commit: 5c2083fd22d252c1d1c082d5852d76a2aaf11436 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5c2083fd22d252c1d1c082d58…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 31 17:30:23 2017 +0200 rpcrt4: Store listening pipe name in RpcConnection_np. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/rpc_transport.c | 61 +++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 36 deletions(-) diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index e2fbbfd..ca33c3e 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -67,6 +67,7 @@ typedef struct _RpcConnection_np RpcConnection common; HANDLE pipe; HANDLE listen_event; + char *listen_pipe; IO_STATUS_BLOCK io_status; HANDLE event_cache; BOOL read_closed; @@ -91,26 +92,26 @@ static void release_np_event(RpcConnection_np *connection, HANDLE event) CloseHandle(event); } -static RPC_STATUS rpcrt4_conn_create_pipe(RpcConnection *Connection, LPCSTR pname) +static RPC_STATUS rpcrt4_conn_create_pipe(RpcConnection *conn) { - RpcConnection_np *npc = (RpcConnection_np *) Connection; - TRACE("listening on %s\n", pname); - - npc->pipe = CreateNamedPipeA(pname, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, - PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, - PIPE_UNLIMITED_INSTANCES, - RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL); - if (npc->pipe == INVALID_HANDLE_VALUE) { - WARN("CreateNamedPipe failed with error %d\n", GetLastError()); - if (GetLastError() == ERROR_FILE_EXISTS) - return RPC_S_DUPLICATE_ENDPOINT; - else - return RPC_S_CANT_CREATE_ENDPOINT; - } + RpcConnection_np *connection = (RpcConnection_np *) conn; - /* Note: we don't call ConnectNamedPipe here because it must be done in the - * server thread as the thread must be alertable */ - return RPC_S_OK; + TRACE("listening on %s\n", connection->listen_pipe); + + connection->pipe = CreateNamedPipeA(connection->listen_pipe, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, + PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, + PIPE_UNLIMITED_INSTANCES, + RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL); + if (connection->pipe == INVALID_HANDLE_VALUE) + { + WARN("CreateNamedPipe failed with error %d\n", GetLastError()); + if (GetLastError() == ERROR_FILE_EXISTS) + return RPC_S_DUPLICATE_ENDPOINT; + else + return RPC_S_CANT_CREATE_ENDPOINT; + } + + return RPC_S_OK; } static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection, LPCSTR pname, BOOL wait) @@ -203,7 +204,6 @@ static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection) static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq, const char *endpoint) { RPC_STATUS r; - LPSTR pname; RpcConnection *Connection; char generated_endpoint[22]; @@ -222,9 +222,8 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq if (r != RPC_S_OK) return r; - pname = ncalrpc_pipe_name(Connection->Endpoint); - r = rpcrt4_conn_create_pipe(Connection, pname); - I_RpcFree(pname); + ((RpcConnection_np*)Connection)->listen_pipe = ncalrpc_pipe_name(Connection->Endpoint); + r = rpcrt4_conn_create_pipe(Connection); EnterCriticalSection(&protseq->cs); list_add_head(&protseq->listeners, &Connection->protseq_entry); @@ -265,7 +264,6 @@ static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protseq, const char *endpoint) { RPC_STATUS r; - LPSTR pname; RpcConnection *Connection; char generated_endpoint[26]; @@ -284,9 +282,8 @@ static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protse if (r != RPC_S_OK) return r; - pname = ncacn_pipe_name(Connection->Endpoint); - r = rpcrt4_conn_create_pipe(Connection, pname); - I_RpcFree(pname); + ((RpcConnection_np*)Connection)->listen_pipe = ncacn_pipe_name(Connection->Endpoint); + r = rpcrt4_conn_create_pipe(Connection); EnterCriticalSection(&protseq->cs); list_add_head(&protseq->listeners, &Connection->protseq_entry); @@ -310,13 +307,9 @@ static RPC_STATUS rpcrt4_ncacn_np_handoff(RpcConnection *old_conn, RpcConnection { DWORD len = MAX_COMPUTERNAME_LENGTH + 1; RPC_STATUS status; - LPSTR pname; rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); - - pname = ncacn_pipe_name(old_conn->Endpoint); - status = rpcrt4_conn_create_pipe(old_conn, pname); - I_RpcFree(pname); + status = rpcrt4_conn_create_pipe(old_conn); /* Store the local computer name as the NetworkAddr for ncacn_np as long as * we don't support named pipes over the network. */ @@ -361,15 +354,11 @@ static RPC_STATUS rpcrt4_ncalrpc_handoff(RpcConnection *old_conn, RpcConnection { DWORD len = MAX_COMPUTERNAME_LENGTH + 1; RPC_STATUS status; - LPSTR pname; TRACE("%s\n", old_conn->Endpoint); rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); - - pname = ncalrpc_pipe_name(old_conn->Endpoint); - status = rpcrt4_conn_create_pipe(old_conn, pname); - I_RpcFree(pname); + status = rpcrt4_conn_create_pipe(old_conn); /* Store the local computer name as the NetworkAddr for ncalrpc. */ new_conn->NetworkAddr = HeapAlloc(GetProcessHeap(), 0, len);
1
0
0
0
Jacek Caban : rpcrt4: Store server thread handle in RpcServerProtseq.
by Alexandre Julliard
31 May '17
31 May '17
Module: wine Branch: master Commit: 5c81f8295e379bf09b51466eb387b6df9c9d70bb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5c81f8295e379bf09b51466eb…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 31 17:30:10 2017 +0200 rpcrt4: Store server thread handle in RpcServerProtseq. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/rpc_server.c | 37 ++++++++++++++++++------------------- dlls/rpcrt4/rpc_server.h | 4 ++-- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index dcfac70..d8225f3 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -669,21 +669,26 @@ static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg) { /* cleanup */ cps->ops->free_wait_array(cps, objs); - - EnterCriticalSection(&cps->cs); - LIST_FOR_EACH_ENTRY(conn, &cps->listeners, RpcConnection, protseq_entry) - RPCRT4_CloseConnection(conn); - LIST_FOR_EACH_ENTRY(conn, &cps->connections, RpcConnection, protseq_entry) - rpcrt4_conn_close_read(conn); - LeaveCriticalSection(&cps->cs); - - if (res == 0 && !std_listen) - SetEvent(cps->server_ready_event); break; } else if (res == 0) set_ready_event = TRUE; } + + EnterCriticalSection(&cps->cs); + LIST_FOR_EACH_ENTRY(conn, &cps->listeners, RpcConnection, protseq_entry) + RPCRT4_CloseConnection(conn); + LIST_FOR_EACH_ENTRY(conn, &cps->connections, RpcConnection, protseq_entry) + rpcrt4_conn_close_read(conn); + LeaveCriticalSection(&cps->cs); + + if (res == 0 && !std_listen) + SetEvent(cps->server_ready_event); + + EnterCriticalSection(&listen_cs); + CloseHandle(cps->server_thread); + cps->server_thread = NULL; + LeaveCriticalSection(&listen_cs); return 0; } @@ -707,21 +712,15 @@ static void RPCRT4_sync_with_server_thread(RpcServerProtseq *ps) static RPC_STATUS RPCRT4_start_listen_protseq(RpcServerProtseq *ps, BOOL auto_listen) { RPC_STATUS status = RPC_S_OK; - HANDLE server_thread; EnterCriticalSection(&listen_cs); - if (ps->is_listening) goto done; + if (ps->server_thread) goto done; if (!ps->mgr_mutex) ps->mgr_mutex = CreateMutexW(NULL, FALSE, NULL); if (!ps->server_ready_event) ps->server_ready_event = CreateEventW(NULL, FALSE, FALSE, NULL); - server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, ps, 0, NULL); - if (!server_thread) - { + ps->server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, ps, 0, NULL); + if (!ps->server_thread) status = RPC_S_OUT_OF_RESOURCES; - goto done; - } - ps->is_listening = TRUE; - CloseHandle(server_thread); done: LeaveCriticalSection(&listen_cs); diff --git a/dlls/rpcrt4/rpc_server.h b/dlls/rpcrt4/rpc_server.h index 130dde7..5e04365 100644 --- a/dlls/rpcrt4/rpc_server.h +++ b/dlls/rpcrt4/rpc_server.h @@ -37,8 +37,8 @@ typedef struct _RpcServerProtseq struct list connections; /* CS cs */ CRITICAL_SECTION cs; - /* is the server currently listening? */ - BOOL is_listening; /* CS ::listen_cs */ + /* handle to listening thread */ + HANDLE server_thread; /* CS ::listen_cs */ /* mutex for ensuring only one thread can change state at a time */ HANDLE mgr_mutex; /* set when server thread has finished opening connections */
1
0
0
0
Jacek Caban : wmp: Added IOleObject:: GetExtent and SetExtent implementation.
by Alexandre Julliard
31 May '17
31 May '17
Module: wine Branch: master Commit: a8d956b5b60759f144a863db6fb563ea8b0873b4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a8d956b5b60759f144a863db6…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 31 16:05:58 2017 +0200 wmp: Added IOleObject::GetExtent and SetExtent implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wmp/oleobj.c | 30 +++++++++++++++++++++++---- dlls/wmp/tests/Makefile.in | 2 +- dlls/wmp/tests/oleobj.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/wmp/wmp_private.h | 1 + 4 files changed, 79 insertions(+), 5 deletions(-) diff --git a/dlls/wmp/oleobj.c b/dlls/wmp/oleobj.c index 75957a4..8dcdfbd 100644 --- a/dlls/wmp/oleobj.c +++ b/dlls/wmp/oleobj.c @@ -457,15 +457,27 @@ static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfTyp static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel) { WindowsMediaPlayer *This = impl_from_IOleObject(iface); - FIXME("(%p)->(%d %p)\n", This, dwDrawAspect, psizel); - return E_NOTIMPL; + + TRACE("(%p)->(%d %p)\n", This, dwDrawAspect, psizel); + + if(dwDrawAspect != DVASPECT_CONTENT) + return DV_E_DVASPECT; + + This->extent = *psizel; + return S_OK; } static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel) { WindowsMediaPlayer *This = impl_from_IOleObject(iface); - FIXME("(%p)->(%d %p)\n", This, dwDrawAspect, psizel); - return E_NOTIMPL; + + TRACE("(%p)->(%d %p)\n", This, dwDrawAspect, psizel); + + if(dwDrawAspect != DVASPECT_CONTENT) + return E_FAIL; + + *psizel = This->extent; + return S_OK; } static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink, DWORD *pdwConnection) @@ -905,6 +917,8 @@ HRESULT WINAPI WMPFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) { WindowsMediaPlayer *wmp; + DWORD dpi_x, dpi_y; + HDC hdc; HRESULT hres; TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv); @@ -924,6 +938,14 @@ HRESULT WINAPI WMPFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, init_player_ifaces(wmp); + hdc = GetDC(0); + dpi_x = GetDeviceCaps(hdc, LOGPIXELSX); + dpi_y = GetDeviceCaps(hdc, LOGPIXELSY); + ReleaseDC(0, hdc); + + wmp->extent.cx = MulDiv(192, 2540, dpi_x); + wmp->extent.cy = MulDiv(192, 2540, dpi_y); + hres = IOleObject_QueryInterface(&wmp->IOleObject_iface, riid, ppv); IOleObject_Release(&wmp->IOleObject_iface); return hres; diff --git a/dlls/wmp/tests/Makefile.in b/dlls/wmp/tests/Makefile.in index 465b878..df770c7 100644 --- a/dlls/wmp/tests/Makefile.in +++ b/dlls/wmp/tests/Makefile.in @@ -1,4 +1,4 @@ TESTDLL = wmp.dll -IMPORTS = ole32 oleaut32 user32 +IMPORTS = ole32 oleaut32 user32 gdi32 C_SRCS = oleobj.c diff --git a/dlls/wmp/tests/oleobj.c b/dlls/wmp/tests/oleobj.c index 971a2fe..b008af1 100644 --- a/dlls/wmp/tests/oleobj.c +++ b/dlls/wmp/tests/oleobj.c @@ -857,6 +857,56 @@ static void test_QI(IUnknown *unk) IUnknown_Release(tmp); } +static void test_extent(IOleObject *oleobj) +{ + SIZE expected, extent; + DWORD dpi_x; + DWORD dpi_y; + HDC hdc; + HRESULT hres; + + /* default aspect ratio is 96dpi / 96dpi */ + hdc = GetDC(0); + dpi_x = GetDeviceCaps(hdc, LOGPIXELSX); + dpi_y = GetDeviceCaps(hdc, LOGPIXELSY); + ReleaseDC(0, hdc); + if (dpi_x != 96 || dpi_y != 96) + trace("dpi: %d / %d\n", dpi_y, dpi_y); + + extent.cx = extent.cy = 0xdeadbeef; + hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &extent); + ok(hres == S_OK, "GetExtent failed: %08x\n", hres); + expected.cx = MulDiv(192, 2540, dpi_x); + expected.cy = MulDiv(192, 2540, dpi_y); + ok(extent.cx == expected.cx && extent.cy == expected.cy, "size = {%d %d} (expected %d %d)\n", + extent.cx, extent.cy, expected.cx, expected.cy ); + + extent.cx = 800; + extent.cy = 700; + hres = IOleObject_SetExtent(oleobj, DVASPECT_CONTENT, &extent); + ok(hres == S_OK, "SetExtent failed: %08x\n", hres); + + extent.cx = extent.cy = 0xdeadbeef; + hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &extent); + ok(hres == S_OK, "GetExtent failed: %08x\n", hres); + ok(extent.cx == 800 && extent.cy == 700, "size = {%d %d}\n", extent.cx, extent.cy); + + hres = IOleObject_GetExtent(oleobj, 0, &extent); + ok(hres == E_FAIL, "GetExtent failed: %08x\n", hres); + hres = IOleObject_GetExtent(oleobj, 7, &extent); + ok(hres == E_FAIL, "GetExtent failed: %08x\n", hres); + + extent.cx = 900; + extent.cy = 800; + hres = IOleObject_SetExtent(oleobj, DVASPECT_CONTENT, &expected); + ok(hres == S_OK, "SetExtent failed: %08x\n", hres); + + hres = IOleObject_SetExtent(oleobj, 0, &expected); + ok(hres == DV_E_DVASPECT, "SetExtent failed: %08x\n", hres); + hres = IOleObject_SetExtent(oleobj, 7, &expected); + ok(hres == DV_E_DVASPECT, "SetExtent failed: %08x\n", hres); +} + static void test_wmp(void) { IProvideClassInfo2 *class_info; @@ -902,6 +952,7 @@ static void test_wmp(void) IProvideClassInfo2_Release(class_info); test_QI((IUnknown*)oleobj); + test_extent(oleobj); hres = IOleObject_GetMiscStatus(oleobj, DVASPECT_CONTENT, &misc_status); ok(hres == S_OK, "GetMiscStatus failed: %08x\n", hres); diff --git a/dlls/wmp/wmp_private.h b/dlls/wmp/wmp_private.h index a44aa35..7b7f51c 100644 --- a/dlls/wmp/wmp_private.h +++ b/dlls/wmp/wmp_private.h @@ -36,6 +36,7 @@ struct WindowsMediaPlayer { IOleClientSite *client_site; HWND hwnd; + SIZEL extent; }; void init_player_ifaces(WindowsMediaPlayer*) DECLSPEC_HIDDEN;
1
0
0
0
Jacek Caban : wininet/tests: Added redirection tests using test server.
by Alexandre Julliard
31 May '17
31 May '17
Module: wine Branch: master Commit: 23e78c01afea3e406a3728fe6d75cbdc96d601f2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=23e78c01afea3e406a3728fe6…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 31 16:04:46 2017 +0200 wininet/tests: Added redirection tests using test server. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wininet/tests/http.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 249658a..ddc1137 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -4561,6 +4561,11 @@ static void server_send_string(const char *msg) send(server_socket, msg, strlen(msg), 0); } +static size_t server_read_data(char *buf, size_t buf_size) +{ + return recv(server_socket, buf, buf_size, 0); +} + static BOOL skip_receive_notification_tests; static DWORD received_response_size; @@ -5152,6 +5157,98 @@ static void test_long_url(int port) close_request(&req); } +static void test_redirect(int port) +{ + char buf[4000], *p, expect_url[INTERNET_MAX_URL_LENGTH]; + INTERNET_BUFFERSW ib; + test_request_t req; + size_t size; + + if(!is_ie7plus) + return; + + skip_receive_notification_tests = TRUE; + + memset(&ib, 0, sizeof(ib)); + ib.dwStructSize = sizeof(ib); + ib.lpvBuffer = buf; + + trace("Testing redirection...\n"); + + open_socket_request(port, &req); + + SET_OPTIONAL(INTERNET_STATUS_COOKIE_SENT); + SET_EXPECT(INTERNET_STATUS_REDIRECT); + SET_EXPECT(INTERNET_STATUS_SENDING_REQUEST); + SET_EXPECT(INTERNET_STATUS_REQUEST_SENT); + + server_send_string("HTTP/1.1 302 Found\r\n" + "Server: winetest\r\n" + "Location: test_redirection\r\n" + "Connection: keep-alive\r\n" + "Content-Length: 0\r\n" + "\r\n"); + + size = server_read_data(buf, sizeof(buf)); + buf[size] = 0; + p = strstr(buf, "\r\n"); + if(p) *p = 0; + ok(p && !strcmp(buf, "GET /test_redirection HTTP/1.1"), "unexpected request %s\n", buf); + + CHECK_NOTIFIED(INTERNET_STATUS_SENDING_REQUEST); + + sprintf(expect_url, "
http://localhost:%u/test_redirection
", port); + test_request_url(req.request, expect_url); + + SET_EXPECT(INTERNET_STATUS_REQUEST_COMPLETE); + + server_send_string("HTTP/1.1 200 OK\r\n" + "Server: winetest\r\n" + "Content-Length: 3\r\n" + "\r\n" + "xxx"); + + WaitForSingleObject(complete_event, INFINITE); + + CLEAR_NOTIFIED(INTERNET_STATUS_COOKIE_SENT); + CHECK_NOTIFIED(INTERNET_STATUS_REQUEST_SENT); + CHECK_NOTIFIED(INTERNET_STATUS_REDIRECT); + CHECK_NOTIFIED(INTERNET_STATUS_REQUEST_COMPLETE); + ok(req_error == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", req_error); + + test_status_code(req.request, 200); + + close_connection(); + close_async_handle(req.session, 2); + + trace("Test redirect to non-http URL...\n"); + + open_socket_request(port, &req); + + SET_EXPECT(INTERNET_STATUS_REQUEST_COMPLETE); + + server_send_string("HTTP/1.1 302 Found\r\n" + "Server: winetest\r\n" + "Location: test:non:http/url\r\n" + "Connection: keep-alive\r\n" + "Content-Length: 0\r\n" + "\r\n"); + + WaitForSingleObject(complete_event, INFINITE); + + CHECK_NOTIFIED(INTERNET_STATUS_REQUEST_COMPLETE); + ok(req_error == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", req_error); + + sprintf(expect_url, "
http://localhost:%u/socket
", port); + test_request_url(req.request, expect_url); + test_status_code(req.request, 302); + + close_connection(); + close_async_handle(req.session, 2); + + skip_receive_notification_tests = FALSE; +} + static void test_remove_dot_segments(int port) { test_request_t req; @@ -5218,6 +5315,7 @@ static void test_http_connection(void) test_http_read(si.port); test_connection_break(si.port); test_long_url(si.port); + test_redirect(si.port); test_remove_dot_segments(si.port); /* send the basic request again to shutdown the server thread */
1
0
0
0
← Newer
1
2
3
4
...
64
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
Results per page:
10
25
50
100
200