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
April 2020
----- 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
1016 discussions
Start a n
N
ew thread
Matteo Bruni : d3dx9: Switch character count to unsigned int in the DrawText implementation.
by Alexandre Julliard
01 Apr '20
01 Apr '20
Module: wine Branch: master Commit: b5df43b9118074485a1f4a917b16d37bc068839d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b5df43b9118074485a1f4a91…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Apr 1 20:27:12 2020 +0200 d3dx9: Switch character count to unsigned int in the DrawText implementation. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/font.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c index 54b1574bb1..ebbda69580 100644 --- a/dlls/d3dx9_36/font.c +++ b/dlls/d3dx9_36/font.c @@ -552,11 +552,11 @@ static void word_break(HDC hdc, const WCHAR *str, unsigned int *str_len, heap_free(sla); } -static const WCHAR *read_line(HDC hdc, const WCHAR *str, int *count, +static const WCHAR *read_line(HDC hdc, const WCHAR *str, unsigned int *count, WCHAR *dest, unsigned int *dest_len, int width, DWORD format, SIZE *size) { + unsigned int orig_count = *count; unsigned int i = 0; - int orig_count = *count; int num_fit; *dest_len = 0; @@ -600,25 +600,25 @@ static const WCHAR *read_line(HDC hdc, const WCHAR *str, int *count, } static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite, - const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color) + const WCHAR *string, INT in_count, RECT *rect, DWORD format, D3DCOLOR color) { struct d3dx_font *font = impl_from_ID3DXFont(iface); ID3DXSprite *target = sprite; - WCHAR *line; RECT textrect = {0}; int lh, x, y, width; + unsigned int count; int max_width = 0; + WCHAR *line; int ret = 0; SIZE size; - TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x.\n", - iface, sprite, debugstr_wn(string, count), count, wine_dbgstr_rect(rect), format, color); + TRACE("iface %p, sprite %p, string %s, in_count %d, rect %s, format %#x, color 0x%08x.\n", + iface, sprite, debugstr_wn(string, in_count), in_count, wine_dbgstr_rect(rect), format, color); if (!string) return 0; - if (count < 0) - count = lstrlenW(string); + count = in_count < 0 ? lstrlenW(string) : in_count; if (!count) return 0;
1
0
0
0
Alexandre Julliard : ntdll: Avoid using the LDT definitions from libwine.
by Alexandre Julliard
01 Apr '20
01 Apr '20
Module: wine Branch: master Commit: b8f0e32b9f00f63abee6ca31e190ff794c053b67 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b8f0e32b9f00f63abee6ca31…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 1 12:41:05 2020 +0200 ntdll: Avoid using the LDT definitions from libwine. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_i386.c | 54 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index b4e2d15e98..e812f634ff 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -2301,6 +2301,11 @@ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) #define LDT_SIZE 8192 +#define LDT_FLAGS_DATA 0x13 /* Data segment */ +#define LDT_FLAGS_CODE 0x1b /* Code segment */ +#define LDT_FLAGS_32BIT 0x40 /* Segment is 32-bit (code or stack) */ +#define LDT_FLAGS_ALLOCATED 0x80 /* Segment is allocated */ + static WORD gdt_fs_sel; static RTL_CRITICAL_SECTION ldt_section; @@ -2335,13 +2340,36 @@ static void ldt_unlock(void) else RtlLeaveCriticalSection( &ldt_section ); } +static inline void *ldt_get_base( LDT_ENTRY ent ) +{ + return (void *)(ent.BaseLow | + (ULONG_PTR)ent.HighWord.Bits.BaseMid << 16 | + (ULONG_PTR)ent.HighWord.Bits.BaseHi << 24); +} + +static inline unsigned int ldt_get_limit( LDT_ENTRY ent ) +{ + unsigned int limit = ent.LimitLow | (ent.HighWord.Bits.LimitHi << 16); + if (ent.HighWord.Bits.Granularity) limit = (limit << 12) | 0xfff; + return limit; +} + static LDT_ENTRY ldt_make_entry( void *base, unsigned int limit, unsigned char flags ) { LDT_ENTRY entry; - wine_ldt_set_base( &entry, base ); - wine_ldt_set_limit( &entry, limit ); - wine_ldt_set_flags( &entry, flags ); + entry.BaseLow = (WORD)(ULONG_PTR)base; + entry.HighWord.Bits.BaseMid = (BYTE)((ULONG_PTR)base >> 16); + entry.HighWord.Bits.BaseHi = (BYTE)((ULONG_PTR)base >> 24); + if ((entry.HighWord.Bits.Granularity = (limit >= 0x100000))) limit >>= 12; + entry.LimitLow = (WORD)limit; + entry.HighWord.Bits.LimitHi = limit >> 16; + entry.HighWord.Bits.Dpl = 3; + entry.HighWord.Bits.Pres = 1; + entry.HighWord.Bits.Type = flags; + entry.HighWord.Bits.Sys = 0; + entry.HighWord.Bits.Reserved_0 = 0; + entry.HighWord.Bits.Default_Big = (flags & LDT_FLAGS_32BIT) != 0; return entry; } @@ -2352,7 +2380,7 @@ static void ldt_set_entry( WORD sel, LDT_ENTRY entry ) #ifdef linux struct modify_ldt_s ldt_info = { index }; - ldt_info.base_addr = wine_ldt_get_base( &entry ); + ldt_info.base_addr = ldt_get_base( entry ); ldt_info.limit = entry.LimitLow | (entry.HighWord.Bits.LimitHi << 16); ldt_info.seg_32bit = entry.HighWord.Bits.Default_Big; ldt_info.contents = (entry.HighWord.Bits.Type >> 2) & 3; @@ -2374,7 +2402,7 @@ static void ldt_set_entry( WORD sel, LDT_ENTRY entry ) struct ssd ldt_mod; ldt_mod.sel = sel; - ldt_mod.bo = (unsigned long)wine_ldt_get_base(&entry); + ldt_mod.bo = (unsigned long)ldt_get_base( entry ); ldt_mod.ls = entry.LimitLow | (entry.HighWord.Bits.LimitHi << 16); ldt_mod.acc1 = entry.HighWord.Bytes.Flags1; ldt_mod.acc2 = entry.HighWord.Bytes.Flags2 >> 4; @@ -2389,11 +2417,11 @@ static void ldt_set_entry( WORD sel, LDT_ENTRY entry ) exit(1); #endif - wine_ldt_copy.base[index] = wine_ldt_get_base( &entry ); - wine_ldt_copy.limit[index] = wine_ldt_get_limit( &entry ); + wine_ldt_copy.base[index] = ldt_get_base( entry ); + wine_ldt_copy.limit[index] = ldt_get_limit( entry ); wine_ldt_copy.flags[index] = (entry.HighWord.Bits.Type | - (entry.HighWord.Bits.Default_Big ? WINE_LDT_FLAGS_32BIT : 0) | - WINE_LDT_FLAGS_ALLOCATED); + (entry.HighWord.Bits.Default_Big ? LDT_FLAGS_32BIT : 0) | + LDT_FLAGS_ALLOCATED); } static void ldt_init(void) @@ -2422,7 +2450,7 @@ WORD ldt_alloc_fs( TEB *teb, int first_thread ) if (gdt_fs_sel) return gdt_fs_sel; - entry = ldt_make_entry( teb, teb_size - 1, WINE_LDT_FLAGS_DATA | WINE_LDT_FLAGS_32BIT ); + entry = ldt_make_entry( teb, teb_size - 1, LDT_FLAGS_DATA | LDT_FLAGS_32BIT ); if (first_thread) /* no locking for first thread */ { @@ -2490,11 +2518,11 @@ NTSTATUS get_thread_ldt_entry( HANDLE handle, void *data, ULONG len, ULONG *ret_ if (!(info->Selector & ~3)) info->Entry = null_entry; else if ((info->Selector | 3) == wine_get_cs()) - info->Entry = ldt_make_entry( 0, ~0u, WINE_LDT_FLAGS_CODE | WINE_LDT_FLAGS_32BIT ); + info->Entry = ldt_make_entry( 0, ~0u, LDT_FLAGS_CODE | LDT_FLAGS_32BIT ); else if ((info->Selector | 3) == wine_get_ds()) - info->Entry = ldt_make_entry( 0, ~0u, WINE_LDT_FLAGS_DATA | WINE_LDT_FLAGS_32BIT ); + info->Entry = ldt_make_entry( 0, ~0u, LDT_FLAGS_DATA | LDT_FLAGS_32BIT ); else if ((info->Selector | 3) == wine_get_fs()) - info->Entry = ldt_make_entry( NtCurrentTeb(), 0xfff, WINE_LDT_FLAGS_DATA | WINE_LDT_FLAGS_32BIT ); + info->Entry = ldt_make_entry( NtCurrentTeb(), 0xfff, LDT_FLAGS_DATA | LDT_FLAGS_32BIT ); else return STATUS_UNSUCCESSFUL; }
1
0
0
0
Alexandre Julliard : ntdll: Reimplement LDT support for the TEB selector.
by Alexandre Julliard
01 Apr '20
01 Apr '20
Module: wine Branch: master Commit: b644034a52360abba3726a28729eac0ff009fdd4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b644034a52360abba3726a28…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 1 12:35:11 2020 +0200 ntdll: Reimplement LDT support for the TEB selector. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_i386.c | 113 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 99 insertions(+), 14 deletions(-) diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 60f4637e2d..b4e2d15e98 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -569,6 +569,14 @@ static inline int is_gdt_sel( WORD sel ) return !(sel & 4); } +/*********************************************************************** + * ldt_is_system + */ +static inline int ldt_is_system( WORD sel ) +{ + return is_gdt_sel( sel ) || ((sel >> 3) < first_ldt_entry); +} + /*********************************************************************** * dispatch_signal */ @@ -893,8 +901,7 @@ static inline void *init_handler( const ucontext_t *sigcontext, WORD *fs, WORD * } #endif - if (!wine_ldt_is_system(CS_sig(sigcontext)) || - !wine_ldt_is_system(SS_sig(sigcontext))) /* 16-bit mode */ + if (!ldt_is_system(CS_sig(sigcontext)) || !ldt_is_system(SS_sig(sigcontext))) /* 16-bit mode */ { /* * Win16 or DOS protected mode. Note that during switch @@ -1580,7 +1587,7 @@ static inline DWORD is_privileged_instr( CONTEXT *context ) BYTE instr[16]; unsigned int i, len, prefix_count = 0; - if (!wine_ldt_is_system( context->SegCs )) return 0; + if (!ldt_is_system( context->SegCs )) return 0; len = virtual_uninterrupted_read_memory( (BYTE *)context->Eip, instr, sizeof(instr) ); for (i = 0; i < len; i++) switch (instr[i]) @@ -1647,7 +1654,7 @@ static inline BOOL check_invalid_gs( ucontext_t *sigcontext, CONTEXT *context ) WORD system_gs = x86_thread_data()->gs; if (context->SegGs == system_gs) return FALSE; - if (!wine_ldt_is_system( context->SegCs )) return FALSE; + if (!ldt_is_system( context->SegCs )) return FALSE; /* only handle faults in system libraries */ if (virtual_is_valid_code_address( instr, 1 )) return FALSE; @@ -2069,7 +2076,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) stack->rec.NumberParameters = 2; stack->rec.ExceptionInformation[0] = 0; /* if error contains a LDT selector, use that as fault address */ - if ((err & 7) == 4 && !wine_ldt_is_system( err | 7 )) + if ((err & 7) == 4 && !ldt_is_system( err | 7 )) stack->rec.ExceptionInformation[1] = err & ~7; else { @@ -2291,6 +2298,11 @@ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) /*********************************************************************** * LDT support */ + +#define LDT_SIZE 8192 + +static WORD gdt_fs_sel; + static RTL_CRITICAL_SECTION ldt_section; static RTL_CRITICAL_SECTION_DEBUG critsect_debug = { @@ -2384,6 +2396,83 @@ static void ldt_set_entry( WORD sel, LDT_ENTRY entry ) WINE_LDT_FLAGS_ALLOCATED); } +static void ldt_init(void) +{ +#ifdef __linux__ + /* the preloader may have allocated it already */ + gdt_fs_sel = wine_get_fs(); + if (!gdt_fs_sel || !is_gdt_sel( gdt_fs_sel )) + { + struct modify_ldt_s ldt_info = { -1 }; + + ldt_info.seg_32bit = 1; + ldt_info.usable = 1; + if (set_thread_area( &ldt_info ) >= 0) gdt_fs_sel = (ldt_info.entry_number << 3) | 3; + else gdt_fs_sel = 0; + } +#elif defined(__FreeBSD__) || defined (__FreeBSD_kernel__) + gdt_fs_sel = GSEL( GUFS_SEL, SEL_UPL ); +#endif +} + +WORD ldt_alloc_fs( TEB *teb, int first_thread ) +{ + LDT_ENTRY entry; + int idx; + + if (gdt_fs_sel) return gdt_fs_sel; + + entry = ldt_make_entry( teb, teb_size - 1, WINE_LDT_FLAGS_DATA | WINE_LDT_FLAGS_32BIT ); + + if (first_thread) /* no locking for first thread */ + { + /* leave some space if libc is using the LDT for %gs */ + if (!is_gdt_sel( wine_get_gs() )) first_ldt_entry = 512; + idx = first_ldt_entry; + ldt_set_entry( (idx << 3) | 7, entry ); + } + else + { + ldt_lock(); + for (idx = first_ldt_entry; idx < LDT_SIZE; idx++) + { + if (wine_ldt_copy.flags[idx]) continue; + ldt_set_entry( (idx << 3) | 7, entry ); + break; + } + ldt_unlock(); + if (idx == LDT_SIZE) return 0; + } + return (idx << 3) | 7; +} + +static void ldt_free_fs( WORD sel ) +{ + if (sel == gdt_fs_sel) return; + + ldt_lock(); + wine_ldt_copy.flags[sel >> 3] = 0; + ldt_unlock(); +} + +static void ldt_set_fs( WORD sel, TEB *teb ) +{ + if (sel == gdt_fs_sel) + { +#ifdef __linux__ + struct modify_ldt_s ldt_info = { sel >> 3 }; + + ldt_info.base_addr = teb; + ldt_info.limit = teb_size - 1; + ldt_info.seg_32bit = 1; + if (set_thread_area( &ldt_info ) < 0) perror( "set_thread_area" ); +#elif defined(__FreeBSD__) || defined (__FreeBSD_kernel__) || defined(__DragonFly__) + i386_set_fsbase( teb ); +#endif + } + wine_set_fs( sel ); +} + /********************************************************************** * get_thread_ldt_entry @@ -2462,6 +2551,7 @@ NTSTATUS signal_alloc_thread( TEB **teb ) SIZE_T size; void *addr = NULL; NTSTATUS status; + int first_thread = !sigstack_alignment; if (!sigstack_alignment) { @@ -2471,6 +2561,7 @@ NTSTATUS signal_alloc_thread( TEB **teb ) while ((1u << sigstack_alignment) < min_size) sigstack_alignment++; signal_stack_mask = (1 << sigstack_alignment) - 1; signal_stack_size = (1 << sigstack_alignment) - teb_size; + ldt_init(); } size = signal_stack_mask + 1; @@ -2481,7 +2572,7 @@ NTSTATUS signal_alloc_thread( TEB **teb ) (*teb)->Tib.Self = &(*teb)->Tib; (*teb)->Tib.ExceptionList = (void *)~0UL; thread_data = (struct x86_thread_data *)(*teb)->SystemReserved2; - if (!(thread_data->fs = wine_ldt_alloc_fs())) + if (!(thread_data->fs = ldt_alloc_fs( *teb, first_thread ))) { size = 0; NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE ); @@ -2500,7 +2591,7 @@ void signal_free_thread( TEB *teb ) SIZE_T size = 0; struct x86_thread_data *thread_data = (struct x86_thread_data *)teb->SystemReserved2; - wine_ldt_free_fs( thread_data->fs ); + ldt_free_fs( thread_data->fs ); NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE ); } @@ -2512,7 +2603,6 @@ void signal_init_thread( TEB *teb ) { const WORD fpu_cw = 0x27f; struct x86_thread_data *thread_data = (struct x86_thread_data *)teb->SystemReserved2; - LDT_ENTRY fs_entry; stack_t ss; #ifdef __APPLE__ @@ -2528,10 +2618,7 @@ void signal_init_thread( TEB *teb ) ss.ss_flags = 0; if (sigaltstack(&ss, NULL) == -1) perror( "sigaltstack" ); - wine_ldt_set_base( &fs_entry, teb ); - wine_ldt_set_limit( &fs_entry, teb_size - 1 ); - wine_ldt_set_flags( &fs_entry, WINE_LDT_FLAGS_DATA|WINE_LDT_FLAGS_32BIT ); - wine_ldt_init_fs( thread_data->fs, &fs_entry ); + ldt_set_fs( thread_data->fs, teb ); thread_data->gs = wine_get_gs(); #ifdef __GNUC__ @@ -2579,8 +2666,6 @@ void signal_init_process(void) sig_act.sa_sigaction = trap_handler; if (sigaction( SIGTRAP, &sig_act, NULL ) == -1) goto error; #endif - - wine_ldt_init_locking( ldt_lock, ldt_unlock ); return; error:
1
0
0
0
Alexandre Julliard : ntdll: Implement NtSetLdtEntries().
by Alexandre Julliard
01 Apr '20
01 Apr '20
Module: wine Branch: master Commit: 01873109662eb7f5879eb72fdf1f55bbdaef0329 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=01873109662eb7f5879eb72f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 1 12:33:37 2020 +0200 ntdll: Implement NtSetLdtEntries(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/nt.c | 12 ----- dlls/ntdll/ntdll.spec | 2 +- dlls/ntdll/signal_arm.c | 9 ++++ dlls/ntdll/signal_arm64.c | 9 ++++ dlls/ntdll/signal_i386.c | 110 ++++++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/signal_powerpc.c | 9 ++++ dlls/ntdll/signal_x86_64.c | 9 ++++ include/winternl.h | 2 +- 8 files changed, 148 insertions(+), 14 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=01873109662eb7f5879e…
1
0
0
0
Alexandre Julliard : ntdll: Move support for getting LDT entries to the platform-specific files.
by Alexandre Julliard
01 Apr '20
01 Apr '20
Module: wine Branch: master Commit: 6169cacd0d5b87459302d8dad278de3106bdbb6f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6169cacd0d5b87459302d8da…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 1 12:33:29 2020 +0200 ntdll: Move support for getting LDT entries to the platform-specific files. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/thread.c | 47 +++++++++++++++++++++++++++ dlls/ntdll/ntdll_misc.h | 1 + dlls/ntdll/signal_arm.c | 8 +++++ dlls/ntdll/signal_arm64.c | 8 +++++ dlls/ntdll/signal_i386.c | 69 +++++++++++++++++++++++++++++++++++++++- dlls/ntdll/signal_powerpc.c | 8 +++++ dlls/ntdll/signal_x86_64.c | 8 +++++ dlls/ntdll/thread.c | 76 ++------------------------------------------ 8 files changed, 151 insertions(+), 74 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=6169cacd0d5b87459302…
1
0
0
0
Alexandre Julliard : krnl386: Avoid using toupperW().
by Alexandre Julliard
01 Apr '20
01 Apr '20
Module: wine Branch: master Commit: 73dad192b49880c9754d46ae84aa9f4a97dd2ea8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=73dad192b49880c9754d46ae…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 1 10:30:21 2020 +0200 krnl386: Avoid using toupperW(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/krnl386.exe16/file.c | 9 ++++++--- dlls/krnl386.exe16/int21.c | 23 +++++++++++++--------- dlls/krnl386.exe16/relay.c | 49 ++++++++++++++++------------------------------ 3 files changed, 37 insertions(+), 44 deletions(-) diff --git a/dlls/krnl386.exe16/file.c b/dlls/krnl386.exe16/file.c index 4e7f7c4b33..e44455a021 100644 --- a/dlls/krnl386.exe16/file.c +++ b/dlls/krnl386.exe16/file.c @@ -461,10 +461,13 @@ LONG WINAPI _hwrite16( HFILE16 hFile, LPCSTR buffer, LONG count ) UINT WINAPI GetTempDrive( BYTE ignored ) { WCHAR buffer[MAX_PATH]; - BYTE ret; + BYTE ret = 'C'; - if (GetTempPathW( MAX_PATH, buffer )) ret = (BYTE)toupperW(buffer[0]); - else ret = 'C'; + if (GetTempPathW( MAX_PATH, buffer )) + { + ret = buffer[0]; + if (ret >= 'a' && ret <= 'z') ret += 'A' - 'a'; + } return MAKELONG( ret | (':' << 8), 1 ); } diff --git a/dlls/krnl386.exe16/int21.c b/dlls/krnl386.exe16/int21.c index 04ae9fe8a8..feab712af0 100644 --- a/dlls/krnl386.exe16/int21.c +++ b/dlls/krnl386.exe16/int21.c @@ -264,6 +264,13 @@ typedef struct static int brk_flag; +static BYTE drive_number( WCHAR letter ) +{ + if (letter >= 'A' && letter <= 'Z') return letter - 'A'; + if (letter >= 'a' && letter <= 'z') return letter - 'a'; + return MAX_DOS_DRIVES; +} + /* Many calls translate a drive argument like this: drive number (00h = default, 01h = A:, etc) @@ -300,8 +307,7 @@ static BYTE INT21_GetCurrentDrive(void) TRACE( "Failed to get current drive.\n" ); return MAX_DOS_DRIVES; } - - return toupperW( current_directory[0] ) - 'A'; + return drive_number( current_directory[0] ); } @@ -636,7 +642,7 @@ static BOOL INT21_GetCurrentDirectory( CONTEXT *context, BOOL islong ) if (!GetCurrentDirectoryW( MAX_PATH, pathW )) return FALSE; - if (toupperW(pathW[0]) - 'A' != drive || pathW[1] != ':') + if (drive_number( pathW[0] ) != drive || pathW[1] != ':') { /* cwd is not on the requested drive, get the environment string instead */ @@ -765,7 +771,7 @@ static BOOL INT21_SetCurrentDirectory( CONTEXT *context ) result = SetEnvironmentVariableW( env_var, dirW ); /* only set current directory if on the current drive */ - if (result && (toupperW(dirW[0]) - 'A' == drive)) result = SetCurrentDirectoryW( dirW ); + if (result && (drive_number( dirW[0] ) == drive)) result = SetCurrentDirectoryW( dirW ); return result; } @@ -3418,8 +3424,7 @@ static BOOL INT21_ToDosFCBFormat( LPCWSTR name, LPWSTR buffer ) break; default: if (strchrW( invalid_chars, *p )) return FALSE; - buffer[i] = toupperW(*p); - p++; + buffer[i] = *p++; break; } } @@ -3455,12 +3460,12 @@ static BOOL INT21_ToDosFCBFormat( LPCWSTR name, LPWSTR buffer ) break; default: if (strchrW( invalid_chars, *p )) return FALSE; - buffer[i] = toupperW(*p); - p++; + buffer[i] = *p++; break; } } buffer[11] = '\0'; + struprW( buffer ); /* at most 3 character of the extension are processed * is something behind this ? @@ -3514,7 +3519,7 @@ static BOOL INT21_FindFirst( CONTEXT *context ) /* we must have a fully qualified file name in dta->fullPath * (we could have a UNC path, but this would lead to some errors later on) */ - dta->drive = toupperW(dta->fullPath[0]) - 'A'; + dta->drive = drive_number( dta->fullPath[0] ); dta->count = 0; dta->search_attr = CL_reg(context); return TRUE; diff --git a/dlls/krnl386.exe16/relay.c b/dlls/krnl386.exe16/relay.c index a47e85126e..837f389230 100644 --- a/dlls/krnl386.exe16/relay.c +++ b/dlls/krnl386.exe16/relay.c @@ -59,37 +59,22 @@ typedef struct { } RELAY_Stack16; -static const WCHAR **debug_relay_excludelist; -static const WCHAR **debug_relay_includelist; -static const WCHAR **debug_snoop_excludelist; -static const WCHAR **debug_snoop_includelist; +static const char **debug_relay_excludelist; +static const char **debug_relay_includelist; +static const char **debug_snoop_excludelist; +static const char **debug_snoop_includelist; -/* compare an ASCII and a Unicode string without depending on the current codepage */ -static inline int strcmpiAW( const char *strA, const WCHAR *strW ) -{ - while (*strA && (toupperW((unsigned char)*strA) == toupperW(*strW))) { strA++; strW++; } - return toupperW((unsigned char)*strA) - toupperW(*strW); -} - -/* compare an ASCII and a Unicode string without depending on the current codepage */ -static inline int strncmpiAW( const char *strA, const WCHAR *strW, int n ) -{ - int ret = 0; - for ( ; n > 0; n--, strA++, strW++) - if ((ret = toupperW((unsigned char)*strA) - toupperW(*strW)) || !*strA) break; - return ret; -} /*********************************************************************** * build_list * * Build a function list from a ';'-separated string. */ -static const WCHAR **build_list( const WCHAR *buffer ) +static const char **build_list( const WCHAR *buffer ) { int count = 1; const WCHAR *p = buffer; - const WCHAR **ret; + const char **ret; while ((p = strchrW( p, ';' ))) { @@ -98,17 +83,17 @@ static const WCHAR **build_list( const WCHAR *buffer ) } /* allocate count+1 pointers, plus the space for a copy of the string */ if ((ret = RtlAllocateHeap( GetProcessHeap(), 0, - (count+1) * sizeof(WCHAR*) + (strlenW(buffer)+1) * sizeof(WCHAR) ))) + (count + 1) * sizeof(char *) + (strlenW(buffer) + 1) ))) { - WCHAR *str = (WCHAR *)(ret + count + 1); - WCHAR *p = str; + char *str = (char *)(ret + count + 1); + char *p = str; - strcpyW( str, buffer ); + while ((*str++ = *buffer++)); count = 0; for (;;) { ret[count++] = p; - if (!(p = strchrW( p, ';' ))) break; + if (!(p = strchr( p, ';' ))) break; *p++ = 0; } ret[count++] = NULL; @@ -185,25 +170,25 @@ void RELAY16_InitDebugLists(void) * * Check if a given module and function is in the list. */ -static BOOL check_list( const char *module, int ordinal, const char *func, const WCHAR **list ) +static BOOL check_list( const char *module, int ordinal, const char *func, const char **list ) { char ord_str[10]; sprintf( ord_str, "%d", ordinal ); for(; *list; list++) { - const WCHAR *p = strrchrW( *list, '.' ); + const char *p = strrchr( *list, '.' ); if (p && p > *list) /* check module and function */ { int len = p - *list; - if (strncmpiAW( module, *list, len-1 ) || module[len]) continue; + if (_strnicmp( module, *list, len-1 ) || module[len]) continue; if (p[1] == '*' && !p[2]) return TRUE; - if (!strcmpiAW( ord_str, p + 1 )) return TRUE; - if (func && !strcmpiAW( func, p + 1 )) return TRUE; + if (!strcmp( ord_str, p + 1 )) return TRUE; + if (func && !_strnicmp( func, p + 1, -1 )) return TRUE; } else /* function only */ { - if (func && !strcmpiAW( func, *list )) return TRUE; + if (func && !_strnicmp( func, *list, -1 )) return TRUE; } } return FALSE;
1
0
0
0
Alexandre Julliard : kernel32: Avoid using wctype functions.
by Alexandre Julliard
01 Apr '20
01 Apr '20
Module: wine Branch: master Commit: 2ec3396122e3f6c7402bbdacea1bb311b264bd1a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2ec3396122e3f6c7402bbdac…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 1 10:30:17 2020 +0200 kernel32: Avoid using wctype functions. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/editline.c | 5 ++++- dlls/kernel32/format_msg.c | 4 ++-- dlls/kernel32/profile.c | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/kernel32/editline.c b/dlls/kernel32/editline.c index e3d52ccc1a..489960aba6 100644 --- a/dlls/kernel32/editline.c +++ b/dlls/kernel32/editline.c @@ -362,7 +362,10 @@ static void WCEL_SaveYank(WCEL_Context* ctx, int beg, int end) */ static inline BOOL WCEL_iswalnum(WCHAR wc) { - return get_char_typeW(wc) & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER); + WORD type; + + GetStringTypeW( CT_CTYPE1, &wc, 1, &type ); + return type & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER); } static int WCEL_GetLeftWordTransition(WCEL_Context* ctx, int ofs) diff --git a/dlls/kernel32/format_msg.c b/dlls/kernel32/format_msg.c index 6a0dc5bd6b..f29c88fd38 100644 --- a/dlls/kernel32/format_msg.c +++ b/dlls/kernel32/format_msg.c @@ -184,7 +184,7 @@ static LPCWSTR format_insert( BOOL unicode_caller, int insert, LPCWSTR format, } else *p++ = *format++; } - while (isdigitW(*format)) *p++ = *format++; + while (*format >= '0' && *format <= '9') *p++ = *format++; if (*format == '.') { @@ -196,7 +196,7 @@ static LPCWSTR format_insert( BOOL unicode_caller, int insert, LPCWSTR format, format++; } else - while (isdigitW(*format)) *p++ = *format++; + while (*format >= '0' && *format <= '9') *p++ = *format++; } /* replicate MS bug: drop an argument when using va_list with width/precision */ diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c index 434728c267..f7d64f16a5 100644 --- a/dlls/kernel32/profile.c +++ b/dlls/kernel32/profile.c @@ -270,8 +270,8 @@ static void PROFILE_Free( PROFILESECTION *section ) /* returns TRUE if a whitespace character, else FALSE */ static inline BOOL PROFILE_isspaceW(WCHAR c) { - /* ^Z (DOS EOF) is a space too (found on CD-ROMs) */ - return isspaceW(c) || c == 0x1a; + /* ^Z (DOS EOF) is a space too (found on CD-ROMs) */ + return (c >= 0x09 && c <= 0x0d) || c == 0x1a || c == 0x20; } static inline ENCODING PROFILE_DetectTextEncoding(const void * buffer, int * len)
1
0
0
0
Alexandre Julliard : kernel32: Avoid using memchrW().
by Alexandre Julliard
01 Apr '20
01 Apr '20
Module: wine Branch: master Commit: e71ffcde30a7b21ea929dd770876873177024e0f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e71ffcde30a7b21ea929dd77…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 1 10:30:13 2020 +0200 kernel32: Avoid using memchrW(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/profile.c | 18 ++++++++---------- dlls/kernel32/volume.c | 6 +++--- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c index c7382fd7b3..434728c267 100644 --- a/dlls/kernel32/profile.c +++ b/dlls/kernel32/profile.c @@ -311,7 +311,7 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding) WCHAR * szFile; const WCHAR *szLineStart, *szLineEnd; const WCHAR *szValueStart, *szEnd, *next_line; - int line = 0, len; + int len; PROFILESECTION *section, *first_section; PROFILESECTION **next_section; PROFILEKEY *key, *prev_key, **next_key; @@ -402,14 +402,10 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding) while (next_line < szEnd) { szLineStart = next_line; - next_line = memchrW(szLineStart, '\n', szEnd - szLineStart); - if (!next_line) next_line = memchrW(szLineStart, '\r', szEnd - szLineStart); - if (!next_line) next_line = szEnd; - else next_line++; + while (next_line < szEnd && *next_line != '\n' && *next_line != '\r') next_line++; + while (next_line < szEnd && (*next_line == '\n' || *next_line == '\r')) next_line++; szLineEnd = next_line; - line++; - /* get rid of white space */ while (szLineStart < szLineEnd && PROFILE_isspaceW(*szLineStart)) szLineStart++; while ((szLineEnd > szLineStart) && PROFILE_isspaceW(szLineEnd[-1])) szLineEnd--; @@ -421,8 +417,8 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding) for (len = szLineEnd - szLineStart; len > 0; len--) if (szLineStart[len - 1] == ']') break; if (!len) { - WARN("Invalid section header at line %d: %s\n", - line, debugstr_wn(szLineStart, (int)(szLineEnd - szLineStart)) ); + WARN("Invalid section header: %s\n", + debugstr_wn(szLineStart, (int)(szLineEnd - szLineStart)) ); } else { @@ -450,7 +446,8 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding) /* get rid of white space after the name and before the start * of the value */ len = szLineEnd - szLineStart; - if ((szValueStart = memchrW( szLineStart, '=', szLineEnd - szLineStart )) != NULL) + for (szValueStart = szLineStart; szValueStart < szLineEnd; szValueStart++) if (*szValueStart == '=') break; + if (szValueStart < szLineEnd) { const WCHAR *szNameEnd = szValueStart; while ((szNameEnd > szLineStart) && PROFILE_isspaceW(szNameEnd[-1])) szNameEnd--; @@ -458,6 +455,7 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding) szValueStart++; while (szValueStart < szLineEnd && PROFILE_isspaceW(*szValueStart)) szValueStart++; } + else szValueStart = NULL; if (len || !prev_key || *prev_key->name) { diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c index 7967a55b2f..4f0f4a0a0f 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -674,7 +674,7 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len, IO_STATUS_BLOCK io; OBJECT_ATTRIBUTES attr; FILE_FS_DEVICE_INFORMATION info; - WCHAR *p; + unsigned int i; enum fs_type type = FS_UNKNOWN; BOOL ret = FALSE; @@ -685,8 +685,8 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len, return FALSE; } /* there must be exactly one backslash in the name, at the end */ - p = memchrW( nt_name.Buffer + 4, '\\', (nt_name.Length - 4) / sizeof(WCHAR) ); - if (p != nt_name.Buffer + nt_name.Length / sizeof(WCHAR) - 1) + for (i = 4; i < nt_name.Length / sizeof(WCHAR); i++) if (nt_name.Buffer[i] == '\\') break; + if (i != nt_name.Length / sizeof(WCHAR) - 1) { /* check if root contains an explicit subdir */ if (root[0] && root[1] == ':') root += 2;
1
0
0
0
Alexandre Julliard : kernel32: Avoid using memrchrW().
by Alexandre Julliard
01 Apr '20
01 Apr '20
Module: wine Branch: master Commit: ce30db504bb61e026736ac0b24ce00ba587044de URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ce30db504bb61e026736ac0b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 1 10:28:57 2020 +0200 kernel32: Avoid using memrchrW(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/profile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c index e4bd861b14..c7382fd7b3 100644 --- a/dlls/kernel32/profile.c +++ b/dlls/kernel32/profile.c @@ -418,8 +418,8 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding) if (*szLineStart == '[') /* section start */ { - const WCHAR * szSectionEnd; - if (!(szSectionEnd = memrchrW( szLineStart, ']', szLineEnd - szLineStart ))) + for (len = szLineEnd - szLineStart; len > 0; len--) if (szLineStart[len - 1] == ']') break; + if (!len) { WARN("Invalid section header at line %d: %s\n", line, debugstr_wn(szLineStart, (int)(szLineEnd - szLineStart)) ); @@ -427,7 +427,7 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding) else { szLineStart++; - len = (int)(szSectionEnd - szLineStart); + len -= 2; /* no need to allocate +1 for NULL terminating character as * already included in structure */ if (!(section = HeapAlloc( GetProcessHeap(), 0, sizeof(*section) + len * sizeof(WCHAR) )))
1
0
0
0
Alexandre Julliard : kernel32: Avoid using tolowerW/toupperW().
by Alexandre Julliard
01 Apr '20
01 Apr '20
Module: wine Branch: master Commit: 68587234bf82e268198f415a45256c854e179ba8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=68587234bf82e268198f415a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 1 10:28:01 2020 +0200 kernel32: Avoid using tolowerW/toupperW(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/comm.c | 11 +++++++++-- dlls/kernel32/editline.c | 16 +++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/dlls/kernel32/comm.c b/dlls/kernel32/comm.c index 48939c0287..656acb6b41 100644 --- a/dlls/kernel32/comm.c +++ b/dlls/kernel32/comm.c @@ -95,20 +95,25 @@ static LPCWSTR COMM_ParseParity(LPCWSTR ptr, LPBYTE lpparity) member of DCB and not fParity even when parity is specified in the device control string */ - switch(toupperW(*ptr++)) + switch(*ptr++) { + case 'e': case 'E': *lpparity = EVENPARITY; break; + case 'm': case 'M': *lpparity = MARKPARITY; break; + case 'n': case 'N': *lpparity = NOPARITY; break; + case 'o': case 'O': *lpparity = ODDPARITY; break; + case 's': case 'S': *lpparity = SPACEPARITY; break; @@ -239,7 +244,7 @@ static BOOL COMM_BuildOldCommDCB(LPCWSTR device, LPDCB lpdcb) { device++; while(*device == ' ') device++; - if(*device) last = toupperW(*device++); + if(*device) last = *device++; while(*device == ' ') device++; } @@ -255,6 +260,7 @@ static BOOL COMM_BuildOldCommDCB(LPCWSTR device, LPDCB lpdcb) lpdcb->fDtrControl = DTR_CONTROL_ENABLE; lpdcb->fRtsControl = RTS_CONTROL_ENABLE; break; + case 'x': case 'X': lpdcb->fInX = TRUE; lpdcb->fOutX = TRUE; @@ -263,6 +269,7 @@ static BOOL COMM_BuildOldCommDCB(LPCWSTR device, LPDCB lpdcb) lpdcb->fDtrControl = DTR_CONTROL_ENABLE; lpdcb->fRtsControl = RTS_CONTROL_ENABLE; break; + case 'p': case 'P': lpdcb->fInX = FALSE; lpdcb->fOutX = FALSE; diff --git a/dlls/kernel32/editline.c b/dlls/kernel32/editline.c index 7492604f04..e3d52ccc1a 100644 --- a/dlls/kernel32/editline.c +++ b/dlls/kernel32/editline.c @@ -27,6 +27,7 @@ #include "windef.h" #include "winbase.h" #include "wincon.h" +#include "winuser.h" #include "wine/unicode.h" #include "winnls.h" #include "wine/debug.h" @@ -598,9 +599,7 @@ static void WCEL_LowerCaseWord(WCEL_Context* ctx) unsigned int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); if (new_ofs != ctx->ofs) { - unsigned int i; - for (i = ctx->ofs; i <= new_ofs; i++) - ctx->line[i] = tolowerW(ctx->line[i]); + CharLowerBuffW( ctx->line + ctx->ofs, new_ofs - ctx->ofs + 1 ); WCEL_Update(ctx, ctx->ofs, new_ofs - ctx->ofs + 1); ctx->ofs = new_ofs; } @@ -611,9 +610,7 @@ static void WCEL_UpperCaseWord(WCEL_Context* ctx) unsigned int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); if (new_ofs != ctx->ofs) { - unsigned int i; - for (i = ctx->ofs; i <= new_ofs; i++) - ctx->line[i] = toupperW(ctx->line[i]); + CharUpperBuffW( ctx->line + ctx->ofs, new_ofs - ctx->ofs + 1 ); WCEL_Update(ctx, ctx->ofs, new_ofs - ctx->ofs + 1); ctx->ofs = new_ofs; } @@ -624,11 +621,8 @@ static void WCEL_CapitalizeWord(WCEL_Context* ctx) unsigned int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); if (new_ofs != ctx->ofs) { - unsigned int i; - - ctx->line[ctx->ofs] = toupperW(ctx->line[ctx->ofs]); - for (i = ctx->ofs + 1; i <= new_ofs; i++) - ctx->line[i] = tolowerW(ctx->line[i]); + CharUpperBuffW( ctx->line + ctx->ofs, 1 ); + CharLowerBuffW( ctx->line + ctx->ofs + 1, new_ofs - ctx->ofs ); WCEL_Update(ctx, ctx->ofs, new_ofs - ctx->ofs + 1); ctx->ofs = new_ofs; }
1
0
0
0
← Newer
1
...
98
99
100
101
102
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
Results per page:
10
25
50
100
200