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 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
1 participants
811 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Store exception jump buffer in the per-thread data.
by Alexandre Julliard
01 Jun '21
01 Jun '21
Module: wine Branch: master Commit: 1cc0649755c8817004901f0e0d9a970367a43b3c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1cc0649755c8817004901f0e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 1 15:16:23 2021 +0200 ntdll: Store exception jump buffer in the per-thread data. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_arm.c | 6 +++--- dlls/ntdll/unix/signal_arm64.c | 6 +++--- dlls/ntdll/unix/signal_i386.c | 6 +++--- dlls/ntdll/unix/signal_x86_64.c | 6 +++--- dlls/ntdll/unix/unix_private.h | 1 + dlls/ntdll/unix/virtual.c | 33 ++++++++++++++++++++++++++++++--- 6 files changed, 43 insertions(+), 15 deletions(-) diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index 8ecdaa3995b..ccd01e16f16 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -536,7 +536,6 @@ __ASM_GLOBAL_FUNC( call_user_exception_dispatcher, static BOOL handle_syscall_fault( ucontext_t *context, EXCEPTION_RECORD *rec ) { struct syscall_frame *frame = arm_thread_data()->syscall_frame; - __WINE_FRAME *wine_frame = (__WINE_FRAME *)NtCurrentTeb()->Tib.ExceptionList; DWORD i; if (!frame) return FALSE; @@ -557,12 +556,13 @@ static BOOL handle_syscall_fault( ucontext_t *context, EXCEPTION_RECORD *rec ) (DWORD)IP_sig(context), (DWORD)SP_sig(context), (DWORD)LR_sig(context), (DWORD)PC_sig(context), (DWORD)CPSR_sig(context) ); - if ((char *)wine_frame < (char *)frame) + if (ntdll_get_thread_data()->jmp_buf) { TRACE( "returning to handler\n" ); - REGn_sig(0, context) = (DWORD)&wine_frame->jmp; + REGn_sig(0, context) = (DWORD)ntdll_get_thread_data()->jmp_buf; REGn_sig(1, context) = 1; PC_sig(context) = (DWORD)__wine_longjmp; + ntdll_get_thread_data()->jmp_buf = NULL; } else { diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index e696ba41a66..248097ce80a 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -676,7 +676,6 @@ __ASM_GLOBAL_FUNC( call_user_exception_dispatcher, static BOOL handle_syscall_fault( ucontext_t *context, EXCEPTION_RECORD *rec ) { struct syscall_frame *frame = arm64_thread_data()->syscall_frame; - __WINE_FRAME *wine_frame = (__WINE_FRAME *)NtCurrentTeb()->Tib.ExceptionList; DWORD i; if (!frame) return FALSE; @@ -712,12 +711,13 @@ static BOOL handle_syscall_fault( ucontext_t *context, EXCEPTION_RECORD *rec ) (DWORD64)REGn_sig(28, context), (DWORD64)FP_sig(context), (DWORD64)LR_sig(context), (DWORD64)SP_sig(context) ); - if ((char *)wine_frame < (char *)frame) + if (ntdll_get_thread_data()->jmp_buf) { TRACE( "returning to handler\n" ); - REGn_sig(0, context) = (ULONG_PTR)&wine_frame->jmp; + REGn_sig(0, context) = (ULONG_PTR)ntdll_get_thread_data()->jmp_buf; REGn_sig(1, context) = 1; PC_sig(context) = (ULONG_PTR)__wine_longjmp; + ntdll_get_thread_data()->jmp_buf = NULL; } else { diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 707e965d8b3..db93d3f6ed0 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1779,7 +1779,6 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, void *stack_ptr, EXCEPTION_RECORD *rec, CONTEXT *context ) { struct syscall_frame *frame = x86_thread_data()->syscall_frame; - __WINE_FRAME *wine_frame = (__WINE_FRAME *)NtCurrentTeb()->Tib.ExceptionList; DWORD i; if (!frame) return FALSE; @@ -1796,7 +1795,7 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, void *stack_ptr, context->Ebp, context->Esp, context->SegCs, context->SegDs, context->SegEs, context->SegFs, context->SegGs, context->EFlags ); - if ((char *)wine_frame < (char *)frame) + if (ntdll_get_thread_data()->jmp_buf) { /* stack frame for calling __wine_longjmp */ struct @@ -1809,10 +1808,11 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, void *stack_ptr, TRACE( "returning to handler\n" ); stack = virtual_setup_exception( stack_ptr, sizeof(*stack), rec ); stack->retval = 1; - stack->jmp = &wine_frame->jmp; + stack->jmp = ntdll_get_thread_data()->jmp_buf; stack->retaddr = (void *)0xdeadbabe; ESP_sig(sigcontext) = (DWORD)stack; EIP_sig(sigcontext) = (DWORD)__wine_longjmp; + ntdll_get_thread_data()->jmp_buf = NULL; } else { diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 1ab991d3cb5..4f28d498cc2 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2253,7 +2253,6 @@ static inline BOOL handle_interrupt( ucontext_t *sigcontext, EXCEPTION_RECORD *r static BOOL handle_syscall_fault( ucontext_t *sigcontext, EXCEPTION_RECORD *rec, CONTEXT *context ) { struct syscall_frame *frame = amd64_thread_data()->syscall_frame; - __WINE_FRAME *wine_frame = (__WINE_FRAME *)NtCurrentTeb()->Tib.ExceptionList; DWORD i; if (!frame) return FALSE; @@ -2272,12 +2271,13 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, EXCEPTION_RECORD *rec, TRACE(" r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", context->R12, context->R13, context->R14, context->R15 ); - if ((char *)wine_frame < (char *)frame) + if (ntdll_get_thread_data()->jmp_buf) { TRACE( "returning to handler\n" ); - RCX_sig(sigcontext) = (ULONG_PTR)&wine_frame->jmp; + RCX_sig(sigcontext) = (ULONG_PTR)ntdll_get_thread_data()->jmp_buf; RDX_sig(sigcontext) = 1; RIP_sig(sigcontext) = (ULONG_PTR)__wine_longjmp; + ntdll_get_thread_data()->jmp_buf = NULL; } else { diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 5b9af322a68..cf3b8280200 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -68,6 +68,7 @@ struct ntdll_thread_data struct list entry; /* entry in TEB list */ PRTL_THREAD_START_ROUTINE start; /* thread entry point */ void *param; /* thread entry point parameter */ + void *jmp_buf; /* setjmp buffer for exception handling */ }; C_ASSERT( sizeof(struct ntdll_thread_data) <= sizeof(((TEB *)0)->GdiTebBatch) ); diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 2ef72220a45..9796451f58f 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -104,7 +104,34 @@ struct file_view unsigned int protect; /* protection for all pages at allocation time and SEC_* flags */ }; -#define __EXCEPT_SYSCALL __EXCEPT_HANDLER(0) +#undef __TRY +#undef __EXCEPT +#undef __ENDTRY + +#define __TRY \ + do { __wine_jmp_buf __jmp; \ + int __first = 1; \ + assert( !ntdll_get_thread_data()->jmp_buf ); \ + for (;;) if (!__first) \ + { \ + do { + +#define __EXCEPT \ + } while(0); \ + ntdll_get_thread_data()->jmp_buf = NULL; \ + break; \ + } else { \ + if (__wine_setjmpex( &__jmp, NULL )) { \ + do { + +#define __ENDTRY \ + } while (0); \ + break; \ + } \ + ntdll_get_thread_data()->jmp_buf = &__jmp; \ + __first = 0; \ + } \ + } while (0); /* per-page protection flags */ #define VPROT_READ 0x01 @@ -3428,7 +3455,7 @@ BOOL virtual_check_buffer_for_read( const void *ptr, SIZE_T size ) dummy = p[0]; dummy = p[count - 1]; } - __EXCEPT_SYSCALL + __EXCEPT { return FALSE; } @@ -3461,7 +3488,7 @@ BOOL virtual_check_buffer_for_write( void *ptr, SIZE_T size ) p[0] |= 0; p[count - 1] |= 0; } - __EXCEPT_SYSCALL + __EXCEPT { return FALSE; }
1
0
0
0
Zebediah Figura : Revert "ntdll: Preserve syscall frame when calling async IO system APC.".
by Alexandre Julliard
01 Jun '21
01 Jun '21
Module: wine Branch: master Commit: 10eba9b2e989a96a8bb7ffedf6b2cee01b48537f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=10eba9b2e989a96a8bb7ffed…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 31 22:16:37 2021 -0500 Revert "ntdll: Preserve syscall frame when calling async IO system APC.". This reverts commit 8b8ddffa2152832908ced42191fa19dcb64d900e. ws2_32 no longer uses system APCs. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/server.c | 15 --------------- dlls/ntdll/unix/signal_arm.c | 9 --------- dlls/ntdll/unix/signal_arm64.c | 10 ---------- dlls/ntdll/unix/signal_i386.c | 12 +----------- dlls/ntdll/unix/signal_x86_64.c | 11 +---------- dlls/ntdll/unix/unix_private.h | 3 --- 6 files changed, 2 insertions(+), 58 deletions(-) diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index c0cf13b3cb4..cec2ef250a3 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -379,24 +379,9 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO { IO_STATUS_BLOCK *iosb = wine_server_get_ptr( call->async_io.sb ); struct async_fileio *user = wine_server_get_ptr( call->async_io.user ); - void *saved_frame = get_syscall_frame(); - void *frame; result->type = call->type; result->async_io.status = user->callback( user, iosb, call->async_io.status ); - - if ((frame = get_syscall_frame()) != saved_frame) - { - /* The frame can be altered by syscalls from ws2_32 async callbacks - * which are currently in the user part. */ - static unsigned int once; - - if (!once++) - FIXME( "syscall frame changed in APC function, frame %p, saved_frame %p.\n", frame, saved_frame ); - - set_syscall_frame( saved_frame ); - } - if (result->async_io.status != STATUS_PENDING) result->async_io.total = iosb->Information; break; diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index 11b6aa8d0ad..8ecdaa3995b 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -201,15 +201,6 @@ static inline struct arm_thread_data *arm_thread_data(void) return (struct arm_thread_data *)ntdll_get_thread_data()->cpu_data; } -void *get_syscall_frame(void) -{ - return arm_thread_data()->syscall_frame; -} - -void set_syscall_frame(void *frame) -{ - arm_thread_data()->syscall_frame = frame; -} /*********************************************************************** * unwind_builtin_dll diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index 2359b1838d6..e696ba41a66 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -157,16 +157,6 @@ static inline struct arm64_thread_data *arm64_thread_data(void) return (struct arm64_thread_data *)ntdll_get_thread_data()->cpu_data; } -void *get_syscall_frame(void) -{ - return arm64_thread_data()->syscall_frame; -} - -void set_syscall_frame(void *frame) -{ - arm64_thread_data()->syscall_frame = frame; -} - extern void raise_func_trampoline( EXCEPTION_RECORD *rec, CONTEXT *context, void *dispatcher ); /*********************************************************************** diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 87024e1bfce..707e965d8b3 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -527,16 +527,6 @@ static inline struct x86_thread_data *x86_thread_data(void) return (struct x86_thread_data *)ntdll_get_thread_data()->cpu_data; } -void *get_syscall_frame(void) -{ - return x86_thread_data()->syscall_frame; -} - -void set_syscall_frame(void *frame) -{ - x86_thread_data()->syscall_frame = frame; -} - static struct syscall_xsave *get_syscall_xsave( struct syscall_frame *frame ) { return (struct syscall_xsave *)((ULONG_PTR)((struct syscall_xsave *)frame - 1) & ~63); @@ -973,7 +963,7 @@ __ASM_GLOBAL_FUNC( set_full_cpu_context, */ void signal_restore_full_cpu_context(void) { - struct syscall_xsave *xsave = get_syscall_xsave( get_syscall_frame() ); + struct syscall_xsave *xsave = get_syscall_xsave( x86_thread_data()->syscall_frame ); if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_XSAVE) { diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index dcb0e588c66..1ab991d3cb5 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -327,15 +327,6 @@ static inline struct amd64_thread_data *amd64_thread_data(void) return (struct amd64_thread_data *)ntdll_get_thread_data()->cpu_data; } -void *get_syscall_frame(void) -{ - return amd64_thread_data()->syscall_frame; -} - -void set_syscall_frame(void *frame) -{ - amd64_thread_data()->syscall_frame = frame; -} static struct syscall_xsave *get_syscall_xsave( struct syscall_frame *frame ) { @@ -1598,7 +1589,7 @@ __ASM_GLOBAL_FUNC( set_full_cpu_context, */ void signal_restore_full_cpu_context(void) { - struct syscall_xsave *xsave = get_syscall_xsave( get_syscall_frame() ); + struct syscall_xsave *xsave = get_syscall_xsave( amd64_thread_data()->syscall_frame ); if (cpu_info.ProcessorFeatureBits & CPU_FEATURE_XSAVE) { diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index f28d5cf4e99..5b9af322a68 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -290,9 +290,6 @@ extern void WINAPI DECLSPEC_NORETURN call_user_exception_dispatcher( EXCEPTION_R NTSTATUS (WINAPI *dispatcher)(EXCEPTION_RECORD*,CONTEXT*) ) DECLSPEC_HIDDEN; extern void WINAPI call_raise_user_exception_dispatcher( NTSTATUS (WINAPI *dispatcher)(void) ) DECLSPEC_HIDDEN; -extern void *get_syscall_frame(void) DECLSPEC_HIDDEN; -extern void set_syscall_frame(void *frame) DECLSPEC_HIDDEN; - #define IMAGE_DLLCHARACTERISTICS_PREFER_NATIVE 0x0010 /* Wine extension */ #define TICKSPERSEC 10000000
1
0
0
0
Zebediah Figura : ws2_32: Use socket_apc for WSAIoctl() completion.
by Alexandre Julliard
01 Jun '21
01 Jun '21
Module: wine Branch: master Commit: 2ead3a1124589d70ad9dddf04b4f5d195a179118 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2ead3a1124589d70ad9dddf0…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 31 22:16:36 2021 -0500 ws2_32: Use socket_apc for WSAIoctl() completion. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 119 +++++++-------------------------------------------- 1 file changed, 15 insertions(+), 104 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index b6a14c3e4f4..c1f415444df 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -457,78 +457,6 @@ static void socket_list_remove(SOCKET socket) LeaveCriticalSection(&cs_socket_list); } -/**************************************************************** - * Async IO declarations - ****************************************************************/ - -typedef NTSTATUS async_callback_t( void *user, IO_STATUS_BLOCK *io, NTSTATUS status ); - -struct ws2_async_io -{ - async_callback_t *callback; /* must be the first field */ - struct ws2_async_io *next; -}; - -struct ws2_async_shutdown -{ - struct ws2_async_io io; - HANDLE hSocket; - IO_STATUS_BLOCK iosb; - int type; -}; - -struct ws2_async -{ - struct ws2_async_io io; - HANDLE hSocket; - LPWSAOVERLAPPED user_overlapped; - LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_func; - IO_STATUS_BLOCK local_iosb; - struct WS_sockaddr *addr; - union - { - int val; /* for send operations */ - int *ptr; /* for recv operations */ - } addrlen; - DWORD flags; - DWORD *lpFlags; - WSABUF *control; - unsigned int n_iovecs; - unsigned int first_iovec; - struct iovec iovec[1]; -}; - -static struct ws2_async_io *async_io_freelist; - -static void release_async_io( struct ws2_async_io *io ) -{ - for (;;) - { - struct ws2_async_io *next = async_io_freelist; - io->next = next; - if (InterlockedCompareExchangePointer( (void **)&async_io_freelist, io, next ) == next) return; - } -} - -static struct ws2_async_io *alloc_async_io( DWORD size, async_callback_t callback ) -{ - /* first free remaining previous fileinfos */ - - struct ws2_async_io *io = InterlockedExchangePointer( (void **)&async_io_freelist, NULL ); - - while (io) - { - struct ws2_async_io *next = io->next; - HeapFree( GetProcessHeap(), 0, io ); - io = next; - } - - io = HeapAlloc( GetProcessHeap(), 0, size ); - if (io) io->callback = callback; - return io; -} - - typedef struct /* WSAAsyncSelect() control struct */ { HANDLE service, event, sock; @@ -1727,20 +1655,6 @@ static BOOL ws_protocol_info(SOCKET s, int unicode, WSAPROTOCOL_INFOW *buffer, i return TRUE; } -/************************************************************************** - * Functions for handling overlapped I/O - **************************************************************************/ - -/* user APC called upon async completion */ -static void WINAPI ws2_async_apc( void *arg, IO_STATUS_BLOCK *iosb, ULONG reserved ) -{ - struct ws2_async *wsa = arg; - - if (wsa->completion_func) wsa->completion_func( NtStatusToWSAError(iosb->u.Status), - iosb->Information, wsa->user_overlapped, - wsa->flags ); - release_async_io( &wsa->io ); -} /*********************************************************************** @@ -3283,29 +3197,28 @@ static DWORD server_ioctl_sock( SOCKET s, DWORD code, LPVOID in_buff, DWORD in_s LPWSAOVERLAPPED overlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE completion ) { - HANDLE event = overlapped ? overlapped->hEvent : 0; + IO_STATUS_BLOCK iosb, *piosb = &iosb; HANDLE handle = SOCKET2HANDLE( s ); - struct ws2_async *wsa = NULL; - IO_STATUS_BLOCK *io = (PIO_STATUS_BLOCK)overlapped, iosb; + PIO_APC_ROUTINE apc = NULL; + HANDLE event = NULL; void *cvalue = NULL; NTSTATUS status; + if (overlapped) + { + piosb = (IO_STATUS_BLOCK *)overlapped; + if (!((ULONG_PTR)overlapped->hEvent & 1)) cvalue = overlapped; + event = overlapped->hEvent; + } + if (completion) { - if (!(wsa = (struct ws2_async *)alloc_async_io( sizeof(*wsa), NULL ))) - return WSA_NOT_ENOUGH_MEMORY; - wsa->hSocket = handle; - wsa->user_overlapped = overlapped; - wsa->completion_func = completion; - if (!io) io = &wsa->local_iosb; - cvalue = wsa; + event = NULL; + cvalue = completion; + apc = socket_apc; } - else if (!io) - io = &iosb; - else if (!((ULONG_PTR)overlapped->hEvent & 1)) - cvalue = overlapped; - status = NtDeviceIoControlFile( handle, event, wsa ? ws2_async_apc : NULL, cvalue, io, code, + status = NtDeviceIoControlFile( handle, event, apc, cvalue, piosb, code, in_buff, in_size, out_buff, out_size ); if (status == STATUS_NOT_SUPPORTED) { @@ -3313,9 +3226,7 @@ static DWORD server_ioctl_sock( SOCKET s, DWORD code, LPVOID in_buff, DWORD in_s code, code >> 16, (code >> 14) & 3, (code >> 2) & 0xfff, code & 3); } else if (status == STATUS_SUCCESS) - *ret_size = io->Information; /* "Information" is the size written to the output buffer */ - - if (status != STATUS_PENDING) RtlFreeHeap( GetProcessHeap(), 0, wsa ); + *ret_size = piosb->Information; return NtStatusToWSAError( status ); }
1
0
0
0
Zebediah Figura : ws2_32: Always return WSAEFAULT from WSAIoctl() if ret_size is NULL.
by Alexandre Julliard
01 Jun '21
01 Jun '21
Module: wine Branch: master Commit: e3e17ba7f891aa00f3564923508eb36f72574d36 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e3e17ba7f891aa00f3564923…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 31 22:16:35 2021 -0500 ws2_32: Always return WSAEFAULT from WSAIoctl() if ret_size is NULL. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 18 ++++++------- dlls/ws2_32/tests/sock.c | 66 +++++++++++++++++++++++------------------------- 2 files changed, 41 insertions(+), 43 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=e3e17ba7f891aa00f356…
1
0
0
0
Zebediah Figura : ws2_32/tests: Expand tests for SIO_GET_INTERFACE_LIST.
by Alexandre Julliard
01 Jun '21
01 Jun '21
Module: wine Branch: master Commit: fde6cd46c86ed8582ae13bb8ef7e8b0293a4cb81 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fde6cd46c86ed8582ae13bb8…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 31 22:16:34 2021 -0500 ws2_32/tests: Expand tests for SIO_GET_INTERFACE_LIST. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/tests/sock.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 3829a7914cb..b5be63d9995 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -10010,23 +10010,46 @@ static void test_iocp(void) closesocket(dst); } -static void test_wsaioctl(void) +static void test_get_interface_list(void) { + OVERLAPPED overlapped = {0}, *overlapped_ptr; + DWORD size, expect_size; unsigned int i, count; INTERFACE_INFO *info; BOOL loopback_found; char buffer[4096]; - DWORD size; + ULONG_PTR key; + HANDLE port; SOCKET s; int ret; s = WSASocketW(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, WSA_FLAG_OVERLAPPED); ok(s != INVALID_SOCKET, "failed to create socket, error %u\n", WSAGetLastError()); + port = CreateIoCompletionPort((HANDLE)s, NULL, 123, 0); size = 0xdeadbeef; + WSASetLastError(0xdeadbeef); ret = WSAIoctl(s, SIO_GET_INTERFACE_LIST, NULL, 0, buffer, sizeof(buffer), &size, NULL, NULL); ok(!ret, "Got unexpected ret %d.\n", ret); + todo_wine ok(!WSAGetLastError(), "Got error %u.\n", WSAGetLastError()); ok(size && size != 0xdeadbeef && !(size % sizeof(INTERFACE_INFO)), "Got unexpected size %u.\n", size); + expect_size = size; + + size = 0xdeadbeef; + overlapped.Internal = 0xdeadbeef; + overlapped.InternalHigh = 0xdeadbeef; + ret = WSAIoctl(s, SIO_GET_INTERFACE_LIST, NULL, 0, buffer, sizeof(buffer), &size, &overlapped, NULL); + todo_wine ok(ret == -1, "Got unexpected ret %d.\n", ret); + todo_wine ok(WSAGetLastError() == ERROR_IO_PENDING, "Got error %u.\n", WSAGetLastError()); + todo_wine ok(size == 0xdeadbeef, "Got size %u.\n", size); + + ret = GetQueuedCompletionStatus(port, &size, &key, &overlapped_ptr, 100); + ok(ret, "Got error %u.\n", GetLastError()); + ok(size == expect_size, "Expected size %u, got %u.\n", expect_size, size); + ok(key == 123, "Got key %Iu.\n", key); + ok(overlapped_ptr == &overlapped, "Got overlapped %p.\n", overlapped_ptr); + ok(!overlapped.Internal, "Got status %#x.\n", (NTSTATUS)overlapped.Internal); + ok(overlapped.InternalHigh == expect_size, "Expected size %u, got %Iu.\n", expect_size, overlapped.InternalHigh); info = (INTERFACE_INFO *)buffer; count = size / sizeof(INTERFACE_INFO); @@ -10058,10 +10081,53 @@ static void test_wsaioctl(void) ok(WSAGetLastError() == WSAEFAULT, "Got unexpected error %d.\n", WSAGetLastError()); ok(!size, "Got unexpected size %u.\n", size); + size = 0xdeadbeef; + overlapped.Internal = 0xdeadbeef; + overlapped.InternalHigh = 0xdeadbeef; + ret = WSAIoctl(s, SIO_GET_INTERFACE_LIST, NULL, 0, buffer, sizeof(INTERFACE_INFO) - 1, &size, &overlapped, NULL); + ok(ret == -1, "Got unexpected ret %d.\n", ret); + todo_wine ok(WSAGetLastError() == ERROR_IO_PENDING, "Got error %u.\n", WSAGetLastError()); + todo_wine ok(size == 0xdeadbeef, "Got size %u.\n", size); + + ret = GetQueuedCompletionStatus(port, &size, &key, &overlapped_ptr, 100); + ok(!ret, "Expected failure.\n"); + todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got error %u.\n", GetLastError()); + ok(!size, "Got size %u.\n", size); + ok(key == 123, "Got key %Iu.\n", key); + ok(overlapped_ptr == &overlapped, "Got overlapped %p.\n", overlapped_ptr); + todo_wine ok((NTSTATUS)overlapped.Internal == STATUS_BUFFER_TOO_SMALL, "Got status %#x.\n", (NTSTATUS)overlapped.Internal); + ok(!overlapped.InternalHigh, "Got size %Iu.\n", overlapped.InternalHigh); + ret = WSAIoctl(s, SIO_GET_INTERFACE_LIST, NULL, 0, buffer, sizeof(buffer), NULL, NULL, NULL); ok(ret == -1, "Got unexpected ret %d.\n", ret); ok(WSAGetLastError() == WSAEFAULT, "Got unexpected error %d.\n", WSAGetLastError()); + CloseHandle(port); + closesocket(s); + + /* Test with an APC. */ + + s = WSASocketW(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, WSA_FLAG_OVERLAPPED); + ok(s != INVALID_SOCKET, "failed to create socket, error %u\n", WSAGetLastError()); + + size = 0xdeadbeef; + apc_count = 0; + ret = WSAIoctl(s, SIO_GET_INTERFACE_LIST, NULL, 0, buffer, + sizeof(INTERFACE_INFO) - 1, &size, &overlapped, socket_apc); + ok(ret == -1, "Got unexpected ret %d.\n", ret); + todo_wine ok(WSAGetLastError() == ERROR_IO_PENDING, "Got error %u.\n", WSAGetLastError()); + todo_wine ok(size == 0xdeadbeef, "Got size %u.\n", size); + + ret = SleepEx(100, TRUE); + todo_wine ok(ret == WAIT_IO_COMPLETION, "got %d\n", ret); + if (ret == WAIT_IO_COMPLETION) + { + ok(apc_count == 1, "APC was called %u times\n", apc_count); + ok(apc_error == WSAEFAULT, "got APC error %u\n", apc_error); + ok(!apc_size, "got APC size %u\n", apc_size); + ok(apc_overlapped == &overlapped, "got APC overlapped %p\n", apc_overlapped); + } + closesocket(s); } @@ -10674,6 +10740,7 @@ START_TEST( sock ) test_fionbio(); test_fionread_siocatmark(); test_get_extension_func(); + test_get_interface_list(); test_keepalive_vals(); test_sioRoutingInterfaceQuery(); test_sioAddressListChange(); @@ -10707,7 +10774,6 @@ START_TEST( sock ) /* this is an io heavy test, do it at the end so the kernel doesn't start dropping packets */ test_send(); - test_wsaioctl(); Exit(); }
1
0
0
0
Zebediah Figura : ws2_32/tests: Expand tests for SIO_ADDRESS_LIST_QUERY.
by Alexandre Julliard
01 Jun '21
01 Jun '21
Module: wine Branch: master Commit: 7852d202ac9e46776e9e0d5f0df418e39c65b9be URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7852d202ac9e46776e9e0d5f…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 31 22:16:33 2021 -0500 ws2_32/tests: Expand tests for SIO_ADDRESS_LIST_QUERY. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/tests/sock.c | 142 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 117 insertions(+), 25 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index e76d9ac27a6..3829a7914cb 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -9231,58 +9231,150 @@ static void test_shutdown_completion_port(void) static void test_address_list_query(void) { - SOCKET_ADDRESS_LIST *address_list; - DWORD bytes_returned, size; + char buffer[1024]; + SOCKET_ADDRESS_LIST *address_list = (SOCKET_ADDRESS_LIST *)buffer; + OVERLAPPED overlapped = {0}, *overlapped_ptr; + DWORD size, expect_size; unsigned int i; + ULONG_PTR key; + HANDLE port; SOCKET s; int ret; s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); ok(s != INVALID_SOCKET, "Failed to create socket, error %d.\n", WSAGetLastError()); + port = CreateIoCompletionPort((HANDLE)s, NULL, 123, 0); - bytes_returned = 0; - ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, NULL, 0, &bytes_returned, NULL, NULL); + size = 0; + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, NULL, 0, &size, NULL, NULL); ok(ret == SOCKET_ERROR, "Got unexpected ret %d.\n", ret); ok(WSAGetLastError() == WSAEFAULT, "Got unexpected error %d.\n", WSAGetLastError()); - ok(bytes_returned >= FIELD_OFFSET(SOCKET_ADDRESS_LIST, Address[0]), - "Got unexpected bytes_returned %u.\n", bytes_returned); + ok(size >= FIELD_OFFSET(SOCKET_ADDRESS_LIST, Address[0]), "Got unexpected size %u.\n", size); + expect_size = size; - size = bytes_returned; - bytes_returned = 0; - address_list = HeapAlloc(GetProcessHeap(), 0, size * 2); - ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, address_list, size * 2, &bytes_returned, NULL, NULL); - ok(!ret, "Got unexpected ret %d, error %d.\n", ret, WSAGetLastError()); - ok(bytes_returned == size, "Got unexpected bytes_returned %u, expected %u.\n", bytes_returned, size); + size = 0; + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buffer, sizeof(buffer), &size, NULL, NULL); + ok(!ret, "Got unexpected ret %d.\n", ret); + todo_wine ok(!WSAGetLastError(), "Got unexpected error %d.\n", WSAGetLastError()); + ok(size == expect_size, "Expected size %u, got %u.\n", expect_size, size); - bytes_returned = FIELD_OFFSET(SOCKET_ADDRESS_LIST, Address[address_list->iAddressCount]); + expect_size = FIELD_OFFSET(SOCKET_ADDRESS_LIST, Address[address_list->iAddressCount]); for (i = 0; i < address_list->iAddressCount; ++i) { - bytes_returned += address_list->Address[i].iSockaddrLength; + expect_size += address_list->Address[i].iSockaddrLength; } - ok(size == bytes_returned, "Got unexpected size %u, expected %u.\n", size, bytes_returned); + ok(size == expect_size, "Expected size %u, got %u.\n", expect_size, size); + + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buffer, sizeof(buffer), NULL, NULL, NULL); + ok(ret == SOCKET_ERROR, "Got unexpected ret %d.\n", ret); + ok(WSAGetLastError() == WSAEFAULT, "Got unexpected error %d.\n", WSAGetLastError()); - ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, address_list, size, NULL, NULL, NULL); + size = 0xdeadbeef; + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, NULL, sizeof(buffer), &size, NULL, NULL); ok(ret == SOCKET_ERROR, "Got unexpected ret %d.\n", ret); ok(WSAGetLastError() == WSAEFAULT, "Got unexpected error %d.\n", WSAGetLastError()); + ok(size == expect_size, "Expected size %u, got %u.\n", expect_size, size); - bytes_returned = 0xdeadbeef; - ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, NULL, size, &bytes_returned, NULL, NULL); + size = 0xdeadbeef; + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buffer, 0, &size, NULL, NULL); ok(ret == SOCKET_ERROR, "Got unexpected ret %d.\n", ret); ok(WSAGetLastError() == WSAEFAULT, "Got unexpected error %d.\n", WSAGetLastError()); - ok(bytes_returned == size, "Got unexpected bytes_returned %u, expected %u.\n", bytes_returned, size); + ok(size == expect_size, "Expected size %u, got %u.\n", expect_size, size); - ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, address_list, 1, &bytes_returned, NULL, NULL); + size = 0xdeadbeef; + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buffer, 1, &size, NULL, NULL); ok(ret == SOCKET_ERROR, "Got unexpected ret %d.\n", ret); ok(WSAGetLastError() == WSAEINVAL, "Got unexpected error %d.\n", WSAGetLastError()); - ok(bytes_returned == 0, "Got unexpected bytes_returned %u.\n", bytes_returned); + ok(!size, "Got size %u.\n", size); - ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, address_list, - FIELD_OFFSET(SOCKET_ADDRESS_LIST, Address[0]), &bytes_returned, NULL, NULL); + size = 0xdeadbeef; + memset(buffer, 0xcc, sizeof(buffer)); + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buffer, + FIELD_OFFSET(SOCKET_ADDRESS_LIST, Address[0]), &size, NULL, NULL); ok(ret == SOCKET_ERROR, "Got unexpected ret %d.\n", ret); ok(WSAGetLastError() == WSAEFAULT, "Got unexpected error %d.\n", WSAGetLastError()); - ok(bytes_returned == size, "Got unexpected bytes_returned %u, expected %u.\n", bytes_returned, size); + ok(size == expect_size, "Expected size %u, got %u.\n", expect_size, size); + ok(address_list->iAddressCount == 0xcccccccc, "Got %u addresses.\n", address_list->iAddressCount); + + WSASetLastError(0xdeadbeef); + overlapped.Internal = 0xdeadbeef; + overlapped.InternalHigh = 0xdeadbeef; + size = 0xdeadbeef; + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buffer, 0, &size, &overlapped, NULL); + ok(ret == -1, "Got unexpected ret %d.\n", ret); + ok(WSAGetLastError() == WSAEFAULT, "Got unexpected error %d.\n", WSAGetLastError()); + ok(size == expect_size, "Expected size %u, got %u.\n", expect_size, size); + todo_wine ok(overlapped.Internal == 0xdeadbeef, "Got status %#x.\n", (NTSTATUS)overlapped.Internal); + todo_wine ok(overlapped.InternalHigh == 0xdeadbeef, "Got size %Iu.\n", overlapped.InternalHigh); + + overlapped.Internal = 0xdeadbeef; + overlapped.InternalHigh = 0xdeadbeef; + size = 0xdeadbeef; + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buffer, 1, &size, &overlapped, NULL); + ok(ret == -1, "Got unexpected ret %d.\n", ret); + ok(WSAGetLastError() == WSAEINVAL, "Got unexpected error %d.\n", WSAGetLastError()); + ok(!size, "Expected size %u, got %u.\n", expect_size, size); + ok(overlapped.Internal == 0xdeadbeef, "Got status %#x.\n", (NTSTATUS)overlapped.Internal); + ok(overlapped.InternalHigh == 0xdeadbeef, "Got size %Iu.\n", overlapped.InternalHigh); + + overlapped.Internal = 0xdeadbeef; + overlapped.InternalHigh = 0xdeadbeef; + size = 0xdeadbeef; + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buffer, + FIELD_OFFSET(SOCKET_ADDRESS_LIST, Address[0]), &size, &overlapped, NULL); + ok(ret == -1, "Got unexpected ret %d.\n", ret); + ok(WSAGetLastError() == WSAEFAULT, "Got unexpected error %d.\n", WSAGetLastError()); + ok(size == expect_size, "Expected size %u, got %u.\n", expect_size, size); + todo_wine ok(overlapped.Internal == 0xdeadbeef, "Got status %#x.\n", (NTSTATUS)overlapped.Internal); + todo_wine ok(overlapped.InternalHigh == 0xdeadbeef, "Got size %Iu.\n", overlapped.InternalHigh); + ok(address_list->iAddressCount == 0xcccccccc, "Got %u addresses.\n", address_list->iAddressCount); + + overlapped.Internal = 0xdeadbeef; + overlapped.InternalHigh = 0xdeadbeef; + size = 0xdeadbeef; + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buffer, sizeof(buffer), &size, &overlapped, NULL); + ok(!ret, "Got unexpected ret %d.\n", ret); + todo_wine ok(!WSAGetLastError(), "Got unexpected error %d.\n", WSAGetLastError()); + ok(size == expect_size, "Expected size %u, got %u.\n", expect_size, size); + + ret = GetQueuedCompletionStatus(port, &size, &key, &overlapped_ptr, 0); + todo_wine ok(ret, "Got error %u.\n", GetLastError()); + todo_wine ok(!size, "Got size %u.\n", size); + ok(overlapped_ptr == &overlapped, "Got overlapped %p.\n", overlapped_ptr); + ok(!overlapped.Internal, "Got status %#x.\n", (NTSTATUS)overlapped.Internal); + todo_wine ok(!overlapped.InternalHigh, "Got size %Iu.\n", overlapped.InternalHigh); + + ret = GetQueuedCompletionStatus(port, &size, &key, &overlapped_ptr, 0); + ok(!ret, "Expected failure.\n"); + todo_wine ok(GetLastError() == WAIT_TIMEOUT, "Got error %u.\n", GetLastError()); + + closesocket(s); + CloseHandle(port); + + /* Test with an APC. */ + + s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buffer, sizeof(buffer), NULL, &overlapped, socket_apc); + ok(ret == -1, "expected failure\n"); + ok(WSAGetLastError() == WSAEFAULT, "got error %u\n", WSAGetLastError()); + + apc_count = 0; + size = 0xdeadbeef; + ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buffer, sizeof(buffer), &size, &overlapped, socket_apc); + ok(!ret, "expected success\n"); + ok(size == expect_size, "got size %u\n", size); + + ret = SleepEx(0, TRUE); + todo_wine ok(ret == WAIT_IO_COMPLETION, "got %d\n", ret); + if (ret == WAIT_IO_COMPLETION) + { + ok(apc_count == 1, "APC was called %u times\n", apc_count); + ok(!apc_error, "got APC error %u\n", apc_error); + ok(!apc_size, "got APC size %u\n", apc_size); + ok(apc_overlapped == &overlapped, "got APC overlapped %p\n", apc_overlapped); + } - HeapFree(GetProcessHeap(), 0, address_list); closesocket(s); }
1
0
0
0
Zebediah Figura : ws2_32/tests: Fix yet another test failure with Vista or older.
by Alexandre Julliard
01 Jun '21
01 Jun '21
Module: wine Branch: master Commit: faf66ae94453dc98f8d2c8636570ed66c83f57ee URL:
https://source.winehq.org/git/wine.git/?a=commit;h=faf66ae94453dc98f8d2c863…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 31 22:16:32 2021 -0500 ws2_32/tests: Fix yet another test failure with Vista or older. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/tests/sock.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index cf3878eba40..e76d9ac27a6 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -200,6 +200,23 @@ static void tcp_socketpair(SOCKET *src, SOCKET *dst) tcp_socketpair_flags(src, dst, WSA_FLAG_OVERLAPPED); } +#define check_poll(a, b) check_poll_(__LINE__, a, POLLRDNORM | POLLRDBAND | POLLWRNORM, b, FALSE) +#define check_poll_todo(a, b) check_poll_(__LINE__, a, POLLRDNORM | POLLRDBAND | POLLWRNORM, b, TRUE) +#define check_poll_mask(a, b, c) check_poll_(__LINE__, a, b, c, FALSE) +#define check_poll_mask_todo(a, b, c) check_poll_(__LINE__, a, b, c, TRUE) +static void check_poll_(int line, SOCKET s, short mask, short expect, BOOL todo) +{ + WSAPOLLFD pollfd; + int ret; + + pollfd.fd = s; + pollfd.events = mask; + pollfd.revents = 0xdead; + ret = pWSAPoll(&pollfd, 1, 1000); + ok_(__FILE__, line)(ret == (pollfd.revents ? 1 : 0), "WSAPoll() returned %d\n", ret); + todo_wine_if (todo) ok_(__FILE__, line)(pollfd.revents == expect, "got wrong events %#x\n", pollfd.revents); +} + static void set_so_opentype ( BOOL overlapped ) { int optval = !overlapped, newval, len = sizeof (int); @@ -3763,11 +3780,17 @@ static void test_fionread_siocatmark(void) ret = send(server, "data", 5, 0); ok(ret == 5, "got %d\n", ret); + /* wait for the data to be available */ + check_poll_mask(client, POLLRDNORM, POLLRDNORM); + check_fionread_siocatmark(client, 5, TRUE); ret = send(server, "a", 1, MSG_OOB); ok(ret == 1, "got %d\n", ret); + /* wait for the data to be available */ + check_poll_mask(client, POLLRDBAND, POLLRDBAND); + check_fionread_siocatmark_todo_oob(client, 5, FALSE); ret = send(server, "a", 1, MSG_OOB); @@ -5871,23 +5894,6 @@ static void test_write_watch(void) VirtualFree( base, 0, MEM_FREE ); } -#define check_poll(a, b) check_poll_(__LINE__, a, POLLRDNORM | POLLRDBAND | POLLWRNORM, b, FALSE) -#define check_poll_todo(a, b) check_poll_(__LINE__, a, POLLRDNORM | POLLRDBAND | POLLWRNORM, b, TRUE) -#define check_poll_mask(a, b, c) check_poll_(__LINE__, a, b, c, FALSE) -#define check_poll_mask_todo(a, b, c) check_poll_(__LINE__, a, b, c, TRUE) -static void check_poll_(int line, SOCKET s, short mask, short expect, BOOL todo) -{ - WSAPOLLFD pollfd; - int ret; - - pollfd.fd = s; - pollfd.events = mask; - pollfd.revents = 0xdead; - ret = pWSAPoll(&pollfd, 1, 1000); - ok_(__FILE__, line)(ret == (pollfd.revents ? 1 : 0), "WSAPoll() returned %d\n", ret); - todo_wine_if (todo) ok_(__FILE__, line)(pollfd.revents == expect, "got wrong events %#x\n", pollfd.revents); -} - static void test_WSAPoll(void) { const struct sockaddr_in bind_addr = {.sin_family = AF_INET, .sin_addr.s_addr = htonl(INADDR_LOOPBACK)};
1
0
0
0
Michael Stefaniuc : fusion/tests: Use wide-char string literals.
by Alexandre Julliard
01 Jun '21
01 Jun '21
Module: wine Branch: master Commit: f921ae8bc671e60e41d7a19d5d75686ab23928d8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f921ae8bc671e60e41d7a19d…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jun 1 00:32:35 2021 +0200 fusion/tests: Use wide-char string literals. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/fusion/tests/asmcache.c | 230 ++++++++++++++----------------------------- dlls/fusion/tests/asmenum.c | 4 +- dlls/fusion/tests/asmname.c | 41 +++----- dlls/fusion/tests/fusion.c | 38 +++---- 4 files changed, 102 insertions(+), 211 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f921ae8bc671e60e41d7…
1
0
0
0
Aurimas Fišeras : po: Update Lithuanian translation.
by Alexandre Julliard
01 Jun '21
01 Jun '21
Module: wine Branch: master Commit: 4031a388dc35fc0416abff3aecf15c7cf0868a19 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4031a388dc35fc0416abff3a…
Author: Aurimas Fišeras <aurimas(a)members.fsf.org> Date: Tue Jun 1 00:07:04 2021 +0300 po: Update Lithuanian translation. Signed-off-by: Aurimas Fišeras <aurimas(a)members.fsf.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- po/lt.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/lt.po b/po/lt.po index 34f4ecaf5c3..2a8f5ae8bcb 100644 --- a/po/lt.po +++ b/po/lt.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To:
https://bugs.winehq.org\n
" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2021-05-19 23:30+0300\n" +"PO-Revision-Date: 2021-06-01 00:06+0300\n" "Last-Translator: Aurimas Fišeras <aurimas(a)members.fsf.org>\n" "Language-Team: Lithuanian <komp_lt(a)konf.lt>\n" "Language: lt\n" @@ -15187,7 +15187,7 @@ msgstr "reg: Netinkami komandos eilutės parametrai\n" #: programs/reg/reg.rc:202 msgid "reg: The source and destination keys cannot be the same\n" -msgstr "" +msgstr "reg: Šaltinio ir paskirties raktai negali būti tie patys\n" #: programs/reg/reg.rc:131 msgid "Are you sure you want to delete the registry value '%1'?"
1
0
0
0
Jefferson Carpenter : msxml3: Null check newNode in domelem insertBefore.
by Alexandre Julliard
01 Jun '21
01 Jun '21
Module: wine Branch: master Commit: 653504a3cab39104928a67c6c6c055d786a31fc0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=653504a3cab39104928a67c6…
Author: Jefferson Carpenter <jeffersoncarpenter2(a)gmail.com> Date: Thu May 27 12:40:08 2021 +0000 msxml3: Null check newNode in domelem insertBefore. Signed-off-by: Jefferson Carpenter <jeffersoncarpenter2(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msxml3/element.c | 2 ++ dlls/msxml3/tests/domdoc.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c index 05255508d4e..5891653a76f 100644 --- a/dlls/msxml3/element.c +++ b/dlls/msxml3/element.c @@ -309,6 +309,8 @@ static HRESULT WINAPI domelem_insertBefore( TRACE("(%p)->(%p %s %p)\n", This, newNode, debugstr_variant(&refChild), old_node); + if (!newNode) return E_INVALIDARG; + hr = IXMLDOMNode_get_nodeType(newNode, &type); if (hr != S_OK) return hr; diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index ea8a95252a1..b1f172e3faa 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -9411,6 +9411,13 @@ static void test_insertBefore(void) todo_wine EXPECT_REF(elem2, 2); + /* NULL to element */ + V_VT(&v) = VT_NULL; + node = (void*)0xdeadbeef; + hr = IXMLDOMElement_insertBefore(elem1, NULL, v, &node); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(node == (void*)0xdeadbeef, "got %p\n", node); + /* document to element */ V_VT(&v) = VT_DISPATCH; V_DISPATCH(&v) = NULL;
1
0
0
0
← Newer
1
...
78
79
80
81
82
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
Results per page:
10
25
50
100
200