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 2023
----- 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
633 discussions
Start a n
N
ew thread
Rémi Bernon : winegstreamer: Lazily allocate wg_allocator unix memory.
by Alexandre Julliard
19 Jun '23
19 Jun '23
Module: wine Branch: master Commit: c47c4d54bdf9a0f2100045fb6bc163291960fa05 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c47c4d54bdf9a0f2100045fb6bc163…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Jun 17 10:50:10 2023 +0200 winegstreamer: Lazily allocate wg_allocator unix memory. --- dlls/winegstreamer/wg_allocator.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/dlls/winegstreamer/wg_allocator.c b/dlls/winegstreamer/wg_allocator.c index 1edd27a0fd4..629546b237c 100644 --- a/dlls/winegstreamer/wg_allocator.c +++ b/dlls/winegstreamer/wg_allocator.c @@ -40,6 +40,7 @@ typedef struct GstMemory parent; struct list entry; + GstAllocationParams alloc_params; GstMemory *unix_memory; GstMapInfo unix_map_info; @@ -65,6 +66,19 @@ typedef struct G_DEFINE_TYPE(WgAllocator, wg_allocator, GST_TYPE_ALLOCATOR); +static void *get_unix_memory_data(WgMemory *memory) +{ + if (!memory->unix_memory) + { + memory->unix_memory = gst_allocator_alloc(NULL, memory->parent.maxsize, &memory->alloc_params); + gst_memory_map(memory->unix_memory, &memory->unix_map_info, GST_MAP_WRITE); + GST_INFO("Allocated unix memory %p, data %p for memory %p, sample %p", memory->unix_memory, + memory->unix_map_info.data, memory, memory->sample); + } + + return memory->unix_map_info.data; +} + static void release_memory_sample(WgAllocator *allocator, WgMemory *memory, bool discard_data) { struct wg_sample *sample; @@ -82,7 +96,7 @@ static void release_memory_sample(WgAllocator *allocator, WgMemory *memory, bool if (memory->written && !discard_data) { GST_WARNING("Copying %#zx bytes from sample %p, back to memory %p", memory->written, sample, memory); - memcpy(memory->unix_map_info.data, memory->sample->data, memory->written); + memcpy(get_unix_memory_data(memory), memory->sample->data, memory->written); } memory->sample = NULL; @@ -102,7 +116,7 @@ static gpointer wg_allocator_map(GstMemory *gst_memory, GstMapInfo *info, gsize pthread_mutex_lock(&allocator->mutex); if (!memory->sample) - info->data = memory->unix_map_info.data; + info->data = get_unix_memory_data(memory); else { InterlockedIncrement(&memory->sample->refcount); @@ -177,8 +191,7 @@ static GstMemory *wg_allocator_alloc(GstAllocator *gst_allocator, gsize size, memory = g_slice_new0(WgMemory); gst_memory_init(GST_MEMORY_CAST(memory), 0, GST_ALLOCATOR_CAST(allocator), NULL, size, 0, 0, size); - memory->unix_memory = gst_allocator_alloc(NULL, size, params); - gst_memory_map(memory->unix_memory, &memory->unix_map_info, GST_MAP_WRITE); + memory->alloc_params = *params; pthread_mutex_lock(&allocator->mutex); @@ -186,14 +199,13 @@ static GstMemory *wg_allocator_alloc(GstAllocator *gst_allocator, gsize size, if (memory->sample && memory->sample->max_size >= size) allocator->next_sample = NULL; else - memory->sample = NULL; + release_memory_sample(allocator, memory, true); list_add_tail(&allocator->memory_list, &memory->entry); pthread_mutex_unlock(&allocator->mutex); - GST_INFO("Allocated memory %p, sample %p, unix_memory %p, data %p", memory, - memory->sample, memory->unix_memory, memory->unix_map_info.data); + GST_INFO("Allocated memory %p, sample %p", memory, memory->sample); return (GstMemory *)memory; } @@ -214,8 +226,11 @@ static void wg_allocator_free(GstAllocator *gst_allocator, GstMemory *gst_memory pthread_mutex_unlock(&allocator->mutex); - gst_memory_unmap(memory->unix_memory, &memory->unix_map_info); - gst_memory_unref(memory->unix_memory); + if (memory->unix_memory) + { + gst_memory_unmap(memory->unix_memory, &memory->unix_map_info); + gst_memory_unref(memory->unix_memory); + } g_slice_free(WgMemory, memory); }
1
0
0
0
Rémi Bernon : winegstreamer: Move release_memory_sample helper around.
by Alexandre Julliard
19 Jun '23
19 Jun '23
Module: wine Branch: master Commit: ca03b68cf47beec4a97004322b6e87d83bf1dc14 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ca03b68cf47beec4a97004322b6e87…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Jun 17 10:49:55 2023 +0200 winegstreamer: Move release_memory_sample helper around. --- dlls/winegstreamer/wg_allocator.c | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/dlls/winegstreamer/wg_allocator.c b/dlls/winegstreamer/wg_allocator.c index fd940d5961e..1edd27a0fd4 100644 --- a/dlls/winegstreamer/wg_allocator.c +++ b/dlls/winegstreamer/wg_allocator.c @@ -65,6 +65,30 @@ typedef struct G_DEFINE_TYPE(WgAllocator, wg_allocator, GST_TYPE_ALLOCATOR); +static void release_memory_sample(WgAllocator *allocator, WgMemory *memory, bool discard_data) +{ + struct wg_sample *sample; + + if (!(sample = memory->sample)) + return; + + while (sample->refcount > 1) + { + GST_WARNING("Waiting for sample %p to be unmapped", sample); + pthread_cond_wait(&allocator->release_cond, &allocator->mutex); + } + InterlockedDecrement(&sample->refcount); + + if (memory->written && !discard_data) + { + GST_WARNING("Copying %#zx bytes from sample %p, back to memory %p", memory->written, sample, memory); + memcpy(memory->unix_map_info.data, memory->sample->data, memory->written); + } + + memory->sample = NULL; + GST_INFO("Released sample %p from memory %p", sample, memory); +} + static gpointer wg_allocator_map(GstMemory *gst_memory, GstMapInfo *info, gsize maxsize) { WgAllocator *allocator = (WgAllocator *)gst_memory->allocator; @@ -217,30 +241,6 @@ GstAllocator *wg_allocator_create(void) return GST_ALLOCATOR(allocator); } -static void release_memory_sample(WgAllocator *allocator, WgMemory *memory, bool discard_data) -{ - struct wg_sample *sample; - - if (!(sample = memory->sample)) - return; - - while (sample->refcount > 1) - { - GST_WARNING("Waiting for sample %p to be unmapped", sample); - pthread_cond_wait(&allocator->release_cond, &allocator->mutex); - } - InterlockedDecrement(&sample->refcount); - - if (memory->written && !discard_data) - { - GST_WARNING("Copying %#zx bytes from sample %p, back to memory %p", memory->written, sample, memory); - memcpy(memory->unix_map_info.data, memory->sample->data, memory->written); - } - - memory->sample = NULL; - GST_INFO("Released sample %p from memory %p", sample, memory); -} - void wg_allocator_destroy(GstAllocator *gst_allocator) { WgAllocator *allocator = (WgAllocator *)gst_allocator;
1
0
0
0
Rémi Bernon : winegstreamer: Remove the callback mechanism from wg_allocator.
by Alexandre Julliard
19 Jun '23
19 Jun '23
Module: wine Branch: master Commit: ca20e06051533aea70200e345cea6a79c072a634 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ca20e06051533aea70200e345cea6a…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Jun 17 10:46:38 2023 +0200 winegstreamer: Remove the callback mechanism from wg_allocator. --- dlls/winegstreamer/unix_private.h | 4 ++-- dlls/winegstreamer/wg_allocator.c | 37 ++++++++++++++++++++++++++----------- dlls/winegstreamer/wg_transform.c | 21 ++++----------------- 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/dlls/winegstreamer/unix_private.h b/dlls/winegstreamer/unix_private.h index 808b59dba57..f1847eb27ef 100644 --- a/dlls/winegstreamer/unix_private.h +++ b/dlls/winegstreamer/unix_private.h @@ -60,9 +60,9 @@ extern NTSTATUS wg_transform_flush(void *args) DECLSPEC_HIDDEN; /* wg_allocator_release_sample can be used to release any sample that was requested. */ typedef struct wg_sample *(*wg_allocator_request_sample_cb)(gsize size, void *context); -extern GstAllocator *wg_allocator_create(wg_allocator_request_sample_cb request_sample, - void *request_sample_context) DECLSPEC_HIDDEN; +extern GstAllocator *wg_allocator_create(void) DECLSPEC_HIDDEN; extern void wg_allocator_destroy(GstAllocator *allocator) DECLSPEC_HIDDEN; +extern void wg_allocator_provide_sample(GstAllocator *allocator, struct wg_sample *sample) DECLSPEC_HIDDEN; extern void wg_allocator_release_sample(GstAllocator *allocator, struct wg_sample *sample, bool discard_data) DECLSPEC_HIDDEN; diff --git a/dlls/winegstreamer/wg_allocator.c b/dlls/winegstreamer/wg_allocator.c index 14550ad8bcc..fd940d5961e 100644 --- a/dlls/winegstreamer/wg_allocator.c +++ b/dlls/winegstreamer/wg_allocator.c @@ -51,12 +51,11 @@ typedef struct { GstAllocator parent; - wg_allocator_request_sample_cb request_sample; - void *request_sample_context; - pthread_mutex_t mutex; pthread_cond_t release_cond; struct list memory_list; + + struct wg_sample *next_sample; } WgAllocator; typedef struct @@ -147,7 +146,6 @@ static GstMemory *wg_allocator_alloc(GstAllocator *gst_allocator, gsize size, GstAllocationParams *params) { WgAllocator *allocator = (WgAllocator *)gst_allocator; - struct wg_sample *sample; WgMemory *memory; GST_LOG("allocator %p, size %#zx, params %p", allocator, size, params); @@ -160,11 +158,11 @@ static GstMemory *wg_allocator_alloc(GstAllocator *gst_allocator, gsize size, pthread_mutex_lock(&allocator->mutex); - sample = allocator->request_sample(size, allocator->request_sample_context); - if (sample && sample->max_size < size) - InterlockedDecrement(&sample->refcount); + memory->sample = allocator->next_sample; + if (memory->sample && memory->sample->max_size >= size) + allocator->next_sample = NULL; else - memory->sample = sample; + memory->sample = NULL; list_add_tail(&allocator->memory_list, &memory->entry); @@ -209,15 +207,13 @@ static void wg_allocator_class_init(WgAllocatorClass *klass) root_class->finalize = wg_allocator_finalize; } -GstAllocator *wg_allocator_create(wg_allocator_request_sample_cb request_sample, void *request_sample_context) +GstAllocator *wg_allocator_create(void) { WgAllocator *allocator; if (!(allocator = g_object_new(wg_allocator_get_type(), NULL))) return NULL; - allocator->request_sample = request_sample; - allocator->request_sample_context = request_sample_context; return GST_ALLOCATOR(allocator); } @@ -273,6 +269,25 @@ static WgMemory *find_sample_memory(WgAllocator *allocator, struct wg_sample *sa return NULL; } +void wg_allocator_provide_sample(GstAllocator *gst_allocator, struct wg_sample *sample) +{ + WgAllocator *allocator = (WgAllocator *)gst_allocator; + struct wg_sample *previous; + + GST_LOG("allocator %p, sample %p", allocator, sample); + + if (sample) + InterlockedIncrement(&sample->refcount); + + pthread_mutex_lock(&allocator->mutex); + previous = allocator->next_sample; + allocator->next_sample = sample; + pthread_mutex_unlock(&allocator->mutex); + + if (previous) + InterlockedDecrement(&previous->refcount); +} + void wg_allocator_release_sample(GstAllocator *gst_allocator, struct wg_sample *sample, bool discard_data) { diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index d6218af04b9..01c7aad1268 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -57,7 +57,6 @@ struct wg_transform GstElement *video_flip; struct wg_format output_format; - struct wg_sample *output_wg_sample; GstAtomicQueue *output_queue; GstSample *output_sample; bool output_caps_changed; @@ -281,15 +280,6 @@ NTSTATUS wg_transform_destroy(void *args) return STATUS_SUCCESS; } -static struct wg_sample *transform_request_sample(gsize size, void *context) -{ - struct wg_transform *transform = context; - - GST_LOG("size %#zx, context %p", size, transform); - - return InterlockedExchangePointer((void **)&transform->output_wg_sample, NULL); -} - static bool wg_format_video_is_flipped(const struct wg_format *format) { return format->major_type == WG_MAJOR_TYPE_VIDEO && (format->u.video.height < 0); @@ -318,7 +308,7 @@ NTSTATUS wg_transform_create(void *args) goto out; if (!(transform->drain_query = gst_query_new_drain())) goto out; - if (!(transform->allocator = wg_allocator_create(transform_request_sample, transform))) + if (!(transform->allocator = wg_allocator_create())) goto out; transform->attrs = *params->attrs; transform->output_format = output_format; @@ -762,9 +752,7 @@ static bool get_transform_output(struct wg_transform *transform, struct wg_sampl GstBuffer *input_buffer; GstFlowReturn ret; - /* Provide the sample for transform_request_sample to pick it up */ - InterlockedIncrement(&sample->refcount); - InterlockedExchangePointer((void **)&transform->output_wg_sample, sample); + wg_allocator_provide_sample(transform->allocator, sample); while (!(transform->output_sample = gst_atomic_queue_pop(transform->output_queue)) && (input_buffer = gst_atomic_queue_pop(transform->input_queue))) @@ -773,9 +761,8 @@ static bool get_transform_output(struct wg_transform *transform, struct wg_sampl GST_WARNING("Failed to push transform input, error %d", ret); } - /* Remove the sample so transform_request_sample cannot use it */ - if (InterlockedExchangePointer((void **)&transform->output_wg_sample, NULL)) - InterlockedDecrement(&sample->refcount); + /* Remove the sample so the allocator cannot use it */ + wg_allocator_provide_sample(transform->allocator, NULL); return !!transform->output_sample; }
1
0
0
0
Rémi Bernon : winegstreamer: Remove colorimetry and chroma-site from wg_format caps.
by Alexandre Julliard
19 Jun '23
19 Jun '23
Module: wine Branch: master Commit: 59dedf2754650bd84ffa7d10c94f83b97198fed2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/59dedf2754650bd84ffa7d10c94f83…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sun Jun 18 21:46:49 2023 +0200 winegstreamer: Remove colorimetry and chroma-site from wg_format caps. They are set by default and will force color conversions we may not want in the wg_transform videoconvert. --- dlls/winegstreamer/wg_format.c | 11 ++++++++--- dlls/winegstreamer/wg_parser.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/winegstreamer/wg_format.c b/dlls/winegstreamer/wg_format.c index a579a1101d1..bd0ebf892c1 100644 --- a/dlls/winegstreamer/wg_format.c +++ b/dlls/winegstreamer/wg_format.c @@ -480,12 +480,17 @@ static GstCaps *wg_format_to_caps_video(const struct wg_format *format) { for (i = 0; i < gst_caps_get_size(caps); ++i) { + GstStructure *structure = gst_caps_get_structure(caps, i); + if (!format->u.video.width) - gst_structure_remove_fields(gst_caps_get_structure(caps, i), "width", NULL); + gst_structure_remove_fields(structure, "width", NULL); if (!format->u.video.height) - gst_structure_remove_fields(gst_caps_get_structure(caps, i), "height", NULL); + gst_structure_remove_fields(structure, "height", NULL); if (!format->u.video.fps_d && !format->u.video.fps_n) - gst_structure_remove_fields(gst_caps_get_structure(caps, i), "framerate", NULL); + gst_structure_remove_fields(structure, "framerate", NULL); + + /* Remove fields which we don't specify but might have some default value */ + gst_structure_remove_fields(structure, "colorimetry", "chroma-site", NULL); } } return caps; diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index f043c4e18b4..cb2901f484d 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -721,7 +721,7 @@ static gboolean sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) /* Clear some fields that shouldn't prevent us from connecting. */ for (i = 0; i < gst_caps_get_size(caps); ++i) gst_structure_remove_fields(gst_caps_get_structure(caps, i), - "framerate", "pixel-aspect-ratio", "colorimetry", "chroma-site", NULL); + "framerate", "pixel-aspect-ratio", NULL); str = gst_caps_to_string(caps); GST_LOG("Stream caps are \"%s\".", str);
1
0
0
0
Connor McAdams : uiautomationcore: Implement UiaEventAddWindow.
by Alexandre Julliard
19 Jun '23
19 Jun '23
Module: wine Branch: master Commit: 41f07a8a0f2efe27dc044b6d4911d8ea0c1d0f82 URL:
https://gitlab.winehq.org/wine/wine/-/commit/41f07a8a0f2efe27dc044b6d4911d8…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Fri Apr 21 14:42:48 2023 -0400 uiautomationcore: Implement UiaEventAddWindow. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 16 ++--- dlls/uiautomationcore/uia_classes.idl | 2 +- dlls/uiautomationcore/uia_client.c | 19 +++--- dlls/uiautomationcore/uia_event.c | 95 ++++++++++++++++++++++-------- 4 files changed, 88 insertions(+), 44 deletions(-) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 13f481a670e..f7f16927b38 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -13952,11 +13952,11 @@ static void test_UiaAddEvent_client_proc(void) SET_EXPECT_MULTI(prov_callback_nonclient, 2); SET_EXPECT_MULTI(prov_callback_proxy, 3); hr = UiaEventAddWindow(event, hwnd); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine CHECK_CALLED(prov_callback_base_hwnd); - todo_wine CHECK_CALLED(prov_callback_nonclient); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + CHECK_CALLED(prov_callback_base_hwnd); + CHECK_CALLED(prov_callback_nonclient); todo_wine CHECK_CALLED(prov_callback_proxy); - post_event_message(hwnd, WM_UIA_TEST_CHECK_EVENT_ADVISE_ADDED, UIA_AutomationFocusChangedEventId, PROVIDER_ID, TRUE); + post_event_message(hwnd, WM_UIA_TEST_CHECK_EVENT_ADVISE_ADDED, UIA_AutomationFocusChangedEventId, PROVIDER_ID, FALSE); /* Successfully raise event. */ GetWindowThreadProcessId(hwnd, &pid); @@ -14000,7 +14000,7 @@ static void test_UiaAddEvent_client_proc(void) hr = UiaRemoveEvent(event); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - post_event_message(hwnd, WM_UIA_TEST_CHECK_EVENT_ADVISE_REMOVED, UIA_AutomationFocusChangedEventId, PROVIDER_ID, TRUE); + post_event_message(hwnd, WM_UIA_TEST_CHECK_EVENT_ADVISE_REMOVED, UIA_AutomationFocusChangedEventId, PROVIDER_ID, FALSE); PostMessageW(hwnd, WM_UIA_TEST_RESET_EVENT_PROVIDERS, 0, 0); post_event_message(hwnd, WM_UIA_TEST_SET_EVENT_PROVIDER_DATA, HandleToUlong(hwnd), PROVIDER_ID, @@ -14093,9 +14093,9 @@ static void test_UiaAddEvent_client_proc(void) SET_EXPECT_MULTI(prov_callback_nonclient, 2); SET_EXPECT_MULTI(prov_callback_proxy, 3); hr = UiaEventAddWindow(event, hwnd); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine CHECK_CALLED(prov_callback_base_hwnd); - todo_wine CHECK_CALLED(prov_callback_nonclient); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + CHECK_CALLED(prov_callback_base_hwnd); + CHECK_CALLED(prov_callback_nonclient); todo_wine CHECK_CALLED(prov_callback_proxy); /* Wrong runtime ID, no match. */ diff --git a/dlls/uiautomationcore/uia_classes.idl b/dlls/uiautomationcore/uia_classes.idl index 651df86d9d2..25417d6c549 100644 --- a/dlls/uiautomationcore/uia_classes.idl +++ b/dlls/uiautomationcore/uia_classes.idl @@ -72,7 +72,7 @@ library UIA_wine_private ] interface IWineUiaEvent : IUnknown { - HRESULT advise_events([in]BOOL advise_added); + HRESULT advise_events([in]BOOL advise_added, [in]long adviser_start_idx); HRESULT set_event_data([in]const GUID *event_guid, [in]long scope, [in]VARIANT runtime_id, [in]IWineUiaEvent *event_iface); } diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index 6d468b68705..e5cdec27e0b 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -544,6 +544,7 @@ static HRESULT WINAPI uia_node_attach_event(IWineUiaNode *iface, long proc_id, l { struct uia_node *node = impl_from_IWineUiaNode(iface); struct uia_event *event = NULL; + int old_event_advisers_count; HRESULT hr; TRACE("%p, %ld, %ld, %p\n", node, proc_id, event_cookie, ret_event); @@ -557,6 +558,7 @@ static HRESULT WINAPI uia_node_attach_event(IWineUiaNode *iface, long proc_id, l if (hr == S_OK) *ret_event = &event->IWineUiaEvent_iface; + old_event_advisers_count = event->event_advisers_count; hr = attach_event_to_node_provider(iface, 0, (HUIAEVENT)event); if (FAILED(hr)) { @@ -575,6 +577,14 @@ static HRESULT WINAPI uia_node_attach_event(IWineUiaNode *iface, long proc_id, l event->u.serverside.node = iface; } + /* + * Pre-existing serverside event that has already had its initial + * advise call and gotten event data - if we've got new advisers, we need + * to advise them here. + */ + if (!(*ret_event) && event->event_id && (event->event_advisers_count != old_event_advisers_count)) + hr = IWineUiaEvent_advise_events(&event->IWineUiaEvent_iface, TRUE, old_event_advisers_count); + return hr; } @@ -3542,15 +3552,6 @@ exit: return hr; } -/*********************************************************************** - * UiaEventAddWindow (uiautomationcore.@) - */ -HRESULT WINAPI UiaEventAddWindow(HUIAEVENT huiaevent, HWND hwnd) -{ - FIXME("(%p, %p): stub\n", huiaevent, hwnd); - return E_NOTIMPL; -} - /*********************************************************************** * UiaEventRemoveWindow (uiautomationcore.@) */ diff --git a/dlls/uiautomationcore/uia_event.c b/dlls/uiautomationcore/uia_event.c index 2cb2cff9ae2..dd3578e7bd5 100644 --- a/dlls/uiautomationcore/uia_event.c +++ b/dlls/uiautomationcore/uia_event.c @@ -272,15 +272,15 @@ static ULONG WINAPI uia_event_Release(IWineUiaEvent *iface) return ref; } -static HRESULT WINAPI uia_event_advise_events(IWineUiaEvent *iface, BOOL advise_added) +static HRESULT WINAPI uia_event_advise_events(IWineUiaEvent *iface, BOOL advise_added, long adviser_start_idx) { struct uia_event *event = impl_from_IWineUiaEvent(iface); HRESULT hr; int i; - TRACE("%p, %d\n", event, advise_added); + TRACE("%p, %d, %ld\n", event, advise_added, adviser_start_idx); - for (i = 0; i < event->event_advisers_count; i++) + for (i = adviser_start_idx; i < event->event_advisers_count; i++) { hr = IWineUiaEventAdviser_advise(event->event_advisers[i], advise_added, (UINT_PTR)event); if (FAILED(hr)) @@ -658,7 +658,7 @@ static HRESULT WINAPI uia_serverside_event_adviser_advise(IWineUiaEventAdviser * } } - return IWineUiaEvent_advise_events(adv_events->event_iface, advise_added); + return IWineUiaEvent_advise_events(adv_events->event_iface, advise_added, 0); } static const IWineUiaEventAdviserVtbl uia_serverside_event_adviser_vtbl = { @@ -706,6 +706,65 @@ HRESULT uia_event_add_serverside_event_adviser(IWineUiaEvent *serverside_event, return hr; } +static HRESULT uia_event_advise(struct uia_event *event, BOOL advise_added, long start_idx) +{ + IWineUiaEvent *event_iface; + HRESULT hr; + + if (event->u.clientside.git_cookie) + { + hr = get_interface_in_git(&IID_IWineUiaEvent, event->u.clientside.git_cookie, + (IUnknown **)&event_iface); + if (FAILED(hr)) + return hr; + } + else + { + event_iface = &event->IWineUiaEvent_iface; + IWineUiaEvent_AddRef(event_iface); + } + + hr = IWineUiaEvent_advise_events(event_iface, advise_added, start_idx); + IWineUiaEvent_Release(event_iface); + + return hr; +} + +/*********************************************************************** + * UiaEventAddWindow (uiautomationcore.@) + */ +HRESULT WINAPI UiaEventAddWindow(HUIAEVENT huiaevent, HWND hwnd) +{ + struct uia_event *event = unsafe_impl_from_IWineUiaEvent((IWineUiaEvent *)huiaevent); + int old_event_advisers_count; + HUIANODE node; + HRESULT hr; + + TRACE("(%p, %p)\n", huiaevent, hwnd); + + if (!event) + return E_INVALIDARG; + + assert(event->event_type == EVENT_TYPE_CLIENTSIDE); + + hr = UiaNodeFromHandle(hwnd, &node); + if (FAILED(hr)) + return hr; + + old_event_advisers_count = event->event_advisers_count; + hr = attach_event_to_uia_node(node, event); + if (FAILED(hr)) + goto exit; + + if (event->event_advisers_count != old_event_advisers_count) + hr = uia_event_advise(event, TRUE, old_event_advisers_count); + +exit: + UiaNodeRelease(node); + + return hr; +} + /*********************************************************************** * UiaAddEvent (uiautomationcore.@) */ @@ -752,7 +811,7 @@ HRESULT WINAPI UiaAddEvent(HUIANODE huianode, EVENTID event_id, UiaEventCallback if (FAILED(hr)) goto exit; - hr = IWineUiaEvent_advise_events(&event->IWineUiaEvent_iface, TRUE); + hr = uia_event_advise(event, TRUE, 0); if (FAILED(hr)) goto exit; @@ -775,7 +834,6 @@ exit: HRESULT WINAPI UiaRemoveEvent(HUIAEVENT huiaevent) { struct uia_event *event = unsafe_impl_from_IWineUiaEvent((IWineUiaEvent *)huiaevent); - IWineUiaEvent *event_iface; HRESULT hr; TRACE("(%p)\n", event); @@ -784,33 +842,18 @@ HRESULT WINAPI UiaRemoveEvent(HUIAEVENT huiaevent) return E_INVALIDARG; assert(event->event_type == EVENT_TYPE_CLIENTSIDE); + hr = uia_event_advise(event, FALSE, 0); + if (FAILED(hr)) + return hr; + if (event->u.clientside.git_cookie) { - hr = get_interface_in_git(&IID_IWineUiaEvent, event->u.clientside.git_cookie, (IUnknown **)&event_iface); - if (FAILED(hr)) - return hr; - hr = unregister_interface_in_git(event->u.clientside.git_cookie); if (FAILED(hr)) - { - IWineUiaEvent_Release(event_iface); return hr; - } - - /* - * We want the release of the event_iface proxy to set the reference - * count to 0, so we release our reference here. - */ - IWineUiaEvent_Release(&event->IWineUiaEvent_iface); } - else - event_iface = &event->IWineUiaEvent_iface; - - hr = IWineUiaEvent_advise_events(event_iface, FALSE); - IWineUiaEvent_Release(event_iface); - if (FAILED(hr)) - WARN("advise_events failed with hr %#lx\n", hr); + IWineUiaEvent_Release(&event->IWineUiaEvent_iface); return S_OK; }
1
0
0
0
Connor McAdams : uiautomationcore: Add support for advising providers of events on serverside events.
by Alexandre Julliard
19 Jun '23
19 Jun '23
Module: wine Branch: master Commit: 92623ccdf0bf4611451595c9e964b7c4881e050f URL:
https://gitlab.winehq.org/wine/wine/-/commit/92623ccdf0bf4611451595c9e964b7…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Fri Apr 21 14:18:55 2023 -0400 uiautomationcore: Add support for advising providers of events on serverside events. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 4 +- dlls/uiautomationcore/uia_classes.idl | 2 + dlls/uiautomationcore/uia_event.c | 65 ++++++++++++++++++++++++++++-- dlls/uiautomationcore/uia_private.h | 1 + 4 files changed, 67 insertions(+), 5 deletions(-) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 6d0e6f7c557..13f481a670e 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -14047,7 +14047,7 @@ static void test_UiaAddEvent_client_proc(void) CHECK_CALLED_MULTI(prov_callback_proxy, 3); } - post_event_message(hwnd, WM_UIA_TEST_CHECK_EVENT_ADVISE_ADDED, UIA_AutomationFocusChangedEventId, PROVIDER_ID, TRUE); + post_event_message(hwnd, WM_UIA_TEST_CHECK_EVENT_ADVISE_ADDED, UIA_AutomationFocusChangedEventId, PROVIDER_ID, FALSE); /* * Starts navigation in server process, then completes navigation in the @@ -14071,7 +14071,7 @@ static void test_UiaAddEvent_client_proc(void) hr = UiaRemoveEvent(event); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - post_event_message(hwnd, WM_UIA_TEST_CHECK_EVENT_ADVISE_REMOVED, UIA_AutomationFocusChangedEventId, PROVIDER_ID, TRUE); + post_event_message(hwnd, WM_UIA_TEST_CHECK_EVENT_ADVISE_REMOVED, UIA_AutomationFocusChangedEventId, PROVIDER_ID, FALSE); /* * Register an event on a node that won't require any navigation to reach. diff --git a/dlls/uiautomationcore/uia_classes.idl b/dlls/uiautomationcore/uia_classes.idl index 74ea1b1a244..651df86d9d2 100644 --- a/dlls/uiautomationcore/uia_classes.idl +++ b/dlls/uiautomationcore/uia_classes.idl @@ -73,6 +73,8 @@ library UIA_wine_private interface IWineUiaEvent : IUnknown { HRESULT advise_events([in]BOOL advise_added); + HRESULT set_event_data([in]const GUID *event_guid, [in]long scope, [in]VARIANT runtime_id, + [in]IWineUiaEvent *event_iface); } [ diff --git a/dlls/uiautomationcore/uia_event.c b/dlls/uiautomationcore/uia_event.c index 8abb4d02556..2cb2cff9ae2 100644 --- a/dlls/uiautomationcore/uia_event.c +++ b/dlls/uiautomationcore/uia_event.c @@ -257,6 +257,8 @@ static ULONG WINAPI uia_event_Release(IWineUiaEvent *iface) rb_remove(&uia_event_map.serverside_event_map, &event->u.serverside.serverside_event_entry); uia_event_map.serverside_event_count--; LeaveCriticalSection(&event_map_cs); + if (event->u.serverside.event_iface) + IWineUiaEvent_Release(event->u.serverside.event_iface); if (event->u.serverside.node) IWineUiaNode_Release(event->u.serverside.node); } @@ -292,7 +294,9 @@ static HRESULT WINAPI uia_event_advise_events(IWineUiaEvent *iface, BOOL advise_ if (!advise_added) { InterlockedIncrement(&event->event_defunct); - uia_event_map_entry_release(event->event_map_entry); + /* FIXME: Remove this check once we can raise serverside events. */ + if (event->event_type == EVENT_TYPE_CLIENTSIDE) + uia_event_map_entry_release(event->event_map_entry); event->event_map_entry = NULL; for (i = 0; i < event->event_advisers_count; i++) @@ -304,11 +308,40 @@ static HRESULT WINAPI uia_event_advise_events(IWineUiaEvent *iface, BOOL advise_ return S_OK; } +static HRESULT WINAPI uia_event_set_event_data(IWineUiaEvent *iface, const GUID *event_guid, long scope, + VARIANT runtime_id, IWineUiaEvent *event_iface) +{ + struct uia_event *event = impl_from_IWineUiaEvent(iface); + + TRACE("%p, %s, %ld, %s, %p\n", event, debugstr_guid(event_guid), scope, debugstr_variant(&runtime_id), event_iface); + + assert(event->event_type == EVENT_TYPE_SERVERSIDE); + + event->event_id = UiaLookupId(AutomationIdentifierType_Event, event_guid); + event->scope = scope; + if (V_VT(&runtime_id) == (VT_I4 | VT_ARRAY)) + { + HRESULT hr; + + hr = SafeArrayCopy(V_ARRAY(&runtime_id), &event->runtime_id); + if (FAILED(hr)) + { + WARN("Failed to copy runtime id, hr %#lx\n", hr); + return hr; + } + } + event->u.serverside.event_iface = event_iface; + IWineUiaEvent_AddRef(event_iface); + + return S_OK; +} + static const IWineUiaEventVtbl uia_event_vtbl = { uia_event_QueryInterface, uia_event_AddRef, uia_event_Release, uia_event_advise_events, + uia_event_set_event_data, }; static struct uia_event *unsafe_impl_from_IWineUiaEvent(IWineUiaEvent *iface) @@ -598,8 +631,34 @@ static ULONG WINAPI uia_serverside_event_adviser_Release(IWineUiaEventAdviser *i static HRESULT WINAPI uia_serverside_event_adviser_advise(IWineUiaEventAdviser *iface, BOOL advise_added, LONG_PTR huiaevent) { - FIXME("%p, %d, %#Ix: stub\n", iface, advise_added, huiaevent); - return S_OK; + struct uia_serverside_event_adviser *adv_events = impl_from_serverside_IWineUiaEventAdviser(iface); + struct uia_event *event_data = (struct uia_event *)huiaevent; + HRESULT hr; + + TRACE("%p, %d, %#Ix\n", adv_events, advise_added, huiaevent); + + if (advise_added) + { + const struct uia_event_info *event_info = uia_event_info_from_id(event_data->event_id); + VARIANT v; + + VariantInit(&v); + if (event_data->runtime_id) + { + V_VT(&v) = VT_I4 | VT_ARRAY; + V_ARRAY(&v) = event_data->runtime_id; + } + + hr = IWineUiaEvent_set_event_data(adv_events->event_iface, event_info->guid, event_data->scope, v, + &event_data->IWineUiaEvent_iface); + if (FAILED(hr)) + { + WARN("Failed to set event data on serverside event, hr %#lx\n", hr); + return hr; + } + } + + return IWineUiaEvent_advise_events(adv_events->event_iface, advise_added); } static const IWineUiaEventAdviserVtbl uia_serverside_event_adviser_vtbl = { diff --git a/dlls/uiautomationcore/uia_private.h b/dlls/uiautomationcore/uia_private.h index c4f8f46abb0..60830c7c8a5 100644 --- a/dlls/uiautomationcore/uia_private.h +++ b/dlls/uiautomationcore/uia_private.h @@ -140,6 +140,7 @@ struct uia_event */ IWineUiaNode *node; + IWineUiaEvent *event_iface; struct rb_entry serverside_event_entry; LONG proc_id; } serverside;
1
0
0
0
Connor McAdams : uiautomationcore: Prevent creation of duplicate serverside events.
by Alexandre Julliard
19 Jun '23
19 Jun '23
Module: wine Branch: master Commit: 2da4d47b5d50a9359d1ce97ce26d4ad3d27b28bc URL:
https://gitlab.winehq.org/wine/wine/-/commit/2da4d47b5d50a9359d1ce97ce26d4a…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Fri Apr 21 13:59:23 2023 -0400 uiautomationcore: Prevent creation of duplicate serverside events. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/uia_classes.idl | 2 +- dlls/uiautomationcore/uia_client.c | 22 ++++++--- dlls/uiautomationcore/uia_event.c | 92 +++++++++++++++++++++++++++++------ dlls/uiautomationcore/uia_private.h | 7 ++- dlls/uiautomationcore/uia_provider.c | 1 - 5 files changed, 100 insertions(+), 24 deletions(-)
1
0
0
0
Connor McAdams : uiautomationcore: Add support for creating serverside events.
by Alexandre Julliard
19 Jun '23
19 Jun '23
Module: wine Branch: master Commit: 549a276c328eead28261de38fa953f16e1379ff1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/549a276c328eead28261de38fa953f…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Fri May 19 14:55:43 2023 -0400 uiautomationcore: Add support for creating serverside events. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 6 +- dlls/uiautomationcore/uia_classes.idl | 2 + dlls/uiautomationcore/uia_client.c | 49 +++++++- dlls/uiautomationcore/uia_event.c | 184 ++++++++++++++++++++++++++--- dlls/uiautomationcore/uia_private.h | 32 ++++- 5 files changed, 252 insertions(+), 21 deletions(-)
1
0
0
0
Connor McAdams : uiautomationcore/tests: Add tests for cross-process events.
by Alexandre Julliard
19 Jun '23
19 Jun '23
Module: wine Branch: master Commit: fa02af30e6a72f0ae14527edeb1ff920812f72de URL:
https://gitlab.winehq.org/wine/wine/-/commit/fa02af30e6a72f0ae14527edeb1ff9…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Fri May 19 13:58:10 2023 -0400 uiautomationcore/tests: Add tests for cross-process events. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 433 ++++++++++++++++++++++++++++- 1 file changed, 427 insertions(+), 6 deletions(-)
1
0
0
0
David Kahurani : gdiplus: Allow NULL format in GdipAddPathString.
by Alexandre Julliard
19 Jun '23
19 Jun '23
Module: wine Branch: master Commit: 101bcc221d4a446aca3c959f5150757de9e5b88c URL:
https://gitlab.winehq.org/wine/wine/-/commit/101bcc221d4a446aca3c959f515075…
Author: David Kahurani <k.kahurani(a)gmail.com> Date: Sun Jun 18 14:41:45 2023 +0300 gdiplus: Allow NULL format in GdipAddPathString. GdipAddPathString accepts NULL for format and presumably uses the default format for formating Signed-off-by: David Kahurani <k.kahurani(a)gmail.com> --- dlls/gdiplus/graphicspath.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 4da84a9eac5..ad4dde58ccd 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1010,9 +1010,12 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT TEXTMETRICW textmetric; TRACE("(%p, %s, %d, %p, %d, %f, %p, %p)\n", path, debugstr_w(string), length, family, style, emSize, layoutRect, format); - if (!path || !string || !family || !emSize || !layoutRect || !format) + if (!path || !string || !family || !emSize || !layoutRect) return InvalidParameter; + if (!format) + format = &default_drawstring_format; + status = GdipGetEmHeight(family, style, &native_height); if (status != Ok) return status;
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
64
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
Results per page:
10
25
50
100
200