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
March 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1163 discussions
Start a n
N
ew thread
Jacek Caban : ntdll: Use xsave compaction in syscall dispatcher.
by Alexandre Julliard
03 Mar '21
03 Mar '21
Module: wine Branch: master Commit: e979ee96b6c4d4bba9e9572603599867fdb321ca URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e979ee96b6c4d4bba9e95726…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 3 15:54:11 2021 +0100 ntdll: Use xsave compaction in syscall dispatcher. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_i386.c | 56 ++++++++++++++++++++++++++++++++++++++----- tools/winebuild/import.c | 13 +++++++++- 2 files changed, 62 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index d9d7e66ca32..655fd69ee73 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1225,17 +1225,20 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) memcpy( &xsave->u.xsave, context->ExtendedRegisters, sizeof(xsave->u.xsave) ); /* reset the current interrupt status */ xsave->u.xsave.StatusWord &= xsave->u.xsave.ControlWord | 0xff80; + xsave->xstate.mask |= XSTATE_MASK_LEGACY; } else if (flags & CONTEXT_FLOATING_POINT) { + struct syscall_xsave *xsave = get_syscall_xsave( frame ); if (cpu_info.FeatureSet & CPU_FEATURE_FXSR) { - fpu_to_fpux( &get_syscall_xsave( frame )->u.xsave, &context->FloatSave ); + fpu_to_fpux( &xsave->u.xsave, &context->FloatSave ); } else { - get_syscall_xsave( frame )->u.fsave = context->FloatSave; + xsave->u.fsave = context->FloatSave; } + xsave->xstate.mask |= XSTATE_MASK_LEGACY_FLOATING_POINT; } if ((cpu_info.FeatureSet & CPU_FEATURE_AVX) && (xs = xstate_from_context( context ))) { @@ -1323,15 +1326,53 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) } if (needed_flags & CONTEXT_FLOATING_POINT) { - if (cpu_info.FeatureSet & CPU_FEATURE_FXSR) + if (!(cpu_info.FeatureSet & CPU_FEATURE_FXSR)) + { + context->FloatSave = xsave->u.fsave; + } + else if (!xstate_compaction_enabled || + (xsave->xstate.mask & XSTATE_MASK_LEGACY_FLOATING_POINT)) + { fpux_to_fpu( &context->FloatSave, &xsave->u.xsave ); + } else - context->FloatSave = xsave->u.fsave; + { + memset( &context->FloatSave, 0, sizeof(context->FloatSave) ); + context->FloatSave.ControlWord = 0x37f; + } context->ContextFlags |= CONTEXT_FLOATING_POINT; } if (needed_flags & CONTEXT_EXTENDED_REGISTERS) { - memcpy( context->ExtendedRegisters, &xsave->u.xsave, sizeof(xsave->u.xsave) ); + XSAVE_FORMAT *xs = (XSAVE_FORMAT *)context->ExtendedRegisters; + + if (!xstate_compaction_enabled || + (xsave->xstate.mask & XSTATE_MASK_LEGACY_FLOATING_POINT)) + { + memcpy( xs, &xsave->u.xsave, FIELD_OFFSET( XSAVE_FORMAT, MxCsr )); + memcpy( xs->FloatRegisters, xsave->u.xsave.FloatRegisters, + sizeof( xs->FloatRegisters )); + } + else + { + memset( xs, 0, FIELD_OFFSET( XSAVE_FORMAT, MxCsr )); + memset( xs->FloatRegisters, 0, sizeof( xs->FloatRegisters )); + xs->ControlWord = 0x37f; + } + + if (!xstate_compaction_enabled || (xsave->xstate.mask & XSTATE_MASK_LEGACY_SSE)) + { + memcpy( xs->XmmRegisters, xsave->u.xsave.XmmRegisters, sizeof( xs->XmmRegisters )); + xs->MxCsr = xsave->u.xsave.MxCsr; + xs->MxCsr_Mask = xsave->u.xsave.MxCsr_Mask; + } + else + { + memset( xs->XmmRegisters, 0, sizeof( xs->XmmRegisters )); + xs->MxCsr = 0x1f80; + xs->MxCsr_Mask = 0x2ffff; + } + context->ContextFlags |= CONTEXT_EXTENDED_REGISTERS; } /* update the cached version of the debug registers */ @@ -2528,8 +2569,11 @@ void *signal_init_syscalls(void) { extern void __wine_syscall_dispatcher_fxsave(void) DECLSPEC_HIDDEN; extern void __wine_syscall_dispatcher_xsave(void) DECLSPEC_HIDDEN; + extern void __wine_syscall_dispatcher_xsavec(void) DECLSPEC_HIDDEN; - if (cpu_info.FeatureSet & CPU_FEATURE_XSAVE) + if (xstate_compaction_enabled) + syscall_dispatcher = __wine_syscall_dispatcher_xsavec; + else if (cpu_info.FeatureSet & CPU_FEATURE_XSAVE) syscall_dispatcher = __wine_syscall_dispatcher_xsave; else if (cpu_info.FeatureSet & CPU_FEATURE_FXSR) syscall_dispatcher = __wine_syscall_dispatcher_fxsave; diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 073ad9b10cf..b745f16db42 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1468,7 +1468,7 @@ static void output_syscall_dispatcher( int count, const char *variant ) { output( "\tfxsave (%%esp)\n" ); } - else + else if(!strcmp( variant, "_xsave" )) { output( "\tmovl %%eax,%%ecx\n "); output( "\tmovl $7,%%eax\n" ); @@ -1478,6 +1478,16 @@ static void output_syscall_dispatcher( int count, const char *variant ) output( "\txsave (%%esp)\n" ); output( "\tmovl %%ecx,%%eax\n "); } + else /* _xsavec */ + { + output( "\tmovl %%eax,%%ecx\n "); + output( "\tmovl $7,%%eax\n" ); + output( "\txorl %%edx,%%edx\n" ); + for (i = 0; i < 16; i++) + output( "\tmovl %%edx,0x%x(%%esp)\n", 0x200 + i * 4 ); + output( "\txsavec (%%esp)\n" ); + output( "\tmovl %%ecx,%%eax\n "); + } output( "\tleal -0x30(%%ebp),%%ecx\n" ); output( "\tmovl %%ecx,%%fs:0x1f8\n" ); /* x86_thread_data()->syscall_frame */ output( "\tcmpl $%u,%%eax\n", count ); @@ -1837,6 +1847,7 @@ void output_syscalls( DLLSPEC *spec ) case CPU_x86: output_syscall_dispatcher( count, "_fxsave" ); output_syscall_dispatcher( count, "_xsave" ); + output_syscall_dispatcher( count, "_xsavec" ); break; case CPU_x86_64: output_syscall_dispatcher( count, "_xsave" );
1
0
0
0
Jacek Caban : ntdll: Fix a typo in SegSs handling in NtSetContextThread.
by Alexandre Julliard
03 Mar '21
03 Mar '21
Module: wine Branch: master Commit: c7152431225d86dbf7144cd091fce062eab992b1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c7152431225d86dbf7144cd0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 3 15:54:06 2021 +0100 ntdll: Fix a typo in SegSs handling in NtSetContextThread. Spotted by Brendan Shanks. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_i386.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 9e97fd9e298..d9d7e66ca32 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1310,7 +1310,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) context->Eip = frame->eip; context->EFlags = frame->eflags; context->SegCs = frame->cs; - context->SegSs = frame->ds; + context->SegSs = frame->ss; context->ContextFlags |= CONTEXT_CONTROL; } if (needed_flags & CONTEXT_SEGMENTS)
1
0
0
0
Huw Davies : winecoreaudio: Cast enums to ints when printing.
by Alexandre Julliard
03 Mar '21
03 Mar '21
Module: wine Branch: master Commit: a33c14fd443adc06045a303d118eb4d0500b5e9e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a33c14fd443adc06045a303d…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Mar 3 14:49:05 2021 +0000 winecoreaudio: Cast enums to ints when printing. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winecoreaudio.drv/mmdevdrv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index b002189e199..bc153d92511 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -1748,7 +1748,7 @@ static DWORD ca_channel_layout_to_channel_mask(const AudioChannelLayout *layout) for (i = 0; i < layout->mNumberChannelDescriptions; ++i) { switch (layout->mChannelDescriptions[i].mChannelLabel) { - default: FIXME("Unhandled channel 0x%x\n", layout->mChannelDescriptions[i].mChannelLabel); break; + default: FIXME("Unhandled channel 0x%x\n", (unsigned int)layout->mChannelDescriptions[i].mChannelLabel); break; case kAudioChannelLabel_Left: mask |= SPEAKER_FRONT_LEFT; break; case kAudioChannelLabel_Mono: case kAudioChannelLabel_Center: mask |= SPEAKER_FRONT_CENTER; break; @@ -1893,12 +1893,13 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient3 *iface, sc = AudioObjectGetPropertyData(This->adevid, &addr, 0, NULL, &size, layout); if(sc == noErr){ TRACE("Got channel layout: {tag: 0x%x, bitmap: 0x%x, num_descs: %u}\n", - layout->mChannelLayoutTag, layout->mChannelBitmap, layout->mNumberChannelDescriptions); + (unsigned int)layout->mChannelLayoutTag, (unsigned int)layout->mChannelBitmap, + (unsigned int)layout->mNumberChannelDescriptions); if(layout->mChannelLayoutTag == kAudioChannelLayoutTag_UseChannelDescriptions){ convert_channel_layout(layout, fmt); }else{ - WARN("Haven't implemented support for this layout tag: 0x%x, guessing at layout\n", layout->mChannelLayoutTag); + WARN("Haven't implemented support for this layout tag: 0x%x, guessing at layout\n", (unsigned int)layout->mChannelLayoutTag); fmt->Format.nChannels = 0; } }else{
1
0
0
0
Huw Davies : winecoreaudio: Undefine a few more items to prevent macro redefinition warnings.
by Alexandre Julliard
03 Mar '21
03 Mar '21
Module: wine Branch: master Commit: 0c2defd9cc3461e2a956a8e1840d5a224fb4d396 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0c2defd9cc3461e2a956a8e1…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Mar 3 14:49:04 2021 +0000 winecoreaudio: Undefine a few more items to prevent macro redefinition warnings. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winecoreaudio.drv/audiounit.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/winecoreaudio.drv/audiounit.c b/dlls/winecoreaudio.drv/audiounit.c index 5f20b3dcb25..a3c190870ad 100644 --- a/dlls/winecoreaudio.drv/audiounit.c +++ b/dlls/winecoreaudio.drv/audiounit.c @@ -30,6 +30,23 @@ #undef ULONG #undef HRESULT #undef STDMETHODCALLTYPE +#undef SUCCEEDED +#undef FAILED +#undef IS_ERROR +#undef HRESULT_FACILITY +#undef MAKE_HRESULT +#undef S_OK +#undef S_FALSE +#undef E_UNEXPECTED +#undef E_NOTIMPL +#undef E_OUTOFMEMORY +#undef E_INVALIDARG +#undef E_NOINTERFACE +#undef E_POINTER +#undef E_HANDLE +#undef E_ABORT +#undef E_FAIL +#undef E_ACCESSDENIED #include "coreaudio.h" #include "wine/debug.h"
1
0
0
0
Giovanni Mascellani : dwrite: Do not segfault when there are no typographic features to return.
by Alexandre Julliard
03 Mar '21
03 Mar '21
Module: wine Branch: master Commit: 65f5033702780ce355749b09644df57c5305db33 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=65f5033702780ce355749b09…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Wed Mar 3 15:25:28 2021 +0100 dwrite: Do not segfault when there are no typographic features to return. Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/shape.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/dwrite/shape.c b/dlls/dwrite/shape.c index 6428bf6ceb0..abeb7eeac79 100644 --- a/dlls/dwrite/shape.c +++ b/dlls/dwrite/shape.c @@ -372,6 +372,12 @@ HRESULT shape_get_typographic_features(struct scriptshaping_context *context, co shape_get_script_lang_index(context, scripts, MS_GPOS_TAG, &script_index, &language_index); opentype_get_typographic_features(&context->cache->gpos, script_index, language_index, &t); + if (t.count == 0) + { + *actual_tagcount = 0; + return S_OK; + } + /* Sort and remove duplicates. */ qsort(t.tags, t.count, sizeof(*t.tags), tag_array_sorting_compare);
1
0
0
0
Nikolay Sivov : dwrite: Implement set builder methods that don't specify font properties.
by Alexandre Julliard
03 Mar '21
03 Mar '21
Module: wine Branch: master Commit: eac1ca616d7723e19e8c82378c2a1876f27cf7c9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=eac1ca616d7723e19e8c8237…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Mar 3 15:30:44 2021 +0300 dwrite: Implement set builder methods that don't specify font properties. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/font.c | 93 ++++++++++++++++++++++++++++++++++++++++++++---- dlls/dwrite/tests/font.c | 3 -- 2 files changed, 87 insertions(+), 9 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index ac8f5c0a7bb..bbd73f734de 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -250,11 +250,22 @@ struct dwrite_fontresource IDWriteFactory7 *factory; }; +struct dwrite_fontset_entry +{ + IDWriteFontFile *file; + unsigned int face_index; + unsigned int simulations; +}; + struct dwrite_fontset_builder { IDWriteFontSetBuilder2 IDWriteFontSetBuilder2_iface; LONG refcount; IDWriteFactory7 *factory; + + struct dwrite_fontset_entry *entries; + size_t count; + size_t capacity; }; static void dwrite_grab_font_table(void *context, UINT32 table, const BYTE **data, UINT32 *size, void **data_context) @@ -7103,18 +7114,65 @@ static ULONG WINAPI dwritefontsetbuilder_Release(IDWriteFontSetBuilder2 *iface) { struct dwrite_fontset_builder *builder = impl_from_IDWriteFontSetBuilder2(iface); ULONG refcount = InterlockedDecrement(&builder->refcount); + size_t i; TRACE("%p, refcount %u.\n", iface, refcount); if (!refcount) { IDWriteFactory7_Release(builder->factory); + for (i = 0; i < builder->count; ++i) + IDWriteFontFile_Release(builder->entries[i].file); + heap_free(builder->entries); heap_free(builder); } return refcount; } +static HRESULT fontset_builder_add_entry(struct dwrite_fontset_builder *builder, IDWriteFontFile *file, + unsigned int face_index, unsigned int simulations) +{ + struct dwrite_fontset_entry *entry; + + if (!dwrite_array_reserve((void **)&builder->entries, &builder->capacity, builder->count + 1, + sizeof(*builder->entries))) + { + return E_OUTOFMEMORY; + } + + entry = &builder->entries[builder->count++]; + entry->file = file; + IDWriteFontFile_AddRef(entry->file); + entry->face_index = face_index; + entry->simulations = simulations; + + return S_OK; +} + +static HRESULT fontset_builder_add_file(struct dwrite_fontset_builder *builder, IDWriteFontFile *file) +{ + DWRITE_FONT_FILE_TYPE filetype; + DWRITE_FONT_FACE_TYPE facetype; + unsigned int i, face_count; + BOOL supported = FALSE; + HRESULT hr; + + if (FAILED(hr = IDWriteFontFile_Analyze(file, &supported, &filetype, &facetype, &face_count))) + return hr; + + if (!supported) + return DWRITE_E_FILEFORMAT; + + for (i = 0; i < face_count; ++i) + { + if (FAILED(hr = fontset_builder_add_entry(builder, file, i, DWRITE_FONT_SIMULATIONS_NONE))) + break; + } + + return hr; +} + static HRESULT WINAPI dwritefontsetbuilder_AddFontFaceReference_(IDWriteFontSetBuilder2 *iface, IDWriteFontFaceReference *ref, DWRITE_FONT_PROPERTY const *props, UINT32 prop_count) { @@ -7126,9 +7184,21 @@ static HRESULT WINAPI dwritefontsetbuilder_AddFontFaceReference_(IDWriteFontSetB static HRESULT WINAPI dwritefontsetbuilder_AddFontFaceReference(IDWriteFontSetBuilder2 *iface, IDWriteFontFaceReference *ref) { - FIXME("%p, %p.\n", iface, ref); + struct dwrite_fontset_builder *builder = impl_from_IDWriteFontSetBuilder2(iface); + unsigned int face_index, simulations; + IDWriteFontFile *file; + HRESULT hr; - return E_NOTIMPL; + TRACE("%p, %p.\n", iface, ref); + + if (FAILED(hr = IDWriteFontFaceReference_GetFontFile(ref, &file))) return hr; + + face_index = IDWriteFontFaceReference_GetFontFaceIndex(ref); + simulations = IDWriteFontFaceReference_GetSimulations(ref); + hr = fontset_builder_add_entry(builder, file, face_index, simulations); + IDWriteFontFile_Release(file); + + return hr; } static HRESULT WINAPI dwritefontsetbuilder_AddFontSet(IDWriteFontSetBuilder2 *iface, IDWriteFontSet *fontset) @@ -7147,9 +7217,11 @@ static HRESULT WINAPI dwritefontsetbuilder_CreateFontSet(IDWriteFontSetBuilder2 static HRESULT WINAPI dwritefontsetbuilder1_AddFontFile(IDWriteFontSetBuilder2 *iface, IDWriteFontFile *file) { - FIXME("%p, %p.\n", iface, file); + struct dwrite_fontset_builder *builder = impl_from_IDWriteFontSetBuilder2(iface); - return E_NOTIMPL; + TRACE("%p, %p.\n", iface, file); + + return fontset_builder_add_file(builder, file); } static HRESULT WINAPI dwritefontsetbuilder2_AddFont(IDWriteFontSetBuilder2 *iface, IDWriteFontFile *file, @@ -7165,9 +7237,18 @@ static HRESULT WINAPI dwritefontsetbuilder2_AddFont(IDWriteFontSetBuilder2 *ifac static HRESULT WINAPI dwritefontsetbuilder2_AddFontFile(IDWriteFontSetBuilder2 *iface, const WCHAR *filepath) { - FIXME("%p, %s.\n", iface, debugstr_w(filepath)); + struct dwrite_fontset_builder *builder = impl_from_IDWriteFontSetBuilder2(iface); + IDWriteFontFile *file; + HRESULT hr; - return E_NOTIMPL; + TRACE("%p, %s.\n", iface, debugstr_w(filepath)); + + if (FAILED(hr = IDWriteFactory7_CreateFontFileReference(builder->factory, filepath, NULL, &file))) + return hr; + + hr = fontset_builder_add_file(builder, file); + IDWriteFontFile_Release(file); + return hr; } static const IDWriteFontSetBuilder2Vtbl fontsetbuildervtbl = diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 24ad30bc845..c377f20556b 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -9394,11 +9394,9 @@ static void test_fontsetbuilder(void) ok(hr == S_OK, "Unexpected hr %#x.\n",hr); hr = IDWriteFontSetBuilder1_AddFontFile(builder1, file); - todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n",hr); hr = IDWriteFontSetBuilder1_AddFontFile(builder1, file); - todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n",hr); hr = IDWriteFontSetBuilder1_CreateFontSet(builder1, &fontset); @@ -9451,7 +9449,6 @@ static void test_fontsetbuilder(void) EXPECT_REF(ref, 1); hr = IDWriteFontSetBuilder_AddFontFaceReference(builder, ref); - todo_wine ok(hr == S_OK, "Failed to add fontface reference, hr %#x.\n", hr); EXPECT_REF(ref, 1);
1
0
0
0
Nikolay Sivov : dwrite/tests: Add more tests for font sets.
by Alexandre Julliard
03 Mar '21
03 Mar '21
Module: wine Branch: master Commit: 1aa26bfe94d0b22fd830afdafafd5fd3d544b4a0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1aa26bfe94d0b22fd830afda…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Mar 3 15:30:43 2021 +0300 dwrite/tests: Add more tests for font sets. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/tests/font.c | 165 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 159 insertions(+), 6 deletions(-) diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index d7ced109a2f..24ad30bc845 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -124,7 +124,7 @@ static void _expect_ref_broken(IUnknown* obj, ULONG ref, ULONG brokenref, int li static BOOL (WINAPI *pGetFontRealizationInfo)(HDC hdc, void *); -static const WCHAR test_fontfile[] = {'w','i','n','e','_','t','e','s','t','_','f','o','n','t','.','t','t','f',0}; +static const WCHAR test_fontfile[] = L"wine_test_font.ttf"; /* PANOSE is 10 bytes in size, need to pack the structure properly */ #include "pshpack2.h" @@ -9363,10 +9363,15 @@ static void test_AnalyzeContainerType(void) static void test_fontsetbuilder(void) { + IDWriteFontFaceReference *ref, *ref2, *ref3; IDWriteFontCollection1 *collection; + IDWriteFontSetBuilder1 *builder1; IDWriteFontSetBuilder *builder; IDWriteFactory3 *factory; - UINT32 count, i, ref; + UINT32 count, i, refcount; + IDWriteFontSet *fontset; + IDWriteFontFile *file; + WCHAR *path; HRESULT hr; factory = create_factory_iid(&IID_IDWriteFactory3); @@ -9380,6 +9385,40 @@ static void test_fontsetbuilder(void) hr = IDWriteFactory3_CreateFontSetBuilder(factory, &builder); ok(hr == S_OK, "Failed to create font set builder, hr %#x.\n", hr); EXPECT_REF(factory, 2); + + if (SUCCEEDED(hr = IDWriteFontSetBuilder_QueryInterface(builder, &IID_IDWriteFontSetBuilder1, (void **)&builder1))) + { + path = create_testfontfile(test_fontfile); + + hr = IDWriteFactory3_CreateFontFileReference(factory, path, NULL, &file); + ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + + hr = IDWriteFontSetBuilder1_AddFontFile(builder1, file); + todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + + hr = IDWriteFontSetBuilder1_AddFontFile(builder1, file); + todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + + hr = IDWriteFontSetBuilder1_CreateFontSet(builder1, &fontset); + todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n",hr); + + if (SUCCEEDED(hr)) + { + /* No attempt to eliminate duplicates. */ + count = IDWriteFontSet_GetFontCount(fontset); + ok(count == 2, "Unexpected font count %u.\n", count); + + IDWriteFontSet_Release(fontset); + } + + IDWriteFontFile_Release(file); + IDWriteFontSetBuilder1_Release(builder1); + } + else + win_skip("IDWriteFontSetBuilder1 is not available.\n"); IDWriteFontSetBuilder_Release(builder); hr = IDWriteFactory3_GetSystemFontCollection(factory, FALSE, &collection, FALSE); @@ -9395,8 +9434,8 @@ static void test_fontsetbuilder(void) ok(hr == S_OK, "Failed to get family, hr %#x.\n", hr); fontcount = IDWriteFontFamily1_GetFontCount(family); - for (j = 0; j < fontcount; j++) { - IDWriteFontFaceReference *ref, *ref2; + for (j = 0; j < fontcount; ++j) + { IDWriteFontSet *fontset; UINT32 setcount, id; @@ -9428,6 +9467,12 @@ static void test_fontsetbuilder(void) hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &ref2); ok(hr == S_OK, "Failed to get font face reference, hr %#x.\n", hr); ok(ref2 != ref, "Unexpected reference.\n"); + + hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &ref3); + ok(hr == S_OK, "Failed to get font face reference, hr %#x.\n", hr); + ok(ref2 != ref3, "Unexpected reference.\n"); + + IDWriteFontFaceReference_Release(ref3); IDWriteFontFaceReference_Release(ref2); for (id = DWRITE_FONT_PROPERTY_ID_FAMILY_NAME; id < DWRITE_FONT_PROPERTY_ID_TOTAL; ++id) @@ -9499,8 +9544,8 @@ static void test_fontsetbuilder(void) IDWriteFontCollection1_Release(collection); - ref = IDWriteFactory3_Release(factory); - ok(ref == 0, "factory not released, %u\n", ref); + refcount = IDWriteFactory3_Release(factory); + ok(!refcount, "Factory not released, %u.\n", refcount); } static void test_font_resource(void) @@ -9805,6 +9850,112 @@ static void test_GetVerticalGlyphVariants(void) ok(!refcount, "Factory not released, refcount %u.\n", refcount); } +static HANDLE get_collection_expiration_event(IDWriteFontCollection *collection) +{ + IDWriteFontCollection3 *collection3; + HANDLE event; + HRESULT hr; + + hr = IDWriteFontCollection_QueryInterface(collection, &IID_IDWriteFontCollection3, (void **)&collection3); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + event = IDWriteFontCollection3_GetExpirationEvent(collection3); + IDWriteFontCollection3_Release(collection3); + + return event; +} + +static void test_expiration_event(void) +{ + IDWriteFontCollection *collection, *collection2; + IDWriteFontCollection3 *collection3; + IDWriteFactory *factory, *factory2; + unsigned int refcount; + HANDLE event, event2; + HRESULT hr; + + factory = create_factory(); + + hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = IDWriteFontCollection_QueryInterface(collection, &IID_IDWriteFontCollection3, (void **)&collection3); + if (FAILED(hr)) + { + win_skip("Expiration events are not supported.\n"); + IDWriteFontCollection_Release(collection); + IDWriteFactory_Release(factory); + return; + } + IDWriteFontCollection3_Release(collection3); + + event = get_collection_expiration_event(collection); +todo_wine + ok(!!event, "Unexpected event handle.\n"); + + /* Compare handles with another isolated factory. */ + factory2 = create_factory(); + + hr = IDWriteFactory_GetSystemFontCollection(factory2, &collection2, FALSE); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + event2 = get_collection_expiration_event(collection2); +todo_wine { + ok(!!event2, "Unexpected event handle.\n"); + ok(event != event2, "Unexpected event handle.\n"); +} + IDWriteFontCollection_Release(collection2); + + IDWriteFontCollection_Release(collection); + + refcount = IDWriteFactory_Release(factory2); + ok(!refcount, "Unexpected factory refcount %u.\n", refcount); + refcount = IDWriteFactory_Release(factory); + ok(!refcount, "Unexpected factory refcount %u.\n", refcount); +} + +static void test_family_font_set(void) +{ + IDWriteFontCollection *collection; + IDWriteFontFamily2 *family2; + IDWriteFontFamily *family; + IDWriteFactory *factory; + unsigned int refcount; + IDWriteFontSet1 *fontset, *fontset2; + HRESULT hr; + + factory = create_factory(); + + hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = IDWriteFontCollection_GetFontFamily(collection, 0, &family); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + if (SUCCEEDED(IDWriteFontFamily_QueryInterface(family, &IID_IDWriteFontFamily2, (void **)&family2))) + { + hr = IDWriteFontFamily2_GetFontSet(family2, &fontset); + todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IDWriteFontFamily2_GetFontSet(family2, &fontset2); + todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + { + ok(fontset != fontset2, "Unexpected fontset instance.\n"); + IDWriteFontSet1_Release(fontset2); + IDWriteFontSet1_Release(fontset); + } + IDWriteFontFamily2_Release(family2); + } + else + win_skip("IDWriteFontFamily2 is not supported.\n"); + + IDWriteFontFamily_Release(family); + IDWriteFontCollection_Release(collection); + + refcount = IDWriteFactory_Release(factory); + ok(!refcount, "Unexpected factory refcount %u.\n", refcount); +} + START_TEST(font) { IDWriteFactory *factory; @@ -9875,6 +10026,8 @@ START_TEST(font) test_font_resource(); test_IsColorFont(); test_GetVerticalGlyphVariants(); + test_expiration_event(); + test_family_font_set(); IDWriteFactory_Release(factory); }
1
0
0
0
Paul Gofman : ntdll: Reset YMM state in NtSetContextThread() if that is assumed by the context being set.
by Alexandre Julliard
03 Mar '21
03 Mar '21
Module: wine Branch: master Commit: 633db76f781cc804c63e9ca68ff6a8327af84d11 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=633db76f781cc804c63e9ca6…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Mar 3 14:55:00 2021 +0300 ntdll: Reset YMM state in NtSetContextThread() if that is assumed by the context being set. Fixes test failure on testbot where compaction is not supported (resetting YMM state if that is implied by the context being set). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_i386.c | 2 +- dlls/ntdll/unix/signal_x86_64.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 0153f772b6d..9e97fd9e298 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -1254,7 +1254,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) xsave->xstate.mask |= XSTATE_MASK_GSSE; memcpy( &xsave->xstate.ymm_high, &xs->YmmContext, sizeof(xsave->xstate.ymm_high) ); } - else if (xs->CompactionMask & XSTATE_MASK_GSSE) + else xsave->xstate.mask &= ~XSTATE_MASK_GSSE; } diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index e62e958b4aa..2a030372fb7 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -1864,7 +1864,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) xsave->xstate.Mask |= XSTATE_MASK_GSSE; memcpy( &xsave->xstate.YmmContext, &xs->YmmContext, sizeof(xs->YmmContext) ); } - else if (xs->CompactionMask & XSTATE_MASK_GSSE) + else xsave->xstate.Mask &= ~XSTATE_MASK_GSSE; } return STATUS_SUCCESS;
1
0
0
0
Huw Davies : riched20: The text host should create the text services object.
by Alexandre Julliard
03 Mar '21
03 Mar '21
Module: wine Branch: master Commit: 9b7261d995f780332389688449f1b6cc3733a4cf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9b7261d995f7803323896884…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Mar 3 11:29:41 2021 +0000 riched20: The text host should create the text services object. For now, we hold on to the editor too; this will eventually go away. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/editor.h | 3 +++ dlls/riched20/txthost.c | 30 +++++++++++++++++----------- dlls/riched20/txtsrv.c | 53 ++++++++++++++++++++++++++----------------------- 3 files changed, 49 insertions(+), 37 deletions(-) diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index e226bc02921..38d99f4351a 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -377,6 +377,9 @@ BOOL ME_Undo(ME_TextEditor *editor) DECLSPEC_HIDDEN; BOOL ME_Redo(ME_TextEditor *editor) DECLSPEC_HIDDEN; void ME_EmptyUndoStack(ME_TextEditor *editor) DECLSPEC_HIDDEN; +/* txtsrv.c */ +HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **unk, BOOL emulate_10, ME_TextEditor **editor ) DECLSPEC_HIDDEN; + /* writer.c */ LRESULT ME_StreamOutRange(ME_TextEditor *editor, DWORD dwFormat, const ME_Cursor *start, int nChars, EDITSTREAM *stream) DECLSPEC_HIDDEN; LRESULT ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream) DECLSPEC_HIDDEN; diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c index d0b43add364..1da34555352 100644 --- a/dlls/riched20/txthost.c +++ b/dlls/riched20/txthost.c @@ -36,6 +36,8 @@ struct host { ITextHost ITextHost_iface; LONG ref; + ITextServices *text_srv; + ME_TextEditor *editor; /* to be removed */ HWND window; BOOL emulate_10; PARAFORMAT2 para_fmt; @@ -46,7 +48,7 @@ static const ITextHostVtbl textHostVtbl; static BOOL listbox_registered; static BOOL combobox_registered; -static ITextHost *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10 ) +struct host *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10 ) { struct host *texthost; @@ -66,7 +68,7 @@ static ITextHost *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10 ) if (cs->style & ES_CENTER) texthost->para_fmt.wAlignment = PFA_CENTER; - return &texthost->ITextHost_iface; + return texthost; } static inline struct host *impl_from_ITextHost( ITextHost *iface ) @@ -104,6 +106,7 @@ static ULONG WINAPI ITextHostImpl_Release(ITextHost *iface) if (!ref) { SetWindowLongPtrW( host->window, 0, 0 ); + ITextServices_Release( host->text_srv ); CoTaskMemFree( host ); } return ref; @@ -723,24 +726,27 @@ static const char *get_msg_name( UINT msg ) static BOOL create_windowed_editor( HWND hwnd, CREATESTRUCTW *create, BOOL emulate_10 ) { - ITextHost *host = host_create( hwnd, create, emulate_10 ); - ME_TextEditor *editor; + struct host *host = host_create( hwnd, create, emulate_10 ); + IUnknown *unk; + HRESULT hr; if (!host) return FALSE; - editor = ME_MakeEditor( host, emulate_10 ); - if (!editor) + hr = create_text_services( NULL, &host->ITextHost_iface, &unk, emulate_10, &host->editor ); + if (FAILED( hr )) { - ITextHost_Release( host ); + ITextHost_Release( &host->ITextHost_iface ); return FALSE; } + IUnknown_QueryInterface( unk, &IID_ITextServices, (void **)&host->text_srv ); + IUnknown_Release( unk ); - editor->exStyleFlags = GetWindowLongW( hwnd, GWL_EXSTYLE ); - editor->styleFlags |= GetWindowLongW( hwnd, GWL_STYLE ) & ES_WANTRETURN; - editor->hWnd = hwnd; /* FIXME: Remove editor's dependence on hWnd */ - editor->hwndParent = create->hwndParent; + host->editor->exStyleFlags = GetWindowLongW( hwnd, GWL_EXSTYLE ); + host->editor->styleFlags |= GetWindowLongW( hwnd, GWL_STYLE ) & ES_WANTRETURN; + host->editor->hWnd = hwnd; /* FIXME: Remove editor's dependence on hWnd */ + host->editor->hwndParent = create->hwndParent; - SetWindowLongPtrW( hwnd, 0, (LONG_PTR)editor ); + SetWindowLongPtrW( hwnd, 0, (LONG_PTR)host->editor ); return TRUE; } diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c index fc8d6765424..3d0eec6f769 100644 --- a/dlls/riched20/txtsrv.c +++ b/dlls/riched20/txtsrv.c @@ -368,33 +368,36 @@ static const ITextServicesVtbl textservices_vtbl = THISCALL(fnTextSrv_TxGetCachedSize) }; +HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **unk, BOOL emulate_10, + ME_TextEditor **editor ) +{ + struct text_services *services; + + TRACE( "%p %p --> %p\n", outer, text_host, unk ); + if (text_host == NULL) return E_POINTER; + + services = CoTaskMemAlloc( sizeof(*services) ); + if (services == NULL) return E_OUTOFMEMORY; + InitializeCriticalSection( &services->csTxtSrv ); + services->csTxtSrv.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ITextServicesImpl.csTxtSrv"); + services->ref = 1; + services->host = text_host; /* Don't take a ref of the host - this would lead to a mutual dependency */ + services->IUnknown_inner.lpVtbl = &textservices_inner_vtbl; + services->ITextServices_iface.lpVtbl = &textservices_vtbl; + services->editor = ME_MakeEditor( text_host, emulate_10 ); + if (editor) *editor = services->editor; /* To be removed */ + + if (outer) services->outer_unk = outer; + else services->outer_unk = &services->IUnknown_inner; + + *unk = &services->IUnknown_inner; + return S_OK; +} + /****************************************************************** * CreateTextServices (RICHED20.4) */ -HRESULT WINAPI CreateTextServices(IUnknown *pUnkOuter, ITextHost *pITextHost, IUnknown **ppUnk) +HRESULT WINAPI CreateTextServices( IUnknown *outer, ITextHost *text_host, IUnknown **unk ) { - struct text_services *ITextImpl; - - TRACE("%p %p --> %p\n", pUnkOuter, pITextHost, ppUnk); - if (pITextHost == NULL) - return E_POINTER; - - ITextImpl = CoTaskMemAlloc(sizeof(*ITextImpl)); - if (ITextImpl == NULL) - return E_OUTOFMEMORY; - InitializeCriticalSection(&ITextImpl->csTxtSrv); - ITextImpl->csTxtSrv.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ITextServicesImpl.csTxtSrv"); - ITextImpl->ref = 1; - ITextImpl->host = pITextHost; /* Don't take a ref of the host - this would lead to a mutual dependency */ - ITextImpl->IUnknown_inner.lpVtbl = &textservices_inner_vtbl; - ITextImpl->ITextServices_iface.lpVtbl = &textservices_vtbl; - ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE); - - if (pUnkOuter) - ITextImpl->outer_unk = pUnkOuter; - else - ITextImpl->outer_unk = &ITextImpl->IUnknown_inner; - - *ppUnk = &ITextImpl->IUnknown_inner; - return S_OK; + return create_text_services( outer, text_host, unk, FALSE, NULL ); }
1
0
0
0
Huw Davies : riched20: Don't take a ref on the text host.
by Alexandre Julliard
03 Mar '21
03 Mar '21
Module: wine Branch: master Commit: 68523af9b0970ca5b1829186ff081aba2a8c997a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=68523af9b0970ca5b1829186…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Mar 3 11:29:40 2021 +0000 riched20: Don't take a ref on the text host. This would result in the host and services objects holding refs on each other. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/editor.c | 1 - dlls/riched20/tests/txtsrv.c | 1 + dlls/riched20/txtsrv.c | 5 ++--- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 487d4137391..516cd104d31 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -3221,7 +3221,6 @@ void ME_DestroyEditor(ME_TextEditor *editor) DeleteObject(editor->hbrBackground); if(editor->lpOleCallback) IRichEditOleCallback_Release(editor->lpOleCallback); - ITextHost_Release(editor->texthost); if (editor->reOle) { IUnknown_Release(editor->reOle); diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c index 1528bef5238..f41375d871a 100644 --- a/dlls/riched20/tests/txtsrv.c +++ b/dlls/riched20/tests/txtsrv.c @@ -602,6 +602,7 @@ static BOOL init_texthost(ITextServices **txtserv, ITextHost **ret) ITextServices object. */ result = pCreateTextServices(NULL, &dummyTextHost->ITextHost_iface, &init); ok(result == S_OK, "Did not return S_OK when created (result = %x)\n", result); + ok(dummyTextHost->refCount == 1, "host ref %d\n", dummyTextHost->refCount); if (result != S_OK) { CoTaskMemFree(dummyTextHost); win_skip("CreateTextServices failed.\n"); diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c index 6f8e3cd3fa3..fc8d6765424 100644 --- a/dlls/riched20/txtsrv.c +++ b/dlls/riched20/txtsrv.c @@ -38,7 +38,7 @@ struct text_services ITextServices ITextServices_iface; IUnknown *outer_unk; LONG ref; - ITextHost *pMyHost; + ITextHost *host; CRITICAL_SECTION csTxtSrv; ME_TextEditor *editor; char spare[256]; @@ -385,8 +385,7 @@ HRESULT WINAPI CreateTextServices(IUnknown *pUnkOuter, ITextHost *pITextHost, I InitializeCriticalSection(&ITextImpl->csTxtSrv); ITextImpl->csTxtSrv.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ITextServicesImpl.csTxtSrv"); ITextImpl->ref = 1; - ITextHost_AddRef(pITextHost); - ITextImpl->pMyHost = pITextHost; + ITextImpl->host = pITextHost; /* Don't take a ref of the host - this would lead to a mutual dependency */ ITextImpl->IUnknown_inner.lpVtbl = &textservices_inner_vtbl; ITextImpl->ITextServices_iface.lpVtbl = &textservices_vtbl; ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE);
1
0
0
0
← Newer
1
...
99
100
101
102
103
104
105
...
117
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200