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 2019
----- 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
1097 discussions
Start a n
N
ew thread
Zebediah Figura : quartz/tests: Add some tests for IBaseFilter_EnumPins() on the DirectSound renderer.
by Alexandre Julliard
12 Mar '19
12 Mar '19
Module: wine Branch: master Commit: 294af5ee91a5585e0ba858bcf3e6e77782965775 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=294af5ee91a5585e0ba858bc…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 12 00:32:56 2019 -0500 quartz/tests: Add some tests for IBaseFilter_EnumPins() on the DirectSound renderer. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/dsoundrender.c | 100 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/dlls/quartz/tests/dsoundrender.c b/dlls/quartz/tests/dsoundrender.c index f631cd2..aa24d33 100644 --- a/dlls/quartz/tests/dsoundrender.c +++ b/dlls/quartz/tests/dsoundrender.c @@ -35,6 +35,13 @@ static IBaseFilter *create_dsound_render(void) return filter; } +static ULONG get_refcount(void *iface) +{ + IUnknown *unknown = iface; + IUnknown_AddRef(unknown); + return IUnknown_Release(unknown); +} + static HRESULT WINAPI property_bag_QueryInterface(IPropertyBag *iface, REFIID iid, void **out) { ok(0, "Unexpected call (iid %s).\n", wine_dbgstr_guid(iid)); @@ -144,6 +151,98 @@ static void test_interfaces(void) IBaseFilter_Release(filter); } +static void test_enum_pins(void) +{ + IBaseFilter *filter = create_dsound_render(); + IEnumPins *enum1, *enum2; + ULONG count, ref; + IPin *pins[2]; + HRESULT hr; + + ref = get_refcount(filter); + ok(ref == 1, "Got unexpected refcount %d.\n", ref); + + hr = IBaseFilter_EnumPins(filter, NULL); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + hr = IBaseFilter_EnumPins(filter, &enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %d.\n", ref); + + hr = IEnumPins_Next(enum1, 1, NULL, NULL); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = get_refcount(filter); +todo_wine + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(pins[0]); +todo_wine + ok(ref == 3, "Got unexpected refcount %d.\n", ref); + ref = get_refcount(enum1); + ok(ref == 1, "Got unexpected refcount %d.\n", ref); + IPin_Release(pins[0]); + ref = get_refcount(filter); + ok(ref == 2, "Got unexpected refcount %d.\n", ref); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 1, "Got count %u.\n", count); + IPin_Release(pins[0]); + + hr = IEnumPins_Next(enum1, 1, pins, &count); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + ok(!count, "Got count %u.\n", count); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 2, pins, NULL); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 2, pins, &count); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + ok(count == 1, "Got count %u.\n", count); + IPin_Release(pins[0]); + + hr = IEnumPins_Reset(enum1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Clone(enum1, &enum2); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Skip(enum1, 2); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Skip(enum1, 1); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IEnumPins_Skip(enum1, 1); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum1, 1, pins, NULL); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + + hr = IEnumPins_Next(enum2, 1, pins, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IPin_Release(pins[0]); + + IEnumPins_Release(enum2); + IEnumPins_Release(enum1); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + static void test_pin(IPin *pin) { IMemInputPin *mpin = NULL; @@ -220,6 +319,7 @@ START_TEST(dsoundrender) test_property_bag(); test_interfaces(); + test_enum_pins(); test_basefilter(); CoUninitialize();
1
0
0
0
Zebediah Figura : quartz/tests: Clean up test_query_interface().
by Alexandre Julliard
12 Mar '19
12 Mar '19
Module: wine Branch: master Commit: cbb7fd5256f90e0ad42c6ba1ce58734ee8a4c3f7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cbb7fd5256f90e0ad42c6ba1…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 12 00:32:55 2019 -0500 quartz/tests: Clean up test_query_interface(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/dsoundrender.c | 192 +++++++++++++++++++++------------------ 1 file changed, 106 insertions(+), 86 deletions(-) diff --git a/dlls/quartz/tests/dsoundrender.c b/dlls/quartz/tests/dsoundrender.c index f633129..f631cd2 100644 --- a/dlls/quartz/tests/dsoundrender.c +++ b/dlls/quartz/tests/dsoundrender.c @@ -26,104 +26,122 @@ #include "amaudio.h" #include "wine/test.h" -#define QI_SUCCEED(iface, riid, ppv) hr = IUnknown_QueryInterface(iface, &riid, (LPVOID*)&ppv); \ - ok(hr == S_OK, "IUnknown_QueryInterface returned %x\n", hr); \ - ok(ppv != NULL, "Pointer is NULL\n"); - -#define RELEASE_EXPECT(iface, num) if (iface) { \ - hr = IUnknown_Release((IUnknown*)iface); \ - ok(hr == num, "IUnknown_Release should return %d, got %d\n", num, hr); \ +static IBaseFilter *create_dsound_render(void) +{ + IBaseFilter *filter = NULL; + HRESULT hr = CoCreateInstance(&CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, + &IID_IBaseFilter, (void **)&filter); + ok(hr == S_OK, "Got hr %#x.\n", hr); + return filter; } -static IUnknown *pDSRender = NULL; +static HRESULT WINAPI property_bag_QueryInterface(IPropertyBag *iface, REFIID iid, void **out) +{ + ok(0, "Unexpected call (iid %s).\n", wine_dbgstr_guid(iid)); + return E_NOINTERFACE; +} -static BOOL create_dsound_renderer(void) +static ULONG WINAPI property_bag_AddRef(IPropertyBag *iface) { - HRESULT hr; + ok(0, "Unexpected call.\n"); + return 2; +} - hr = CoCreateInstance(&CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, - &IID_IUnknown, (LPVOID*)&pDSRender); - return (hr == S_OK && pDSRender != NULL); +static ULONG WINAPI property_bag_Release(IPropertyBag *iface) +{ + ok(0, "Unexpected call.\n"); + return 1; } -static void release_dsound_renderer(void) +static HRESULT WINAPI property_bag_Read(IPropertyBag *iface, const WCHAR *name, VARIANT *var, IErrorLog *log) { - HRESULT hr; + static const WCHAR dsguidW[] = {'D','S','G','u','i','d',0}; + WCHAR guidstr[39]; + + ok(!lstrcmpW(name, dsguidW), "Got unexpected name %s.\n", wine_dbgstr_w(name)); + ok(V_VT(var) == VT_BSTR, "Got unexpected type %u.\n", V_VT(var)); + StringFromGUID2(&DSDEVID_DefaultPlayback, guidstr, ARRAY_SIZE(guidstr)); + V_BSTR(var) = SysAllocString(guidstr); + return S_OK; +} - hr = IUnknown_Release(pDSRender); - ok(hr == 0, "IUnknown_Release failed with %x\n", hr); +static HRESULT WINAPI property_bag_Write(IPropertyBag *iface, const WCHAR *name, VARIANT *var) +{ + ok(0, "Unexpected call (name %s).\n", wine_dbgstr_w(name)); + return E_FAIL; } +static const IPropertyBagVtbl property_bag_vtbl = +{ + property_bag_QueryInterface, + property_bag_AddRef, + property_bag_Release, + property_bag_Read, + property_bag_Write, +}; + static void test_property_bag(void) { + IPropertyBag property_bag = {&property_bag_vtbl}; IPersistPropertyBag *ppb; - ICreateDevEnum *devenum; - IEnumMoniker *enummon; - IPropertyBag *propbag; - IMoniker *mon; HRESULT hr; + ULONG ref; - CoCreateInstance(&CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, - &IID_ICreateDevEnum, (void **)&devenum); - ICreateDevEnum_CreateClassEnumerator(devenum, &CLSID_AudioRendererCategory, &enummon, 0); + hr = CoCreateInstance(&CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, + &IID_IPersistPropertyBag, (void **)&ppb); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + if (hr != S_OK) return; - while (IEnumMoniker_Next(enummon, 1, &mon, NULL) == S_OK) - { - hr = CoCreateInstance(&CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, - &IID_IPersistPropertyBag, (void **)&ppb); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); - if (hr != S_OK) break; + hr = IPersistPropertyBag_InitNew(ppb); + ok(hr == S_OK, "Got hr %#x.\n", hr); - IMoniker_BindToStorage(mon, NULL, NULL, &IID_IPropertyBag, (void **)&propbag); + hr = IPersistPropertyBag_Load(ppb, &property_bag, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); - hr = IPersistPropertyBag_InitNew(ppb); - ok(hr == S_OK, "Got hr %#x.\n", hr); + ref = IPersistPropertyBag_Release(ppb); + ok(!ref, "Got unexpected refcount %d.\n", ref); +} - hr = IPersistPropertyBag_Load(ppb, propbag, NULL); - ok(hr == S_OK, "Got hr %#x.\n", hr); +#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c) +static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported) +{ + IUnknown *iface = iface_ptr; + HRESULT hr, expected_hr; + IUnknown *unk; - IPersistPropertyBag_Release(ppb); - IPropertyBag_Release(propbag); - IMoniker_Release(mon); - } + expected_hr = supported ? S_OK : E_NOINTERFACE; - IEnumMoniker_Release(enummon); - ICreateDevEnum_Release(devenum); + hr = IUnknown_QueryInterface(iface, iid, (void **)&unk); + ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr); + if (SUCCEEDED(hr)) + IUnknown_Release(unk); } -static void test_query_interface(void) +static void test_interfaces(void) { - HRESULT hr; - IBaseFilter *pBaseFilter = NULL; - IBasicAudio *pBasicAudio = NULL; - IMediaPosition *pMediaPosition = NULL; - IMediaSeeking *pMediaSeeking = NULL; - IQualityControl *pQualityControl = NULL; - IPersistPropertyBag *ppb = NULL; - IDirectSound3DBuffer *ds3dbuf = NULL; - IReferenceClock *clock = NULL; - IAMDirectSound *pAMDirectSound = NULL; - - QI_SUCCEED(pDSRender, IID_IBaseFilter, pBaseFilter); - RELEASE_EXPECT(pBaseFilter, 1); - QI_SUCCEED(pDSRender, IID_IBasicAudio, pBasicAudio); - RELEASE_EXPECT(pBasicAudio, 1); - QI_SUCCEED(pDSRender, IID_IMediaSeeking, pMediaSeeking); - RELEASE_EXPECT(pMediaSeeking, 1); - QI_SUCCEED(pDSRender, IID_IReferenceClock, clock); - RELEASE_EXPECT(clock, 1); - QI_SUCCEED(pDSRender, IID_IAMDirectSound, pAMDirectSound); - RELEASE_EXPECT( pAMDirectSound, 1); - todo_wine { - QI_SUCCEED(pDSRender, IID_IDirectSound3DBuffer, ds3dbuf); - RELEASE_EXPECT(ds3dbuf, 1); - QI_SUCCEED(pDSRender, IID_IPersistPropertyBag, ppb); - RELEASE_EXPECT(ppb, 1); - } - QI_SUCCEED(pDSRender, IID_IMediaPosition, pMediaPosition); - RELEASE_EXPECT(pMediaPosition, 1); - QI_SUCCEED(pDSRender, IID_IQualityControl, pQualityControl); - RELEASE_EXPECT(pQualityControl, 1); + IBaseFilter *filter = create_dsound_render(); + + check_interface(filter, &IID_IAMDirectSound, TRUE); + check_interface(filter, &IID_IBaseFilter, TRUE); + check_interface(filter, &IID_IBasicAudio, TRUE); + todo_wine check_interface(filter, &IID_IDirectSound3DBuffer, TRUE); + check_interface(filter, &IID_IMediaFilter, TRUE); + check_interface(filter, &IID_IMediaPosition, TRUE); + check_interface(filter, &IID_IMediaSeeking, TRUE); + check_interface(filter, &IID_IPersist, TRUE); + todo_wine check_interface(filter, &IID_IPersistPropertyBag, TRUE); + check_interface(filter, &IID_IQualityControl, TRUE); + check_interface(filter, &IID_IReferenceClock, TRUE); + check_interface(filter, &IID_IUnknown, TRUE); + + todo_wine check_interface(filter, &IID_IAMFilterMiscFlags, FALSE); + check_interface(filter, &IID_IBasicVideo, FALSE); + check_interface(filter, &IID_IKsPropertySet, FALSE); + check_interface(filter, &IID_IPin, FALSE); + check_interface(filter, &IID_IQualProp, FALSE); + check_interface(filter, &IID_IVideoWindow, FALSE); + + IBaseFilter_Release(filter); } static void test_pin(IPin *pin) @@ -145,19 +163,11 @@ static void test_pin(IPin *pin) static void test_basefilter(void) { IEnumPins *pin_enum = NULL; - IBaseFilter *base = NULL; + IBaseFilter *base = create_dsound_render(); IPin *pins[2]; ULONG ref; HRESULT hr; - IUnknown_QueryInterface(pDSRender, &IID_IBaseFilter, (void **)&base); - if (base == NULL) - { - /* test_query_interface handles this case */ - skip("No IBaseFilter\n"); - return; - } - hr = IBaseFilter_EnumPins(base, NULL); ok(hr == E_POINTER, "hr = %08x and not E_POINTER\n", hr); @@ -192,15 +202,25 @@ static void test_basefilter(void) START_TEST(dsoundrender) { + IBaseFilter *filter; + HRESULT hr; + CoInitialize(NULL); - if (!create_dsound_renderer()) + + hr = CoCreateInstance(&CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, + &IID_IBaseFilter, (void **)&filter); + if (hr == VFW_E_NO_AUDIO_HARDWARE) + { + skip("No audio hardware.\n"); + CoUninitialize(); return; + } + ok(hr == S_OK, "Got hr %#x.\n", hr); + IBaseFilter_Release(filter); test_property_bag(); - test_query_interface(); + test_interfaces(); test_basefilter(); - release_dsound_renderer(); - CoUninitialize(); }
1
0
0
0
Zebediah Figura : quartz/tests: Clean up tests for IPersistPropertyBag on the DirectSound renderer.
by Alexandre Julliard
12 Mar '19
12 Mar '19
Module: wine Branch: master Commit: fd2412fbe5ff8d9d1da743f18b688fc246d251b2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fd2412fbe5ff8d9d1da743f1…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 12 00:32:54 2019 -0500 quartz/tests: Clean up tests for IPersistPropertyBag on the DirectSound renderer. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/dsoundrender.c | 91 ++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 59 deletions(-) diff --git a/dlls/quartz/tests/dsoundrender.c b/dlls/quartz/tests/dsoundrender.c index c350192..f633129 100644 --- a/dlls/quartz/tests/dsoundrender.c +++ b/dlls/quartz/tests/dsoundrender.c @@ -1,5 +1,5 @@ /* - * Unit tests for DSound Renderer functions + * DirectSound renderer filter unit tests * * Copyright (C) 2010 Maarten Lankhorst for CodeWeavers * Copyright (C) 2007 Google (Lei Zhang) @@ -20,12 +20,11 @@ */ #define COBJMACROS - -#include "wine/test.h" #include "dshow.h" #include "initguid.h" #include "dsound.h" #include "amaudio.h" +#include "wine/test.h" #define QI_SUCCEED(iface, riid, ppv) hr = IUnknown_QueryInterface(iface, &riid, (LPVOID*)&ppv); \ ok(hr == S_OK, "IUnknown_QueryInterface returned %x\n", hr); \ @@ -55,64 +54,43 @@ static void release_dsound_renderer(void) ok(hr == 0, "IUnknown_Release failed with %x\n", hr); } -static HRESULT WINAPI PB_QueryInterface(IPropertyBag *iface, REFIID riid, void **ppv) -{ - ok(0, "Should not be called\n"); - *ppv = NULL; - return E_NOINTERFACE; -} - -static ULONG WINAPI PB_AddRef(IPropertyBag *iface) +static void test_property_bag(void) { - ok(0, "Should not be called\n"); - return 2; -} + IPersistPropertyBag *ppb; + ICreateDevEnum *devenum; + IEnumMoniker *enummon; + IPropertyBag *propbag; + IMoniker *mon; + HRESULT hr; -static ULONG WINAPI PB_Release(IPropertyBag *iface) -{ - ok(0, "Should not be called\n"); - return 1; -} + CoCreateInstance(&CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, + &IID_ICreateDevEnum, (void **)&devenum); + ICreateDevEnum_CreateClassEnumerator(devenum, &CLSID_AudioRendererCategory, &enummon, 0); -static HRESULT WINAPI PB_Read(IPropertyBag *iface, LPCOLESTR name, VARIANT *var, IErrorLog *log) -{ - static const WCHAR dsguid[] = { 'D','S','G','u','i','d', 0 }; - char temp[50]; - WideCharToMultiByte(CP_ACP, 0, name, -1, temp, sizeof(temp)-1, NULL, NULL); - temp[sizeof(temp)-1] = 0; - trace("Trying to read %s, type %u\n", temp, var->n1.n2.vt); - if (!lstrcmpW(name, dsguid)) + while (IEnumMoniker_Next(enummon, 1, &mon, NULL) == S_OK) { - static const WCHAR defaultplayback[] = - { - '{','D','E','F','0','0','0','0','0','-', - '9','C','6','D','-','4','7','E','D','-', - 'A','A','F','1','-','4','D','D','A','8', - 'F','2','B','5','C','0','3','}',0 - }; - ok(var->n1.n2.vt == VT_BSTR, "Wrong type asked: %u\n", var->n1.n2.vt); - var->n1.n2.n3.bstrVal = SysAllocString(defaultplayback); - return S_OK; + hr = CoCreateInstance(&CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, + &IID_IPersistPropertyBag, (void **)&ppb); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + if (hr != S_OK) break; + + IMoniker_BindToStorage(mon, NULL, NULL, &IID_IPropertyBag, (void **)&propbag); + + hr = IPersistPropertyBag_InitNew(ppb); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IPersistPropertyBag_Load(ppb, propbag, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + IPersistPropertyBag_Release(ppb); + IPropertyBag_Release(propbag); + IMoniker_Release(mon); } - ok(0, "Unknown property '%s' queried\n", temp); - return E_FAIL; -} -static HRESULT WINAPI PB_Write(IPropertyBag *iface, LPCOLESTR name, VARIANT *var) -{ - ok(0, "Should not be called\n"); - return E_FAIL; + IEnumMoniker_Release(enummon); + ICreateDevEnum_Release(devenum); } -static IPropertyBagVtbl PB_Vtbl = -{ - PB_QueryInterface, - PB_AddRef, - PB_Release, - PB_Read, - PB_Write -}; - static void test_query_interface(void) { HRESULT hr; @@ -140,12 +118,6 @@ static void test_query_interface(void) QI_SUCCEED(pDSRender, IID_IDirectSound3DBuffer, ds3dbuf); RELEASE_EXPECT(ds3dbuf, 1); QI_SUCCEED(pDSRender, IID_IPersistPropertyBag, ppb); - if (ppb) - { - IPropertyBag bag = { &PB_Vtbl }; - hr = IPersistPropertyBag_Load(ppb, &bag, NULL); - ok(hr == S_OK, "Couldn't load default device: %08x\n", hr); - } RELEASE_EXPECT(ppb, 1); } QI_SUCCEED(pDSRender, IID_IMediaPosition, pMediaPosition); @@ -224,6 +196,7 @@ START_TEST(dsoundrender) if (!create_dsound_renderer()) return; + test_property_bag(); test_query_interface(); test_basefilter();
1
0
0
0
Zebediah Figura : quartz/tests: Add some tests for ACM wrapper pin interfaces.
by Alexandre Julliard
12 Mar '19
12 Mar '19
Module: wine Branch: master Commit: 2d9d66b7b20f4ca93707177891f3df864281fc3e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2d9d66b7b20f4ca937071778…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Mar 12 00:32:53 2019 -0500 quartz/tests: Add some tests for ACM wrapper pin interfaces. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/acmwrapper.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/dlls/quartz/tests/acmwrapper.c b/dlls/quartz/tests/acmwrapper.c index 571e78d9..a543893 100644 --- a/dlls/quartz/tests/acmwrapper.c +++ b/dlls/quartz/tests/acmwrapper.c @@ -61,6 +61,7 @@ static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOO static void test_interfaces(void) { IBaseFilter *filter = create_acm_wrapper(); + IPin *pin; check_interface(filter, &IID_IBaseFilter, TRUE); check_interface(filter, &IID_IMediaFilter, TRUE); @@ -80,6 +81,30 @@ static void test_interfaces(void) check_interface(filter, &IID_IReferenceClock, FALSE); check_interface(filter, &IID_IVideoWindow, FALSE); + IBaseFilter_FindPin(filter, sink_id, &pin); + + check_interface(pin, &IID_IMemInputPin, TRUE); + check_interface(pin, &IID_IPin, TRUE); + todo_wine check_interface(pin, &IID_IQualityControl, TRUE); + check_interface(pin, &IID_IUnknown, TRUE); + + check_interface(pin, &IID_IMediaPosition, FALSE); + todo_wine check_interface(pin, &IID_IMediaSeeking, FALSE); + + IPin_Release(pin); + + IBaseFilter_FindPin(filter, source_id, &pin); + + check_interface(pin, &IID_IPin, TRUE); + todo_wine check_interface(pin, &IID_IMediaPosition, TRUE); + check_interface(pin, &IID_IMediaSeeking, TRUE); + check_interface(pin, &IID_IQualityControl, TRUE); + check_interface(pin, &IID_IUnknown, TRUE); + + check_interface(pin, &IID_IAsyncReader, FALSE); + + IPin_Release(pin); + IBaseFilter_Release(filter); }
1
0
0
0
Alexandre Julliard : winegcc: Use a .spec.o files when building for Windows.
by Alexandre Julliard
12 Mar '19
12 Mar '19
Module: wine Branch: master Commit: 4c0ea277cbbd575a362ad96f632e2a9390be65ea URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4c0ea277cbbd575a362ad96f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 12 10:02:50 2019 +0100 winegcc: Use a .spec.o files when building for Windows. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winegcc/winegcc.c | 170 ++++++++++++------------------------------------ 1 file changed, 41 insertions(+), 129 deletions(-) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 94d2906..79a4cbe 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -818,21 +818,6 @@ static strarray *get_winebuild_args(struct options *opts) return spec_args; } -static const char* compile_resources_to_object(struct options* opts, const strarray *resources, - const char *res_o_name) -{ - strarray *winebuild_args = get_winebuild_args( opts ); - - strarray_add( winebuild_args, "--resources" ); - strarray_add( winebuild_args, "-o" ); - strarray_add( winebuild_args, res_o_name ); - strarray_addall( winebuild_args, resources ); - - spawn( opts->prefix, winebuild_args, 0 ); - strarray_free( winebuild_args ); - return res_o_name; -} - /* check if there is a static lib associated to a given dll */ static char *find_static_lib( const char *dll ) { @@ -873,11 +858,12 @@ static void build(struct options* opts) { strarray *lib_dirs, *files; strarray *spec_args, *link_args; - char *output_file; + char *output_file, *output_path; const char *spec_o_name; const char *output_name, *spec_file, *lang; int generate_app_loader = 1; int fake_module = 0; + int is_pe = (opts->target_platform == PLATFORM_WINDOWS || opts->target_platform == PLATFORM_CYGWIN); unsigned int j; /* NOTE: for the files array we'll use the following convention: @@ -900,7 +886,7 @@ static void build(struct options* opts) } /* generate app loader only for .exe */ - if (opts->shared || strendswith(output_file, ".so")) + if (opts->shared || is_pe || strendswith(output_file, ".so")) generate_app_loader = 0; if (strendswith(output_file, ".fake")) fake_module = 1; @@ -912,6 +898,7 @@ static void build(struct options* opts) else output_name = output_file; if (!strchr(output_name, '.')) output_file = strmake("%s.%s", output_file, opts->shared ? "dll" : "exe"); + output_path = is_pe ? output_file : strmake( "%s.so", output_file ); /* get the filename from the path */ if ((output_name = strrchr(output_file, '/'))) output_name++; @@ -980,118 +967,19 @@ static void build(struct options* opts) lang = file; } - /* building for Windows is completely different */ - - if (opts->target_platform == PLATFORM_WINDOWS || opts->target_platform == PLATFORM_CYGWIN) - { - strarray *resources = strarray_alloc(); - char *res_o_name = NULL; - - if (opts->win16_app) - error( "Building 16-bit code is not supported for Windows\n" ); - - link_args = get_link_args( opts, output_name ); - - if (opts->shared) - { - /* run winebuild to generate the .def file */ - char *spec_def_name = get_temp_file(output_name, ".spec.def"); - spec_args = get_winebuild_args( opts ); - strarray_add(spec_args, "--def"); - strarray_add(spec_args, "-o"); - strarray_add(spec_args, spec_def_name); - if (spec_file) - { - strarray_add(spec_args, "--export"); - strarray_add(spec_args, spec_file); - } - spawn(opts->prefix, spec_args, 0); - strarray_free(spec_args); - - strarray_add(link_args, spec_def_name); - } - - strarray_add(link_args, "-o"); - strarray_add(link_args, output_file); - - for ( j = 0; j < lib_dirs->size; j++ ) - strarray_add(link_args, strmake("-L%s", lib_dirs->base[j])); - - if (!opts->nodefaultlibs) - { - add_library(opts, lib_dirs, files, "winecrt0"); - add_library(opts, lib_dirs, files, "kernel32"); - add_library(opts, lib_dirs, files, "ntdll"); - } - if (!opts->shared && opts->use_msvcrt && opts->target_platform == PLATFORM_CYGWIN) - add_library(opts, lib_dirs, files, "msvcrt"); - - for ( j = 0; j < files->size; j++ ) - { - const char* name = files->base[j] + 2; - - switch(files->base[j][1]) - { - case 'l': - case 'd': - strarray_add(link_args, strmake("-l%s", name)); - break; - case 's': - case 'o': - strarray_add(link_args, name); - break; - case 'a': - if (!opts->lib_suffix && strchr(name, '/')) - { - /* turn the path back into -Ldir -lfoo options - * this makes sure that we use the specified libs even - * when mingw adds its own import libs to the link */ - char *lib = xstrdup( name ); - char *p = strrchr( lib, '/' ); - - *p++ = 0; - if (!strncmp( p, "lib", 3 )) - { - char *ext = strrchr( p, '.' ); - - if (ext) *ext = 0; - p += 3; - strarray_add(link_args, strmake("-L%s", lib )); - strarray_add(link_args, strmake("-l%s", p )); - free( lib ); - break; - } - free( lib ); - } - strarray_add(link_args, name); - break; - case 'r': - if (!res_o_name) - { - res_o_name = get_temp_file( output_name, ".res.o" ); - strarray_add( link_args, res_o_name ); - } - strarray_add( resources, name ); - break; - } - } + if (opts->win16_app && is_pe) + error( "Building 16-bit code is not supported for Windows\n" ); - if (res_o_name) compile_resources_to_object( opts, resources, res_o_name ); + /* add the default libraries, if needed */ - spawn(opts->prefix, link_args, 0); - strarray_free (resources); - strarray_free (link_args); - strarray_free (lib_dirs); - strarray_free (files); - return; + if (!opts->nostdlib && opts->use_msvcrt && opts->target_platform != PLATFORM_WINDOWS) + { + if (!is_pe || !opts->shared) add_library(opts, lib_dirs, files, "msvcrt"); } - /* add the default libraries, if needed */ - if (!opts->nostdlib && opts->use_msvcrt) add_library(opts, lib_dirs, files, "msvcrt"); - - if (!opts->wine_objdir && !opts->nodefaultlibs) + if (!opts->wine_objdir && !opts->nodefaultlibs) { - if (opts->gui_app) + if (opts->gui_app) { add_library(opts, lib_dirs, files, "shell32"); add_library(opts, lib_dirs, files, "comdlg32"); @@ -1108,7 +996,7 @@ static void build(struct options* opts) add_library(opts, lib_dirs, files, "kernel32"); add_library(opts, lib_dirs, files, "ntdll"); } - if (!opts->nostdlib) add_library(opts, lib_dirs, files, "wine"); + if (!opts->nostdlib && !is_pe) add_library(opts, lib_dirs, files, "wine"); /* run winebuild to generate the .spec.o file */ spec_args = get_winebuild_args( opts ); @@ -1191,7 +1079,7 @@ static void build(struct options* opts) link_args = get_link_args( opts, output_name ); strarray_add(link_args, "-o"); - strarray_add(link_args, strmake("%s.so", output_file)); + strarray_add(link_args, output_path); for ( j = 0; j < lib_dirs->size; j++ ) strarray_add(link_args, strmake("-L%s", lib_dirs->base[j])); @@ -1207,14 +1095,38 @@ static void build(struct options* opts) strarray_add(link_args, strmake("-l%s", name)); break; case 's': - case 'a': case 'o': strarray_add(link_args, name); break; + case 'a': + if (is_pe && !opts->lib_suffix && strchr(name, '/')) + { + /* turn the path back into -Ldir -lfoo options + * this makes sure that we use the specified libs even + * when mingw adds its own import libs to the link */ + char *lib = xstrdup( name ); + char *p = strrchr( lib, '/' ); + + *p++ = 0; + if (!strncmp( p, "lib", 3 )) + { + char *ext = strrchr( p, '.' ); + + if (ext) *ext = 0; + p += 3; + strarray_add(link_args, strmake("-L%s", lib )); + strarray_add(link_args, strmake("-l%s", p )); + free( lib ); + break; + } + free( lib ); + } + strarray_add(link_args, name); + break; } } - if (!opts->nostdlib) + if (!opts->nostdlib && !is_pe) { strarray_add(link_args, "-lm"); strarray_add(link_args, "-lc"); @@ -1232,7 +1144,7 @@ static void build(struct options* opts) strarray_add(prelink_args, opts->prelink); strarray_add(prelink_args, "--reloc-only"); strarray_add(prelink_args, opts->image_base); - strarray_add(prelink_args, strmake("%s.so", output_file)); + strarray_add(prelink_args, output_path); spawn(opts->prefix, prelink_args, 1); strarray_free(prelink_args); }
1
0
0
0
Alexandre Julliard : winebuild: Support generating a .spec.o file for Windows platforms.
by Alexandre Julliard
12 Mar '19
12 Mar '19
Module: wine Branch: master Commit: e4b9a501a3ddbbfb2cd8aee6eb9330f6af91fe6d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e4b9a501a3ddbbfb2cd8aee6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 12 10:02:04 2019 +0100 winebuild: Support generating a .spec.o file for Windows platforms. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winebuild/build.h | 1 + tools/winebuild/main.c | 3 ++- tools/winebuild/res32.c | 9 ++++++--- tools/winebuild/spec32.c | 23 ++++++++++++++++++++++- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index 44fa317..1d4f217 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -303,6 +303,7 @@ extern int load_res32_file( const char *name, DLLSPEC *spec ); extern void output_resources( DLLSPEC *spec ); extern void output_bin_resources( DLLSPEC *spec, unsigned int start_rva ); extern void output_spec32_file( DLLSPEC *spec ); +extern void output_pe_module( DLLSPEC *spec ); extern void output_fake_module( DLLSPEC *spec ); extern void output_def_file( DLLSPEC *spec, int include_private ); extern void load_res16_file( const char *name, DLLSPEC *spec ); diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index d7bc39f..781d391 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -645,7 +645,8 @@ int main(int argc, char **argv) output_spec16_file( spec ); break; case SPEC_WIN32: - output_spec32_file( spec ); + if (target_platform == PLATFORM_WINDOWS) output_pe_module( spec ); + else output_spec32_file( spec ); break; default: assert(0); } diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c index 16e5c65..634c933 100644 --- a/tools/winebuild/res32.c +++ b/tools/winebuild/res32.c @@ -441,7 +441,7 @@ void output_resources( DLLSPEC *spec ) /* output the resource directories */ output( "\n/* resources */\n\n" ); - output( "\t.data\n" ); + output( "\t.section %s\n", target_platform == PLATFORM_WINDOWS ? ".rsrc" : ".data" ); output( "\t.align %d\n", get_alignment(get_ptr_size()) ); output( ".L__wine_spec_resources:\n" ); @@ -498,9 +498,12 @@ void output_resources( DLLSPEC *spec ) output( ".L__wine_spec_res_%d:\n", i ); dump_res_data( res ); } - output( ".L__wine_spec_resources_end:\n" ); - output( "\t.byte 0\n" ); + if (target_platform != PLATFORM_WINDOWS) + { + output( ".L__wine_spec_resources_end:\n" ); + output( "\t.byte 0\n" ); + } free_resource_tree( tree ); } diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 7b4d661..d0c147d 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -384,7 +384,7 @@ void output_exports( DLLSPEC *spec ) if (!nr_exports) return; output( "\n/* export table */\n\n" ); - output( "\t.data\n" ); + output( "\t.section %s\n", target_platform == PLATFORM_WINDOWS ? ".edata" : ".data" ); output( "\t.align %d\n", get_alignment(4) ); output( ".L__wine_spec_exports:\n" ); @@ -492,6 +492,9 @@ void output_exports( DLLSPEC *spec ) output( "\t%s \"%s\"\n", get_asm_string_keyword(), odp->link_name ); } } + + if (target_platform == PLATFORM_WINDOWS) return; + output( "\t.align %d\n", get_alignment(get_ptr_size()) ); output( ".L__wine_spec_exports_end:\n" ); @@ -708,6 +711,24 @@ void output_spec32_file( DLLSPEC *spec ) /******************************************************************* + * output_pe_module + * + * Build a PE from a spec file. + */ +void output_pe_module( DLLSPEC *spec ) +{ + UsePIC = 0; + resolve_imports( spec ); + open_output_file(); + output_standard_file_header(); + output_stubs( spec ); + output_exports( spec ); + output_resources( spec ); + close_output_file(); +} + + +/******************************************************************* * output_fake_module * * Build a fake binary module from a spec file.
1
0
0
0
Huw Davies : winegcc: Restore the linker option specifier for strip.
by Alexandre Julliard
12 Mar '19
12 Mar '19
Module: wine Branch: master Commit: 7cb188fdb1227c8249f9fbd9b63ebdf1223a89e8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7cb188fdb1227c8249f9fbd9…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Mar 12 08:44:12 2019 +0000 winegcc: Restore the linker option specifier for strip. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winegcc/winegcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index b58c39a..94d2906 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -406,7 +406,7 @@ static strarray *get_link_args( struct options *opts, const char *output_name ) strarray_add( flags, "-image_base" ); strarray_add( flags, opts->image_base ); } - if (opts->strip) strarray_add( flags, "-x" ); + if (opts->strip) strarray_add( flags, "-Wl,-x" ); return flags; case PLATFORM_SOLARIS:
1
0
0
0
Vincent Povirk : mscoree: Implement an override setting for .net libraries.
by Alexandre Julliard
11 Mar '19
11 Mar '19
Module: wine Branch: master Commit: 5baadda536172d6713fa6fef1196dc2baa773904 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5baadda536172d6713fa6fef…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Fri Mar 8 15:40:41 2019 -0600 mscoree: Implement an override setting for .net libraries. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mscoree/metahost.c | 319 ++++++++++++++++++++++++++++++++++++++--- dlls/mscoree/mscoree_private.h | 1 + 2 files changed, 300 insertions(+), 20 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=5baadda536172d6713fa…
1
0
0
0
Jacek Caban : server: Wake waiters when new pipe server instance is created.
by Alexandre Julliard
11 Mar '19
11 Mar '19
Module: wine Branch: master Commit: c8b50c98a34f6f6e32a946ffcc8c758dcabb819c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c8b50c98a34f6f6e32a946ff…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 11 17:03:33 2019 +0100 server: Wake waiters when new pipe server instance is created. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/pipe.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++ server/named_pipe.c | 1 + 2 files changed, 79 insertions(+) diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 7817fd5..4c7df3d 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -3808,6 +3808,83 @@ static void test_multiple_instances(void) } } +static DWORD WINAPI wait_pipe_proc(void *arg) +{ + BOOL ret; + ret = WaitNamedPipeA(PIPENAME, 1000); + ok(ret, "WaitNamedPipe failed (%u)\n", GetLastError()); + return 0; +} + +static HANDLE async_wait_pipe(void) +{ + HANDLE thread; + BOOL ret; + + thread = CreateThread(NULL, 0, wait_pipe_proc, NULL, 0, NULL); + ok(thread != NULL, "CreateThread failed: %u\n", GetLastError()); + + ret = WaitNamedPipeA(PIPENAME, 1); + ok(!ret && GetLastError() == ERROR_SEM_TIMEOUT, "WaitNamedPipe failed %x(%u)\n", ret, GetLastError()); + + return thread; +} + +static void test_wait_pipe(void) +{ + HANDLE server[2], client, wait; + OVERLAPPED ov; + DWORD res; + BOOL ret; + + ret = WaitNamedPipeA(PIPENAME, 0); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "WaitNamedPipe failed %x(%u)\n", ret, GetLastError()); + + server[0] = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, + PIPE_READMODE_BYTE | PIPE_WAIT, ARRAY_SIZE(server), 1024, 1024, + NMPWAIT_USE_DEFAULT_WAIT, NULL); + ok(server[0] != INVALID_HANDLE_VALUE, "got invalid handle\n"); + + ret = WaitNamedPipeA(PIPENAME, 1); + ok(ret, "WaitNamedPipe failed (%u)\n", GetLastError()); + + client = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); + ok(client != INVALID_HANDLE_VALUE, "got invalid handle\n"); + + /* Creating a new pipe server wakes waiters */ + wait = async_wait_pipe(); + server[1] = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, + PIPE_READMODE_BYTE | PIPE_WAIT, ARRAY_SIZE(server), 1024, 1024, + NMPWAIT_USE_DEFAULT_WAIT, NULL); + ok(server[1] != INVALID_HANDLE_VALUE, "got invalid handle\n"); + + res = WaitForSingleObject(wait, 100); + ok(res == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", res); + + CloseHandle(wait); + CloseHandle(server[1]); + + CloseHandle(client); + ret = DisconnectNamedPipe(server[0]); + ok(ret, "DisconnectNamedPipe failed (%u)\n", GetLastError()); + + /* Putting pipe server into waiting listening state wakes waiters */ + wait = async_wait_pipe(); + memset(&ov, 0, sizeof(ov)); + ov.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); + ret = ConnectNamedPipe(server[0], &ov); + ok(ret == FALSE, "got %d\n", ret); + ok(GetLastError() == ERROR_IO_PENDING, "got %d\n", GetLastError()); + + res = WaitForSingleObject(wait, 100); + ok(res == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", res); + CloseHandle(server[0]); + + res = WaitForSingleObject(ov.hEvent, 0); + ok(res == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", res); + CloseHandle(ov.hEvent); +} + START_TEST(pipe) { char **argv; @@ -3874,4 +3951,5 @@ START_TEST(pipe) test_namedpipe_process_id(); test_namedpipe_session_id(); test_multiple_instances(); + test_wait_pipe(); } diff --git a/server/named_pipe.c b/server/named_pipe.c index 85e7286..a6ec8ae 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -1173,6 +1173,7 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned } allow_fd_caching( server->pipe_end.fd ); set_fd_signaled( server->pipe_end.fd, 1 ); + async_wake_up( &pipe->waiters, STATUS_SUCCESS ); return server; }
1
0
0
0
Jacek Caban : server: Connect pipe servers in order that they enter listening state.
by Alexandre Julliard
11 Mar '19
11 Mar '19
Module: wine Branch: master Commit: be3ae0131ee79156178c6f34d31aae2561e9ab97 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=be3ae0131ee79156178c6f34…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 11 17:03:23 2019 +0100 server: Connect pipe servers in order that they enter listening state. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/pipe.c | 114 ++++++++++++++++++++++++++++++++++++++++++--- server/named_pipe.c | 52 ++++++--------------- 2 files changed, 122 insertions(+), 44 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=be3ae0131ee79156178c…
1
0
0
0
← Newer
1
...
59
60
61
62
63
64
65
...
110
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
Results per page:
10
25
50
100
200