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
May
April
March
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-devel
February 2018
----- 2025 -----
May 2025
April 2025
March 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-devel@winehq.org
74 participants
746 discussions
Start a n
N
ew thread
[PATCH v2] wmp: add IWMPControls stub implementation
by Anton Romanov
15 Feb '18
15 Feb '18
Signed-off-by: Anton Romanov <theli.ua(a)gmail.com> --- dlls/wmp/oleobj.c | 3 + dlls/wmp/player.c | 213 +++++++++++++++++++++++++++++++++++++++++++++++- dlls/wmp/tests/oleobj.c | 20 +++++ dlls/wmp/wmp_private.h | 1 + 4 files changed, 235 insertions(+), 2 deletions(-) diff --git a/dlls/wmp/oleobj.c b/dlls/wmp/oleobj.c index 1baf45a439..b3d65840fc 100644 --- a/dlls/wmp/oleobj.c +++ b/dlls/wmp/oleobj.c @@ -270,6 +270,9 @@ static HRESULT WINAPI OleObject_QueryInterface(
…
[View More]
IOleObject *iface, REFIID riid, v }else if(IsEqualGUID(riid, &IID_IWMPSettings)) { TRACE("(%p)->(IID_IWMPSettings %p)\n", This, ppv); *ppv = &This->IWMPSettings_iface; + }else if(IsEqualGUID(riid, &IID_IWMPControls)) { + TRACE("(%p)->(IID_IWMPControls %p)\n", This, ppv); + *ppv = &This->IWMPControls_iface; }else if(IsEqualGUID(riid, &IID_IOleControl)) { TRACE("(%p)->(IID_IOleControl %p)\n", This, ppv); *ppv = &This->IOleControl_iface; diff --git a/dlls/wmp/player.c b/dlls/wmp/player.c index accf5401ed..64ddfca704 100644 --- a/dlls/wmp/player.c +++ b/dlls/wmp/player.c @@ -32,6 +32,11 @@ static inline WindowsMediaPlayer *impl_from_IWMPPlayer(IWMPPlayer *iface) return CONTAINING_RECORD(iface, WindowsMediaPlayer, IWMPPlayer_iface); } +static inline WindowsMediaPlayer *impl_from_IWMPControls(IWMPControls *iface) +{ + return CONTAINING_RECORD(iface, WindowsMediaPlayer, IWMPControls_iface); +} + static HRESULT WINAPI WMPPlayer4_QueryInterface(IWMPPlayer4 *iface, REFIID riid, void **ppv) { WindowsMediaPlayer *This = impl_from_IWMPPlayer4(iface); @@ -121,8 +126,12 @@ static HRESULT WINAPI WMPPlayer4_get_playState(IWMPPlayer4 *iface, WMPPlayState static HRESULT WINAPI WMPPlayer4_get_controls(IWMPPlayer4 *iface, IWMPControls **ppControl) { WindowsMediaPlayer *This = impl_from_IWMPPlayer4(iface); - FIXME("(%p)->(%p)\n", This, ppControl); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, ppControl); + + IWMPControls_AddRef(&This->IWMPControls_iface); + *ppControl = &This->IWMPControls_iface; + return S_OK; } static HRESULT WINAPI WMPPlayer4_get_settings(IWMPPlayer4 *iface, IWMPSettings **ppSettings) @@ -931,9 +940,209 @@ static const IWMPSettingsVtbl WMPSettingsVtbl = { WMPSettings_put_enableErrorDialogs }; +HRESULT WINAPI WMPControls_fastForward(IWMPControls *iface) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_fastReverse(IWMPControls *iface) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_get_currentItem(IWMPControls *iface, IWMPMedia **ppIWMPMedia) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%p)\n", This, ppIWMPMedia); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_get_currentMarker(IWMPControls *iface, LONG *plMarker) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%p)\n", This, plMarker); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_get_currentPosition(IWMPControls *iface, DOUBLE *pdCurrentPosition) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%p)\n", This, pdCurrentPosition); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_get_currentPositionString(IWMPControls *iface, BSTR *pbstrCurrentPosition) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%p)\n", This, pbstrCurrentPosition); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMPControls_get_isAvailable(IWMPControls *iface, BSTR bstrItem, VARIANT_BOOL *pIsAvailable) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(bstrItem)); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_next(IWMPControls *iface) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_pause(IWMPControls *iface) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_play(IWMPControls *iface) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_playItem(IWMPControls *iface, IWMPMedia *pIWMPMedia) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%p)\n", This, pIWMPMedia); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_previous(IWMPControls *iface) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_put_currentItem(IWMPControls *iface, IWMPMedia *pIWMPMedia) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%p)\n", This, pIWMPMedia); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_put_currentMarker(IWMPControls *iface, LONG lMarker) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%d)\n", This, lMarker); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_put_currentPosition(IWMPControls *iface, DOUBLE dCurrentPosition) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%f)\n", This, dCurrentPosition); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_stop(IWMPControls *iface) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPControls_QueryInterface(IWMPControls *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &IID_IDispatch)) { + *ppv = iface; + }else if(IsEqualGUID(riid, &IID_IWMPControls)) { + *ppv = iface; + }else { + WARN("Unsupported interface (%s)\n", wine_dbgstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI WMPControls_AddRef(IWMPControls *iface) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + return IOleObject_AddRef(&This->IOleObject_iface); +} + +static ULONG WINAPI WMPControls_Release(IWMPControls *iface) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + return IOleObject_Release(&This->IOleObject_iface); +} + +static HRESULT WINAPI WMPControls_GetTypeInfoCount(IWMPControls *iface, UINT *pctinfo) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%p)\n", This, pctinfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMPControls_GetTypeInfo(IWMPControls *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%u %d %p)\n", This, iTInfo, lcid, ppTInfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMPControls_GetIDsOfNames(IWMPControls *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%s %p %u %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMPControls_Invoke(IWMPControls *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, + EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + WindowsMediaPlayer *This = impl_from_IWMPControls(iface); + FIXME("(%p)->(%d %s %d %x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), lcid, + wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + return E_NOTIMPL; +} + +static const IWMPControlsVtbl WMPControlsVtbl = { + WMPControls_QueryInterface, + WMPControls_AddRef, + WMPControls_Release, + WMPControls_GetTypeInfoCount, + WMPControls_GetTypeInfo, + WMPControls_GetIDsOfNames, + WMPControls_Invoke, + WMPControls_get_isAvailable, + WMPControls_play, + WMPControls_stop, + WMPControls_pause, + WMPControls_fastForward, + WMPControls_fastReverse, + WMPControls_get_currentPosition, + WMPControls_put_currentPosition, + WMPControls_get_currentPositionString, + WMPControls_next, + WMPControls_previous, + WMPControls_get_currentItem, + WMPControls_put_currentItem, + WMPControls_get_currentMarker, + WMPControls_put_currentMarker, + WMPControls_playItem, +}; + void init_player_ifaces(WindowsMediaPlayer *wmp) { wmp->IWMPPlayer4_iface.lpVtbl = &WMPPlayer4Vtbl; wmp->IWMPPlayer_iface.lpVtbl = &WMPPlayerVtbl; wmp->IWMPSettings_iface.lpVtbl = &WMPSettingsVtbl; + wmp->IWMPControls_iface.lpVtbl = &WMPControlsVtbl; } diff --git a/dlls/wmp/tests/oleobj.c b/dlls/wmp/tests/oleobj.c index 46b0b72cd3..67950e0118 100644 --- a/dlls/wmp/tests/oleobj.c +++ b/dlls/wmp/tests/oleobj.c @@ -859,11 +859,31 @@ static void test_wmp_ifaces(IOleObject *oleobj) IWMPSettings *settings, *settings_qi; IWMPPlayer4 *player4; IWMPPlayer *player; + IWMPControls *controls; HRESULT hres; hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer4, (void**)&player4); ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08x\n", hres); + controls = NULL; + hres = IWMPPlayer4_get_controls(player4, &controls); + ok(hres == S_OK, "get_controls failed: %08x\n", hres); + ok(controls != NULL, "controls = NULL\n"); + + player = NULL; + hres = IWMPControls_QueryInterface(controls, &IID_IWMPPlayer, (void**)&player); + ok(hres != S_OK, "Getting IWMPPlayer from IWMPControls SUCCEEDED\n"); + ok(player == NULL, "player != NULL\n"); + + IWMPControls_Release(controls); + + controls = NULL; + hres = IWMPPlayer4_QueryInterface(player4, &IID_IWMPControls, (void**)&controls); + ok(hres == S_OK, "Getting IWMPControls from IWMPPlayer failed: %08x\n", hres); + ok(controls != NULL, "controls = NULL\n"); + + IWMPControls_Release(controls); + settings = NULL; hres = IWMPPlayer4_get_settings(player4, &settings); ok(hres == S_OK, "get_settings failed: %08x\n", hres); diff --git a/dlls/wmp/wmp_private.h b/dlls/wmp/wmp_private.h index 710793c513..65de6bbd09 100644 --- a/dlls/wmp/wmp_private.h +++ b/dlls/wmp/wmp_private.h @@ -44,6 +44,7 @@ struct WindowsMediaPlayer { IWMPPlayer4 IWMPPlayer4_iface; IWMPPlayer IWMPPlayer_iface; IWMPSettings IWMPSettings_iface; + IWMPControls IWMPControls_iface; LONG ref; -- 2.16.1
[View Less]
2
1
0
0
[PATCH 4/4] mshtml: Added IDOMEvent::pageX and pageY properties implementation.
by Jacek Caban
15 Feb '18
15 Feb '18
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> --- dlls/mshtml/htmlevent.c | 26 ++++++++++++++++++++++---- dlls/mshtml/tests/events.js | 3 +++ 2 files changed, 25 insertions(+), 4 deletions(-)
1
0
0
0
[PATCH 2/4] mshtml: Added IDOMEvent::view property implementation.
by Jacek Caban
15 Feb '18
15 Feb '18
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> --- dlls/mshtml/htmlevent.c | 27 +++++++++++++++++++++++++-- dlls/mshtml/nsiface.idl | 2 +- dlls/mshtml/tests/events.js | 4 ++++ 3 files changed, 30 insertions(+), 3 deletions(-)
1
0
0
0
[PATCH 1/4] mshtml: Added IDOMEvent::stopImmediatePropagation implementaition.
by Jacek Caban
15 Feb '18
15 Feb '18
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> --- dlls/mshtml/htmlevent.c | 11 ++++++++--- dlls/mshtml/htmlevent.h | 1 + dlls/mshtml/tests/events.js | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-)
1
0
0
0
[PATCH 1/6] d3d8/tests: Add test for changing multisample type of implicit swapchain.
by Józef Kucia
15 Feb '18
15 Feb '18
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> --- dlls/d3d8/tests/device.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 9efa94329836..6ae17829b818 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -8492,9 +8492,64 @@ static void test_clip_planes_limits(void) DestroyWindow(window); } +static void
…
[View More]
test_swapchain_multisample_reset(void) +{ + D3DPRESENT_PARAMETERS present_parameters; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + ok(!!window, "Failed to create a window.\n"); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create D3D object.\n"); + + if (IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES) == D3DERR_NOTAVAILABLE) + { + skip("Multisampling not supported for D3DFMT_A8R8G8B8.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + if (!(device = create_device(d3d, window, NULL))) + { + skip("Failed to create 3D device.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0); + ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr); + + memset(&present_parameters, 0, sizeof(present_parameters)); + present_parameters.BackBufferWidth = 640; + present_parameters.BackBufferHeight = 480; + present_parameters.BackBufferFormat = D3DFMT_A8R8G8B8; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + present_parameters.hDeviceWindow = NULL; + present_parameters.Windowed = TRUE; + present_parameters.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES; + hr = IDirect3DDevice8_Reset(device, &present_parameters); + ok(hr == D3D_OK, "Failed to reset device, hr %#x.\n", hr); + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); + ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr); + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + START_TEST(device) { - HMODULE d3d8_handle = GetModuleHandleA( "d3d8.dll" ); + HMODULE d3d8_handle = GetModuleHandleA("d3d8.dll"); WNDCLASSA wc = {0}; IDirect3D8 *d3d8; DEVMODEW current_mode; @@ -8600,6 +8655,7 @@ START_TEST(device) test_format_unknown(); test_destroyed_window(); test_clip_planes_limits(); + test_swapchain_multisample_reset(); UnregisterClassA("d3d8_test_wc", GetModuleHandleA(NULL)); } -- 2.13.6
[View Less]
2
11
0
0
[PATCH 1/4] comctl32/edit: Use the global memory allocation helpers
by Nikolay Sivov
15 Feb '18
15 Feb '18
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/comctl32/edit.c | 67 ++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/dlls/comctl32/edit.c b/dlls/comctl32/edit.c index e1a79b1bc8..67d77dafab 100644 --- a/dlls/comctl32/edit.c +++ b/dlls/comctl32/edit.c @@ -50,6 +50,7 @@ #include "vsstyle.h" #include "wine/unicode.h" #include "wine/debug.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(edit);
…
[View More]
@@ -242,7 +243,7 @@ static INT EDIT_WordBreakProc(EDITSTATE *es, LPWSTR s, INT index, INT count, INT memset(&psa,0,sizeof(SCRIPT_ANALYSIS)); psa.eScript = SCRIPT_UNDEFINED; - es->logAttr = HeapAlloc(GetProcessHeap(), 0, sizeof(SCRIPT_LOGATTR) * get_text_length(es)); + es->logAttr = heap_alloc(sizeof(SCRIPT_LOGATTR) * get_text_length(es)); ScriptBreak(es->text, get_text_length(es), &psa, es->logAttr); } @@ -480,7 +481,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta { /* The buffer has been expanded, create a new line and insert it into the link list */ - LINEDEF *new_line = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LINEDEF)); + LINEDEF *new_line = heap_alloc_zero(sizeof(*new_line)); new_line->next = previous_line->next; previous_line->next = new_line; current_line = new_line; @@ -490,7 +491,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta { /* The previous line merged with this line so we delete this extra entry */ previous_line->next = current_line->next; - HeapFree(GetProcessHeap(), 0, current_line); + heap_free(current_line); current_line = previous_line->next; es->line_count--; continue; @@ -590,7 +591,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta if (current_line->ssa) { count = ScriptString_pcOutChars(current_line->ssa); - piDx = HeapAlloc(GetProcessHeap(),0,sizeof(INT) * (*count)); + piDx = heap_alloc(sizeof(INT) * (*count)); ScriptStringGetLogicalWidths(current_line->ssa,piDx); prev = current_line->net_length-1; @@ -600,7 +601,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta } while ( prev > 0 && current_line->width > fw); if (prev<=0) prev = 1; - HeapFree(GetProcessHeap(),0,piDx); + heap_free(piDx); } else prev = (fw / es->char_width); @@ -689,7 +690,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta { pnext = current_line->next; EDIT_InvalidateUniscribeData_linedef(current_line); - HeapFree(GetProcessHeap(), 0, current_line); + heap_free(current_line); current_line = pnext; es->line_count--; } @@ -1181,7 +1182,7 @@ static inline void text_buffer_changed(EDITSTATE *es) { es->text_length = (UINT)-1; - HeapFree( GetProcessHeap(), 0, es->logAttr ); + heap_free( es->logAttr ); es->logAttr = NULL; EDIT_InvalidateUniscribeData(es); } @@ -2463,7 +2464,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r /* there is something to be deleted */ TRACE("deleting stuff.\n"); bufl = e - s; - buf = HeapAlloc(GetProcessHeap(), 0, (bufl + 1) * sizeof(WCHAR)); + buf = heap_alloc((bufl + 1) * sizeof(WCHAR)); if (!buf) return; memcpy(buf, es->text + s, bufl * sizeof(WCHAR)); buf[bufl] = 0; /* ensure 0 termination */ @@ -2576,7 +2577,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r EDIT_EM_EmptyUndoBuffer(es); } - HeapFree(GetProcessHeap(), 0, buf); + heap_free(buf); s += strl; @@ -2803,12 +2804,12 @@ static BOOL EDIT_EM_SetTabStops(EDITSTATE *es, INT count, const INT *tabs) { if (!(es->style & ES_MULTILINE)) return FALSE; - HeapFree(GetProcessHeap(), 0, es->tabs); + heap_free(es->tabs); es->tabs_count = count; if (!count) es->tabs = NULL; else { - es->tabs = HeapAlloc(GetProcessHeap(), 0, count * sizeof(INT)); + es->tabs = heap_alloc(count * sizeof(INT)); memcpy(es->tabs, tabs, count * sizeof(INT)); } EDIT_InvalidateUniscribeData(es); @@ -2852,7 +2853,7 @@ static BOOL EDIT_EM_Undo(EDITSTATE *es) ulength = strlenW(es->undo_text); - utext = HeapAlloc(GetProcessHeap(), 0, (ulength + 1) * sizeof(WCHAR)); + utext = heap_alloc((ulength + 1) * sizeof(WCHAR)); strcpyW(utext, es->undo_text); @@ -2866,7 +2867,7 @@ static BOOL EDIT_EM_Undo(EDITSTATE *es) /* send the notification after the selection start and end are set */ EDIT_NOTIFY_PARENT(es, EN_CHANGE); EDIT_EM_ScrollCaret(es); - HeapFree(GetProcessHeap(), 0, utext); + heap_free(utext); TRACE("after UNDO:insertion length = %d, deletion buffer = %s\n", es->undo_insert_count, debugstr_w(es->undo_text)); @@ -4171,7 +4172,7 @@ static void EDIT_GetCompositionStr(HIMC hIMC, LPARAM CompFlag, EDITSTATE *es) return; } - lpCompStr = HeapAlloc(GetProcessHeap(),0,buflen); + lpCompStr = heap_alloc(buflen); if (!lpCompStr) { ERR("Unable to allocate IME CompositionString\n"); @@ -4191,11 +4192,11 @@ static void EDIT_GetCompositionStr(HIMC hIMC, LPARAM CompFlag, EDITSTATE *es) if (dwBufLenAttr) { dwBufLenAttr ++; - lpCompStrAttr = HeapAlloc(GetProcessHeap(),0,dwBufLenAttr+1); + lpCompStrAttr = heap_alloc(dwBufLenAttr + 1); if (!lpCompStrAttr) { ERR("Unable to allocate IME Attribute String\n"); - HeapFree(GetProcessHeap(),0,lpCompStr); + heap_free(lpCompStr); return; } ImmGetCompositionStringW(hIMC,GCS_COMPATTR, lpCompStrAttr, @@ -4222,8 +4223,8 @@ static void EDIT_GetCompositionStr(HIMC hIMC, LPARAM CompFlag, EDITSTATE *es) es->selection_start = es->composition_start; es->selection_end = es->selection_start + es->composition_len; - HeapFree(GetProcessHeap(),0,lpCompStrAttr); - HeapFree(GetProcessHeap(),0,lpCompStr); + heap_free(lpCompStrAttr); + heap_free(lpCompStr); } static void EDIT_GetResultStr(HIMC hIMC, EDITSTATE *es) @@ -4237,7 +4238,7 @@ static void EDIT_GetResultStr(HIMC hIMC, EDITSTATE *es) return; } - lpResultStr = HeapAlloc(GetProcessHeap(),0, buflen); + lpResultStr = heap_alloc(buflen); if (!lpResultStr) { ERR("Unable to alloc buffer for IME string\n"); @@ -4256,7 +4257,7 @@ static void EDIT_GetResultStr(HIMC hIMC, EDITSTATE *es) es->composition_start = es->selection_end; es->composition_len = 0; - HeapFree(GetProcessHeap(),0,lpResultStr); + heap_free(lpResultStr); } static void EDIT_ImeComposition(HWND hwnd, LPARAM CompFlag, EDITSTATE *es) @@ -4303,9 +4304,9 @@ static LRESULT EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTW lpcs) TRACE("Creating edit control, style = %08x\n", lpcs->style); - if (!(es = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*es)))) - return FALSE; - SetWindowLongPtrW( hwnd, 0, (LONG_PTR)es ); + if (!(es = heap_alloc_zero(sizeof(*es)))) + return FALSE; + SetWindowLongPtrW( hwnd, 0, (LONG_PTR)es ); /* * Note: since the EDITSTATE has not been fully initialized yet, @@ -4365,13 +4366,13 @@ static LRESULT EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTW lpcs) goto cleanup; es->buffer_size = LocalSize(es->hloc32W)/sizeof(WCHAR) - 1; - if (!(es->undo_text = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (es->buffer_size + 1) * sizeof(WCHAR)))) + if (!(es->undo_text = heap_alloc_zero((es->buffer_size + 1) * sizeof(WCHAR)))) goto cleanup; es->undo_buffer_size = es->buffer_size; if (es->style & ES_MULTILINE) - if (!(es->first_line_def = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LINEDEF)))) - goto cleanup; + if (!(es->first_line_def = heap_alloc_zero(sizeof(LINEDEF)))) + goto cleanup; es->line_count = 1; /* @@ -4395,11 +4396,11 @@ static LRESULT EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTW lpcs) cleanup: SetWindowLongPtrW(es->hwndSelf, 0, 0); EDIT_InvalidateUniscribeData(es); - HeapFree(GetProcessHeap(), 0, es->first_line_def); - HeapFree(GetProcessHeap(), 0, es->undo_text); + heap_free(es->first_line_def); + heap_free(es->undo_text); if (es->hloc32W) LocalFree(es->hloc32W); - HeapFree(GetProcessHeap(), 0, es->logAttr); - HeapFree(GetProcessHeap(), 0, es); + heap_free(es->logAttr); + heap_free(es); return FALSE; } @@ -4482,13 +4483,13 @@ static LRESULT EDIT_WM_NCDestroy(EDITSTATE *es) while (pc) { pp = pc->next; - HeapFree(GetProcessHeap(), 0, pc); + heap_free(pc); pc = pp; } SetWindowLongPtrW( es->hwndSelf, 0, 0 ); - HeapFree(GetProcessHeap(), 0, es->undo_text); - HeapFree(GetProcessHeap(), 0, es); + heap_free(es->undo_text); + heap_free(es); return 0; } -- 2.15.1
[View Less]
3
5
0
0
[PATCH vkd3d 1/5] include: Move D3D_PRIMITIVE_TOPOLOGY to d3dcommon.
by Józef Kucia
15 Feb '18
15 Feb '18
From: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> --- include/vkd3d_d3d12.idl | 10 ---------- include/vkd3d_d3dcommon.idl | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl index 2ccfa22d344f..5bfc76718873 100644 --- a/include/vkd3d_d3d12.idl +++ b/include/vkd3d_d3d12.idl @@ -66,16 +66,6 @@ const UINT D3D12_SHADER_COMPONENT_MAPPING_SHIFT = 3;
…
[View More]
const UINT D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES = 1 << (D3D12_SHADER_COMPONENT_MAPPING_SHIFT * 4); -typedef enum D3D_PRIMITIVE_TOPOLOGY -{ - D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0, - D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1, - D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2, - D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3, - D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4, - D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5, -} D3D_PRIMITIVE_TOPOLOGY; - typedef enum D3D12_SHADER_MIN_PRECISION_SUPPORT { D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE = 0x0, diff --git a/include/vkd3d_d3dcommon.idl b/include/vkd3d_d3dcommon.idl index 1ddfce3c3d34..a874b6c869dd 100644 --- a/include/vkd3d_d3dcommon.idl +++ b/include/vkd3d_d3dcommon.idl @@ -20,6 +20,16 @@ import "vkd3d_windows.h"; #include "vkd3d_unknown.idl" +typedef enum D3D_PRIMITIVE_TOPOLOGY +{ + D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0, + D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1, + D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5, +} D3D_PRIMITIVE_TOPOLOGY; + typedef enum D3D_FEATURE_LEVEL { D3D_FEATURE_LEVEL_9_1 = 0x9100, -- 2.13.6
[View Less]
2
9
0
0
[PATCH v2 1/2] include: Add some tchar forwards.
by Daniel Lehman
15 Feb '18
15 Feb '18
V2: remove old
2
1
0
0
[PATCH 1/2] msvcrt: Fix _searchenv, _searchenv_s, _wsearchenv, _wsearchenv_s
by Kirill Erofeev
15 Feb '18
15 Feb '18
- in some cases the last '\' was not appended to curPath. (reason: char next to the last one was checked for delimiter) - not all PATH list elements processed in case leading ';' or double ';' are present in environment variable. I.e empty element stops further processing. Signed-off-by: Kirill Erofeev <erofeev.info(a)gmail.com> --- dlls/msvcrt/dir.c | 177 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 97 insertions(+), 80 deletions(-) diff --git a/
…
[View More]
dlls/msvcrt/dir.c b/dlls/msvcrt/dir.c index f4edc28..5f094e1 100644 --- a/dlls/msvcrt/dir.c +++ b/dlls/msvcrt/dir.c @@ -1658,6 +1658,8 @@ void CDECL MSVCRT__searchenv(const char* file, const char* env, char *buf) { char*envVal, *penv; char curPath[MAX_PATH]; + MSVCRT_size_t path_len; + const MSVCRT_size_t fname_len = strlen(file); *buf = '\0'; @@ -1686,30 +1688,33 @@ void CDECL MSVCRT__searchenv(const char* file, const char* env, char *buf) char *end = penv; while(*end && *end != ';') end++; /* Find end of next path */ - if (penv == end || !*penv) - { - msvcrt_set_errno(ERROR_FILE_NOT_FOUND); - return; - } - memcpy(curPath, penv, end - penv); - if (curPath[end - penv] != '/' && curPath[end - penv] != '\\') - { - curPath[end - penv] = '\\'; - curPath[end - penv + 1] = '\0'; - } - else - curPath[end - penv] = '\0'; + path_len = end - penv; - strcat(curPath, file); - TRACE("Checking for file %s\n", curPath); - if (GetFileAttributesA( curPath ) != INVALID_FILE_ATTRIBUTES) + if (penv != end && *penv && + (path_len + fname_len) < MAX_PATH)/*If temporary buffer is not enough just skip. Other way is to use dynamic memory. We will not.*/ { - strcpy(buf, curPath); - msvcrt_set_errno(ERROR_FILE_NOT_FOUND); - return; /* Found */ + memcpy(curPath, penv, path_len); + if (curPath[path_len - 1] != '/' && curPath[path_len - 1] != '\\') + { + curPath[path_len] = '\\'; + curPath[path_len + 1] = '\0'; + } + else + curPath[path_len] = '\0'; + + strcat(curPath, file); + TRACE("Checking for file %s\n", curPath); + if (GetFileAttributesA( curPath ) != INVALID_FILE_ATTRIBUTES) + { + strcpy(buf, curPath); + break; /* Found */ + } } penv = *end ? end + 1 : end; - } while(1); + } while(*penv); + + msvcrt_set_errno(ERROR_FILE_NOT_FOUND); + return; } /********************************************************************* @@ -1719,6 +1724,8 @@ int CDECL MSVCRT__searchenv_s(const char* file, const char* env, char *buf, MSVC { char*envVal, *penv; char curPath[MAX_PATH]; + MSVCRT_size_t path_len; + const MSVCRT_size_t fname_len = strlen(file); if (!MSVCRT_CHECK_PMT(file != NULL)) return MSVCRT_EINVAL; if (!MSVCRT_CHECK_PMT(buf != NULL)) return MSVCRT_EINVAL; @@ -1750,34 +1757,36 @@ int CDECL MSVCRT__searchenv_s(const char* file, const char* env, char *buf, MSVC char *end = penv; while(*end && *end != ';') end++; /* Find end of next path */ - if (penv == end || !*penv) - { - *MSVCRT__errno() = MSVCRT_ENOENT; - return MSVCRT_ENOENT; - } - memcpy(curPath, penv, end - penv); - if (curPath[end - penv] != '/' && curPath[end - penv] != '\\') + path_len = end - penv; + if (penv != end && *penv && + (path_len + fname_len) < MAX_PATH)/*If temporary buffer is not enough just skip. Other way is to use dynamic memory. We will not.*/ { - curPath[end - penv] = '\\'; - curPath[end - penv + 1] = '\0'; - } - else - curPath[end - penv] = '\0'; + memcpy(curPath, penv, path_len); + if (curPath[path_len - 1] != '/' && curPath[path_len - 1] != '\\') + { + curPath[path_len] = '\\'; + curPath[path_len + 1] = '\0'; + } + else + curPath[path_len] = '\0'; - strcat(curPath, file); - TRACE("Checking for file %s\n", curPath); - if (GetFileAttributesA( curPath ) != INVALID_FILE_ATTRIBUTES) - { - if (strlen(curPath) + 1 > count) + strcat(curPath, file); + TRACE("Checking for file %s\n", curPath); + if (GetFileAttributesA( curPath ) != INVALID_FILE_ATTRIBUTES) { + if (strlen(curPath) + 1 > count) + { MSVCRT_INVALID_PMT("buf[count] is too small", MSVCRT_ERANGE); return MSVCRT_ERANGE; + } + strcpy(buf, curPath); + return 0; } - strcpy(buf, curPath); - return 0; } penv = *end ? end + 1 : end; - } while(1); + } while(*penv); + *MSVCRT__errno() = MSVCRT_ENOENT; + return MSVCRT_ENOENT; } /********************************************************************* @@ -1789,6 +1798,8 @@ void CDECL MSVCRT__wsearchenv(const MSVCRT_wchar_t* file, const MSVCRT_wchar_t* { MSVCRT_wchar_t *envVal, *penv; MSVCRT_wchar_t curPath[MAX_PATH]; + MSVCRT_size_t path_len; + const MSVCRT_size_t fname_len = strlenW(file); *buf = '\0'; @@ -1817,30 +1828,31 @@ void CDECL MSVCRT__wsearchenv(const MSVCRT_wchar_t* file, const MSVCRT_wchar_t* MSVCRT_wchar_t *end = penv; while(*end && *end != ';') end++; /* Find end of next path */ - if (penv == end || !*penv) + path_len = end - penv; + if (penv != end && *penv && + (path_len + fname_len) < MAX_PATH)/*If temporary buffer is not enough just skip. Other way is to use dynamic memory. We will not.*/ { - msvcrt_set_errno(ERROR_FILE_NOT_FOUND); - return; - } - memcpy(curPath, penv, (end - penv) * sizeof(MSVCRT_wchar_t)); - if (curPath[end - penv] != '/' && curPath[end - penv] != '\\') - { - curPath[end - penv] = '\\'; - curPath[end - penv + 1] = '\0'; - } - else - curPath[end - penv] = '\0'; + memcpy(curPath, penv, path_len * sizeof(MSVCRT_wchar_t)); + if (curPath[path_len - 1] != '/' && curPath[path_len - 1] != '\\') + { + curPath[path_len] = '\\'; + curPath[path_len + 1] = '\0'; + } + else + curPath[end - penv] = '\0'; - strcatW(curPath, file); - TRACE("Checking for file %s\n", debugstr_w(curPath)); - if (GetFileAttributesW( curPath ) != INVALID_FILE_ATTRIBUTES) - { - strcpyW(buf, curPath); - msvcrt_set_errno(ERROR_FILE_NOT_FOUND); - return; /* Found */ + strcatW(curPath, file); + TRACE("Checking for file %s\n", debugstr_w(curPath)); + if (GetFileAttributesW( curPath ) != INVALID_FILE_ATTRIBUTES) + { + strcpyW(buf, curPath); + break; /* Found */ + } } penv = *end ? end + 1 : end; - } while(1); + } while(*penv); + msvcrt_set_errno(ERROR_FILE_NOT_FOUND); + return; } /********************************************************************* @@ -1851,6 +1863,8 @@ int CDECL MSVCRT__wsearchenv_s(const MSVCRT_wchar_t* file, const MSVCRT_wchar_t* { MSVCRT_wchar_t* envVal, *penv; MSVCRT_wchar_t curPath[MAX_PATH]; + MSVCRT_size_t path_len; + const MSVCRT_size_t fname_len = strlenW(file); if (!MSVCRT_CHECK_PMT(file != NULL)) return MSVCRT_EINVAL; if (!MSVCRT_CHECK_PMT(buf != NULL)) return MSVCRT_EINVAL; @@ -1882,32 +1896,35 @@ int CDECL MSVCRT__wsearchenv_s(const MSVCRT_wchar_t* file, const MSVCRT_wchar_t* MSVCRT_wchar_t *end = penv; while(*end && *end != ';') end++; /* Find end of next path */ - if (penv == end || !*penv) + path_len = end - penv; + if (penv != end && *penv && + (path_len + fname_len) < MAX_PATH)/*If temporary buffer is not enough just skip. Other way is to use dynamic memory. We will not.*/ { - *MSVCRT__errno() = MSVCRT_ENOENT; - return MSVCRT_ENOENT; - } - memcpy(curPath, penv, (end - penv) * sizeof(MSVCRT_wchar_t)); - if (curPath[end - penv] != '/' && curPath[end - penv] != '\\') - { - curPath[end - penv] = '\\'; - curPath[end - penv + 1] = '\0'; - } - else - curPath[end - penv] = '\0'; + memcpy(curPath, penv, path_len * sizeof(MSVCRT_wchar_t)); + if (curPath[path_len - 1] != '/' && curPath[path_len - 1] != '\\') + { + curPath[path_len] = '\\'; + curPath[path_len + 1] = '\0'; + } + else + curPath[path_len] = '\0'; - strcatW(curPath, file); - TRACE("Checking for file %s\n", debugstr_w(curPath)); - if (GetFileAttributesW( curPath ) != INVALID_FILE_ATTRIBUTES) - { - if (strlenW(curPath) + 1 > count) + strcatW(curPath, file); + TRACE("Checking for file %s\n", debugstr_w(curPath)); + if (GetFileAttributesW( curPath ) != INVALID_FILE_ATTRIBUTES) { + if (strlenW(curPath) + 1 > count) + { MSVCRT_INVALID_PMT("buf[count] is too small", MSVCRT_ERANGE); return MSVCRT_ERANGE; + } + strcpyW(buf, curPath); + return 0; } - strcpyW(buf, curPath); - return 0; } penv = *end ? end + 1 : end; - } while(1); + } while(*penv); + *MSVCRT__errno() = MSVCRT_ENOENT; + return MSVCRT_ENOENT; } + -- 2.7.4
[View Less]
1
1
0
0
[PATCH 5/5] dxgi/tests: Introduce an ARRAY_SIZE macro.
by Henri Verbeet
15 Feb '18
15 Feb '18
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> --- dlls/dxgi/tests/device.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c index 148cd73..8351a32 100644 --- a/dlls/dxgi/tests/device.c +++ b/dlls/dxgi/tests/device.c @@ -23,6 +23,10 @@ #include "d3d11.h" #include "wine/test.h" +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) +#endif + enum
…
[View More]
frame_latency { DEFAULT_FRAME_LATENCY = 3, @@ -1179,7 +1183,7 @@ static void test_create_swapchain(void) refcount = get_refcount((IUnknown *)factory); ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); - for (i = 0; i < sizeof(refresh_list) / sizeof(*refresh_list); ++i) + for (i = 0; i < ARRAY_SIZE(refresh_list); ++i) { creation_desc.BufferDesc.RefreshRate.Numerator = refresh_list[i].numerator; creation_desc.BufferDesc.RefreshRate.Denominator = refresh_list[i].denominator; @@ -1275,7 +1279,7 @@ static void test_create_swapchain(void) creation_desc.Windowed = FALSE; - for (i = 0; i < sizeof(refresh_list) / sizeof(*refresh_list); ++i) + for (i = 0; i < ARRAY_SIZE(refresh_list); ++i) { creation_desc.BufferDesc.RefreshRate.Numerator = refresh_list[i].numerator; creation_desc.BufferDesc.RefreshRate.Denominator = refresh_list[i].denominator; @@ -1637,16 +1641,16 @@ static void test_get_containing_output(void) break; } - for (j = 0; j < sizeof(offsets) / sizeof(*offsets); ++j) + for (j = 0; j < ARRAY_SIZE(offsets); ++j) { - unsigned int idx = (sizeof(offsets) / sizeof(*offsets)) * i + j; - assert(idx < sizeof(points) / sizeof(*points)); + unsigned int idx = ARRAY_SIZE(offsets) * i + j; + assert(idx < ARRAY_SIZE(points)); points[idx].x = x + offsets[j].x; points[idx].y = y + offsets[j].y; } } - for (i = 0; i < sizeof(points) / sizeof(*points); ++i) + for (i = 0; i < ARRAY_SIZE(points); ++i) { ret = SetWindowPos(swapchain_desc.OutputWindow, 0, points[i].x, points[i].y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); @@ -2089,7 +2093,7 @@ static void test_windowed_resize_target(IDXGISwapChain *swapchain, HWND window, expected_state = *state; e = &expected_state.fullscreen_state; - for (i = 0; i < sizeof(sizes) / sizeof(*sizes); ++i) + for (i = 0; i < ARRAY_SIZE(sizes); ++i) { SetRect(&e->client_rect, 0, 0, sizes[i].width, sizes[i].height); e->window_rect = e->client_rect; @@ -2260,7 +2264,7 @@ static void test_resize_target(void) swapchain_desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; swapchain_desc.Flags = 0; - for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) + for (i = 0; i < ARRAY_SIZE(tests); ++i) { swapchain_desc.Flags = tests[i].flags; swapchain_desc.OutputWindow = CreateWindowA("static", "dxgi_test", 0, @@ -2425,7 +2429,7 @@ static void test_inexact_modes(void) check_window_fullscreen_state(swapchain_desc.OutputWindow, &initial_state.fullscreen_state); - for (i = 0; i < sizeof(sizes) / sizeof(*sizes); ++i) + for (i = 0; i < ARRAY_SIZE(sizes); ++i) { /* Test CreateSwapChain(). */ swapchain_desc.BufferDesc.Width = sizes[i].width; @@ -3190,7 +3194,7 @@ static void test_swapchain_parameters(void) hr = IDXGIAdapter_GetParent(adapter, &IID_IDXGIFactory, (void **)&factory); ok(SUCCEEDED(hr), "GetParent failed, hr %#x.\n", hr); - for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) + for (i = 0; i < ARRAY_SIZE(tests); ++i) { memset(&desc, 0, sizeof(desc)); desc.BufferDesc.Width = registry_mode.dmPelsWidth; @@ -3278,7 +3282,7 @@ static void test_swapchain_parameters(void) IDXGISwapChain_Release(swapchain); } - for (i = 0; i < sizeof(usage_tests) / sizeof(*usage_tests); ++i) + for (i = 0; i < ARRAY_SIZE(usage_tests); ++i) { usage = usage_tests[i]; -- 2.1.4
[View Less]
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
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