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 2017
----- 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
757 discussions
Start a n
N
ew thread
Józef Kucia : wined3d: Simplify logic in wined3d_event_query_issue().
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 1d27b69f3219f3bd5ac9cf68dd0eebf0f0a86f7d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1d27b69f3219f3bd5ac9cf68d…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Apr 5 15:38:06 2017 +0200 wined3d: Simplify logic in wined3d_event_query_issue(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/query.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index 1927e7e..685c5ce 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -214,27 +214,17 @@ enum wined3d_event_query_result wined3d_event_query_finish(const struct wined3d_ void wined3d_event_query_issue(struct wined3d_event_query *query, const struct wined3d_device *device) { + struct wined3d_context *context = NULL; const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; - if (query->context) - { - if (!(context = context_reacquire(device, query->context)) - && !query->context->gl_info->supported[ARB_SYNC]) - { - context_free_event_query(query); - context = context_acquire(device, NULL, 0); - context_alloc_event_query(context, query); - } - if (!context) - context = context_acquire(device, NULL, 0); - } - else - { + if (query->context && !(context = context_reacquire(device, query->context)) + && !query->context->gl_info->supported[ARB_SYNC]) + context_free_event_query(query); + if (!context) context = context_acquire(device, NULL, 0); - context_alloc_event_query(context, query); - } gl_info = context->gl_info; + if (!query->context) + context_alloc_event_query(context, query); if (gl_info->supported[ARB_SYNC]) {
1
0
0
0
Józef Kucia : wined3d: Introduce context_reacquire() helper function.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 8b9ece67977249f66e21592832f42b3f6475aea0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b9ece67977249f66e2159283…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Apr 5 15:38:05 2017 +0200 wined3d: Introduce context_reacquire() helper function. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 15 +++++++ dlls/wined3d/query.c | 89 ++++++++++++++++++------------------------ dlls/wined3d/wined3d_private.h | 2 + 3 files changed, 55 insertions(+), 51 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 8427eb7..2e9b38a 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -3832,3 +3832,18 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, return context; } + +struct wined3d_context *context_reacquire(const struct wined3d_device *device, + struct wined3d_context *context) +{ + struct wined3d_context *current_context; + + if (context->tid != GetCurrentThreadId()) + return NULL; + + current_context = context_acquire(device, context->current_rt.texture, + context->current_rt.sub_resource_idx); + if (current_context != context) + ERR("Acquired context %p instead of %p.\n", current_context, context); + return current_context; +} diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index 371f7d3..1927e7e 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -68,27 +68,28 @@ void wined3d_event_query_destroy(struct wined3d_event_query *query) static enum wined3d_event_query_result wined3d_event_query_test(const struct wined3d_event_query *query, const struct wined3d_device *device, DWORD flags) { - struct wined3d_context *context; const struct wined3d_gl_info *gl_info; enum wined3d_event_query_result ret; + struct wined3d_context *context; BOOL fence_result; TRACE("query %p, device %p, flags %#x.\n", query, device, flags); if (!query->context) { - TRACE("Query not started\n"); + TRACE("Query not started.\n"); return WINED3D_EVENT_QUERY_NOT_STARTED; } - if (!query->context->gl_info->supported[ARB_SYNC] && query->context->tid != GetCurrentThreadId()) + if (!(context = context_reacquire(device, query->context))) { - WARN("Event query tested from wrong thread\n"); - return WINED3D_EVENT_QUERY_WRONG_THREAD; + if (!query->context->gl_info->supported[ARB_SYNC]) + { + WARN("Event query tested from wrong thread.\n"); + return WINED3D_EVENT_QUERY_WRONG_THREAD; + } + context = context_acquire(device, NULL, 0); } - - context = context_acquire(device, query->context->current_rt.texture, - query->context->current_rt.sub_resource_idx); gl_info = context->gl_info; if (gl_info->supported[ARB_SYNC]) @@ -141,30 +142,32 @@ static enum wined3d_event_query_result wined3d_event_query_test(const struct win enum wined3d_event_query_result wined3d_event_query_finish(const struct wined3d_event_query *query, const struct wined3d_device *device) { - struct wined3d_context *context; const struct wined3d_gl_info *gl_info; enum wined3d_event_query_result ret; + struct wined3d_context *context; TRACE("query %p, device %p.\n", query, device); if (!query->context) { - TRACE("Query not started\n"); + TRACE("Query not started.\n"); return WINED3D_EVENT_QUERY_NOT_STARTED; } gl_info = query->context->gl_info; - if (query->context->tid != GetCurrentThreadId() && !gl_info->supported[ARB_SYNC]) + if (!(context = context_reacquire(device, query->context))) { /* A glFinish does not reliably wait for draws in other contexts. The caller has * to find its own way to cope with the thread switch */ - WARN("Event query finished from wrong thread\n"); - return WINED3D_EVENT_QUERY_WRONG_THREAD; + if (!gl_info->supported[ARB_SYNC]) + { + WARN("Event query finished from wrong thread.\n"); + return WINED3D_EVENT_QUERY_WRONG_THREAD; + } + context = context_acquire(device, NULL, 0); } - - context = context_acquire(device, query->context->current_rt.texture, - query->context->current_rt.sub_resource_idx); + gl_info = context->gl_info; if (gl_info->supported[ARB_SYNC]) { @@ -216,24 +219,21 @@ void wined3d_event_query_issue(struct wined3d_event_query *query, const struct w if (query->context) { - if (!query->context->gl_info->supported[ARB_SYNC] && query->context->tid != GetCurrentThreadId()) + if (!(context = context_reacquire(device, query->context)) + && !query->context->gl_info->supported[ARB_SYNC]) { context_free_event_query(query); context = context_acquire(device, NULL, 0); context_alloc_event_query(context, query); } - else - { - context = context_acquire(device, query->context->current_rt.texture, - query->context->current_rt.sub_resource_idx); - } + if (!context) + context = context_acquire(device, NULL, 0); } else { context = context_acquire(device, NULL, 0); context_alloc_event_query(context, query); } - gl_info = context->gl_info; if (gl_info->supported[ARB_SYNC]) @@ -378,15 +378,12 @@ static BOOL wined3d_occlusion_query_ops_poll(struct wined3d_query *query, DWORD TRACE("query %p, flags %#x.\n", query, flags); - if (oq->context->tid != GetCurrentThreadId()) + if (!(context = context_reacquire(device, oq->context))) { FIXME("%p Wrong thread, returning 1.\n", query); oq->samples = 1; return TRUE; } - - context = context_acquire(device, oq->context->current_rt.texture, - oq->context->current_rt.sub_resource_idx); gl_info = context->gl_info; GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT_AVAILABLE, &available)); @@ -494,28 +491,24 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD { if (query->state == QUERY_BUILDING) { - if (oq->context->tid != GetCurrentThreadId()) + if ((context = context_reacquire(device, oq->context))) { - FIXME("Wrong thread, can't restart query.\n"); - - context_free_occlusion_query(oq); - context = context_acquire(query->device, NULL, 0); - context_alloc_occlusion_query(context, oq); + GL_EXTCALL(glEndQuery(GL_SAMPLES_PASSED)); + checkGLcall("glEndQuery()"); } else { - context = context_acquire(device, oq->context->current_rt.texture, - oq->context->current_rt.sub_resource_idx); - - GL_EXTCALL(glEndQuery(GL_SAMPLES_PASSED)); - checkGLcall("glEndQuery()"); + FIXME("Wrong thread, can't restart query.\n"); + context_free_occlusion_query(oq); + context = context_acquire(device, NULL, 0); + context_alloc_occlusion_query(context, oq); } } else { if (oq->context) context_free_occlusion_query(oq); - context = context_acquire(query->device, NULL, 0); + context = context_acquire(device, NULL, 0); context_alloc_occlusion_query(context, oq); } @@ -531,20 +524,17 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD * so avoid generating an error. */ if (query->state == QUERY_BUILDING) { - if (oq->context->tid != GetCurrentThreadId()) + if ((context = context_reacquire(device, oq->context))) { - FIXME("Wrong thread, can't end query.\n"); - } - else - { - context = context_acquire(device, oq->context->current_rt.texture, - oq->context->current_rt.sub_resource_idx); - GL_EXTCALL(glEndQuery(GL_SAMPLES_PASSED)); checkGLcall("glEndQuery()"); context_release(context); } + else + { + FIXME("Wrong thread, can't end query.\n"); + } } } } @@ -560,15 +550,12 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query, DWORD TRACE("query %p, flags %#x.\n", query, flags); - if (tq->context->tid != GetCurrentThreadId()) + if (!(context = context_reacquire(device, tq->context))) { FIXME("%p Wrong thread, returning 1.\n", query); tq->timestamp = 1; return TRUE; } - - context = context_acquire(device, tq->context->current_rt.texture, - tq->context->current_rt.sub_resource_idx); gl_info = context->gl_info; GL_EXTCALL(glGetQueryObjectuiv(tq->id, GL_QUERY_RESULT_AVAILABLE, &available)); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 82aecf7..c824e2b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1933,6 +1933,8 @@ void context_gl_resource_released(struct wined3d_device *device, GLuint name, BOOL rb_namespace) DECLSPEC_HIDDEN; void context_invalidate_compute_state(struct wined3d_context *context, DWORD state_id) DECLSPEC_HIDDEN; void context_invalidate_state(struct wined3d_context *context, DWORD state_id) DECLSPEC_HIDDEN; +struct wined3d_context *context_reacquire(const struct wined3d_device *device, + struct wined3d_context *context) DECLSPEC_HIDDEN; void context_release(struct wined3d_context *context) DECLSPEC_HIDDEN; void context_resource_released(const struct wined3d_device *device, struct wined3d_resource *resource, enum wined3d_resource_type type) DECLSPEC_HIDDEN;
1
0
0
0
Józef Kucia : wined3d: Avoid accessing "context-> current_rt" in wined3d_rendertarget_view_get_drawable_size().
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: c6168a526e967eb63be767cc35821444fe644684 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c6168a526e967eb63be767cc3…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed Apr 5 15:38:04 2017 +0200 wined3d: Avoid accessing "context->current_rt" in wined3d_rendertarget_view_get_drawable_size(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/view.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 82fac25..f37b601 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -359,8 +359,8 @@ void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarg /* The drawable size of an onscreen drawable is the surface size. * (Actually: The window size, but the surface is created in window * size.) */ - *width = context->current_rt.texture->resource.width; - *height = context->current_rt.texture->resource.height; + *width = texture->resource.width; + *height = texture->resource.height; } else if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) { @@ -374,13 +374,12 @@ void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarg } else { - struct wined3d_surface *rt; + unsigned int level_idx = view->sub_resource_idx % texture->level_count; /* The drawable size of an FBO target is the OpenGL texture size, * which is the power of two size. */ - rt = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface; - *width = wined3d_texture_get_level_pow2_width(rt->container, rt->texture_level); - *height = wined3d_texture_get_level_pow2_height(rt->container, rt->texture_level); + *width = wined3d_texture_get_level_pow2_width(texture, level_idx); + *height = wined3d_texture_get_level_pow2_height(texture, level_idx); } }
1
0
0
0
Michael Stefaniuc : dmsynth: Don' t store a SynthSink implementation in IDirectMusicSynth8Impl.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 44fd37a323e23c7a687dc96476edde8de4620307 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=44fd37a323e23c7a687dc9647…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Apr 5 15:25:45 2017 +0200 dmsynth: Don't store a SynthSink implementation in IDirectMusicSynth8Impl. Avoids an unsafe interface to object transition. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmsynth/dmsynth_private.h | 2 +- dlls/dmsynth/synth.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/dmsynth/dmsynth_private.h b/dlls/dmsynth/dmsynth_private.h index ed86ce0..db61e46 100644 --- a/dlls/dmsynth/dmsynth_private.h +++ b/dlls/dmsynth/dmsynth_private.h @@ -66,7 +66,7 @@ struct IDirectMusicSynth8Impl { DMUS_PORTCAPS pCaps; BOOL fActive; IReferenceClock* pLatencyClock; - IDirectMusicSynthSinkImpl* pSynthSink; + IDirectMusicSynthSink *synth_sink; }; /***************************************************************************** diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 88ba53e..afeebda 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -310,7 +310,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_GetLatencyClock(LPDIRECTMUSICSYNTH8 if (!clock) return E_POINTER; - if (!This->pSynthSink) + if (!This->synth_sink) return DMUS_E_NOSYNTHSINK; *clock = This->pLatencyClock; @@ -336,7 +336,7 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_SetSynthSink(LPDIRECTMUSICSYNTH8 if TRACE("(%p)->(%p)\n", iface, synth_sink); - This->pSynthSink = (IDirectMusicSynthSinkImpl*)synth_sink; + This->synth_sink = synth_sink; if (synth_sink) return IDirectMusicSynthSink_GetLatencyClock(synth_sink, &This->pLatencyClock);
1
0
0
0
Michael Stefaniuc : comctl32/tests: Add an ImageList_Copy() test.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: a6a9ec4459d1ba912b4ce13671fe8ba0bfe531ee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a6a9ec4459d1ba912b4ce1367…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Apr 5 15:25:44 2017 +0200 comctl32/tests: Add an ImageList_Copy() test. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/imagelist.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c index 2b68b63..8cdef18 100644 --- a/dlls/comctl32/tests/imagelist.c +++ b/dlls/comctl32/tests/imagelist.c @@ -2216,6 +2216,29 @@ static void test_color_table(UINT ilc) ImageList_Destroy(himl); } +static void test_copy(void) +{ + HIMAGELIST dst, src; + BOOL ret; + int count; + + dst = ImageList_Create(5, 11, ILC_COLOR, 1, 1); + count = ImageList_GetImageCount(dst); + ok(!count, "ImageList not empty.\n"); + src = createImageList(7, 13); + count = ImageList_GetImageCount(src); + ok(count > 2, "Tests need an ImageList with more than 2 images\n"); + + /* ImageList_Copy() cannot copy between two ImageLists */ + ret = ImageList_Copy(dst, 0, src, 2, ILCF_MOVE); + ok(!ret, "ImageList_Copy() should have returned FALSE\n"); + count = ImageList_GetImageCount(dst); + ok(count == 0, "Expected no image in dst ImageList, got %d\n", count); + + ImageList_Destroy(dst); + ImageList_Destroy(src); +} + static void test_IImageList_Clone(void) { IImageList *imgl, *imgl2; @@ -2366,6 +2389,7 @@ START_TEST(imagelist) test_iconsize(); test_color_table(ILC_COLOR4); test_color_table(ILC_COLOR8); + test_copy(); FreeLibrary(hComCtl32);
1
0
0
0
Huw Davies : riched20: Don' t compare the colours if the old and new states are both auto.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 5f3772a730073b950ff42d43015a6d72608e3f5b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5f3772a730073b950ff42d430…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Apr 5 14:02:08 2017 +0100 riched20: Don't compare the colours if the old and new states are both auto. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/writer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/writer.c b/dlls/riched20/writer.c index d579084..6b654ca 100644 --- a/dlls/riched20/writer.c +++ b/dlls/riched20/writer.c @@ -769,14 +769,14 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt) } if ((old_fmt->dwEffects ^ fmt->dwEffects) & CFE_AUTOBACKCOLOR || - old_fmt->crBackColor != fmt->crBackColor) + (!(fmt->dwEffects & CFE_AUTOBACKCOLOR) && old_fmt->crBackColor != fmt->crBackColor)) { if (fmt->dwEffects & CFE_AUTOBACKCOLOR) i = 0; else find_color_in_colortbl( pStream, fmt->crBackColor, &i ); sprintf(props + strlen(props), "\\cb%u", i); } if ((old_fmt->dwEffects ^ fmt->dwEffects) & CFE_AUTOCOLOR || - old_fmt->crTextColor != fmt->crTextColor) + (!(fmt->dwEffects & CFE_AUTOCOLOR) && old_fmt->crTextColor != fmt->crTextColor)) { if (fmt->dwEffects & CFE_AUTOCOLOR) i = 0; else find_color_in_colortbl( pStream, fmt->crTextColor, &i );
1
0
0
0
Hans Leidekker : webservices/tests: Add listener tests.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 71cc41b9327b897343ed722834554932f1dcda51 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=71cc41b9327b897343ed72283…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Apr 5 11:40:27 2017 +0200 webservices/tests: Add listener tests. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/tests/Makefile.in | 1 + dlls/webservices/tests/listener.c | 85 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/dlls/webservices/tests/Makefile.in b/dlls/webservices/tests/Makefile.in index e63952c..1adfecc 100644 --- a/dlls/webservices/tests/Makefile.in +++ b/dlls/webservices/tests/Makefile.in @@ -3,6 +3,7 @@ IMPORTS = webservices user32 ws2_32 C_SRCS = \ channel.c \ + listener.c \ msg.c \ proxy.c \ reader.c \ diff --git a/dlls/webservices/tests/listener.c b/dlls/webservices/tests/listener.c new file mode 100644 index 0000000..901a9a0 --- /dev/null +++ b/dlls/webservices/tests/listener.c @@ -0,0 +1,85 @@ +/* + * Copyright 2017 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdio.h> +#include "windows.h" +#include "webservices.h" +#include "wine/test.h" + +static void test_WsCreateListener(void) +{ + HRESULT hr; + WS_LISTENER *listener; + WS_CHANNEL_TYPE type; + WS_CHANNEL_BINDING binding; + WS_LISTENER_STATE state; + WS_IP_VERSION version; + ULONG size, backlog; + + hr = WsCreateListener( WS_CHANNEL_TYPE_DUPLEX_SESSION, WS_TCP_CHANNEL_BINDING, NULL, 0, NULL, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + listener = NULL; + hr = WsCreateListener( WS_CHANNEL_TYPE_DUPLEX_SESSION, WS_TCP_CHANNEL_BINDING, NULL, 0, NULL, &listener, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( listener != NULL, "listener not set\n" ); + + backlog = 1000; + size = sizeof(backlog); + hr = WsSetListenerProperty( listener, WS_LISTENER_PROPERTY_LISTEN_BACKLOG, &backlog, size, NULL ); + todo_wine ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + version = WS_IP_VERSION_4; + size = sizeof(version); + hr = WsSetListenerProperty( listener, WS_LISTENER_PROPERTY_IP_VERSION, &version, size, NULL ); + todo_wine ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + type = 0xdeadbeef; + hr = WsGetListenerProperty( listener, WS_LISTENER_PROPERTY_CHANNEL_TYPE, &type, sizeof(type), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( type == WS_CHANNEL_TYPE_DUPLEX_SESSION, "got %u\n", type ); + + binding = 0xdeadbeef; + hr = WsGetListenerProperty( listener, WS_LISTENER_PROPERTY_CHANNEL_BINDING, &binding, sizeof(binding), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( binding == WS_TCP_CHANNEL_BINDING, "got %u\n", binding ); + + version = 0; + size = sizeof(version); + hr = WsGetListenerProperty( listener, WS_LISTENER_PROPERTY_IP_VERSION, &version, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + todo_wine ok( version == WS_IP_VERSION_AUTO, "got %u\n", version ); + + state = 0xdeadbeef; + size = sizeof(state); + hr = WsGetListenerProperty( listener, WS_LISTENER_PROPERTY_STATE, &state, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( state == WS_LISTENER_STATE_CREATED, "got %u\n", state ); + + state = WS_LISTENER_STATE_CREATED; + size = sizeof(state); + hr = WsSetListenerProperty( listener, WS_LISTENER_PROPERTY_STATE, &state, size, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + WsFreeListener( listener ); +} + +START_TEST(listener) +{ + test_WsCreateListener(); +}
1
0
0
0
Hans Leidekker : webservices: Implement WsGetListenerProperty and WsSetListenerProperty.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 92fdb3ffb55fd408c5590b75b2f2c41d73a26dee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=92fdb3ffb55fd408c5590b75b…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Apr 5 11:40:26 2017 +0200 webservices: Implement WsGetListenerProperty and WsSetListenerProperty. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/listener.c | 75 +++++++++++++++++++++++++++++++++++++++ dlls/webservices/webservices.spec | 4 +-- 2 files changed, 77 insertions(+), 2 deletions(-) diff --git a/dlls/webservices/listener.c b/dlls/webservices/listener.c index 205f7bc..4adddf4 100644 --- a/dlls/webservices/listener.c +++ b/dlls/webservices/listener.c @@ -172,3 +172,78 @@ void WINAPI WsFreeListener( WS_LISTENER *handle ) LeaveCriticalSection( &listener->cs ); free_listener( listener ); } + +/************************************************************************** + * WsGetListenerProperty [webservices.@] + */ +HRESULT WINAPI WsGetListenerProperty( WS_LISTENER *handle, WS_LISTENER_PROPERTY_ID id, void *buf, + ULONG size, WS_ERROR *error ) +{ + struct listener *listener = (struct listener *)handle; + HRESULT hr = S_OK; + + TRACE( "%p %u %p %u %p\n", handle, id, buf, size, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!listener) return E_INVALIDARG; + + EnterCriticalSection( &listener->cs ); + + if (listener->magic != LISTENER_MAGIC) + { + LeaveCriticalSection( &listener->cs ); + return E_INVALIDARG; + } + + switch (id) + { + case WS_LISTENER_PROPERTY_STATE: + if (!buf || size != sizeof(listener->state)) hr = E_INVALIDARG; + else *(WS_LISTENER_STATE *)buf = listener->state; + break; + + case WS_LISTENER_PROPERTY_CHANNEL_TYPE: + if (!buf || size != sizeof(listener->type)) hr = E_INVALIDARG; + else *(WS_CHANNEL_TYPE *)buf = listener->type; + break; + + case WS_LISTENER_PROPERTY_CHANNEL_BINDING: + if (!buf || size != sizeof(listener->binding)) hr = E_INVALIDARG; + else *(WS_CHANNEL_BINDING *)buf = listener->binding; + break; + + default: + hr = prop_get( listener->prop, listener->prop_count, id, buf, size ); + } + + LeaveCriticalSection( &listener->cs ); + return hr; +} + +/************************************************************************** + * WsSetListenerProperty [webservices.@] + */ +HRESULT WINAPI WsSetListenerProperty( WS_LISTENER *handle, WS_LISTENER_PROPERTY_ID id, const void *value, + ULONG size, WS_ERROR *error ) +{ + struct listener *listener = (struct listener *)handle; + HRESULT hr; + + TRACE( "%p %u %p %u\n", handle, id, value, size ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!listener) return E_INVALIDARG; + + EnterCriticalSection( &listener->cs ); + + if (listener->magic != LISTENER_MAGIC) + { + LeaveCriticalSection( &listener->cs ); + return E_INVALIDARG; + } + + hr = prop_set( listener->prop, listener->prop_count, id, value, size ); + + LeaveCriticalSection( &listener->cs ); + return hr; +} diff --git a/dlls/webservices/webservices.spec b/dlls/webservices/webservices.spec index 9f1fc3e..7e8dbee 100644 --- a/dlls/webservices/webservices.spec +++ b/dlls/webservices/webservices.spec @@ -69,7 +69,7 @@ @ stub WsGetHeader @ stub WsGetHeaderAttributes @ stdcall WsGetHeapProperty(ptr long ptr long ptr) -@ stub WsGetListenerProperty +@ stdcall WsGetListenerProperty(ptr long ptr long ptr) @ stub WsGetMappedHeader @ stdcall WsGetMessageProperty(ptr long ptr long ptr) @ stub WsGetMetadataEndpoints @@ -152,7 +152,7 @@ @ stdcall WsSetHeader(ptr long long long ptr long ptr) @ stdcall WsSetInput(ptr ptr ptr ptr long ptr) @ stdcall WsSetInputToBuffer(ptr ptr ptr long ptr) -@ stub WsSetListenerProperty +@ stdcall WsSetListenerProperty(ptr long ptr long ptr) @ stdcall WsSetMessageProperty(ptr long ptr long ptr) @ stdcall WsSetOutput(ptr ptr ptr ptr long ptr) @ stdcall WsSetOutputToBuffer(ptr ptr ptr long ptr)
1
0
0
0
Hans Leidekker : webservices: Implement WsCreateListener and WsFreeListener.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 83a2c56fc07ff50793169a59dab5abfc5adcb186 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=83a2c56fc07ff50793169a59d…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Apr 5 11:40:25 2017 +0200 webservices: Implement WsCreateListener and WsFreeListener. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/Makefile.in | 1 + dlls/webservices/listener.c | 174 ++++++++++++++++++++++++++++++++++++++ dlls/webservices/webservices.spec | 4 +- 3 files changed, 177 insertions(+), 2 deletions(-) diff --git a/dlls/webservices/Makefile.in b/dlls/webservices/Makefile.in index fa79a68..70ca1fc 100644 --- a/dlls/webservices/Makefile.in +++ b/dlls/webservices/Makefile.in @@ -6,6 +6,7 @@ C_SRCS = \ channel.c \ error.c \ heap.c \ + listener.c \ msg.c \ proxy.c \ reader.c \ diff --git a/dlls/webservices/listener.c b/dlls/webservices/listener.c new file mode 100644 index 0000000..205f7bc --- /dev/null +++ b/dlls/webservices/listener.c @@ -0,0 +1,174 @@ +/* + * Copyright 2017 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "webservices.h" + +#include "wine/debug.h" +#include "wine/list.h" +#include "wine/unicode.h" +#include "webservices_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(webservices); + +static const struct prop_desc listener_props[] = +{ + { sizeof(ULONG), FALSE }, /* WS_LISTENER_PROPERTY_LISTEN_BACKLOG */ + { sizeof(WS_IP_VERSION), FALSE }, /* WS_LISTENER_PROPERTY_IP_VERSION */ + { sizeof(WS_LISTENER_STATE), TRUE }, /* WS_LISTENER_PROPERTY_STATE */ + { sizeof(WS_CALLBACK_MODEL), FALSE }, /* WS_LISTENER_PROPERTY_ASYNC_CALLBACK_MODEL */ + { sizeof(WS_CHANNEL_TYPE), TRUE }, /* WS_LISTENER_PROPERTY_CHANNEL_TYPE */ + { sizeof(WS_CHANNEL_BINDING), TRUE }, /* WS_LISTENER_PROPERTY_CHANNEL_BINDING */ + { sizeof(ULONG), FALSE }, /* WS_LISTENER_PROPERTY_CONNECT_TIMEOUT */ + { sizeof(BOOL), FALSE }, /* WS_LISTENER_PROPERTY_IS_MULTICAST */ + { 0, FALSE }, /* WS_LISTENER_PROPERTY_MULTICAST_INTERFACES */ + { sizeof(BOOL), FALSE }, /* WS_LISTENER_PROPERTY_MULTICAST_LOOPBACK */ + { sizeof(ULONG), FALSE }, /* WS_LISTENER_PROPERTY_CLOSE_TIMEOUT */ + { sizeof(ULONG), FALSE }, /* WS_LISTENER_PROPERTY_TO_HEADER_MATCHING_OPTIONS */ + { sizeof(ULONG), FALSE }, /* WS_LISTENER_PROPERTY_TRANSPORT_URL_MATCHING_OPTIONS */ + { sizeof(WS_CUSTOM_LISTENER_CALLBACKS), FALSE }, /* WS_LISTENER_PROPERTY_CUSTOM_LISTENER_CALLBACKS */ + { 0, FALSE }, /* WS_LISTENER_PROPERTY_CUSTOM_LISTENER_PARAMETERS */ + { sizeof(void *), TRUE }, /* WS_LISTENER_PROPERTY_CUSTOM_LISTENER_INSTANCE */ + { sizeof(WS_DISALLOWED_USER_AGENT_SUBSTRINGS), FALSE } /* WS_LISTENER_PROPERTY_DISALLOWED_USER_AGENT */ +}; + +struct listener +{ + ULONG magic; + CRITICAL_SECTION cs; + WS_CHANNEL_TYPE type; + WS_CHANNEL_BINDING binding; + WS_LISTENER_STATE state; + ULONG prop_count; + struct prop prop[sizeof(listener_props)/sizeof(listener_props[0])]; +}; + +#define LISTENER_MAGIC (('L' << 24) | ('I' << 16) | ('S' << 8) | 'T') + +static struct listener *alloc_listener(void) +{ + static const ULONG count = sizeof(listener_props)/sizeof(listener_props[0]); + struct listener *ret; + ULONG size = sizeof(*ret) + prop_size( listener_props, count ); + + if (!(ret = heap_alloc_zero( size ))) return NULL; + + ret->magic = LISTENER_MAGIC; + InitializeCriticalSection( &ret->cs ); + ret->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": listener.cs"); + + prop_init( listener_props, count, ret->prop, &ret[1] ); + ret->prop_count = count; + return ret; +} + +static void free_listener( struct listener *listener ) +{ + listener->cs.DebugInfo->Spare[0] = 0; + DeleteCriticalSection( &listener->cs ); + heap_free( listener ); +} + +static HRESULT create_listener( WS_CHANNEL_TYPE type, WS_CHANNEL_BINDING binding, + const WS_LISTENER_PROPERTY *properties, ULONG count, struct listener **ret ) +{ + struct listener *listener; + HRESULT hr; + ULONG i; + + if (!(listener = alloc_listener())) return E_OUTOFMEMORY; + + for (i = 0; i < count; i++) + { + hr = prop_set( listener->prop, listener->prop_count, properties[i].id, properties[i].value, + properties[i].valueSize ); + if (hr != S_OK) + { + free_listener( listener ); + return hr; + } + } + + listener->type = type; + listener->binding = binding; + + *ret = listener; + return S_OK; +} + +/************************************************************************** + * WsCreateListener [webservices.@] + */ +HRESULT WINAPI WsCreateListener( WS_CHANNEL_TYPE type, WS_CHANNEL_BINDING binding, + const WS_LISTENER_PROPERTY *properties, ULONG count, + const WS_SECURITY_DESCRIPTION *desc, WS_LISTENER **handle, + WS_ERROR *error ) +{ + struct listener *listener; + HRESULT hr; + + TRACE( "%u %u %p %u %p %p %p\n", type, binding, properties, count, desc, handle, error ); + if (error) FIXME( "ignoring error parameter\n" ); + if (desc) FIXME( "ignoring security description\n" ); + + if (!handle) return E_INVALIDARG; + + if (type != WS_CHANNEL_TYPE_DUPLEX_SESSION) + { + FIXME( "channel type %u not implemented\n", type ); + return E_NOTIMPL; + } + if (binding != WS_TCP_CHANNEL_BINDING) + { + FIXME( "channel binding %u not implemented\n", binding ); + return E_NOTIMPL; + } + + if ((hr = create_listener( type, binding, properties, count, &listener )) != S_OK) return hr; + + *handle = (WS_LISTENER *)listener; + return S_OK; +} + +/************************************************************************** + * WsFreeListener [webservices.@] + */ +void WINAPI WsFreeListener( WS_LISTENER *handle ) +{ + struct listener *listener = (struct listener *)handle; + + TRACE( "%p\n", handle ); + + if (!listener) return; + + EnterCriticalSection( &listener->cs ); + + if (listener->magic != LISTENER_MAGIC) + { + LeaveCriticalSection( &listener->cs ); + return; + } + + listener->magic = 0; + + LeaveCriticalSection( &listener->cs ); + free_listener( listener ); +} diff --git a/dlls/webservices/webservices.spec b/dlls/webservices/webservices.spec index def0cca..9f1fc3e 100644 --- a/dlls/webservices/webservices.spec +++ b/dlls/webservices/webservices.spec @@ -25,7 +25,7 @@ @ stdcall WsCreateError(ptr long ptr) @ stub WsCreateFaultFromError @ stdcall WsCreateHeap(long long ptr long ptr ptr) -@ stub WsCreateListener +@ stdcall WsCreateListener(long long ptr long ptr ptr ptr) @ stdcall WsCreateMessage(long long ptr long ptr ptr) @ stdcall WsCreateMessageForChannel(ptr ptr long ptr ptr) @ stub WsCreateMetadata @@ -51,7 +51,7 @@ @ stdcall WsFreeChannel(ptr) @ stdcall WsFreeError(ptr) @ stdcall WsFreeHeap(ptr) -@ stub WsFreeListener +@ stdcall WsFreeListener(ptr) @ stdcall WsFreeMessage(ptr) @ stub WsFreeMetadata @ stdcall WsFreeReader(ptr)
1
0
0
0
Hans Leidekker : webservices: Implement WsResetServiceProxy.
by Alexandre Julliard
05 Apr '17
05 Apr '17
Module: wine Branch: master Commit: 3c78421499256a7de92eb70e05dc2363b18af1d1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3c78421499256a7de92eb70e0…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Apr 5 11:40:24 2017 +0200 webservices: Implement WsResetServiceProxy. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/proxy.c | 40 +++++++++++++++++++++++++++++++++++ dlls/webservices/tests/proxy.c | 44 +++++++++++++++++++++++++++++++++++++++ dlls/webservices/webservices.spec | 2 +- include/webservices.h | 1 + 4 files changed, 86 insertions(+), 1 deletion(-) diff --git a/dlls/webservices/proxy.c b/dlls/webservices/proxy.c index ac8387a..d9821c7 100644 --- a/dlls/webservices/proxy.c +++ b/dlls/webservices/proxy.c @@ -70,9 +70,17 @@ static struct proxy *alloc_proxy(void) return ret; } +static void reset_proxy( struct proxy *proxy ) +{ + WsResetChannel( proxy->channel, NULL ); + proxy->state = WS_SERVICE_PROXY_STATE_CREATED; +} + static void free_proxy( struct proxy *proxy ) { + reset_proxy( proxy ); WsFreeChannel( proxy->channel ); + proxy->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection( &proxy->cs ); heap_free( proxy ); @@ -192,6 +200,38 @@ HRESULT WINAPI WsCreateServiceProxyFromTemplate( WS_CHANNEL_TYPE channel_type, } /************************************************************************** + * WsResetServiceProxy [webservices.@] + */ +HRESULT WINAPI WsResetServiceProxy( WS_SERVICE_PROXY *handle, WS_ERROR *error ) +{ + struct proxy *proxy = (struct proxy *)handle; + + TRACE( "%p %p\n", handle, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!proxy) return E_INVALIDARG; + + EnterCriticalSection( &proxy->cs ); + + if (proxy->magic != PROXY_MAGIC) + { + LeaveCriticalSection( &proxy->cs ); + return E_INVALIDARG; + } + + if (proxy->state != WS_SERVICE_PROXY_STATE_CREATED && proxy->state != WS_SERVICE_PROXY_STATE_CLOSED) + { + LeaveCriticalSection( &proxy->cs ); + return WS_E_INVALID_OPERATION; + } + + reset_proxy( proxy ); + + LeaveCriticalSection( &proxy->cs ); + return S_OK; +} + +/************************************************************************** * WsFreeServiceProxy [webservices.@] */ void WINAPI WsFreeServiceProxy( WS_SERVICE_PROXY *handle ) diff --git a/dlls/webservices/tests/proxy.c b/dlls/webservices/tests/proxy.c index 9351d2d..bc7ef81 100644 --- a/dlls/webservices/tests/proxy.c +++ b/dlls/webservices/tests/proxy.c @@ -185,6 +185,49 @@ static void test_WsOpenServiceProxy(void) WsFreeServiceProxy( proxy ); } +static void test_WsResetServiceProxy(void) +{ + WCHAR url[] = {'h','t','t','p',':','/','/','l','o','c','a','l','h','o','s','t','/'}; + HRESULT hr; + WS_SERVICE_PROXY *proxy; + WS_ENDPOINT_ADDRESS addr; + WS_SERVICE_PROXY_STATE state; + + hr = WsCreateServiceProxy( WS_CHANNEL_TYPE_REQUEST, WS_HTTP_CHANNEL_BINDING, NULL, NULL, + 0, NULL, 0, &proxy, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsResetServiceProxy( proxy, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + state = 0xdeadbeef; + hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, sizeof(state), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( state == WS_SERVICE_PROXY_STATE_CREATED, "got %u\n", state ); + + memset( &addr, 0, sizeof(addr) ); + addr.url.length = sizeof(url)/sizeof(url[0]); + addr.url.chars = url; + hr = WsOpenServiceProxy( proxy, &addr, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsResetServiceProxy( proxy, NULL ); + ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); + + hr = WsCloseServiceProxy( proxy , NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsResetServiceProxy( proxy, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + state = 0xdeadbeef; + hr = WsGetServiceProxyProperty( proxy, WS_PROXY_PROPERTY_STATE, &state, sizeof(state), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( state == WS_SERVICE_PROXY_STATE_CREATED, "got %u\n", state ); + + WsFreeServiceProxy( proxy ); +} + static HRESULT create_channel( int port, WS_CHANNEL **ret ) { static const WCHAR fmt[] = @@ -680,6 +723,7 @@ START_TEST(proxy) test_WsCreateServiceProxy(); test_WsCreateServiceProxyFromTemplate(); test_WsOpenServiceProxy(); + test_WsResetServiceProxy(); info.port = 7533; info.event = CreateEventW( NULL, 0, 0, NULL ); diff --git a/dlls/webservices/webservices.spec b/dlls/webservices/webservices.spec index 0a3057d..def0cca 100644 --- a/dlls/webservices/webservices.spec +++ b/dlls/webservices/webservices.spec @@ -140,7 +140,7 @@ @ stdcall WsResetMessage(ptr ptr) @ stub WsResetMetadata @ stub WsResetServiceHost -@ stub WsResetServiceProxy +@ stdcall WsResetServiceProxy(ptr ptr) @ stub WsRevokeSecurityContext @ stub WsSendFaultMessageForError @ stdcall WsSendMessage(ptr ptr ptr long ptr long ptr ptr) diff --git a/include/webservices.h b/include/webservices.h index 9f1d989..783a6ae 100644 --- a/include/webservices.h +++ b/include/webservices.h @@ -1631,6 +1631,7 @@ HRESULT WINAPI WsResetError(WS_ERROR*); HRESULT WINAPI WsResetHeap(WS_HEAP*, WS_ERROR*); HRESULT WINAPI WsResetListener(WS_LISTENER*, WS_ERROR*); HRESULT WINAPI WsResetMessage(WS_MESSAGE*, WS_ERROR*); +HRESULT WINAPI WsResetServiceProxy(WS_SERVICE_PROXY*, WS_ERROR*); HRESULT WINAPI WsRequestReply(WS_CHANNEL*, WS_MESSAGE*, const WS_MESSAGE_DESCRIPTION*, WS_WRITE_OPTION, const void*, ULONG, WS_MESSAGE*, const WS_MESSAGE_DESCRIPTION*, WS_READ_OPTION, WS_HEAP*, void*, ULONG, const WS_ASYNC_CONTEXT*, WS_ERROR*);
1
0
0
0
← Newer
1
...
63
64
65
66
67
68
69
...
76
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
Results per page:
10
25
50
100
200