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
July 2024
----- 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
519 discussions
Start a n
N
ew thread
Nikolay Sivov : winhttp/tests: Add some more tests for string options in WinHttpQueryOption().
by Alexandre Julliard
16 Jul '24
16 Jul '24
Module: wine Branch: master Commit: 4a2265742a07609f1d53bccfd46d60cc6f09b07f URL:
https://gitlab.winehq.org/wine/wine/-/commit/4a2265742a07609f1d53bccfd46d60…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jul 16 12:54:24 2024 +0200 winhttp/tests: Add some more tests for string options in WinHttpQueryOption(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/winhttp/tests/winhttp.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index a1f8c15e356..6e814247167 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -3332,6 +3332,15 @@ static void test_redirect(int port) ok(ret, "got %lu\n", GetLastError()); ok(!wcscmp(url, expected), "expected %s got %s\n", wine_dbgstr_w(expected), wine_dbgstr_w(url)); + /* Exact buffer size match. */ + url[0] = 0; + size = (lstrlenW(expected) + 1) * sizeof(WCHAR); + ret = WinHttpQueryOption(req, WINHTTP_OPTION_URL, url, &size); + todo_wine + ok(ret, "got %lu\n", GetLastError()); + todo_wine + ok(!wcscmp(url, expected), "expected %s got %s\n", wine_dbgstr_w(expected), wine_dbgstr_w(url)); + ret = WinHttpReceiveResponse(req, NULL); ok(ret, "failed to receive response %lu\n", GetLastError()); @@ -4417,6 +4426,17 @@ static void test_credentials(void) ok(!wcscmp(buffer, proxy_userW), "unexpected result %s\n", wine_dbgstr_w(buffer)); ok(size == lstrlenW(proxy_userW) * sizeof(WCHAR), "unexpected result %lu\n", size); + /* Exact buffer size match. */ + size = (lstrlenW(proxy_userW) + 1) * sizeof(WCHAR); + buffer[0] = 0; + ret = WinHttpQueryOption(req, WINHTTP_OPTION_PROXY_USERNAME, &buffer, &size); + todo_wine + ok(ret, "failed to query proxy username %lu\n", GetLastError()); + todo_wine + ok(!wcscmp(buffer, proxy_userW), "unexpected result %s\n", wine_dbgstr_w(buffer)); + todo_wine + ok(size == lstrlenW(proxy_userW) * sizeof(WCHAR), "unexpected result %lu\n", size); + buffer[0] = 0x1; SetLastError(0xdeadbeef); ret = WinHttpQueryOption(req, WINHTTP_OPTION_PROXY_USERNAME, &buffer, &size); @@ -4463,6 +4483,17 @@ static void test_credentials(void) ok(!wcscmp(buffer, proxy_passW), "unexpected result %s\n", wine_dbgstr_w(buffer)); ok(size == lstrlenW(proxy_passW) * sizeof(WCHAR), "unexpected result %lu\n", size); + /* Exact buffer size match. */ + size = (lstrlenW(proxy_passW) + 1) * sizeof(WCHAR); + buffer[0] = 0; + ret = WinHttpQueryOption(req, WINHTTP_OPTION_PROXY_PASSWORD, &buffer, &size); + todo_wine + ok(ret, "failed to query proxy password %lu\n", GetLastError()); + todo_wine + ok(!wcscmp(buffer, proxy_passW), "unexpected result %s\n", wine_dbgstr_w(buffer)); + todo_wine + ok(size == lstrlenW(proxy_passW) * sizeof(WCHAR), "unexpected result %lu\n", size); + buffer[0] = 0x1; SetLastError(0xdeadbeef); ret = WinHttpQueryOption(req, WINHTTP_OPTION_PROXY_PASSWORD, &buffer, &size); @@ -4485,6 +4516,17 @@ static void test_credentials(void) ok(!wcscmp(buffer, userW), "unexpected result %s\n", wine_dbgstr_w(buffer)); ok(size == lstrlenW(userW) * sizeof(WCHAR), "unexpected result %lu\n", size); + /* Exact buffer size match. */ + size = (lstrlenW(userW) + 1) * sizeof(WCHAR); + buffer[0] = 0; + ret = WinHttpQueryOption(req, WINHTTP_OPTION_USERNAME, &buffer, &size); + todo_wine + ok(ret, "failed to query username %lu\n", GetLastError()); + todo_wine + ok(!wcscmp(buffer, userW), "unexpected result %s\n", wine_dbgstr_w(buffer)); + todo_wine + ok(size == lstrlenW(userW) * sizeof(WCHAR), "unexpected result %lu\n", size); + buffer[0] = 0x1; SetLastError(0xdeadbeef); ret = WinHttpQueryOption(req, WINHTTP_OPTION_USERNAME, &buffer, &size); @@ -4507,6 +4549,17 @@ static void test_credentials(void) ok(!wcscmp(buffer, passW), "unexpected result %s\n", wine_dbgstr_w(buffer)); ok(size == lstrlenW(passW) * sizeof(WCHAR), "unexpected result %lu\n", size); + /* Exact buffer size match. */ + buffer[0] = 0; + size = (lstrlenW(passW) + 1) * sizeof(WCHAR); + ret = WinHttpQueryOption(req, WINHTTP_OPTION_PASSWORD, &buffer, &size); + todo_wine + ok(ret, "failed to query password %lu\n", GetLastError()); + todo_wine + ok(!wcscmp(buffer, passW), "unexpected result %s\n", wine_dbgstr_w(buffer)); + todo_wine + ok(size == lstrlenW(passW) * sizeof(WCHAR), "unexpected result %lu\n", size); + buffer[0] = 0x1; SetLastError(0xdeadbeef); ret = WinHttpQueryOption(req, WINHTTP_OPTION_PASSWORD, &buffer, &size);
1
0
0
0
Alexandre Julliard : ntdll: Implement KiUserEmulationDispatcher on ARM64EC.
by Alexandre Julliard
16 Jul '24
16 Jul '24
Module: wine Branch: master Commit: 3bd8af0eb6a6d665ef6b3feb4dafe0d26e602aa1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/3bd8af0eb6a6d665ef6b3feb4dafe0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jul 16 12:25:37 2024 +0200 ntdll: Implement KiUserEmulationDispatcher on ARM64EC. --- dlls/ntdll/ntdll.spec | 1 + dlls/ntdll/signal_arm64ec.c | 18 ++++++++++++++++++ dlls/ntdll/unix/loader.c | 3 +++ dlls/ntdll/unix/signal_arm64.c | 13 ++++++++++++- dlls/ntdll/unix/unix_private.h | 8 ++++++++ 5 files changed, 42 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 78afe2f49f5..85aa48eacb5 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -71,6 +71,7 @@ @ stdcall -norelay KiUserApcDispatcher(ptr long long long ptr) @ stdcall -norelay KiUserCallbackDispatcher(long ptr long) @ stdcall -norelay -arch=arm,arm64,arm64ec KiUserCallbackDispatcherReturn() +@ stdcall -norelay -arch=arm64ec KiUserEmulationDispatcher(ptr) @ stdcall -norelay KiUserExceptionDispatcher(ptr ptr) # @ stub LdrAccessOutOfProcessResource @ stdcall LdrAccessResource(long ptr ptr ptr) diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index 20eb5ff662e..e44ac9fc467 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -44,6 +44,7 @@ static void (WINAPI *pBTCpu64FlushInstructionCache)(const void*,SIZE_T); static BOOLEAN (WINAPI *pBTCpu64IsProcessorFeaturePresent)(UINT); static void (WINAPI *pBTCpu64NotifyMemoryDirty)(void*,SIZE_T); static void (WINAPI *pBTCpu64NotifyReadFile)(HANDLE,void*,SIZE_T,BOOL,NTSTATUS); +static void (WINAPI *pBeginSimulation)(void); static void (WINAPI *pFlushInstructionCacheHeavy)(const void*,SIZE_T); static NTSTATUS (WINAPI *pNotifyMapViewOfSection)(void*,void*,void*,SIZE_T,ULONG,ULONG); static void (WINAPI *pNotifyMemoryAlloc)(void*,SIZE_T,ULONG,ULONG,BOOL,NTSTATUS); @@ -157,6 +158,7 @@ NTSTATUS arm64ec_process_init( HMODULE module ) GET_PTR( BTCpu64IsProcessorFeaturePresent ); GET_PTR( BTCpu64NotifyMemoryDirty ); GET_PTR( BTCpu64NotifyReadFile ); + GET_PTR( BeginSimulation ); GET_PTR( FlushInstructionCacheHeavy ); GET_PTR( NotifyMapViewOfSection ); GET_PTR( NotifyMemoryAlloc ); @@ -1030,6 +1032,22 @@ NTSTATUS call_seh_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_context ) } +/******************************************************************* + * KiUserEmulationDispatcher (NTDLL.@) + */ +void dispatch_emulation( ARM64_NT_CONTEXT *arm_ctx ) +{ + context_arm_to_x64( get_arm64ec_cpu_area()->ContextAmd64, arm_ctx ); + pBeginSimulation(); +} +__ASM_GLOBAL_FUNC( "#KiUserEmulationDispatcher", + ".seh_context\n\t" + ".seh_endprologue\n\t" + "mov x0, sp\n\t" /* context */ + "bl dispatch_emulation\n\t" + "brk #1" ) + + /******************************************************************* * KiUserExceptionDispatcher (NTDLL.@) */ diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 19fbfb2b68c..1267469bf37 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -111,6 +111,7 @@ void *pKiRaiseUserExceptionDispatcher = NULL; void *pKiUserExceptionDispatcher = NULL; void *pKiUserApcDispatcher = NULL; void *pKiUserCallbackDispatcher = NULL; +void *pKiUserEmulationDispatcher = NULL; void *pLdrInitializeThunk = NULL; void *pRtlUserThreadStart = NULL; void *p__wine_ctrl_routine = NULL; @@ -1576,6 +1577,7 @@ static void load_ntdll_functions( HMODULE module ) if (is_arm64ec()) { GET_FUNC( __wine_unix_call_dispatcher_arm64ec ); + GET_FUNC( KiUserEmulationDispatcher ); } *p__wine_syscall_dispatcher = __wine_syscall_dispatcher; *p__wine_unixlib_handle = (UINT_PTR)unix_call_funcs; @@ -1669,6 +1671,7 @@ static void redirect_ntdll_functions( HMODULE module ) REDIRECT( KiUserExceptionDispatcher ); REDIRECT( KiUserApcDispatcher ); REDIRECT( KiUserCallbackDispatcher ); + REDIRECT( KiUserEmulationDispatcher ); REDIRECT( LdrInitializeThunk ); REDIRECT( RtlUserThreadStart ); #undef REDIRECT diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index 667bc1108cf..b54fa30a318 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -320,10 +320,21 @@ static void restore_context( const CONTEXT *context, ucontext_t *sigcontext ) */ NTSTATUS signal_set_full_context( CONTEXT *context ) { + struct syscall_frame *frame = arm64_thread_data()->syscall_frame; NTSTATUS status = NtSetContextThread( GetCurrentThread(), context ); if (!status && (context->ContextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER) - arm64_thread_data()->syscall_frame->restore_flags |= CONTEXT_INTEGER; + frame->restore_flags |= CONTEXT_INTEGER; + + if (is_arm64ec() && !is_ec_code( frame->pc )) + { + CONTEXT *user_context = (CONTEXT *)((frame->sp - sizeof(CONTEXT)) & ~15); + + user_context->ContextFlags = CONTEXT_FULL; + NtGetContextThread( GetCurrentThread(), user_context ); + frame->sp = (ULONG_PTR)user_context; + frame->pc = (ULONG_PTR)pKiUserEmulationDispatcher; + } return status; } diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 6cd88a5acc0..91267f66e76 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -147,6 +147,7 @@ extern void *pKiRaiseUserExceptionDispatcher; extern void *pKiUserExceptionDispatcher; extern void *pKiUserApcDispatcher; extern void *pKiUserCallbackDispatcher; +extern void *pKiUserEmulationDispatcher; extern void *pLdrInitializeThunk; extern void *pRtlUserThreadStart; extern void *p__wine_ctrl_routine; @@ -415,6 +416,13 @@ static inline BOOL is_inside_signal_stack( void *ptr ) (char *)ptr < (char *)get_signal_stack() + signal_stack_size); } +static inline BOOL is_ec_code( ULONG_PTR ptr ) +{ + const UINT64 *map = (const UINT64 *)peb->EcCodeBitMap; + ULONG_PTR page = ptr / page_size; + return (map[page / 64] >> (page & 63)) & 1; +} + static inline void mutex_lock( pthread_mutex_t *mutex ) { if (!process_exiting) pthread_mutex_lock( mutex );
1
0
0
0
Shaun Ren : vkd3d-shader/d3dbc: Implement HLSL_OP1_{COS,SIN}_REDUCED for SM1.
by Alexandre Julliard
16 Jul '24
16 Jul '24
Module: vkd3d Branch: master Commit: 0202393d41f00d8c9f20f59ec080b833b5436f5a URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/0202393d41f00d8c9f20f59ec080b…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Tue Jul 9 16:33:47 2024 -0400 vkd3d-shader/d3dbc: Implement HLSL_OP1_{COS,SIN}_REDUCED for SM1. Also enable SM1 trigonometry function tests. --- libs/vkd3d-shader/d3dbc.c | 16 ++++++++++++++++ libs/vkd3d-shader/hlsl.h | 4 ++-- tests/hlsl/trigonometry.shader_test | 16 ++++++++-------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d-shader/d3dbc.c index e4b501c6..492ad9b6 100644 --- a/libs/vkd3d-shader/d3dbc.c +++ b/libs/vkd3d-shader/d3dbc.c @@ -2371,6 +2371,17 @@ static void d3dbc_write_per_component_unary_op(struct d3dbc_compiler *d3dbc, } } +static void d3dbc_write_sincos(struct d3dbc_compiler *d3dbc, enum hlsl_ir_expr_op op, + const struct hlsl_reg *dst, const struct hlsl_reg *src) +{ + if (op == HLSL_OP1_COS_REDUCED) + assert(dst->writemask == VKD3DSP_WRITEMASK_0); + else /* HLSL_OP1_SIN_REDUCED */ + assert(dst->writemask == VKD3DSP_WRITEMASK_1); + + d3dbc_write_unary_op(d3dbc, D3DSIO_SINCOS, dst, src, 0, 0); +} + static void d3dbc_write_expr(struct d3dbc_compiler *d3dbc, const struct hlsl_ir_node *instr) { const struct vkd3d_shader_version *version = &d3dbc->program->shader_version; @@ -2439,6 +2450,11 @@ static void d3dbc_write_expr(struct d3dbc_compiler *d3dbc, const struct hlsl_ir_ d3dbc_write_per_component_unary_op(d3dbc, instr, D3DSIO_RSQ); break; + case HLSL_OP1_COS_REDUCED: + case HLSL_OP1_SIN_REDUCED: + d3dbc_write_sincos(d3dbc, expr->op, &instr->reg, &arg1->reg); + break; + case HLSL_OP2_ADD: d3dbc_write_binary_op(d3dbc, D3DSIO_ADD, &instr->reg, &arg1->reg, &arg2->reg); break; diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index cd6cf91e..d08dd4f2 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -645,7 +645,7 @@ enum hlsl_ir_expr_op HLSL_OP1_CAST, HLSL_OP1_CEIL, HLSL_OP1_COS, - HLSL_OP1_COS_REDUCED, /* Reduced range [-pi, pi] */ + HLSL_OP1_COS_REDUCED, /* Reduced range [-pi, pi], writes to .x */ HLSL_OP1_DSX, HLSL_OP1_DSX_COARSE, HLSL_OP1_DSX_FINE, @@ -666,7 +666,7 @@ enum hlsl_ir_expr_op HLSL_OP1_SAT, HLSL_OP1_SIGN, HLSL_OP1_SIN, - HLSL_OP1_SIN_REDUCED, /* Reduced range [-pi, pi] */ + HLSL_OP1_SIN_REDUCED, /* Reduced range [-pi, pi], writes to .y */ HLSL_OP1_SQRT, HLSL_OP1_TRUNC, diff --git a/tests/hlsl/trigonometry.shader_test b/tests/hlsl/trigonometry.shader_test index 0b3e4c1a..86161e3d 100644 --- a/tests/hlsl/trigonometry.shader_test +++ b/tests/hlsl/trigonometry.shader_test @@ -5,7 +5,7 @@ void main(float4 pos : position, out float tex : texcoord, out float4 out_pos : out_pos = pos; } -[pixel shader todo(sm<4)] +[pixel shader] float4 main(float tex : texcoord) : sv_target { tex = floor(tex + 0.25); @@ -13,7 +13,7 @@ float4 main(float tex : texcoord) : sv_target } [test] -todo(sm<4 | glsl) draw quad +todo(glsl) draw quad probe ( 0, 0) rgba ( 0.00000000, 1.00000000, 0.00000000, 0.0) probe ( 1, 0) rgba ( 0.84147098, 0.54030231, 1.55740772, 0.0) 1024 probe ( 2, 0) rgba ( 0.90929743, -0.41614684, -2.18503986, 0.0) 1024 @@ -32,7 +32,7 @@ probe (14, 0) rgba ( 0.99060736, 0.13673722, 7.24460662, 0.0) 1024 probe (15, 0) rgba ( 0.65028784, -0.75968791, -0.85599340, 0.0) 1024 -[pixel shader todo(sm<4)] +[pixel shader] uniform float4 a; float4 main() : sv_target @@ -42,11 +42,11 @@ float4 main() : sv_target [test] uniform 0 float4 0.0 0.52359877 2.61799387 3.14159265 -todo(sm<4 | glsl) draw quad +todo(glsl) draw quad probe (0, 0) rgba (0.0, 500.0, 500.0, 0.0) -[pixel shader todo(sm<4)] +[pixel shader] uniform float4 a; float4 main() : sv_target @@ -56,11 +56,11 @@ float4 main() : sv_target [test] uniform 0 float4 0.0 0.78539816 1.57079632 2.35619449 -todo(sm<4 | glsl) draw quad +todo(glsl) draw quad probe (0, 0) rgba (1000.0, 707.0, -0.0, -707.0) -[pixel shader todo(sm<4)] +[pixel shader] uniform float4 a; float4 main() : sv_target @@ -72,7 +72,7 @@ float4 main() : sv_target % tan(pi/2) is an asymtote and therefore undefined % so check 0, pi/4, 3pi/4, pi uniform 0 float4 0.0 0.78539816 2.35619449 3.14159265 -todo(sm<4 | glsl) draw quad +todo(glsl) draw quad probe (0, 0) rgba (0, 1000, -1000.0, 0)
1
0
0
0
Shaun Ren : vkd3d-shader/hlsl: Allocate registers for HLSL_OP1_{COS,SIN}_REDUCED with the required writemasks.
by Alexandre Julliard
16 Jul '24
16 Jul '24
Module: vkd3d Branch: master Commit: ea2ffc0b6c040e7da564f64f1224f47126a26893 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/ea2ffc0b6c040e7da564f64f1224f…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Thu Jun 20 19:11:44 2024 -0400 vkd3d-shader/hlsl: Allocate registers for HLSL_OP1_{COS,SIN}_REDUCED with the required writemasks. --- libs/vkd3d-shader/hlsl_codegen.c | 70 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 7 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index c96a70b4..26386c0b 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -4333,6 +4333,30 @@ static struct hlsl_reg allocate_register(struct hlsl_ctx *ctx, struct register_a return ret; } +/* Allocate a register with writemask, while reserving reg_writemask. */ +static struct hlsl_reg allocate_register_with_masks(struct hlsl_ctx *ctx, struct register_allocator *allocator, + unsigned int first_write, unsigned int last_read, uint32_t reg_writemask, uint32_t writemask) +{ + struct hlsl_reg ret = {0}; + uint32_t reg_idx; + + assert((reg_writemask & writemask) == writemask); + + for (reg_idx = 0;; ++reg_idx) + { + if ((get_available_writemask(allocator, first_write, last_read, reg_idx) & reg_writemask) == reg_writemask) + break; + } + + record_allocation(ctx, allocator, reg_idx, reg_writemask, first_write, last_read); + + ret.id = reg_idx; + ret.allocation_size = 1; + ret.writemask = writemask; + ret.allocated = true; + return ret; +} + static bool is_range_available(const struct register_allocator *allocator, unsigned int first_write, unsigned int last_read, uint32_t reg_idx, unsigned int reg_size) { @@ -4536,6 +4560,44 @@ static void calculate_resource_register_counts(struct hlsl_ctx *ctx) } } +static void allocate_instr_temp_register(struct hlsl_ctx *ctx, + struct hlsl_ir_node *instr, struct register_allocator *allocator) +{ + unsigned int reg_writemask = 0, dst_writemask = 0; + + if (instr->reg.allocated || !instr->last_read) + return; + + if (instr->type == HLSL_IR_EXPR) + { + switch (hlsl_ir_expr(instr)->op) + { + case HLSL_OP1_COS_REDUCED: + dst_writemask = VKD3DSP_WRITEMASK_0; + reg_writemask = ctx->profile->major_version < 3 ? (1 << 3) - 1 : VKD3DSP_WRITEMASK_0; + break; + + case HLSL_OP1_SIN_REDUCED: + dst_writemask = VKD3DSP_WRITEMASK_1; + reg_writemask = ctx->profile->major_version < 3 ? (1 << 3) - 1 : VKD3DSP_WRITEMASK_1; + break; + + default: + break; + } + } + + if (reg_writemask) + instr->reg = allocate_register_with_masks(ctx, allocator, + instr->index, instr->last_read, reg_writemask, dst_writemask); + else + instr->reg = allocate_numeric_registers_for_type(ctx, allocator, + instr->index, instr->last_read, instr->data_type); + + TRACE("Allocated anonymous expression @%u to %s (liveness %u-%u).\n", instr->index, + debug_register('r', instr->reg, instr->data_type), instr->index, instr->last_read); +} + static void allocate_variable_temp_register(struct hlsl_ctx *ctx, struct hlsl_ir_var *var, struct register_allocator *allocator) { @@ -4575,13 +4637,7 @@ static void allocate_temp_registers_recurse(struct hlsl_ctx *ctx, if (ctx->profile->major_version >= 4 && instr->type == HLSL_IR_CONSTANT) continue; - if (!instr->reg.allocated && instr->last_read) - { - instr->reg = allocate_numeric_registers_for_type(ctx, allocator, instr->index, instr->last_read, - instr->data_type); - TRACE("Allocated anonymous expression @%u to %s (liveness %u-%u).\n", instr->index, - debug_register('r', instr->reg, instr->data_type), instr->index, instr->last_read); - } + allocate_instr_temp_register(ctx, instr, allocator); switch (instr->type) {
1
0
0
0
Shaun Ren : vkd3d-shader/d3dbc: Implement HLSL_OP3_MAD for SM1.
by Alexandre Julliard
16 Jul '24
16 Jul '24
Module: vkd3d Branch: master Commit: 8724cbe5d56004db001d46e41759905a83a33c75 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/8724cbe5d56004db001d46e417599…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Wed Jul 10 22:51:05 2024 -0400 vkd3d-shader/d3dbc: Implement HLSL_OP3_MAD for SM1. --- libs/vkd3d-shader/d3dbc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/vkd3d-shader/d3dbc.c b/libs/vkd3d-shader/d3dbc.c index abfbd461..e4b501c6 100644 --- a/libs/vkd3d-shader/d3dbc.c +++ b/libs/vkd3d-shader/d3dbc.c @@ -2499,6 +2499,10 @@ static void d3dbc_write_expr(struct d3dbc_compiler *d3dbc, const struct hlsl_ir_ d3dbc_write_dp2add(d3dbc, &instr->reg, &arg1->reg, &arg2->reg, &arg3->reg); break; + case HLSL_OP3_MAD: + d3dbc_write_ternary_op(d3dbc, D3DSIO_MAD, &instr->reg, &arg1->reg, &arg2->reg, &arg3->reg); + break; + default: hlsl_fixme(ctx, &instr->loc, "SM1 \"%s\" expression.", debug_hlsl_expr_op(expr->op)); break;
1
0
0
0
Shaun Ren : vkd3d-shader/hlsl: Implement sin/cos for SM1.
by Alexandre Julliard
16 Jul '24
16 Jul '24
Module: vkd3d Branch: master Commit: b4845b9dcaa0a1075a9d0e400009b1f810170d20 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/b4845b9dcaa0a1075a9d0e400009b…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Wed Jul 10 22:47:51 2024 -0400 vkd3d-shader/hlsl: Implement sin/cos for SM1. Also introduce HLSL_OP3_MAD. --- libs/vkd3d-shader/hlsl.c | 1 + libs/vkd3d-shader/hlsl.h | 1 + libs/vkd3d-shader/hlsl_codegen.c | 104 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index acf50869..1526d7b0 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -2849,6 +2849,7 @@ const char *debug_hlsl_expr_op(enum hlsl_ir_expr_op op) [HLSL_OP3_CMP] = "cmp", [HLSL_OP3_DP2ADD] = "dp2add", [HLSL_OP3_TERNARY] = "ternary", + [HLSL_OP3_MAD] = "mad", }; return op_names[op]; diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 0f78f0b5..cd6cf91e 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -699,6 +699,7 @@ enum hlsl_ir_expr_op * CMP(a, b, c) returns 'b' if 'a' >= 0, and 'c' otherwise. It's used only for SM1-SM3 targets. */ HLSL_OP3_CMP, HLSL_OP3_TERNARY, + HLSL_OP3_MAD, }; #define HLSL_MAX_OPERANDS 3 diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 02884df9..c96a70b4 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -20,6 +20,7 @@ #include "hlsl.h" #include <stdio.h> +#include <math.h> /* TODO: remove when no longer needed, only used for new_offset_instr_from_deref() */ static struct hlsl_ir_node *new_offset_from_path_index(struct hlsl_ctx *ctx, struct hlsl_block *block, @@ -3016,6 +3017,108 @@ static bool lower_floor(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, struct return true; } +/* Lower SIN/COS to SINCOS for SM1. */ +static bool lower_trig(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, struct hlsl_block *block) +{ + struct hlsl_ir_node *arg, *half, *two_pi, *reciprocal_two_pi, *neg_pi; + struct hlsl_constant_value half_value, two_pi_value, reciprocal_two_pi_value, neg_pi_value; + struct hlsl_ir_node *mad, *frc, *reduced; + struct hlsl_type *type; + struct hlsl_ir_expr *expr; + enum hlsl_ir_expr_op op; + struct hlsl_ir_node *sincos; + int i; + + if (instr->type != HLSL_IR_EXPR) + return false; + expr = hlsl_ir_expr(instr); + + if (expr->op == HLSL_OP1_SIN) + op = HLSL_OP1_SIN_REDUCED; + else if (expr->op == HLSL_OP1_COS) + op = HLSL_OP1_COS_REDUCED; + else + return false; + + arg = expr->operands[0].node; + type = arg->data_type; + + /* Reduce the range of the input angles to [-pi, pi]. */ + for (i = 0; i < type->dimx; ++i) + { + half_value.u[i].f = 0.5; + two_pi_value.u[i].f = 2.0 * M_PI; + reciprocal_two_pi_value.u[i].f = 1.0 / (2.0 * M_PI); + neg_pi_value.u[i].f = -M_PI; + } + + if (!(half = hlsl_new_constant(ctx, type, &half_value, &instr->loc)) + || !(two_pi = hlsl_new_constant(ctx, type, &two_pi_value, &instr->loc)) + || !(reciprocal_two_pi = hlsl_new_constant(ctx, type, &reciprocal_two_pi_value, &instr->loc)) + || !(neg_pi = hlsl_new_constant(ctx, type, &neg_pi_value, &instr->loc))) + return false; + hlsl_block_add_instr(block, half); + hlsl_block_add_instr(block, two_pi); + hlsl_block_add_instr(block, reciprocal_two_pi); + hlsl_block_add_instr(block, neg_pi); + + if (!(mad = hlsl_new_ternary_expr(ctx, HLSL_OP3_MAD, arg, reciprocal_two_pi, half))) + return false; + hlsl_block_add_instr(block, mad); + if (!(frc = hlsl_new_unary_expr(ctx, HLSL_OP1_FRACT, mad, &instr->loc))) + return false; + hlsl_block_add_instr(block, frc); + if (!(reduced = hlsl_new_ternary_expr(ctx, HLSL_OP3_MAD, frc, two_pi, neg_pi))) + return false; + hlsl_block_add_instr(block, reduced); + + if (type->dimx == 1) + { + if (!(sincos = hlsl_new_unary_expr(ctx, op, reduced, &instr->loc))) + return false; + hlsl_block_add_instr(block, sincos); + } + else + { + struct hlsl_ir_node *comps[4] = {0}; + struct hlsl_ir_var *var; + struct hlsl_deref var_deref; + struct hlsl_ir_load *var_load; + + for (i = 0; i < type->dimx; ++i) + { + uint32_t s = hlsl_swizzle_from_writemask(1 << i); + + if (!(comps[i] = hlsl_new_swizzle(ctx, s, 1, reduced, &instr->loc))) + return false; + hlsl_block_add_instr(block, comps[i]); + } + + if (!(var = hlsl_new_synthetic_var(ctx, "sincos", type, &instr->loc))) + return false; + hlsl_init_simple_deref_from_var(&var_deref, var); + + for (i = 0; i < type->dimx; ++i) + { + struct hlsl_block store_block; + + if (!(sincos = hlsl_new_unary_expr(ctx, op, comps[i], &instr->loc))) + return false; + hlsl_block_add_instr(block, sincos); + + if (!hlsl_new_store_component(ctx, &store_block, &var_deref, i, sincos)) + return false; + hlsl_block_add_block(block, &store_block); + } + + if (!(var_load = hlsl_new_load_index(ctx, &var_deref, NULL, &instr->loc))) + return false; + hlsl_block_add_instr(block, &var_load->node); + } + + return true; +} + static bool lower_logic_not(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, struct hlsl_block *block) { struct hlsl_ir_node *operands[HLSL_MAX_OPERANDS]; @@ -6050,6 +6153,7 @@ int hlsl_emit_bytecode(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry lower_ir(ctx, lower_round, body); lower_ir(ctx, lower_ceil, body); lower_ir(ctx, lower_floor, body); + lower_ir(ctx, lower_trig, body); lower_ir(ctx, lower_comparison_operators, body); lower_ir(ctx, lower_logic_not, body); if (ctx->profile->type == VKD3D_SHADER_TYPE_PIXEL)
1
0
0
0
Shaun Ren : vkd3d-shader/ir: Lower SM1 SINCOS to SM4 SINCOS.
by Alexandre Julliard
16 Jul '24
16 Jul '24
Module: vkd3d Branch: master Commit: b3a11a9ec4879ee151bcbcd35a9b3f5a1914c454 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/b3a11a9ec4879ee151bcbcd35a9b3…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Tue Jul 9 18:29:29 2024 -0400 vkd3d-shader/ir: Lower SM1 SINCOS to SM4 SINCOS. --- libs/vkd3d-shader/ir.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index be9e4219..9202c77c 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -377,6 +377,58 @@ static enum vkd3d_result vsir_program_lower_precise_mad(struct vsir_program *pro return VKD3D_OK; } +static enum vkd3d_result vsir_program_lower_sm1_sincos(struct vsir_program *program, + struct vkd3d_shader_instruction *sincos) +{ + struct vkd3d_shader_instruction_array *instructions = &program->instructions; + size_t pos = sincos - instructions->elements; + struct vkd3d_shader_instruction *ins; + unsigned int s; + + if (sincos->dst_count != 1) + return VKD3D_OK; + + if (!shader_instruction_array_insert_at(instructions, pos + 1, 1)) + return VKD3D_ERROR_OUT_OF_MEMORY; + + ins = &instructions->elements[pos + 1]; + + if (!(vsir_instruction_init_with_params(program, ins, &sincos->location, VKD3DSIH_SINCOS, 2, 1))) + return VKD3D_ERROR_OUT_OF_MEMORY; + + ins->flags = sincos->flags; + + *ins->src = *sincos->src; + /* Set the source swizzle to replicate the first component. */ + s = vsir_swizzle_get_component(sincos->src->swizzle, 0); + ins->src->swizzle = vkd3d_shader_create_swizzle(s, s, s, s); + + if (sincos->dst->write_mask & VKD3DSP_WRITEMASK_1) + { + ins->dst[0] = *sincos->dst; + ins->dst[0].write_mask = VKD3DSP_WRITEMASK_1; + } + else + { + vsir_dst_param_init(&ins->dst[0], VKD3DSPR_NULL, VKD3D_DATA_UNUSED, 0); + } + + if (sincos->dst->write_mask & VKD3DSP_WRITEMASK_0) + { + ins->dst[1] = *sincos->dst; + ins->dst[1].write_mask = VKD3DSP_WRITEMASK_0; + } + else + { + vsir_dst_param_init(&ins->dst[1], VKD3DSPR_NULL, VKD3D_DATA_UNUSED, 0); + } + + /* Make the original instruction no-op */ + vkd3d_shader_instruction_make_nop(sincos); + + return VKD3D_OK; +} + static enum vkd3d_result vsir_program_lower_instructions(struct vsir_program *program, struct vkd3d_shader_message_context *message_context) { @@ -410,6 +462,11 @@ static enum vkd3d_result vsir_program_lower_instructions(struct vsir_program *pr vkd3d_shader_instruction_make_nop(ins); break; + case VKD3DSIH_SINCOS: + if ((ret = vsir_program_lower_sm1_sincos(program, ins)) < 0) + return ret; + break; + default: break; }
1
0
0
0
Elizabeth Figura : setupapi: Use SetupGetIntField() in SetupGetSourceFileLocation().
by Alexandre Julliard
15 Jul '24
15 Jul '24
Module: wine Branch: master Commit: 8070ed27bc4bb8c9c43c20734d340b62b379fcfc URL:
https://gitlab.winehq.org/wine/wine/-/commit/8070ed27bc4bb8c9c43c20734d340b…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Mon Jul 15 16:34:30 2024 -0500 setupapi: Use SetupGetIntField() in SetupGetSourceFileLocation(). --- dlls/setupapi/query.c | 50 ++++++++++++++------------------------------------ 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/dlls/setupapi/query.c b/dlls/setupapi/query.c index 40ec30ae11f..707492ac984 100644 --- a/dlls/setupapi/query.c +++ b/dlls/setupapi/query.c @@ -369,30 +369,6 @@ BOOL WINAPI SetupGetSourceFileLocationA( HINF hinf, PINFCONTEXT context, PCSTR f return ret; } -static LPWSTR get_source_id( HINF hinf, PINFCONTEXT context, PCWSTR filename ) -{ - DWORD size; - LPWSTR source_id; - - if (!SetupFindFirstLineW( hinf, source_disks_files_platform, filename, context ) && - !SetupFindFirstLineW( hinf, source_disks_files, filename, context )) - return NULL; - - if (!SetupGetStringFieldW( context, 1, NULL, 0, &size )) - return NULL; - - if (!(source_id = malloc( size * sizeof(WCHAR) ))) - return NULL; - - if (!SetupGetStringFieldW( context, 1, source_id, size, NULL )) - { - free( source_id ); - return NULL; - } - - return source_id; -} - /*********************************************************************** * SetupGetSourceFileLocationW (SETUPAPI.@) */ @@ -402,7 +378,7 @@ BOOL WINAPI SetupGetSourceFileLocationW( HINF hinf, PINFCONTEXT context, PCWSTR PDWORD required_size ) { INFCONTEXT ctx; - WCHAR *end, *source_id_str; + int id; TRACE("%p, %p, %s, %p, %p, 0x%08lx, %p\n", hinf, context, debugstr_w(filename), source_id, buffer, buffer_size, required_size); @@ -418,25 +394,27 @@ BOOL WINAPI SetupGetSourceFileLocationW( HINF hinf, PINFCONTEXT context, PCWSTR return FALSE; SetupGetStringFieldW( context, 1, ctx_filename, filename_size, NULL ); - source_id_str = get_source_id( hinf, &ctx, ctx_filename ); + if (!SetupFindFirstLineW( hinf, source_disks_files_platform, ctx_filename, &ctx ) && + !SetupFindFirstLineW( hinf, source_disks_files, ctx_filename, &ctx )) + { + free( ctx_filename ); + return FALSE; + } free( ctx_filename ); } else { - source_id_str = get_source_id( hinf, &ctx, filename ); + if (!SetupFindFirstLineW( hinf, source_disks_files_platform, filename, &ctx ) && + !SetupFindFirstLineW( hinf, source_disks_files, filename, &ctx )) + { + return FALSE; + } } - if (!source_id_str) + if (!SetupGetIntField( &ctx, 1, &id )) return FALSE; - - *source_id = wcstol( source_id_str, &end, 10 ); - if (end == source_id_str || *end) - { - free( source_id_str ); - return FALSE; - } - free( source_id_str ); + *source_id = id; if (SetupGetStringFieldW( &ctx, 2, buffer, buffer_size, required_size )) return TRUE;
1
0
0
0
Elizabeth Figura : setupapi: Return the file's relative path from SetupGetSourceFileLocation().
by Alexandre Julliard
15 Jul '24
15 Jul '24
Module: wine Branch: master Commit: 56089f60ed1d66c68338bb150b29ac16e13248d1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/56089f60ed1d66c68338bb150b29ac…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Mon Jul 15 16:34:29 2024 -0500 setupapi: Return the file's relative path from SetupGetSourceFileLocation(). --- dlls/setupapi/query.c | 8 +------- dlls/setupapi/tests/query.c | 14 +++++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/dlls/setupapi/query.c b/dlls/setupapi/query.c index c94fec77124..40ec30ae11f 100644 --- a/dlls/setupapi/query.c +++ b/dlls/setupapi/query.c @@ -390,12 +390,6 @@ static LPWSTR get_source_id( HINF hinf, PINFCONTEXT context, PCWSTR filename ) return NULL; } - if (!SetupFindFirstLineW( hinf, source_disks_names_platform, source_id, context ) && - !SetupFindFirstLineW( hinf, source_disks_names, source_id, context )) - { - free( source_id ); - return NULL; - } return source_id; } @@ -444,7 +438,7 @@ BOOL WINAPI SetupGetSourceFileLocationW( HINF hinf, PINFCONTEXT context, PCWSTR } free( source_id_str ); - if (SetupGetStringFieldW( &ctx, 4, buffer, buffer_size, required_size )) + if (SetupGetStringFieldW( &ctx, 2, buffer, buffer_size, required_size )) return TRUE; if (required_size) *required_size = 1; diff --git a/dlls/setupapi/tests/query.c b/dlls/setupapi/tests/query.c index 8f4400b802e..d5de41b368a 100644 --- a/dlls/setupapi/tests/query.c +++ b/dlls/setupapi/tests/query.c @@ -349,7 +349,7 @@ static void test_SetupGetSourceFileLocation(void) ret = SetupGetSourceFileLocationA(hinf, NULL, "two.txt", &source_id, buffer, sizeof(buffer), NULL); ok(ret, "Got error %lu.\n", GetLastError()); ok(source_id == 4, "Got source id %u.\n", source_id); - todo_wine ok(!strcmp(buffer, "there"), "Got relative path %s.\n", debugstr_a(buffer)); + ok(!strcmp(buffer, "there"), "Got relative path %s.\n", debugstr_a(buffer)); ret = SetupFindFirstLineA(hinf, "copy_section", NULL, &ctx); ok(ret, "Got error %lu.\n", GetLastError()); @@ -381,14 +381,14 @@ static void test_SetupGetSourceFileLocation(void) ok(ret, "Got error %lu.\n", GetLastError()); ret = SetupGetSourceFileLocationA(hinf, &ctx, "two.txt", &source_id, buffer, sizeof(buffer), NULL); - todo_wine ok(ret, "Got error %lu.\n", GetLastError()); - todo_wine ok(source_id == 10, "Got source id %u.\n", source_id); - todo_wine ok(!strcmp(buffer, ""), "Got relative path %s.\n", debugstr_a(buffer)); + ok(ret, "Got error %lu.\n", GetLastError()); + ok(source_id == 10, "Got source id %u.\n", source_id); + ok(!strcmp(buffer, ""), "Got relative path %s.\n", debugstr_a(buffer)); ret = SetupGetSourceFileLocationA(hinf, NULL, "three.txt", &source_id, buffer, sizeof(buffer), NULL); - todo_wine ok(ret, "Got error %lu.\n", GetLastError()); - todo_wine ok(source_id == 6, "Got source id %u.\n", source_id); - todo_wine ok(!strcmp(buffer, ""), "Got relative path %s.\n", debugstr_a(buffer)); + ok(ret, "Got error %lu.\n", GetLastError()); + ok(source_id == 6, "Got source id %u.\n", source_id); + ok(!strcmp(buffer, ""), "Got relative path %s.\n", debugstr_a(buffer)); SetLastError(0xdeadbeef); ret = SetupGetSourceFileLocationA(hinf, NULL, "four.txt", &source_id, buffer, sizeof(buffer), NULL);
1
0
0
0
Elizabeth Figura : setupapi: Correctly interpret the INFCONTEXT parameter in SetupGetSourceFileLocation().
by Alexandre Julliard
15 Jul '24
15 Jul '24
Module: wine Branch: master Commit: bdb04298254954514e2232b1ce0f3d9418e61e12 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bdb04298254954514e2232b1ce0f3d…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Mon Jul 15 16:34:29 2024 -0500 setupapi: Correctly interpret the INFCONTEXT parameter in SetupGetSourceFileLocation(). --- dlls/setupapi/query.c | 24 +++++++++++++++++++++--- dlls/setupapi/tests/query.c | 14 +++++++------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/dlls/setupapi/query.c b/dlls/setupapi/query.c index 88efea17473..c94fec77124 100644 --- a/dlls/setupapi/query.c +++ b/dlls/setupapi/query.c @@ -413,9 +413,27 @@ BOOL WINAPI SetupGetSourceFileLocationW( HINF hinf, PINFCONTEXT context, PCWSTR TRACE("%p, %p, %s, %p, %p, 0x%08lx, %p\n", hinf, context, debugstr_w(filename), source_id, buffer, buffer_size, required_size); - if (!context) context = &ctx; + if (context) + { + WCHAR *ctx_filename; + DWORD filename_size; + + if (!SetupGetStringFieldW( context, 1, NULL, 0, &filename_size )) + return FALSE; + if (!(ctx_filename = malloc( filename_size * sizeof(WCHAR) ))) + return FALSE; + SetupGetStringFieldW( context, 1, ctx_filename, filename_size, NULL ); + + source_id_str = get_source_id( hinf, &ctx, ctx_filename ); + + free( ctx_filename ); + } + else + { + source_id_str = get_source_id( hinf, &ctx, filename ); + } - if (!(source_id_str = get_source_id( hinf, context, filename ))) + if (!source_id_str) return FALSE; *source_id = wcstol( source_id_str, &end, 10 ); @@ -426,7 +444,7 @@ BOOL WINAPI SetupGetSourceFileLocationW( HINF hinf, PINFCONTEXT context, PCWSTR } free( source_id_str ); - if (SetupGetStringFieldW( context, 4, buffer, buffer_size, required_size )) + if (SetupGetStringFieldW( &ctx, 4, buffer, buffer_size, required_size )) return TRUE; if (required_size) *required_size = 1; diff --git a/dlls/setupapi/tests/query.c b/dlls/setupapi/tests/query.c index 145ca6e12eb..8f4400b802e 100644 --- a/dlls/setupapi/tests/query.c +++ b/dlls/setupapi/tests/query.c @@ -356,12 +356,12 @@ static void test_SetupGetSourceFileLocation(void) ret = SetupGetSourceFileLocationA(hinf, &ctx, "two.txt", &source_id, buffer, sizeof(buffer), NULL); ok(ret, "Got error %lu.\n", GetLastError()); - todo_wine ok(source_id == 2, "Got source id %u.\n", source_id); - todo_wine ok(!strcmp(buffer, ""), "Got relative path %s.\n", debugstr_a(buffer)); + ok(source_id == 2, "Got source id %u.\n", source_id); + ok(!strcmp(buffer, ""), "Got relative path %s.\n", debugstr_a(buffer)); /* ctx should not be changed. */ ret = SetupGetLineTextA(&ctx, NULL, NULL, NULL, buffer, sizeof(buffer), NULL); - todo_wine ok(!strcmp(buffer, "one.txt,,2"), "Got line %s.\n", debugstr_a(buffer)); + ok(!strcmp(buffer, "one.txt,,2"), "Got line %s.\n", debugstr_a(buffer)); /* Test when the source name differs from the destination name. * It seems SetupGetSourceFileLocation() is buggy and doesn't take that @@ -370,18 +370,18 @@ static void test_SetupGetSourceFileLocation(void) ret = SetupFindNextLine(&ctx, &ctx); ok(ret, "Got error %lu.\n", GetLastError()); ret = SetupFindNextLine(&ctx, &ctx); - todo_wine ok(ret, "Got error %lu.\n", GetLastError()); + ok(ret, "Got error %lu.\n", GetLastError()); SetLastError(0xdeadbeef); ret = SetupGetSourceFileLocationA(hinf, &ctx, "two.txt", &source_id, buffer, sizeof(buffer), NULL); - todo_wine ok(!ret, "Expected failure.\n"); - todo_wine ok(GetLastError() == ERROR_LINE_NOT_FOUND, "Got error %lu.\n", GetLastError()); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_LINE_NOT_FOUND, "Got error %lu.\n", GetLastError()); ret = SetupFindNextLine(&ctx, &ctx); ok(ret, "Got error %lu.\n", GetLastError()); ret = SetupGetSourceFileLocationA(hinf, &ctx, "two.txt", &source_id, buffer, sizeof(buffer), NULL); - ok(ret, "Got error %lu.\n", GetLastError()); + todo_wine ok(ret, "Got error %lu.\n", GetLastError()); todo_wine ok(source_id == 10, "Got source id %u.\n", source_id); todo_wine ok(!strcmp(buffer, ""), "Got relative path %s.\n", debugstr_a(buffer));
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
52
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
Results per page:
10
25
50
100
200