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 2016
----- 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
750 discussions
Start a n
N
ew thread
Józef Kucia : d3d11/tests: Add more tests for D3D11CreateDeviceAndSwapChain().
by Alexandre Julliard
12 Apr '16
12 Apr '16
Module: wine Branch: master Commit: 80284177996d172078fa5197ae84044490c734aa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=80284177996d172078fa5197a…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Apr 12 12:29:39 2016 +0200 d3d11/tests: Add more tests for D3D11CreateDeviceAndSwapChain(). 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/d3d11/tests/d3d11.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index ee7103d..6237575 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -677,8 +677,16 @@ static void test_create_device(void) &swapchain_desc, NULL, NULL, NULL, NULL); ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr); + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + &swapchain_desc, &swapchain, NULL, NULL, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + IDXGISwapChain_Release(swapchain); + swapchain_desc.OutputWindow = NULL; hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + &swapchain_desc, NULL, NULL, NULL, NULL); + ok(hr == S_FALSE, "D3D11CreateDeviceAndSwapChain returned %#x.\n", hr); + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, &swapchain_desc, NULL, &device, NULL, NULL); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); ID3D11Device_Release(device);
1
0
0
0
Józef Kucia : dxgi: Implement dxgi_swapchain_GetDevice().
by Alexandre Julliard
12 Apr '16
12 Apr '16
Module: wine Branch: master Commit: 282afc4450e71339ce366b55cdf454e05cc04a2b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=282afc4450e71339ce366b55c…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Apr 12 12:29:38 2016 +0200 dxgi: Implement dxgi_swapchain_GetDevice(). 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/d3d11/device.c | 2 +- dlls/dxgi/device.c | 12 +++++------- dlls/dxgi/dxgi_private.h | 3 ++- dlls/dxgi/factory.c | 2 +- dlls/dxgi/swapchain.c | 41 ++++++++++++++++++++++++++++++++++------- dlls/dxgi/tests/device.c | 2 +- include/wine/winedxgi.idl | 1 + 7 files changed, 45 insertions(+), 18 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 4f24c48..9144438 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -5064,7 +5064,7 @@ static HRESULT CDECL device_parent_create_swapchain(struct wined3d_device_parent return E_FAIL; } - hr = IWineDXGIDevice_create_swapchain(wine_device, desc, swapchain); + hr = IWineDXGIDevice_create_swapchain(wine_device, desc, TRUE, swapchain); IWineDXGIDevice_Release(wine_device); if (FAILED(hr)) { diff --git a/dlls/dxgi/device.c b/dlls/dxgi/device.c index a10bb01..0c82383 100644 --- a/dlls/dxgi/device.c +++ b/dlls/dxgi/device.c @@ -310,31 +310,29 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_surface(IWineDXGIDevice *ifa } static HRESULT STDMETHODCALLTYPE dxgi_device_create_swapchain(IWineDXGIDevice *iface, - struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **wined3d_swapchain) + struct wined3d_swapchain_desc *desc, BOOL implicit, struct wined3d_swapchain **wined3d_swapchain) { - struct dxgi_device *This = impl_from_IWineDXGIDevice(iface); + struct dxgi_device *device = impl_from_IWineDXGIDevice(iface); struct dxgi_swapchain *object; HRESULT hr; TRACE("iface %p, desc %p, wined3d_swapchain %p.\n", iface, desc, wined3d_swapchain); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) { ERR("Failed to allocate DXGI swapchain object memory\n"); return E_OUTOFMEMORY; } - hr = dxgi_swapchain_init(object, This, desc); - if (FAILED(hr)) + if (FAILED(hr = dxgi_swapchain_init(object, device, desc, implicit))) { WARN("Failed to initialize swapchain, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); return hr; } - TRACE("Created IDXGISwapChain %p\n", object); + TRACE("Created IDXGISwapChain %p.\n", object); *wined3d_swapchain = object->wined3d_swapchain; return S_OK; diff --git a/dlls/dxgi/dxgi_private.h b/dlls/dxgi/dxgi_private.h index 86d8608..fb49b21 100644 --- a/dlls/dxgi/dxgi_private.h +++ b/dlls/dxgi/dxgi_private.h @@ -157,10 +157,11 @@ struct dxgi_swapchain LONG refcount; struct wined3d_private_store private_store; struct wined3d_swapchain *wined3d_swapchain; + IWineDXGIDevice *device; }; HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device *device, - struct wined3d_swapchain_desc *desc) DECLSPEC_HIDDEN; + struct wined3d_swapchain_desc *desc, BOOL implicit) DECLSPEC_HIDDEN; /* IDXGISurface */ struct dxgi_surface diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index 5956e62..8e16311 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -246,7 +246,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IDXGIFactory1 *ifa wined3d_desc.swap_interval = WINED3DPRESENT_INTERVAL_DEFAULT; wined3d_desc.auto_restore_display_mode = TRUE; - hr = IWineDXGIDevice_create_swapchain(dxgi_device, &wined3d_desc, &wined3d_swapchain); + hr = IWineDXGIDevice_create_swapchain(dxgi_device, &wined3d_desc, FALSE, &wined3d_swapchain); IWineDXGIDevice_Release(dxgi_device); if (FAILED(hr)) { diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index 10a5786..b729970 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -70,16 +70,19 @@ static ULONG STDMETHODCALLTYPE dxgi_swapchain_AddRef(IDXGISwapChain *iface) static ULONG STDMETHODCALLTYPE dxgi_swapchain_Release(IDXGISwapChain *iface) { - struct dxgi_swapchain *This = impl_from_IDXGISwapChain(iface); - ULONG refcount = InterlockedDecrement(&This->refcount); + struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface); + ULONG refcount = InterlockedDecrement(&swapchain->refcount); - TRACE("%p decreasing refcount to %u\n", This, refcount); + TRACE("%p decreasing refcount to %u.\n", swapchain, refcount); if (!refcount) { + IWineDXGIDevice *device = swapchain->device; wined3d_mutex_lock(); - wined3d_swapchain_decref(This->wined3d_swapchain); + wined3d_swapchain_decref(swapchain->wined3d_swapchain); wined3d_mutex_unlock(); + if (device) + IWineDXGIDevice_Release(device); } return refcount; @@ -128,9 +131,18 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetParent(IDXGISwapChain *iface, static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDevice(IDXGISwapChain *iface, REFIID riid, void **device) { - FIXME("iface %p, riid %s, device %p stub!\n", iface, debugstr_guid(riid), device); + struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface); - return E_NOTIMPL; + TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device); + + if (!swapchain->device) + { + ERR("Implicit swapchain does not store reference to device.\n"); + *device = NULL; + return E_NOINTERFACE; + } + + return IWineDXGIDevice_QueryInterface(swapchain->device, riid, device); } /* IDXGISwapChain methods */ @@ -334,7 +346,7 @@ static const struct wined3d_parent_ops dxgi_swapchain_wined3d_parent_ops = }; HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device *device, - struct wined3d_swapchain_desc *desc) + struct wined3d_swapchain_desc *desc, BOOL implicit) { HRESULT hr; @@ -353,5 +365,20 @@ HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device } wined3d_mutex_unlock(); + /** + * A reference to the implicit swapchain is held by the wined3d device. + * In order to avoid circular references we do not keep a reference + * to the device in the implicit swapchain. + */ + if (!implicit) + { + swapchain->device = &device->IWineDXGIDevice_iface; + IWineDXGIDevice_AddRef(swapchain->device); + } + else + { + swapchain->device = NULL; + } + return S_OK; } diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c index 71385ab..837618a 100644 --- a/dlls/dxgi/tests/device.c +++ b/dlls/dxgi/tests/device.c @@ -479,7 +479,7 @@ static void test_create_swapchain(void) refcount = get_refcount((IUnknown *)factory); todo_wine ok(refcount == 4, "Got unexpected refcount %u.\n", refcount); refcount = get_refcount((IUnknown *)device); - todo_wine ok(refcount == 3, "Got unexpected refcount %u.\n", refcount); + ok(refcount == 3, "Got unexpected refcount %u.\n", refcount); hr = IDXGISwapChain_GetDesc(swapchain, NULL); ok(hr == E_INVALIDARG, "GetDesc unexpectedly returned %#x.\n", hr); diff --git a/include/wine/winedxgi.idl b/include/wine/winedxgi.idl index d13a2f1..d9f6677 100644 --- a/include/wine/winedxgi.idl +++ b/include/wine/winedxgi.idl @@ -36,6 +36,7 @@ interface IWineDXGIDevice : IDXGIDevice1 ); HRESULT create_swapchain( [in] struct wined3d_swapchain_desc *desc, + [in] BOOL implicit, [out] struct wined3d_swapchain **wined3d_swapchain ); }
1
0
0
0
Józef Kucia : dxgi/tests: Add test for IDXGISwapChain_GetParent().
by Alexandre Julliard
12 Apr '16
12 Apr '16
Module: wine Branch: master Commit: d7b8c2e8f69fa822032c9032b787d85e1890680c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d7b8c2e8f69fa822032c9032b…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Apr 12 12:29:37 2016 +0200 dxgi/tests: Add test for IDXGISwapChain_GetParent(). 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/dxgi/tests/device.c | 46 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c index b92d3cc..71385ab 100644 --- a/dlls/dxgi/tests/device.c +++ b/dlls/dxgi/tests/device.c @@ -412,15 +412,15 @@ struct refresh_rates BOOL denominator_should_pass; }; -static void test_createswapchain(void) +static void test_create_swapchain(void) { - IUnknown *obj; + DXGI_SWAP_CHAIN_DESC creation_desc, result_desc; + ULONG refcount, expected_refcount; + IDXGISwapChain *swapchain; + IUnknown *obj, *parent; IDXGIAdapter *adapter; IDXGIFactory *factory; IDXGIDevice *device; - ULONG refcount; - IDXGISwapChain *swapchain; - DXGI_SWAP_CHAIN_DESC creation_desc, result_desc; HRESULT hr; UINT i; @@ -465,14 +465,42 @@ static void test_createswapchain(void) hr = IDXGIAdapter_GetParent(adapter, &IID_IDXGIFactory, (void **)&factory); ok(SUCCEEDED(hr), "GetParent failed, hr %#x.\n", hr); + expected_refcount = get_refcount((IUnknown *)adapter); + refcount = get_refcount((IUnknown *)factory); + ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + refcount = get_refcount((IUnknown *)device); + ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + hr = IDXGIFactory_CreateSwapChain(factory, obj, &creation_desc, &swapchain); ok(SUCCEEDED(hr), "CreateSwapChain failed, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)adapter); + ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount); + refcount = get_refcount((IUnknown *)factory); + todo_wine ok(refcount == 4, "Got unexpected refcount %u.\n", refcount); + refcount = get_refcount((IUnknown *)device); + todo_wine ok(refcount == 3, "Got unexpected refcount %u.\n", refcount); + hr = IDXGISwapChain_GetDesc(swapchain, NULL); ok(hr == E_INVALIDARG, "GetDesc unexpectedly returned %#x.\n", hr); + hr = IDXGISwapChain_GetParent(swapchain, &IID_IUnknown, (void **)&parent); + todo_wine ok(SUCCEEDED(hr), "GetParent failed %#x.\n", hr); + todo_wine ok(parent == (IUnknown *)factory, "Got unexpected parent interface pointer %p.\n", parent); + if (SUCCEEDED(hr)) refcount = IUnknown_Release(parent); + todo_wine ok(refcount == 4, "Got unexpected refcount %u.\n", refcount); + + hr = IDXGISwapChain_GetParent(swapchain, &IID_IDXGIFactory, (void **)&parent); + todo_wine ok(SUCCEEDED(hr), "GetParent failed %#x.\n", hr); + todo_wine ok(parent == (IUnknown *)factory, "Got unexpected parent interface pointer %p.\n", parent); + if (SUCCEEDED(hr)) refcount = IUnknown_Release(parent); + todo_wine ok(refcount == 4, "Got unexpected refcount %u.\n", refcount); + IDXGISwapChain_Release(swapchain); + refcount = get_refcount((IUnknown *)factory); + ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + for (i = 0; i < sizeof(refresh_list)/sizeof(refresh_list[0]); i++) { creation_desc.BufferDesc.RefreshRate.Numerator = refresh_list[i].numerator; @@ -522,11 +550,13 @@ static void test_createswapchain(void) IDXGISwapChain_Release(swapchain); } - IDXGIFactory_Release(factory); - IDXGIAdapter_Release(adapter); IUnknown_Release(obj); refcount = IDXGIDevice_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); + refcount = IDXGIAdapter_Release(adapter); + todo_wine ok(!refcount, "Adapter has %u references left.\n", refcount); + refcount = IDXGIFactory_Release(factory); + ok(!refcount, "Factory has %u references left.\n", refcount); DestroyWindow(creation_desc.OutputWindow); } @@ -1381,7 +1411,7 @@ START_TEST(device) test_create_surface(); test_parents(); test_output(); - test_createswapchain(); + test_create_swapchain(); test_create_factory(); test_private_data(); test_swapchain_resize();
1
0
0
0
Józef Kucia : dxgi/tests: Add tests for reference counting.
by Alexandre Julliard
12 Apr '16
12 Apr '16
Module: wine Branch: master Commit: 6061d909ad99502bae8223e6d6ef289d8e1b7926 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6061d909ad99502bae8223e6d…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Apr 12 12:29:36 2016 +0200 dxgi/tests: Add tests for reference counting. 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/dxgi/tests/device.c | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c index 1e4022e..b92d3cc 100644 --- a/dlls/dxgi/tests/device.c +++ b/dlls/dxgi/tests/device.c @@ -1284,11 +1284,12 @@ static void test_maximum_frame_latency(void) static void test_output_desc(void) { + IDXGIAdapter *adapter, *adapter2; + IDXGIOutput *output, *output2; DXGI_OUTPUT_DESC desc; IDXGIFactory *factory; - IDXGIAdapter *adapter; - IDXGIOutput *output; unsigned int i, j; + ULONG refcount; HRESULT hr; hr = CreateDXGIFactory(&IID_IDXGIFactory, (void **)&factory); @@ -1301,6 +1302,18 @@ static void test_output_desc(void) break; ok(SUCCEEDED(hr), "Failed to enumerate adapter %u, hr %#x.\n", i, hr); + hr = IDXGIFactory_EnumAdapters(factory, i, &adapter2); + ok(SUCCEEDED(hr), "Failed to enumerate adapter %u, hr %#x.\n", i, hr); + todo_wine ok(adapter != adapter2, "Expected to get new instance of IDXGIAdapter, %p == %p.\n", adapter, adapter2); + refcount = get_refcount((IUnknown *)adapter); + todo_wine ok(refcount == 1, "Get unexpected refcount %u for adapter %u.\n", refcount, i); + IDXGIAdapter_Release(adapter2); + + refcount = get_refcount((IUnknown *)factory); + todo_wine ok(refcount == 2, "Get unexpected refcount %u.\n", refcount); + refcount = get_refcount((IUnknown *)adapter); + todo_wine ok(refcount == 1, "Get unexpected refcount %u for adapter %u.\n", refcount, i); + for (j = 0; ; ++j) { MONITORINFOEXW monitor_info; @@ -1311,6 +1324,20 @@ static void test_output_desc(void) break; ok(SUCCEEDED(hr), "Failed to enumerate output %u on adapter %u, hr %#x.\n", j, i, hr); + hr = IDXGIAdapter_EnumOutputs(adapter, j, &output2); + ok(SUCCEEDED(hr), "Failed to enumerate output %u on adapter %u, hr %#x.\n", j, i, hr); + todo_wine ok(output != output2, "Expected to get new instance of IDXGIOuput, %p == %p.\n", output, output2); + refcount = get_refcount((IUnknown *)output); + todo_wine ok(refcount == 1, "Get unexpected refcount %u for output %u, adapter %u.\n", refcount, j, i); + IDXGIOutput_Release(output2); + + refcount = get_refcount((IUnknown *)factory); + todo_wine ok(refcount == 2, "Get unexpected refcount %u.\n", refcount); + refcount = get_refcount((IUnknown *)adapter); + ok(refcount == 2, "Get unexpected refcount %u for adapter %u.\n", refcount, i); + refcount = get_refcount((IUnknown *)output); + todo_wine ok(refcount == 1, "Get unexpected refcount %u for output %u, adapter %u.\n", refcount, j, i); + hr = IDXGIOutput_GetDesc(output, NULL); ok(hr == E_INVALIDARG, "Got unexpected hr %#x for output %u on adapter %u.\n", hr, j, i); hr = IDXGIOutput_GetDesc(output, &desc); @@ -1329,12 +1356,17 @@ static void test_output_desc(void) monitor_info.rcMonitor.right, monitor_info.rcMonitor.bottom); IDXGIOutput_Release(output); + refcount = get_refcount((IUnknown *)adapter); + todo_wine ok(refcount == 1, "Get unexpected refcount %u for adapter %u.\n", refcount, i); } IDXGIAdapter_Release(adapter); + refcount = get_refcount((IUnknown *)factory); + ok(refcount == 1, "Get unexpected refcount %u.\n", refcount); } - IDXGIFactory_Release(factory); + refcount = IDXGIFactory_Release(factory); + ok(!refcount, "IDXGIFactory has %u references left.\n", refcount); } START_TEST(device)
1
0
0
0
Alistair Leslie-Hughes : d3d11: Support NULL RenderTargetView pointer in ClearRenderTargetView.
by Alexandre Julliard
12 Apr '16
12 Apr '16
Module: wine Branch: master Commit: f3bbf32381c4a82c8ed58dbba2bdb3967c8cbe3f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f3bbf32381c4a82c8ed58dbba…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Apr 12 10:22:29 2016 +0000 d3d11: Support NULL RenderTargetView pointer in ClearRenderTargetView. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 3 +++ dlls/d3d11/tests/d3d11.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index c59e5a9..4f24c48 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -967,6 +967,9 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearRenderTargetView(ID3D TRACE("iface %p, render_target_view %p, color_rgba %s.\n", iface, render_target_view, debug_float4(color_rgba)); + if (!view) + return; + wined3d_mutex_lock(); if (FAILED(hr = wined3d_device_clear_rendertarget_view(device->wined3d_device, view->wined3d_view, NULL, WINED3DCLEAR_TARGET, &color, 0.0f, 0))) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index a844c11..ee7103d 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -5824,6 +5824,7 @@ static void test_clear_render_target_view(void) { static const DWORD expected_color = 0xbf4c7f19, expected_srgb_color = 0xbf95bc59; static const float color[] = {0.1f, 0.5f, 0.3f, 0.75f}; + static const float green[] = {0.0f, 1.0f, 0.0f, 0.5f}; ID3D11Texture2D *texture, *srgb_texture; struct d3d11_test_context test_context; @@ -5870,6 +5871,9 @@ static void test_clear_render_target_view(void) ID3D11DeviceContext_ClearRenderTargetView(context, rtv, color); check_texture_color(texture, expected_color, 1); + ID3D11DeviceContext_ClearRenderTargetView(context, NULL, green); + check_texture_color(texture, expected_color, 1); + ID3D11DeviceContext_ClearRenderTargetView(context, srgb_rtv, color); check_texture_color(srgb_texture, expected_srgb_color, 1);
1
0
0
0
Alistair Leslie-Hughes : d3d11: Support NULL DepthStecilView pointer in ClearDepthStencilView.
by Alexandre Julliard
12 Apr '16
12 Apr '16
Module: wine Branch: master Commit: da5cc1ec928873a4e91e969130e4c671e4c3e77d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=da5cc1ec928873a4e91e96913…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Apr 12 10:22:17 2016 +0000 d3d11: Support NULL DepthStecilView pointer in ClearDepthStencilView. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 3 +++ dlls/d3d11/tests/d3d11.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 569d397..c59e5a9 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -999,6 +999,9 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearDepthStencilView(ID3D TRACE("iface %p, depth_stencil_view %p, flags %#x, depth %.8e, stencil %u.\n", iface, depth_stencil_view, flags, depth, stencil); + if (!view) + return; + wined3d_flags = wined3d_clear_flags_from_d3d11_clear_flags(flags); wined3d_mutex_lock(); diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 8ba6a77..a844c11 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -5955,6 +5955,9 @@ static void test_clear_depth_stencil_view(void) ID3D11DeviceContext_ClearDepthStencilView(context, dsv, D3D11_CLEAR_DEPTH, 0.25f, 0); check_texture_float(depth_texture, 0.25f, 0); + ID3D11DeviceContext_ClearDepthStencilView(context, NULL, D3D11_CLEAR_DEPTH, 1.0f, 0); + check_texture_float(depth_texture, 0.25f, 0); + ID3D11Texture2D_Release(depth_texture); ID3D11DepthStencilView_Release(dsv);
1
0
0
0
Aaryaman Vasishta : d3drm/tests: Add tests for IDirect3DRMObject::Add/ DeleteDestroyCallback.
by Alexandre Julliard
12 Apr '16
12 Apr '16
Module: wine Branch: master Commit: e62475b0f1edd6959c3971ff8ebdef965b471bbe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e62475b0f1edd6959c3971ff8…
Author: Aaryaman Vasishta <jem456.vasishta(a)gmail.com> Date: Mon Apr 11 23:52:32 2016 +0530 d3drm/tests: Add tests for IDirect3DRMObject::Add/DeleteDestroyCallback. Signed-off-by: Aaryaman Vasishta <jem456.vasishta(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3drm/tests/d3drm.c | 240 ++++++++++++++++++++++------------------------- 1 file changed, 114 insertions(+), 126 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=e62475b0f1edd6959c397…
1
0
0
0
Aaryaman Vasishta : d3drm/tests: Add tests for IDirect3DRM*::CreateObject.
by Alexandre Julliard
12 Apr '16
12 Apr '16
Module: wine Branch: master Commit: 0e6578d16bb8d61a8746c1c3312475ef65b4b4b4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0e6578d16bb8d61a8746c1c33…
Author: Aaryaman Vasishta <jem456.vasishta(a)gmail.com> Date: Mon Apr 11 23:52:31 2016 +0530 d3drm/tests: Add tests for IDirect3DRM*::CreateObject. Signed-off-by: Aaryaman Vasishta <jem456.vasishta(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3drm/tests/d3drm.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index c94d31e..72691f7 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -1238,6 +1238,107 @@ static void CDECL destroy_callback1(IDirect3DRMObject *obj, void *arg) ctxt->called++; } +static void test_object(void) +{ + static const struct + { + REFCLSID clsid; + REFIID iid; + } + tests[] = + { + { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice }, + { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice2 }, + { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMDevice3 }, + { &CLSID_CDirect3DRMDevice, &IID_IDirect3DRMWinDevice }, + { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture }, + { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture2 }, + { &CLSID_CDirect3DRMTexture, &IID_IDirect3DRMTexture3 }, + { &CLSID_CDirect3DRMViewport, &IID_IDirect3DRMViewport }, + { &CLSID_CDirect3DRMViewport, &IID_IDirect3DRMViewport2 }, + }; + IDirect3DRM *d3drm1; + IDirect3DRM2 *d3drm2; + IDirect3DRM3 *d3drm3; + IUnknown *unknown; + HRESULT hr; + ULONG ref1, ref2, ref3, ref4; + int i; + + hr = Direct3DRMCreate(&d3drm1); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRM interface (hr = %#x).\n", hr); + ref1 = get_refcount((IUnknown *)d3drm1); + hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM2, (void **)&d3drm2); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRM2 interface (hr = %#x).\n", hr); + hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM3, (void **)&d3drm3); + ok(SUCCEEDED(hr), "Cannot get IDirect3DRM3 interface (hr = %#x).\n", hr); + + for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) + { + hr = IDirect3DRM_CreateObject(d3drm1, NULL, NULL, tests[i].iid, (void **)&unknown); + todo_wine ok(hr == D3DRMERR_BADVALUE, "Test %u: expected hr == D3DRMERR_BADVALUE, got %#x.\n", i, hr); + hr = IDirect3DRM_CreateObject(d3drm1, tests[i].clsid, NULL, NULL, (void **)&unknown); + todo_wine ok(hr == D3DRMERR_BADVALUE, "Test %u: expected hr == D3DRMERR_BADVALUE, got %#x.\n", i, hr); + hr = IDirect3DRM_CreateObject(d3drm1, tests[i].clsid, NULL, NULL, NULL); + todo_wine ok(hr == D3DRMERR_BADVALUE, "Test %u: expected hr == D3DRMERR_BADVALUE, got %#x.\n", i, hr); + + hr = IDirect3DRM_CreateObject(d3drm1, tests[i].clsid, NULL, tests[i].iid, (void **)&unknown); + todo_wine ok(SUCCEEDED(hr), "Test %u: expected hr == D3DRM_OK, got %#x.\n", i, hr); + if (SUCCEEDED(hr)) + { + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", i, ref1, ref4); + IUnknown_Release(unknown); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", i, ref1, ref4); + + hr = IDirect3DRM2_CreateObject(d3drm2, tests[i].clsid, NULL, tests[i].iid, (void **)&unknown); + ok(SUCCEEDED(hr), "Test %u: expected hr == D3DRM_OK, got %#x.\n", i, hr); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", i, ref1, ref4); + IUnknown_Release(unknown); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", i, ref1, ref4); + + hr = IDirect3DRM3_CreateObject(d3drm3, tests[i].clsid, NULL, tests[i].iid, (void **)&unknown); + ok(SUCCEEDED(hr), "Test %u: expected hr == D3DRM_OK, got %#x.\n", i, hr); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", i, ref1, ref4); + IUnknown_Release(unknown); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 == ref1, "Test %u: expected ref2 == ref1, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + ref3 = get_refcount((IUnknown *)d3drm2); + ok(ref3 == ref1, "Test %u: expected ref3 == ref1, got ref1 = %u, ref3 = %u.\n", i, ref1, ref3); + ref4 = get_refcount((IUnknown *)d3drm3); + ok(ref4 == ref1, "Test %u: expected ref4 == ref1, got ref1 = %u, ref4 = %u.\n", i, ref1, ref4); + } + } + + IDirect3DRM_Release(d3drm1); + IDirect3DRM2_Release(d3drm2); + IDirect3DRM3_Release(d3drm3); +} + static void test_Viewport(void) { struct destroy_context context; @@ -4287,6 +4388,7 @@ START_TEST(d3drm) test_Face(); test_Frame(); test_Device(); + test_object(); test_Viewport(); test_Light(); test_Material2();
1
0
0
0
Huw Davies : gdi32: Use abs() on an integer argument to avoid a clang warning.
by Alexandre Julliard
12 Apr '16
12 Apr '16
Module: wine Branch: master Commit: bb4ead4c7cc7b285b16bb3432785f23736e5fb67 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bb4ead4c7cc7b285b16bb3432…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Apr 12 12:33:13 2016 +0100 gdi32: Use abs() on an integer argument to avoid a clang warning. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/painting.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index f978001..32b6183 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -303,8 +303,8 @@ BOOL WINAPI ArcTo( HDC hdc, INT xstart, INT ystart, INT xend, INT yend ) { - double width = fabs(right-left), - height = fabs(bottom-top), + double width = abs( right - left ), + height = abs( bottom - top ), xradius = width/2, yradius = height/2, xcenter = right > left ? left+xradius : right+xradius,
1
0
0
0
Michael Stefaniuc : shell32/tests: Use SetRect instead of open coding it.
by Alexandre Julliard
12 Apr '16
12 Apr '16
Module: wine Branch: master Commit: 851777dcb174e4f85bdfa82276f1327a456216f6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=851777dcb174e4f85bdfa8227…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Apr 12 12:32:50 2016 +0200 shell32/tests: Use SetRect instead of open coding it. Signed-off-by: Michael Stefaniuc <mstefani(a)redhat.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/tests/appbar.c | 30 ++++++------------------------ dlls/shell32/tests/ebrowser.c | 20 ++++++++++---------- dlls/shell32/tests/shlview.c | 3 +-- 3 files changed, 17 insertions(+), 36 deletions(-) diff --git a/dlls/shell32/tests/appbar.c b/dlls/shell32/tests/appbar.c index 8138131..ca72f3f 100644 --- a/dlls/shell32/tests/appbar.c +++ b/dlls/shell32/tests/appbar.c @@ -232,10 +232,7 @@ static void test_setpos(void) windows[0].registered = TRUE; windows[0].to_be_deleted = FALSE; windows[0].edge = ABE_BOTTOM; - windows[0].desired_rect.left = 0; - windows[0].desired_rect.right = screen_width; - windows[0].desired_rect.top = screen_height - 15; - windows[0].desired_rect.bottom = screen_height; + SetRect(&windows[0].desired_rect, 0, screen_height - 15, screen_width, screen_height); SetWindowLongPtrA(windows[0].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[0]); testwindow_setpos(windows[0].hwnd); do_events(); @@ -253,10 +250,7 @@ static void test_setpos(void) windows[1].registered = TRUE; windows[1].to_be_deleted = FALSE; windows[1].edge = ABE_BOTTOM; - windows[1].desired_rect.left = 0; - windows[1].desired_rect.right = screen_width; - windows[1].desired_rect.top = screen_height - 10; - windows[1].desired_rect.bottom = screen_height; + SetRect(&windows[1].desired_rect, 0, screen_height - 10, screen_width, screen_height); SetWindowLongPtrA(windows[1].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[1]); testwindow_setpos(windows[1].hwnd); @@ -285,10 +279,7 @@ static void test_setpos(void) windows[2].registered = TRUE; windows[2].to_be_deleted = FALSE; windows[2].edge = ABE_BOTTOM; - windows[2].desired_rect.left = 0; - windows[2].desired_rect.right = screen_width; - windows[2].desired_rect.top = screen_height - 10; - windows[2].desired_rect.bottom = screen_height; + SetRect(&windows[2].desired_rect, 0, screen_height - 10, screen_width, screen_height); SetWindowLongPtrA(windows[2].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[2]); testwindow_setpos(windows[2].hwnd); @@ -299,10 +290,7 @@ static void test_setpos(void) /* move windows[2] to the right side of the screen */ windows[2].edge = ABE_RIGHT; - windows[2].desired_rect.left = screen_width - 15; - windows[2].desired_rect.right = screen_width; - windows[2].desired_rect.top = 0; - windows[2].desired_rect.bottom = screen_height; + SetRect(&windows[2].desired_rect, screen_width - 15, 0, screen_width, screen_height); testwindow_setpos(windows[2].hwnd); do_events_until(no_appbars_intersect); @@ -312,10 +300,7 @@ static void test_setpos(void) /* move windows[1] to the top of the screen */ windows[1].edge = ABE_TOP; - windows[1].desired_rect.left = 0; - windows[1].desired_rect.right = screen_width; - windows[1].desired_rect.top = 0; - windows[1].desired_rect.bottom = 15; + SetRect(&windows[1].desired_rect, 0, 0, screen_width, 15); testwindow_setpos(windows[1].hwnd); do_events_until(no_appbars_intersect); @@ -325,10 +310,7 @@ static void test_setpos(void) /* move windows[1] back to the bottom of the screen */ windows[1].edge = ABE_BOTTOM; - windows[1].desired_rect.left = 0; - windows[1].desired_rect.right = screen_width; - windows[1].desired_rect.top = screen_height - 10; - windows[1].desired_rect.bottom = screen_height; + SetRect(&windows[1].desired_rect, 0, screen_height - 10, screen_width, screen_height); testwindow_setpos(windows[1].hwnd); do_events_until(no_appbars_intersect); diff --git a/dlls/shell32/tests/ebrowser.c b/dlls/shell32/tests/ebrowser.c index 3b22ffb..57f52c9 100644 --- a/dlls/shell32/tests/ebrowser.c +++ b/dlls/shell32/tests/ebrowser.c @@ -98,7 +98,7 @@ static HRESULT ebrowser_instantiate(IExplorerBrowser **peb) static HRESULT ebrowser_initialize(IExplorerBrowser *peb) { RECT rc; - rc.top = rc.left = 0; rc.bottom = rc.right = 500; + SetRect(&rc, 0, 0, 500, 500); return IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL); } @@ -802,7 +802,7 @@ static void test_initialization(void) /* Initialize with a few different rectangles */ peb = NULL; ebrowser_instantiate(&peb); - rc.left = 50; rc.top = 20; rc.right = 100; rc.bottom = 80; + SetRect(&rc, 50, 20, 100, 80); hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL); ok(hr == S_OK, "got (0x%08x)\n", hr); hr = IExplorerBrowser_QueryInterface(peb, &IID_IShellBrowser, (void**)&psb); @@ -861,7 +861,7 @@ static void test_initialization(void) ebrowser_instantiate(&peb); hr = IExplorerBrowser_SetOptions(peb, EBO_NOBORDER); ok(hr == S_OK, "got 0x%08x\n", hr); - rc.left = 50; rc.top = 20; rc.right = 100; rc.bottom = 80; + SetRect(&rc, 50, 20, 100, 80); hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL); ok(hr == S_OK, "got (0x%08x)\n", hr); @@ -889,7 +889,7 @@ static void test_initialization(void) ok(lres == 0, "Got refcount %d\n", lres); ebrowser_instantiate(&peb); - rc.left = -1; rc.top = -1; rc.right = 1; rc.bottom = 1; + SetRect(&rc, -1, -1, 1, 1); hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL); ok(hr == S_OK, "got (0x%08x)\n", hr); IExplorerBrowser_Destroy(peb); @@ -897,7 +897,7 @@ static void test_initialization(void) ok(lres == 0, "Got refcount %d\n", lres); ebrowser_instantiate(&peb); - rc.left = 10; rc.top = 10; rc.right = 5; rc.bottom = 5; + SetRect(&rc, 10, 10, 5, 5); hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL); ok(hr == S_OK, "got (0x%08x)\n", hr); IExplorerBrowser_Destroy(peb); @@ -905,7 +905,7 @@ static void test_initialization(void) ok(lres == 0, "Got refcount %d\n", lres); ebrowser_instantiate(&peb); - rc.left = 10; rc.top = 10; rc.right = 5; rc.bottom = 5; + SetRect(&rc, 10, 10, 5, 5); hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL); ok(hr == S_OK, "got (0x%08x)\n", hr); IExplorerBrowser_Destroy(peb); @@ -1105,12 +1105,12 @@ static void test_basics(void) hr = IExplorerBrowser_SetRect(peb, NULL, rc); ok(hr == S_OK, "got (0x%08x)\n", hr); - rc.left = 100; rc.top = 100; rc.right = 10; rc.bottom = 10; + SetRect(&rc, 100, 100, 10, 10); hr = IExplorerBrowser_SetRect(peb, NULL, rc); ok(hr == S_OK, "got (0x%08x)\n", hr); /* SetRect with DeferWindowPos */ - rc.left = rc.top = 0; rc.right = rc.bottom = 10; + SetRect(&rc, 0, 0, 10, 10); hdwp = BeginDeferWindowPos(1); hr = IExplorerBrowser_SetRect(peb, &hdwp, rc); ok(hr == S_OK, "got (0x%08x)\n", hr); @@ -1125,7 +1125,7 @@ static void test_basics(void) ok(!lres, "EndDeferWindowPos succeeded unexpectedly.\n"); /* Test positioning */ - rc.left = 10; rc.top = 20; rc.right = 50; rc.bottom = 50; + SetRect(&rc, 10, 20, 50, 50); hr = IExplorerBrowser_SetRect(peb, NULL, rc); ok(hr == S_OK, "got (0x%08x)\n", hr); hr = IExplorerBrowser_QueryInterface(peb, &IID_IShellBrowser, (void**)&psb); @@ -1715,7 +1715,7 @@ static void test_InputObject(void) hr = IInputObject_TranslateAcceleratorIO(pio, &msg_a); todo_wine ok(hr == E_FAIL, "Got 0x%08x\n", hr); - rc.left = 0; rc.top = 0; rc.right = 100; rc.bottom = 100; + SetRect(&rc, 0, 0, 100, 100); hr = IExplorerBrowser_Initialize(peb, hwnd, &rc, NULL); ok(hr == S_OK, "Got 0x%08x\n", hr); diff --git a/dlls/shell32/tests/shlview.c b/dlls/shell32/tests/shlview.c index 8b2b5b4..2c683e3 100644 --- a/dlls/shell32/tests/shlview.c +++ b/dlls/shell32/tests/shlview.c @@ -761,8 +761,7 @@ if (0) settings.ViewMode = FVM_ICON; settings.fFlags = 0; hwnd_view = (HWND)0xdeadbeef; - r.left = r.top = 0; - r.right = r.bottom = 100; + SetRect(&r, 0, 0, 100, 100); hr = IShellView_CreateViewWindow(view, NULL, &settings, browser, &r, &hwnd_view); ok(hr == S_OK, "got (0x%08x)\n", hr); ok(IsWindow(hwnd_view), "got %p\n", hwnd_view);
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
75
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
Results per page:
10
25
50
100
200