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
October 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1165 discussions
Start a n
N
ew thread
Alexandre Julliard : Release 6.19.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 7554bd4b41a1429517eb86fd20dbe813cdd0550a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7554bd4b41a1429517eb86fd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Oct 8 21:10:44 2021 +0200 Release 6.19. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- ANNOUNCE | 1180 ++++++++++++++++++++++++++++++++----------------------------- AUTHORS | 1 + VERSION | 2 +- configure | 18 +- 4 files changed, 623 insertions(+), 578 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=7554bd4b41a1429517eb…
1
0
0
0
Zebediah Figura : krnl386: Fix a mistyped NULL check in WOWTHUNK_Init().
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 55678ccaae1922310706dc741d78b00b9268ee8a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=55678ccaae1922310706dc74…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Oct 8 12:20:17 2021 -0500 krnl386: Fix a mistyped NULL check in WOWTHUNK_Init(). Fixes Collins English Dictionary. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51802
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/krnl386.exe16/wowthunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/krnl386.exe16/wowthunk.c b/dlls/krnl386.exe16/wowthunk.c index ca3c57f8e0b..8cc1fa248e6 100644 --- a/dlls/krnl386.exe16/wowthunk.c +++ b/dlls/krnl386.exe16/wowthunk.c @@ -79,7 +79,7 @@ BOOL WOWTHUNK_Init(void) LDT_FLAGS_CODE | LDT_FLAGS_32BIT ); cbclientex_selector = SELECTOR_AllocBlock( cbclientex_ret, cbclientex_ret_end - cbclientex_ret, LDT_FLAGS_CODE | LDT_FLAGS_32BIT ); - if (!codesel || cbclient_selector || !cbclientex_selector) + if (!codesel || !cbclient_selector || !cbclientex_selector) return FALSE; /* Patch the return addresses for CallTo16 routines */
1
0
0
0
Robert Wilhelm : vbscript: Don't use function return value for call expressions.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 4f5e5cc63f5fa40d198c3cae60633d7de0c03bc0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4f5e5cc63f5fa40d198c3cae…
Author: Robert Wilhelm <robert.wilhelm(a)gmx.net> Date: Fri Oct 8 19:14:09 2021 +0200 vbscript: Don't use function return value for call expressions. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50758
Signed-off-by: Robert Wilhelm <robert.wilhelm(a)gmx.net> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/interp.c | 10 +++++++++- dlls/vbscript/tests/lang.vbs | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index e2c1d5cc53d..48863068013 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -134,7 +134,8 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ DISPID id; HRESULT hres; - if((ctx->func->type == FUNC_FUNCTION || ctx->func->type == FUNC_PROPGET) + if(invoke_type != VBDISP_CALLGET + && (ctx->func->type == FUNC_FUNCTION || ctx->func->type == FUNC_PROPGET) && !wcsicmp(name, ctx->func->name)) { ref->type = REF_VAR; ref->u.v = &ctx->ret_val; @@ -800,6 +801,13 @@ static HRESULT interp_ident(exec_ctx_t *ctx) TRACE("%s\n", debugstr_w(identifier)); + if((ctx->func->type == FUNC_FUNCTION || ctx->func->type == FUNC_PROPGET) + && !wcsicmp(identifier, ctx->func->name)) { + V_VT(&v) = VT_BYREF|VT_VARIANT; + V_BYREF(&v) = &ctx->ret_val; + return stack_push(ctx, &v); + } + hres = do_icall(ctx, &v, identifier, 0); if(FAILED(hres)) return hres; diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index d7865301784..dc2acbae69c 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -1882,6 +1882,30 @@ set arr(0) = new TestPropSyntax arr(0).prop = 1 ok arr(0).prop = 1, "arr(0) = " & arr(0).prop +function recursingfunction(x) + if (x) then exit function + recursingfunction = 2 + dim y + y = recursingfunction + call ok(y = 2, "y = " & y) + recursingfunction = 1 + call recursingfunction(True) +end function +call ok(recursingfunction(False) = 1, "unexpected return value " & recursingfunction(False)) + +x = false +function recursingfunction2 + if (x) then exit function + recursingfunction2 = 2 + dim y + y = recursingfunction2 + call ok(y = 2, "y = " & y) + recursingfunction2 = 1 + x = true + recursingfunction2() +end function +call ok(recursingfunction2() = 1, "unexpected return value " & recursingfunction2()) + function f2(x,y) end function
1
0
0
0
Jacek Caban : vbscript: Use a dedicated opcode for identifier expressions.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 2613f8bfe688d42acd8c320e21a3e95fab347b0b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2613f8bfe688d42acd8c320e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Oct 8 19:13:59 2021 +0200 vbscript: Use a dedicated opcode for identifier expressions. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/compile.c | 21 ++++++++++++++++++--- dlls/vbscript/interp.c | 29 ++++++++++++++++++++++++----- dlls/vbscript/vbscript.h | 1 + 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 821d85310b6..da56eac74b2 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -446,7 +446,8 @@ static HRESULT compile_args(compile_ctx_t *ctx, expression_t *args, unsigned *re return S_OK; } -static HRESULT compile_member_expression(compile_ctx_t *ctx, member_expression_t *expr, unsigned arg_cnt, BOOL ret_val) +static HRESULT compile_member_call_expression(compile_ctx_t *ctx, member_expression_t *expr, + unsigned arg_cnt, BOOL ret_val) { HRESULT hres; @@ -471,6 +472,20 @@ static HRESULT compile_member_expression(compile_ctx_t *ctx, member_expression_t return hres; } +static HRESULT compile_member_expression(compile_ctx_t *ctx, member_expression_t *expr) +{ + expression_t *const_expr; + + if (expr->obj_expr) /* FIXME: we should probably have a dedicated opcode as well */ + return compile_member_call_expression(ctx, expr, 0, TRUE); + + const_expr = lookup_const_decls(ctx, expr->identifier, TRUE); + if(const_expr) + return compile_expression(ctx, const_expr); + + return push_instr_bstr(ctx, OP_ident, expr->identifier); +} + static HRESULT compile_call_expression(compile_ctx_t *ctx, call_expression_t *expr, BOOL ret_val) { unsigned arg_cnt = 0; @@ -484,7 +499,7 @@ static HRESULT compile_call_expression(compile_ctx_t *ctx, call_expression_t *ex for(call = expr->call_expr; call->type == EXPR_BRACKETS; call = ((unary_expression_t*)call)->subexpr); if(call->type == EXPR_MEMBER) - return compile_member_expression(ctx, (member_expression_t*)call, arg_cnt, ret_val); + return compile_member_call_expression(ctx, (member_expression_t*)call, arg_cnt, ret_val); hres = compile_expression(ctx, call); if(FAILED(hres)) @@ -582,7 +597,7 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) case EXPR_ME: return push_instr(ctx, OP_me) ? S_OK : E_OUTOFMEMORY; case EXPR_MEMBER: - return compile_member_expression(ctx, (member_expression_t*)expr, 0, TRUE); + return compile_member_expression(ctx, (member_expression_t*)expr); case EXPR_MOD: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_mod); case EXPR_MUL: diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index f648f073bc8..e2c1d5cc53d 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -615,10 +615,8 @@ static HRESULT variant_call(exec_ctx_t *ctx, VARIANT *v, unsigned arg_cnt, VARIA return S_OK; } -static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res) +static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res, BSTR identifier, unsigned arg_cnt) { - BSTR identifier = ctx->instr->arg1.bstr; - const unsigned arg_cnt = ctx->instr->arg2.uint; DISPPARAMS dp; ref_t ref; HRESULT hres; @@ -687,12 +685,14 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res) static HRESULT interp_icall(exec_ctx_t *ctx) { + BSTR identifier = ctx->instr->arg1.bstr; + const unsigned arg_cnt = ctx->instr->arg2.uint; VARIANT v; HRESULT hres; TRACE("\n"); - hres = do_icall(ctx, &v); + hres = do_icall(ctx, &v, identifier, arg_cnt); if(FAILED(hres)) return hres; @@ -701,8 +701,12 @@ static HRESULT interp_icall(exec_ctx_t *ctx) static HRESULT interp_icallv(exec_ctx_t *ctx) { + BSTR identifier = ctx->instr->arg1.bstr; + const unsigned arg_cnt = ctx->instr->arg2.uint; + TRACE("\n"); - return do_icall(ctx, NULL); + + return do_icall(ctx, NULL, identifier, arg_cnt); } static HRESULT interp_vcall(exec_ctx_t *ctx) @@ -788,6 +792,21 @@ static HRESULT interp_mcallv(exec_ctx_t *ctx) return do_mcall(ctx, NULL); } +static HRESULT interp_ident(exec_ctx_t *ctx) +{ + BSTR identifier = ctx->instr->arg1.bstr; + VARIANT v; + HRESULT hres; + + TRACE("%s\n", debugstr_w(identifier)); + + hres = do_icall(ctx, &v, identifier, 0); + if(FAILED(hres)) + return hres; + + return stack_push(ctx, &v); +} + static HRESULT assign_value(exec_ctx_t *ctx, VARIANT *dst, VARIANT *src, WORD flags) { VARIANT value; diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 9ef2cae81e5..f5353b33cae 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -242,6 +242,7 @@ typedef enum { X(gteq, 1, 0, 0) \ X(icall, 1, ARG_BSTR, ARG_UINT) \ X(icallv, 1, ARG_BSTR, ARG_UINT) \ + X(ident, 1, ARG_BSTR, 0) \ X(idiv, 1, 0, 0) \ X(imp, 1, 0, 0) \ X(incc, 1, ARG_BSTR, 0) \
1
0
0
0
Alexandre Julliard : makefiles: Only build static libraries that are needed for linking.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 1699847dad88e4a79e850ea70627d2e0603b8f79 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1699847dad88e4a79e850ea7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Oct 8 16:57:24 2021 +0200 makefiles: Only build static libraries that are needed for linking. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/makedep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index bb2201dadb1..c7d08dc21e6 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -3344,7 +3344,7 @@ static void output_module( struct makefile *make ) */ static void output_static_lib( struct makefile *make ) { - strarray_add( &make->all_targets, make->staticlib ); + strarray_add( &make->clean_files, make->staticlib ); output( "%s:", obj_dir_path( make, make->staticlib )); output_filenames_obj_dir( make, make->object_files ); output_filenames_obj_dir( make, make->unixobj_files ); @@ -3357,7 +3357,7 @@ static void output_static_lib( struct makefile *make ) { char *name = replace_extension( make->staticlib, ".a", ".cross.a" ); - strarray_add( &make->all_targets, name ); + strarray_add( &make->clean_files, name ); output( "%s: %s", obj_dir_path( make, name ), tools_path( make, "winebuild" )); output_filenames_obj_dir( make, make->crossobj_files ); output( "\n" );
1
0
0
0
Rémi Bernon : dinput: Check for ReadFile errors and return DIERR_INPUTLOST.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 022076532fcc81fd6f7ebbb77419670ce93b995a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=022076532fcc81fd6f7ebbb7…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 8 15:36:03 2021 +0200 dinput: Check for ReadFile errors and return DIERR_INPUTLOST. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 57 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index a0ea1a7bf1c..728b98591d2 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -937,6 +937,7 @@ static HRESULT WINAPI hid_joystick_Acquire( IDirectInputDevice8W *iface ) struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); ULONG report_len = impl->caps.InputReportByteLength; HRESULT hr = DI_OK; + BOOL ret; TRACE( "iface %p.\n", iface ); @@ -947,15 +948,29 @@ static HRESULT WINAPI hid_joystick_Acquire( IDirectInputDevice8W *iface ) hr = DIERR_INVALIDPARAM; else if ((impl->base.dwCoopLevel & DISCL_FOREGROUND) && impl->base.win != GetForegroundWindow()) hr = DIERR_OTHERAPPHASPRIO; - else + else if (impl->device == INVALID_HANDLE_VALUE) + { + impl->device = CreateFileW( impl->device_path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, 0 ); + if (impl->device == INVALID_HANDLE_VALUE) hr = DIERR_INPUTLOST; + } + + if (hr == DI_OK) { memset( &impl->read_ovl, 0, sizeof(impl->read_ovl) ); impl->read_ovl.hEvent = impl->base.read_event; - if (ReadFile( impl->device, impl->input_report_buf, report_len, NULL, &impl->read_ovl )) - impl->base.read_callback( iface ); - - impl->base.acquired = TRUE; - IDirectInputDevice8_SendForceFeedbackCommand( iface, DISFFC_RESET ); + ret = ReadFile( impl->device, impl->input_report_buf, report_len, NULL, &impl->read_ovl ); + if (!ret && GetLastError() != ERROR_IO_PENDING) + { + CloseHandle( impl->device ); + impl->device = INVALID_HANDLE_VALUE; + hr = DIERR_INPUTLOST; + } + else + { + impl->base.acquired = TRUE; + IDirectInputDevice8_SendForceFeedbackCommand( iface, DISFFC_RESET ); + } } LeaveCriticalSection( &impl->base.crit ); if (hr != DI_OK) return hr; @@ -978,9 +993,12 @@ static HRESULT WINAPI hid_joystick_Unacquire( IDirectInputDevice8W *iface ) if (!impl->base.acquired) hr = DI_NOEFFECT; else { - ret = CancelIoEx( impl->device, &impl->read_ovl ); - if (!ret) WARN( "CancelIoEx failed, last error %u\n", GetLastError() ); - else WaitForSingleObject( impl->base.read_event, INFINITE ); + if (impl->device != INVALID_HANDLE_VALUE) + { + ret = CancelIoEx( impl->device, &impl->read_ovl ); + if (!ret) WARN( "CancelIoEx failed, last error %u\n", GetLastError() ); + else WaitForSingleObject( impl->base.read_event, INFINITE ); + } IDirectInputDevice8_SendForceFeedbackCommand( iface, DISFFC_RESET ); impl->base.acquired = FALSE; } @@ -1583,11 +1601,11 @@ static HRESULT hid_joystick_read_state( IDirectInputDevice8W *iface ) char *report_buf = impl->input_report_buf; USAGE_AND_PAGE *usages; NTSTATUS status; + HRESULT hr; BOOL ret; ret = GetOverlappedResult( impl->device, &impl->read_ovl, &count, FALSE ); - if (!ret) WARN( "ReadFile failed, error %u\n", GetLastError() ); - else if (TRACE_ON(dinput)) + if (ret && TRACE_ON(dinput)) { TRACE( "read size %u report:\n", count ); for (i = 0; i < report_len;) @@ -1603,7 +1621,7 @@ static HRESULT hid_joystick_read_state( IDirectInputDevice8W *iface ) } EnterCriticalSection( &impl->base.crit ); - do + while (ret) { count = impl->usages_count; memset( impl->usages_buf, 0, count * sizeof(*impl->usages_buf) ); @@ -1637,10 +1655,21 @@ static HRESULT hid_joystick_read_state( IDirectInputDevice8W *iface ) memset( &impl->read_ovl, 0, sizeof(impl->read_ovl) ); impl->read_ovl.hEvent = impl->base.read_event; - } while (ReadFile( impl->device, report_buf, report_len, &count, &impl->read_ovl )); + ret = ReadFile( impl->device, report_buf, report_len, &count, &impl->read_ovl ); + } + + if (GetLastError() == ERROR_IO_PENDING || GetLastError() == ERROR_OPERATION_ABORTED) hr = DI_OK; + else + { + WARN( "GetOverlappedResult/ReadFile failed, error %u\n", GetLastError() ); + CloseHandle(impl->device); + impl->device = INVALID_HANDLE_VALUE; + impl->base.acquired = FALSE; + hr = DIERR_INPUTLOST; + } LeaveCriticalSection( &impl->base.crit ); - return DI_OK; + return hr; } static DWORD device_type_for_version( DWORD type, DWORD version )
1
0
0
0
Rémi Bernon : dinput: Call device read_callback while holding the internal CS.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: c93813e11f9b4b393d1a91efe7e2593f1becd3a5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c93813e11f9b4b393d1a91ef…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 8 15:36:02 2021 +0200 dinput: Call device read_callback while holding the internal CS. And remove the device from the list of acquired devices if the callback indicates a read error. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/dinput_main.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index 1cd6d390430..9c0e3875c00 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -1289,11 +1289,11 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam static DWORD WINAPI hook_thread_proc(void *param) { static HHOOK kbd_hook, mouse_hook; - IDirectInputDeviceImpl *impl; - IDirectInputDevice8W *iface; + IDirectInputDeviceImpl *impl, *next; SIZE_T events_count = 0; HANDLE finished_event; HANDLE events[128]; + HRESULT hr; DWORD ret; MSG msg; @@ -1310,24 +1310,17 @@ static DWORD WINAPI hook_thread_proc(void *param) if (ret < events_count) { - iface = NULL; EnterCriticalSection( &dinput_hook_crit ); - LIST_FOR_EACH_ENTRY( impl, &acquired_device_list, IDirectInputDeviceImpl, entry ) + LIST_FOR_EACH_ENTRY_SAFE( impl, next, &acquired_device_list, IDirectInputDeviceImpl, entry ) { if (impl->read_event == events[ret]) { - iface = &impl->IDirectInputDevice8W_iface; - IDirectInputDevice8_AddRef( iface ); + hr = impl->read_callback( &impl->IDirectInputDevice8W_iface ); + if (FAILED(hr)) list_remove( &impl->entry ); break; } } LeaveCriticalSection( &dinput_hook_crit ); - - if (iface) - { - impl->read_callback( iface ); - IDirectInputDevice8_Release( iface ); - } } while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
1
0
0
0
Rémi Bernon : dinput: Wait for CancelIoEx completion when unacquiring HID joysticks.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: bbb68aeaae5476257eec7b41da8c854a05b7b696 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bbb68aeaae5476257eec7b41…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 8 15:36:01 2021 +0200 dinput: Wait for CancelIoEx completion when unacquiring HID joysticks. Otherwise we may later write the cancelled status to invalid memory. Also use a manual-reset event, as it should be for overlapped I/O, so all waiters are woken up on cancel. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 6f9e9987e6e..a0ea1a7bf1c 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -599,7 +599,6 @@ static ULONG hid_joystick_private_decref( struct hid_joystick *impl ) HeapFree( GetProcessHeap(), 0, tmp.input_report_buf ); HeapFree( GetProcessHeap(), 0, tmp.input_extra_caps ); HidD_FreePreparsedData( tmp.preparsed ); - CancelIoEx( tmp.device, &tmp.read_ovl ); CloseHandle( tmp.base.read_event ); CloseHandle( tmp.device ); } @@ -981,7 +980,7 @@ static HRESULT WINAPI hid_joystick_Unacquire( IDirectInputDevice8W *iface ) { ret = CancelIoEx( impl->device, &impl->read_ovl ); if (!ret) WARN( "CancelIoEx failed, last error %u\n", GetLastError() ); - + else WaitForSingleObject( impl->base.read_event, INFINITE ); IDirectInputDevice8_SendForceFeedbackCommand( iface, DISFFC_RESET ); impl->base.acquired = FALSE; } @@ -2244,7 +2243,7 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID if (FAILED(hr)) return hr; impl->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": hid_joystick.base.crit"); impl->base.dwCoopLevel = DISCL_NONEXCLUSIVE | DISCL_BACKGROUND; - impl->base.read_event = CreateEventA( NULL, FALSE, FALSE, NULL ); + impl->base.read_event = CreateEventW( NULL, TRUE, FALSE, NULL ); impl->base.read_callback = hid_joystick_read_state; hr = hid_joystick_device_open( -1, &instance, impl->device_path, &impl->device, &impl->preparsed,
1
0
0
0
Rémi Bernon : dinput: Hold the HID joystick CS when updating the device state.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 2b61d8dd9797406519e19c8cbcb49dd30d0db4d2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2b61d8dd9797406519e19c8c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 8 15:36:00 2021 +0200 dinput: Hold the HID joystick CS when updating the device state. The read buffer is only used by the reading thread but the device state is not, we should only update it while holding the CS. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 4449c11256c..6f9e9987e6e 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1603,6 +1603,7 @@ static HRESULT hid_joystick_read_state( IDirectInputDevice8W *iface ) } } + EnterCriticalSection( &impl->base.crit ); do { count = impl->usages_count; @@ -1638,6 +1639,7 @@ static HRESULT hid_joystick_read_state( IDirectInputDevice8W *iface ) memset( &impl->read_ovl, 0, sizeof(impl->read_ovl) ); impl->read_ovl.hEvent = impl->base.read_event; } while (ReadFile( impl->device, report_buf, report_len, &count, &impl->read_ovl )); + LeaveCriticalSection( &impl->base.crit ); return DI_OK; }
1
0
0
0
Rémi Bernon : dinput: Do not wait for internal hooks inside the HID joystick CS.
by Alexandre Julliard
08 Oct '21
08 Oct '21
Module: wine Branch: master Commit: 1014cfcff835b92f94c6505b412e345e1915faf1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1014cfcff835b92f94c6505b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Oct 8 15:35:59 2021 +0200 dinput: Do not wait for internal hooks inside the HID joystick CS. This can cause some deadlocks as the internal thread will acquire the device CS when reading the state. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/joystick_hid.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index b2aac264bb7..4449c11256c 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -937,22 +937,32 @@ static HRESULT WINAPI hid_joystick_Acquire( IDirectInputDevice8W *iface ) { struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); ULONG report_len = impl->caps.InputReportByteLength; - HRESULT hr; + HRESULT hr = DI_OK; TRACE( "iface %p.\n", iface ); EnterCriticalSection( &impl->base.crit ); - hr = IDirectInputDevice2WImpl_Acquire( iface ); - if (hr == DI_OK) + if (impl->base.acquired) + hr = DI_NOEFFECT; + else if (!impl->base.data_format.user_df) + hr = DIERR_INVALIDPARAM; + else if ((impl->base.dwCoopLevel & DISCL_FOREGROUND) && impl->base.win != GetForegroundWindow()) + hr = DIERR_OTHERAPPHASPRIO; + else { memset( &impl->read_ovl, 0, sizeof(impl->read_ovl) ); impl->read_ovl.hEvent = impl->base.read_event; if (ReadFile( impl->device, impl->input_report_buf, report_len, NULL, &impl->read_ovl )) impl->base.read_callback( iface ); + impl->base.acquired = TRUE; IDirectInputDevice8_SendForceFeedbackCommand( iface, DISFFC_RESET ); } LeaveCriticalSection( &impl->base.crit ); + if (hr != DI_OK) return hr; + + dinput_hooks_acquire_device( iface ); + check_dinput_hooks( iface, TRUE ); return hr; } @@ -960,21 +970,26 @@ static HRESULT WINAPI hid_joystick_Acquire( IDirectInputDevice8W *iface ) static HRESULT WINAPI hid_joystick_Unacquire( IDirectInputDevice8W *iface ) { struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); - HRESULT hr; + HRESULT hr = DI_OK; BOOL ret; TRACE( "iface %p.\n", iface ); EnterCriticalSection( &impl->base.crit ); - if (impl->base.acquired) + if (!impl->base.acquired) hr = DI_NOEFFECT; + else { ret = CancelIoEx( impl->device, &impl->read_ovl ); if (!ret) WARN( "CancelIoEx failed, last error %u\n", GetLastError() ); IDirectInputDevice8_SendForceFeedbackCommand( iface, DISFFC_RESET ); + impl->base.acquired = FALSE; } - hr = IDirectInputDevice2WImpl_Unacquire( iface ); LeaveCriticalSection( &impl->base.crit ); + if (hr != DI_OK) return hr; + + dinput_hooks_unacquire_device( iface ); + check_dinput_hooks( iface, FALSE ); return hr; }
1
0
0
0
← Newer
1
...
77
78
79
80
81
82
83
...
117
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200