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 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
1 participants
613 discussions
Start a n
N
ew thread
Alexandre Julliard : kernelbase: Implement the GetProcAddress wrapper on ARM64EC.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: 468fbf5907f690c4df3e60a1794d2f7ce0eade13 URL:
https://gitlab.winehq.org/wine/wine/-/commit/468fbf5907f690c4df3e60a1794d2f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jun 7 10:23:38 2024 +0200 kernelbase: Implement the GetProcAddress wrapper on ARM64EC. --- dlls/kernelbase/loader.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dlls/kernelbase/loader.c b/dlls/kernelbase/loader.c index e0be2a88d2b..7afbe0460eb 100644 --- a/dlls/kernelbase/loader.c +++ b/dlls/kernelbase/loader.c @@ -430,7 +430,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetModuleHandleExW( DWORD flags, LPCWSTR name, HMO * GetProcAddress (kernelbase.@) */ -#ifdef __x86_64__ /* * Work around a Delphi bug on x86_64. When delay loading a symbol, * Delphi saves rcx, rdx, r8 and r9 to the stack. It then calls @@ -440,6 +439,23 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetModuleHandleExW( DWORD flags, LPCWSTR name, HMO * these registers if the function takes floating point parameters. * This wrapper saves xmm0 - 3 to the stack. */ +#ifdef __arm64ec__ +FARPROC WINAPI __attribute__((naked)) GetProcAddress( HMODULE module, LPCSTR function ) +{ + asm( ".seh_proc \"#GetProcAddress\"\n\t" + "stp x29, x30, [sp, #-48]!\n\t" + ".seh_save_fplr_x 48\n\t" + ".seh_endprologue\n\t" + "stp d0, d1, [sp, #16]\n\t" + "stp d2, d3, [sp, #32]\n\t" + "bl \"#get_proc_address\"\n\t" + "ldp d0, d1, [sp, #16]\n\t" + "ldp d2, d3, [sp, #32]\n\t" + "ldp x29, x30, [sp], #48\n\t" + "ret\n\t" + ".seh_endproc" ); +} +#elif defined(__x86_64__) __ASM_GLOBAL_FUNC( GetProcAddress, ".byte 0x48\n\t" /* hotpatch prolog */ "pushq %rbp\n\t"
1
0
0
0
Alexandre Julliard : msvcrt: Disable SSE2 memmove implementation on ARM64EC.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: bdd89987782b4828317b68264f48bc99cfaa33b4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bdd89987782b4828317b68264f48bc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jun 7 10:21:45 2024 +0200 msvcrt: Disable SSE2 memmove implementation on ARM64EC. --- dlls/msvcrt/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 7f7959e81e6..571ca34b847 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -2786,7 +2786,7 @@ int __cdecl memcmp(const void *ptr1, const void *ptr2, size_t n) return memcmp_blocks(p1, p2, n); } -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || (defined(__x86_64__) && !defined(__arm64ec__)) #ifdef __i386__ @@ -3052,7 +3052,7 @@ __ASM_GLOBAL_FUNC( sse2_memmove, #endif void * __cdecl memmove(void *dst, const void *src, size_t n) { -#ifdef __x86_64__ +#if defined(__x86_64__) && !defined(__arm64ec__) return sse2_memmove(dst, src, n); #else unsigned char *d = dst;
1
0
0
0
Alexandre Julliard : msvcrt: Implement asm sqrt functions on ARM platforms.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: 2fc773199080dedbe64a33ef66be02a4f44bcd08 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2fc773199080dedbe64a33ef66be02…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jun 7 10:21:34 2024 +0200 msvcrt: Implement asm sqrt functions on ARM platforms. --- dlls/msvcrt/math.c | 67 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index cbe17463b03..738d4138c99 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -77,14 +77,12 @@ void msvcrt_init_math( void *module ) #endif } -#if defined(__i386__) || defined(__x86_64__) static inline double ret_nan( BOOL update_sw ) { double x = 1.0; if (!update_sw) return -NAN; return (x - x) / (x - x); } -#endif #define SET_X87_CW(MASK) \ "subl $4, %esp\n\t" \ @@ -260,7 +258,7 @@ float CDECL MSVCRT_atanf( float x ) } #endif -#ifdef __x86_64__ +#ifndef __i386__ extern short CDECL _fdclass(float x); static BOOL sqrtf_validate( float *x ) @@ -278,10 +276,21 @@ static BOOL sqrtf_validate( float *x ) return TRUE; } -float CDECL sse2_sqrtf(float); -__ASM_GLOBAL_FUNC( sse2_sqrtf, - "sqrtss %xmm0, %xmm0\n\t" - "ret" ) +#ifdef __arm64ec__ +static float __attribute__((naked)) CDECL asm_sqrtf(float x) +{ + asm( "fsqrt s0,s0; ret" ); +} +#elif defined __aarch64__ +float CDECL asm_sqrtf(float); +__ASM_GLOBAL_FUNC( asm_sqrtf, "fsqrt s0,s0; ret" ) +#elif defined __arm__ +float CDECL asm_sqrtf(float); +__ASM_GLOBAL_FUNC( asm_sqrtf, "vsqrt s0,s0; bx lr" ) +#elif defined __x86_64__ +float CDECL asm_sqrtf(float); +__ASM_GLOBAL_FUNC( asm_sqrtf, "sqrtss %xmm0, %xmm0; ret" ) +#endif #endif /********************************************************************* @@ -289,11 +298,11 @@ __ASM_GLOBAL_FUNC( sse2_sqrtf, */ float CDECL MSVCRT_sqrtf( float x ) { -#ifdef __x86_64__ +#ifndef __i386__ if (!sqrtf_validate(&x)) return x; - return sse2_sqrtf(x); + return asm_sqrtf(x); #else return sqrtf( x ); #endif @@ -382,7 +391,6 @@ double CDECL MSVCRT_exp( double x ) } #endif -#if defined(__x86_64__) || defined(__i386__) extern short CDECL _dclass(double x); static BOOL sqrt_validate( double *x, BOOL update_sw ) @@ -410,15 +418,23 @@ static BOOL sqrt_validate( double *x, BOOL update_sw ) return TRUE; } -double CDECL sse2_sqrt(double); -__ASM_GLOBAL_FUNC( sse2_sqrt, - "sqrtsd %xmm0, %xmm0\n\t" - "ret" ) -#endif - -#ifdef __i386__ -double CDECL x87_sqrt(double); -__ASM_GLOBAL_FUNC( x87_sqrt, +#ifdef __arm64ec__ +static double __attribute__((naked)) CDECL asm_sqrt(double x) +{ + asm( "fsqrt d0,d0; ret" ); +} +#elif defined __aarch64__ +double CDECL asm_sqrt(double); +__ASM_GLOBAL_FUNC( asm_sqrt, "fsqrt d0,d0; ret" ) +#elif defined __arm__ +double CDECL asm_sqrt(double); +__ASM_GLOBAL_FUNC( asm_sqrt, "vsqrt d0,d0; bx lr" ) +#elif defined __x86_64__ +double CDECL asm_sqrt(double); +__ASM_GLOBAL_FUNC( asm_sqrt, "sqrtsd %xmm0, %xmm0; ret" ) +#elif defined __i386__ +double CDECL asm_sqrt(double); +__ASM_GLOBAL_FUNC( asm_sqrt, "fldl 4(%esp)\n\t" SET_X87_CW(0xc00) "fsqrt\n\t" @@ -431,19 +447,10 @@ __ASM_GLOBAL_FUNC( x87_sqrt, */ double CDECL MSVCRT_sqrt( double x ) { -#ifdef __x86_64__ if (!sqrt_validate(&x, TRUE)) return x; - return sse2_sqrt(x); -#elif defined( __i386__ ) - if (!sqrt_validate(&x, TRUE)) - return x; - - return x87_sqrt(x); -#else - return sqrt( x ); -#endif + return asm_sqrt(x); } /********************************************************************* @@ -2561,7 +2568,7 @@ void __cdecl __libm_sse2_sqrt_precise(void) __asm__ __volatile__( "movq %0,%%xmm0" : : "m" (d) ); return; } - __asm__ __volatile__( "call " __ASM_NAME( "sse2_sqrt" ) ); + __asm__ __volatile__( "call " __ASM_NAME( "asm_sqrt" ) ); } #endif /* __i386__ */
1
0
0
0
Alexandre Julliard : msvcrt: Use the __os_arm64x functions to get/set mxcsr on ARM64EC.
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: ad6674efdbfbc828918f8cb3bb433a11424c66e9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ad6674efdbfbc828918f8cb3bb433a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jun 7 10:20:17 2024 +0200 msvcrt: Use the __os_arm64x functions to get/set mxcsr on ARM64EC. --- dlls/msvcrt/math.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index a62705bc8f4..cbe17463b03 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -698,14 +698,36 @@ __int64 CDECL _abs64( __int64 n ) } #if defined(__i386__) || defined(__x86_64__) + +static unsigned int get_mxcsr(void) +{ + unsigned int ret; +#ifdef __arm64ec__ + extern NTSTATUS (*__os_arm64x_get_x64_information)(ULONG,void*,void*); + __os_arm64x_get_x64_information( 0, &ret, NULL ); +#else + __asm__ __volatile__( "stmxcsr %0" : "=m" (ret) ); +#endif + return ret; +} + +static void set_mxcsr( unsigned int val ) +{ +#ifdef __arm64ec__ + extern NTSTATUS (*__os_arm64x_set_x64_information)(ULONG,ULONG_PTR,void*); + __os_arm64x_set_x64_information( 0, val, NULL ); +#else + __asm__ __volatile__( "ldmxcsr %0" : : "m" (val) ); +#endif +} + static void _setfp_sse( unsigned int *cw, unsigned int cw_mask, unsigned int *sw, unsigned int sw_mask ) { #if defined(__GNUC__) || defined(__clang__) - unsigned long old_fpword, fpword; + unsigned int old_fpword, fpword = get_mxcsr(); unsigned int flags; - __asm__ __volatile__( "stmxcsr %0" : "=m" (fpword) ); old_fpword = fpword; cw_mask &= _MCW_EM | _MCW_RC | _MCW_DN; @@ -785,8 +807,7 @@ static void _setfp_sse( unsigned int *cw, unsigned int cw_mask, } } - if (fpword != old_fpword) - __asm__ __volatile__( "ldmxcsr %0" : : "m" (fpword) ); + if (fpword != old_fpword) set_mxcsr( fpword ); #else FIXME("not implemented\n"); if (cw) *cw = 0; @@ -993,7 +1014,7 @@ static void _setfp( unsigned int *cw, unsigned int cw_mask, __asm__ __volatile__( "msr fpsr, %0" :: "r" (fpsr) ); if (old_fpcr != fpcr) __asm__ __volatile__( "msr fpcr, %0" :: "r" (fpcr) ); -#elif defined(__arm__) && !defined(__SOFTFP__) +#elif defined(__arm__) DWORD old_fpscr, fpscr; unsigned int flags;
1
0
0
0
Alexandre Julliard : msvcrt: Reimplement __crtCapturePreviousContext() based on RtlWalkFrameChain().
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: 356be34dcd2b1acfaa55c5d896b06a2628d41dfe URL:
https://gitlab.winehq.org/wine/wine/-/commit/356be34dcd2b1acfaa55c5d896b06a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jun 7 10:19:57 2024 +0200 msvcrt: Reimplement __crtCapturePreviousContext() based on RtlWalkFrameChain(). --- dlls/msvcrt/except_arm64ec.c | 20 +++++++++++++++++++- dlls/msvcrt/except_x86_64.c | 36 ++++++++++++++---------------------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/dlls/msvcrt/except_arm64ec.c b/dlls/msvcrt/except_arm64ec.c index 12790cee7d8..b2e723f79b3 100644 --- a/dlls/msvcrt/except_arm64ec.c +++ b/dlls/msvcrt/except_arm64ec.c @@ -144,7 +144,25 @@ int handle_fpieee_flt( __msvcrt_ulong exception_code, EXCEPTION_POINTERS *ep, */ void __cdecl __crtCapturePreviousContext( CONTEXT *ctx ) { - FIXME("not implemented\n"); + UNWIND_HISTORY_TABLE table; + RUNTIME_FUNCTION *func; + PEXCEPTION_ROUTINE handler; + ULONG_PTR pc, frame, base; + void *data; + ULONG i; + + RtlCaptureContext( ctx ); + for (i = 0; i < 2; i++) + { + pc = ctx->Rip; + if ((ctx->ContextFlags & CONTEXT_UNWOUND_TO_CALL) && RtlIsEcCode( pc )) pc -= 4; + if (!(func = RtlLookupFunctionEntry( pc, &base, &table ))) break; + if (RtlVirtualUnwind2( UNW_FLAG_NHANDLER, base, pc, func, ctx, NULL, + &data, &frame, NULL, NULL, NULL, &handler, 0 )) + break; + if (!ctx->Rip) break; + if (!frame) break; + } } #endif diff --git a/dlls/msvcrt/except_x86_64.c b/dlls/msvcrt/except_x86_64.c index 1c3cc62bc7f..e0fda975be4 100644 --- a/dlls/msvcrt/except_x86_64.c +++ b/dlls/msvcrt/except_x86_64.c @@ -133,33 +133,25 @@ int handle_fpieee_flt( __msvcrt_ulong exception_code, EXCEPTION_POINTERS *ep, /********************************************************************* * __crtCapturePreviousContext (MSVCR110.@) */ -void __cdecl get_prev_context(CONTEXT *ctx, DWORD64 rip) +void __cdecl __crtCapturePreviousContext( CONTEXT *ctx ) { - ULONG64 frame, image_base; - RUNTIME_FUNCTION *rf; + UNWIND_HISTORY_TABLE table; + RUNTIME_FUNCTION *func; + PEXCEPTION_ROUTINE handler; + ULONG_PTR frame, base; void *data; + ULONG i; - TRACE("(%p)\n", ctx); - - rf = RtlLookupFunctionEntry(ctx->Rip, &image_base, NULL); - if(!rf) { - FIXME("RtlLookupFunctionEntry failed\n"); - return; + RtlCaptureContext( ctx ); + for (i = 0; i < 2; i++) + { + if (!(func = RtlLookupFunctionEntry( ctx->Rip, &base, &table ))) break; + if (RtlVirtualUnwind2( UNW_FLAG_NHANDLER, base, ctx->Rip, func, ctx, NULL, + &data, &frame, NULL, NULL, NULL, &handler, 0 )) break; + if (!ctx->Rip) break; + if (!frame) break; } - - RtlVirtualUnwind(UNW_FLAG_NHANDLER, image_base, ctx->Rip, - rf, ctx, &data, &frame, NULL); } - -__ASM_GLOBAL_FUNC( __crtCapturePreviousContext, - "movq %rcx,8(%rsp)\n\t" - "call " __ASM_NAME("RtlCaptureContext") "\n\t" - "movq 8(%rsp),%rcx\n\t" /* context */ - "leaq 8(%rsp),%rax\n\t" - "movq %rax,0x98(%rcx)\n\t" /* context->Rsp */ - "movq (%rsp),%rax\n\t" - "movq %rax,0xf8(%rcx)\n\t" /* context->Rip */ - "jmp " __ASM_NAME("get_prev_context") ) #endif #endif /* __x86_64__ */
1
0
0
0
Paul Gofman : kernelbase: Preprocess wildcarded mask and pass it with NtQueryDirectoryFile().
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: e1d2fb8e058c8a70d01e56e5a89ca22ecbc0e164 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e1d2fb8e058c8a70d01e56e5a89ca2…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Jun 3 20:13:21 2024 -0600 kernelbase: Preprocess wildcarded mask and pass it with NtQueryDirectoryFile(). --- dlls/kernel32/tests/file.c | 156 +++++++++++++++++++++++++------------------ dlls/kernelbase/file.c | 154 +++++++++++------------------------------- dlls/ntdll/tests/directory.c | 5 ++ 3 files changed, 137 insertions(+), 178 deletions(-)
1
0
0
0
Paul Gofman : ntdll: Skip name search for wildcards in asterisk handling in match_filename().
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: 691ccd64b30d9c4c8777c29980a35b4a072e7c48 URL:
https://gitlab.winehq.org/wine/wine/-/commit/691ccd64b30d9c4c8777c29980a35b…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Jun 5 16:18:01 2024 -0600 ntdll: Skip name search for wildcards in asterisk handling in match_filename(). --- dlls/ntdll/tests/directory.c | 1 + dlls/ntdll/unix/file.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/tests/directory.c b/dlls/ntdll/tests/directory.c index babe0f7a8fe..c05b51860e1 100644 --- a/dlls/ntdll/tests/directory.c +++ b/dlls/ntdll/tests/directory.c @@ -483,6 +483,7 @@ static void test_NtQueryDirectoryFile(void) {L"??.", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}, {L"??.???", {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, {L"<", {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1}}, + {L"*<a", {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0}}, {L"<.", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1}}, {L"<..", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}, {L"<.\"", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1}}, diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index d3bbcdffdc6..429f8839ed2 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1442,10 +1442,13 @@ static BOOLEAN match_filename_part( const WCHAR *name, const WCHAR *name_end, co while (name < name_end) { c = *mask == '"' ? '.' : *mask; - if (is_case_sensitive) - while (name < name_end && (*name != c)) name++; - else - while (name < name_end && (towupper(*name) != towupper(c))) name++; + if (!is_wildcard(c)) + { + if (is_case_sensitive) + while (name < name_end && (*name != c)) name++; + else + while (name < name_end && (towupper(*name) != towupper(c))) name++; + } if (match_filename_part( name, name_end, mask, mask_end )) return TRUE; ++name; }
1
0
0
0
Paul Gofman : ntdll: Properly match DOS_QM in match_filename().
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: 2e048acf2940a402496d0daea971be54d1e25609 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2e048acf2940a402496d0daea971be…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Jun 3 16:42:36 2024 -0600 ntdll: Properly match DOS_QM in match_filename(). --- dlls/ntdll/tests/directory.c | 11 +++++++++++ dlls/ntdll/unix/file.c | 12 ++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/directory.c b/dlls/ntdll/tests/directory.c index d61a1a73b3f..babe0f7a8fe 100644 --- a/dlls/ntdll/tests/directory.c +++ b/dlls/ntdll/tests/directory.c @@ -531,6 +531,17 @@ static void test_NtQueryDirectoryFile(void) {L"<<<", {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}, {L"< ..", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, {L"<\"\"", {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1}}, + {L">", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0}}, + {L">.", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0}}, + {L">..", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}, + {L">>", {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0}}, + {L">>.", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0}}, + {L">>>", {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0}}, + {L">>.>>>", {0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1}}, + {L">.>", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1}}, + {L">>.tmp", {0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, + {L">>tmp", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, + {L">>>tmp", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, }; OBJECT_ATTRIBUTES attr; diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index eee3610b487..d3bbcdffdc6 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1487,10 +1487,18 @@ static BOOLEAN match_filename_part( const WCHAR *name, const WCHAR *name_end, co break; } case '?': - case '>': mask++; name++; break; + case '>': + mask++; + if (*name == '.') + { + while (mask < mask_end && *mask == '>') mask++; + if (mask == mask_end) name++; + } + else name++; + break; default: c = *mask == '"' ? '.' : *mask; if (is_case_sensitive && c != *name) return FALSE; @@ -1500,7 +1508,7 @@ static BOOLEAN match_filename_part( const WCHAR *name, const WCHAR *name_end, co break; } } - while (mask < mask_end && (*mask == '*' || *mask == '<' || *mask == '"')) + while (mask < mask_end && (*mask == '*' || *mask == '<' || *mask == '"' || *mask == '>')) mask++; return (name == name_end && mask == mask_end); }
1
0
0
0
Paul Gofman : ntdll: Implement matching DOS_DOT in NtQueryDirectoryFile().
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: a31d68d800e3520b65ff5eb0cfa8f38a2795dca4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a31d68d800e3520b65ff5eb0cfa8f3…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Jun 5 18:27:18 2024 -0600 ntdll: Implement matching DOS_DOT in NtQueryDirectoryFile(). --- dlls/ntdll/tests/directory.c | 19 +++++++++++++++++++ dlls/ntdll/unix/file.c | 14 ++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/tests/directory.c b/dlls/ntdll/tests/directory.c index c12c5547ade..d61a1a73b3f 100644 --- a/dlls/ntdll/tests/directory.c +++ b/dlls/ntdll/tests/directory.c @@ -485,12 +485,17 @@ static void test_NtQueryDirectoryFile(void) {L"<", {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1}}, {L"<.", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1}}, {L"<..", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}, + {L"<.\"", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1}}, {L".<", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0}}, {L"..<", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}}, {L"..*", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}}, {L"*..*", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1}}, {L"*..", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}, {L"..?", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}}, + {L"..\"", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, + {L"\"", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0}}, + {L"\"\"", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0}}, + {L"\"\"\"", {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0}}, {L"a.<", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1}}, {L"ea.tmp.tmp<", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}}, {L"<tmp", {1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}}, @@ -499,7 +504,20 @@ static void test_NtQueryDirectoryFile(void) {L"<nam<tmp", {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, {L"<name.<", {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, {L"<name<", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, + {L"<\"", {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1}}, + {L"*\"", {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}, + {L"*\"tmp\"tmp\"", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}}, + {L"n\"tmp", {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, + {L"ea\"", {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, + {L"\"a", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}}, + {L"\"\"a", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}}, + {L"e\"a", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, + {L"*\"tmp", {1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}}, {L"<.<", {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}}, + {L"<\"<", {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}, + {L"<\"<\"", {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}, + {L"<\"<.", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}, + {L"<.<\"", {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}}, {L"<<", {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}, {L"<a", {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0}}, {L"*a", {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0}}, @@ -512,6 +530,7 @@ static void test_NtQueryDirectoryFile(void) {L"<.<<", {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}}, {L"<<<", {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}, {L"< ..", {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, + {L"<\"\"", {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1}}, }; OBJECT_ATTRIBUTES attr; diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 8694564b576..eee3610b487 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1441,10 +1441,11 @@ static BOOLEAN match_filename_part( const WCHAR *name, const WCHAR *name_end, co while (name < name_end) { + c = *mask == '"' ? '.' : *mask; if (is_case_sensitive) - while (name < name_end && (*name != *mask)) name++; + while (name < name_end && (*name != c)) name++; else - while (name < name_end && (towupper(*name) != towupper(*mask))) name++; + while (name < name_end && (towupper(*name) != towupper(c))) name++; if (match_filename_part( name, name_end, mask, mask_end )) return TRUE; ++name; } @@ -1469,7 +1470,7 @@ static BOOLEAN match_filename_part( const WCHAR *name, const WCHAR *name_end, co { while (name < next_dot) { - c = *mask; + c = *mask == '"' ? '.' : *mask; if (!is_wildcard(c)) { if (is_case_sensitive) @@ -1491,14 +1492,15 @@ static BOOLEAN match_filename_part( const WCHAR *name, const WCHAR *name_end, co name++; break; default: - if (is_case_sensitive && *mask != *name) return FALSE; - if (!is_case_sensitive && towupper(*mask) != towupper(*name)) return FALSE; + c = *mask == '"' ? '.' : *mask; + if (is_case_sensitive && c != *name) return FALSE; + if (!is_case_sensitive && towupper(c) != towupper(*name)) return FALSE; mask++; name++; break; } } - while (mask < mask_end && (*mask == '*' || *mask == '<')) + while (mask < mask_end && (*mask == '*' || *mask == '<' || *mask == '"')) mask++; return (name == name_end && mask == mask_end); }
1
0
0
0
Paul Gofman : ntdll: Implement matching DOS_STAR in NtQueryDirectoryFile().
by Alexandre Julliard
07 Jun '24
07 Jun '24
Module: wine Branch: master Commit: db032ac4a9e30d06c430eb3125cb78b4d5ba4073 URL:
https://gitlab.winehq.org/wine/wine/-/commit/db032ac4a9e30d06c430eb3125cb78…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Jun 5 18:21:30 2024 -0600 ntdll: Implement matching DOS_STAR in NtQueryDirectoryFile(). --- dlls/kernel32/tests/file.c | 4 +-- dlls/ntdll/tests/directory.c | 64 ++++++++++++++++++++++++++++++++++++-------- dlls/ntdll/unix/file.c | 40 ++++++++++++++++++++++++++- 3 files changed, 94 insertions(+), 14 deletions(-)
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
62
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
Results per page:
10
25
50
100
200