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
July 2012
----- 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
712 discussions
Start a n
N
ew thread
Michael Stefaniuc : dsound: Merge IUnknown into the main DirectSound object .
by Alexandre Julliard
19 Jul '12
19 Jul '12
Module: wine Branch: master Commit: 8978a4b51b26f3d6f2a937cb5ee7f93c96a67d5c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8978a4b51b26f3d6f2a937cb5…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jul 19 01:54:54 2012 +0200 dsound: Merge IUnknown into the main DirectSound object. --- dlls/dsound/dsound.c | 126 +++++++++++++----------------------------- dlls/dsound/dsound_private.h | 2 - 2 files changed, 38 insertions(+), 90 deletions(-) diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index b8c3d8b..6ce01b2 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -44,14 +44,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound); /***************************************************************************** * IDirectSound COM components */ -struct IDirectSound_IUnknown { - const IUnknownVtbl *lpVtbl; - LONG ref; - LPDIRECTSOUND8 pds; -}; - -static HRESULT IDirectSound_IUnknown_Create(LPDIRECTSOUND8 pds, LPUNKNOWN * ppunk); - struct IDirectSound_IDirectSound { const IDirectSoundVtbl *lpVtbl; LONG ref; @@ -72,20 +64,15 @@ struct IDirectSound8_IDirectSound8 { static HRESULT IDirectSound8_IDirectSound8_Create(LPDIRECTSOUND8 pds, LPDIRECTSOUND8 * ppds); static ULONG WINAPI IDirectSound8_IDirectSound8_AddRef(LPDIRECTSOUND8 iface); -/***************************************************************************** - * IDirectSound implementation structure - */ -struct IDirectSoundImpl -{ - LONG numIfaces; +typedef struct IDirectSoundImpl { + IUnknown IUnknown_iface; /* Separate refcount, not for COM aggregation */ + LONG ref, numIfaces; DirectSoundDevice *device; BOOL has_ds8; - LPUNKNOWN pUnknown; LPDIRECTSOUND pDS; LPDIRECTSOUND8 pDS8; -}; +} IDirectSoundImpl; -static ULONG WINAPI IDirectSound_IUnknown_AddRef(LPUNKNOWN iface); static ULONG WINAPI IDirectSound_IDirectSound_AddRef(LPDIRECTSOUND iface); const char * dumpCooperativeLevel(DWORD level) @@ -172,16 +159,8 @@ static HRESULT DSOUND_QueryInterface( } if (IsEqualIID(riid, &IID_IUnknown)) { - if (!This->pUnknown) { - IDirectSound_IUnknown_Create(iface, &This->pUnknown); - if (!This->pUnknown) { - WARN("IDirectSound_IUnknown_Create() failed\n"); - *ppobj = NULL; - return E_NOINTERFACE; - } - } - IDirectSound_IUnknown_AddRef(This->pUnknown); - *ppobj = This->pUnknown; + IUnknown_AddRef(&This->IUnknown_iface); + *ppobj = &This->IUnknown_iface; return S_OK; } else if (IsEqualIID(riid, &IID_IDirectSound)) { if (!This->pDS) { @@ -223,84 +202,53 @@ static void directsound_destroy(IDirectSoundImpl *This) } /******************************************************************************* - * IDirectSound_IUnknown + * IUnknown Implementation for DirectSound */ -static HRESULT WINAPI IDirectSound_IUnknown_QueryInterface( - LPUNKNOWN iface, - REFIID riid, - LPVOID * ppobj) +static inline IDirectSoundImpl *impl_from_IUnknown(IUnknown *iface) { - IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface; - TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); - return DSOUND_QueryInterface(This->pds, riid, ppobj); + return CONTAINING_RECORD(iface, IDirectSoundImpl, IUnknown_iface); } -static ULONG WINAPI IDirectSound_IUnknown_AddRef( - LPUNKNOWN iface) +static HRESULT WINAPI IUnknownImpl_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) { - IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface; - ULONG ref = InterlockedIncrement(&(This->ref)); - TRACE("(%p) ref was %d\n", This, ref - 1); - return ref; -} - -static ULONG WINAPI IDirectSound_IUnknown_Release( - LPUNKNOWN iface) -{ - IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface; - ULONG ref = InterlockedDecrement(&(This->ref)); - TRACE("(%p) ref was %d\n", This, ref + 1); - if (!ref && !InterlockedDecrement(&((IDirectSoundImpl *)This->pds)->numIfaces)) { - ((IDirectSoundImpl*)This->pds)->pUnknown = NULL; - directsound_destroy((IDirectSoundImpl*)This->pds); - HeapFree(GetProcessHeap(), 0, This); - TRACE("(%p) released\n", This); - } - return ref; + IDirectSoundImpl *This = impl_from_IUnknown(iface); + TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppv); + return DSOUND_QueryInterface((IDirectSound8 *)This, riid, ppv); } -static const IUnknownVtbl DirectSound_Unknown_Vtbl = +static ULONG WINAPI IUnknownImpl_AddRef(IUnknown *iface) { - IDirectSound_IUnknown_QueryInterface, - IDirectSound_IUnknown_AddRef, - IDirectSound_IUnknown_Release -}; + IDirectSoundImpl *This = impl_from_IUnknown(iface); + ULONG ref = InterlockedIncrement(&This->ref); -static HRESULT IDirectSound_IUnknown_Create( - LPDIRECTSOUND8 pds, - LPUNKNOWN * ppunk) -{ - IDirectSound_IUnknown * pdsunk; - TRACE("(%p,%p)\n",pds,ppunk); + TRACE("(%p) ref=%d\n", This, ref); - if (ppunk == NULL) { - ERR("invalid parameter: ppunk == NULL\n"); - return DSERR_INVALIDPARAM; - } + if(ref == 1) + InterlockedIncrement(&This->numIfaces); - if (pds == NULL) { - ERR("invalid parameter: pds == NULL\n"); - *ppunk = NULL; - return DSERR_INVALIDPARAM; - } + return ref; +} - pdsunk = HeapAlloc(GetProcessHeap(),0,sizeof(*pdsunk)); - if (pdsunk == NULL) { - WARN("out of memory\n"); - *ppunk = NULL; - return DSERR_OUTOFMEMORY; - } +static ULONG WINAPI IUnknownImpl_Release(IUnknown *iface) +{ + IDirectSoundImpl *This = impl_from_IUnknown(iface); + ULONG ref = InterlockedDecrement(&This->ref); - pdsunk->lpVtbl = &DirectSound_Unknown_Vtbl; - pdsunk->ref = 0; - pdsunk->pds = pds; + TRACE("(%p) ref=%d\n", This, ref); - InterlockedIncrement(&((IDirectSoundImpl *)pds)->numIfaces); - *ppunk = (LPUNKNOWN)pdsunk; + if (!ref && !InterlockedDecrement(&This->numIfaces)) + directsound_destroy(This); - return DS_OK; + return ref; } +static const IUnknownVtbl unk_vtbl = +{ + IUnknownImpl_QueryInterface, + IUnknownImpl_AddRef, + IUnknownImpl_Release +}; + /******************************************************************************* * IDirectSound_IDirectSound */ @@ -646,6 +594,8 @@ static HRESULT IDirectSoundImpl_Create(void **ppv, BOOL has_ds8) return DSERR_OUTOFMEMORY; } + obj->IUnknown_iface.lpVtbl = &unk_vtbl; + obj->ref = 0; obj->numIfaces = 0; obj->device = NULL; obj->has_ds8 = has_ds8; diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index c2449b3..8d361bc 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -39,8 +39,6 @@ extern int ds_default_bits_per_sample DECLSPEC_HIDDEN; /***************************************************************************** * Predeclare the interface implementation structures */ -typedef struct IDirectSoundImpl IDirectSoundImpl; -typedef struct IDirectSound_IUnknown IDirectSound_IUnknown; typedef struct IDirectSound_IDirectSound IDirectSound_IDirectSound; typedef struct IDirectSound8_IDirectSound8 IDirectSound8_IDirectSound8; typedef struct IDirectSoundBufferImpl IDirectSoundBufferImpl;
1
0
0
0
Michael Stefaniuc : dsound: Cleanup IDirectSoundImpl_Create() and move it.
by Alexandre Julliard
19 Jul '12
19 Jul '12
Module: wine Branch: master Commit: 478191c0595457ab68ad08ae6ef16f2ac2f1a265 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=478191c0595457ab68ad08ae6…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jul 19 01:53:31 2012 +0200 dsound: Cleanup IDirectSoundImpl_Create() and move it. --- dlls/dsound/dsound.c | 47 +++++++++++++++++++++-------------------------- 1 files changed, 21 insertions(+), 26 deletions(-) diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index e59f176..b8c3d8b 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -85,8 +85,6 @@ struct IDirectSoundImpl LPDIRECTSOUND8 pDS8; }; -static HRESULT IDirectSoundImpl_Create(IDirectSound8 **ppds, BOOL has_ds8); - static ULONG WINAPI IDirectSound_IUnknown_AddRef(LPUNKNOWN iface); static ULONG WINAPI IDirectSound_IDirectSound_AddRef(LPDIRECTSOUND iface); @@ -224,28 +222,6 @@ static void directsound_destroy(IDirectSoundImpl *This) TRACE("(%p) released\n", This); } -static HRESULT IDirectSoundImpl_Create(IDirectSound8 **ppDS, BOOL has_ds8) -{ - IDirectSoundImpl* pDS; - TRACE("(%p)\n",ppDS); - - /* Allocate memory */ - pDS = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectSoundImpl)); - if (pDS == NULL) { - WARN("out of memory\n"); - *ppDS = NULL; - return DSERR_OUTOFMEMORY; - } - - pDS->numIfaces = 0; - pDS->device = NULL; - pDS->has_ds8 = has_ds8; - - *ppDS = (LPDIRECTSOUND8)pDS; - - return DS_OK; -} - /******************************************************************************* * IDirectSound_IUnknown */ @@ -659,6 +635,25 @@ static HRESULT IDirectSound8_IDirectSound8_Create( return DS_OK; } +static HRESULT IDirectSoundImpl_Create(void **ppv, BOOL has_ds8) +{ + IDirectSoundImpl *obj; + + *ppv = NULL; + obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*obj)); + if (!obj) { + WARN("out of memory\n"); + return DSERR_OUTOFMEMORY; + } + + obj->numIfaces = 0; + obj->device = NULL; + obj->has_ds8 = has_ds8; + + *ppv = obj; + return DS_OK; +} + HRESULT DSOUND_Create( REFIID riid, LPDIRECTSOUND *ppDS) @@ -676,7 +671,7 @@ HRESULT DSOUND_Create( /* Get dsound configuration */ setup_dsound_options(); - hr = IDirectSoundImpl_Create(&pDS, FALSE); + hr = IDirectSoundImpl_Create((void **)&pDS, FALSE); if (hr == DS_OK) { hr = IDirectSound_IDirectSound_Create(pDS, ppDS); if (*ppDS) @@ -764,7 +759,7 @@ HRESULT DSOUND_Create8( /* Get dsound configuration */ setup_dsound_options(); - hr = IDirectSoundImpl_Create(&pDS, TRUE); + hr = IDirectSoundImpl_Create((void **)&pDS, TRUE); if (hr == DS_OK) { hr = IDirectSound8_IDirectSound8_Create(pDS, ppDS); if (*ppDS)
1
0
0
0
Michael Stefaniuc : dsound: Rename the DirectSound object refcount to " numIfaces".
by Alexandre Julliard
19 Jul '12
19 Jul '12
Module: wine Branch: master Commit: a565c0fadf2b55a70ce634fd582e1b854f316c5c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a565c0fadf2b55a70ce634fd5…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jul 19 01:51:26 2012 +0200 dsound: Rename the DirectSound object refcount to "numIfaces". --- dlls/dsound/dsound.c | 52 ++++++++++++++++--------------------------------- 1 files changed, 17 insertions(+), 35 deletions(-) diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index 7f5d288..e59f176 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -77,9 +77,8 @@ static ULONG WINAPI IDirectSound8_IDirectSound8_AddRef(LPDIRECTSOUND8 iface); */ struct IDirectSoundImpl { - LONG ref; - - DirectSoundDevice *device; + LONG numIfaces; + DirectSoundDevice *device; BOOL has_ds8; LPUNKNOWN pUnknown; LPDIRECTSOUND pDS; @@ -217,29 +216,12 @@ static HRESULT DSOUND_QueryInterface( return E_NOINTERFACE; } -static ULONG IDirectSoundImpl_AddRef( - LPDIRECTSOUND8 iface) -{ - IDirectSoundImpl *This = (IDirectSoundImpl *)iface; - ULONG ref = InterlockedIncrement(&(This->ref)); - TRACE("(%p) ref was %d\n", This, ref - 1); - return ref; -} - -static ULONG IDirectSoundImpl_Release( - LPDIRECTSOUND8 iface) +static void directsound_destroy(IDirectSoundImpl *This) { - IDirectSoundImpl *This = (IDirectSoundImpl *)iface; - ULONG ref = InterlockedDecrement(&(This->ref)); - TRACE("(%p) ref was %d\n", This, ref + 1); - - if (!ref) { - if (This->device) - DirectSoundDevice_Release(This->device); - HeapFree(GetProcessHeap(),0,This); - TRACE("(%p) released\n", This); - } - return ref; + if (This->device) + DirectSoundDevice_Release(This->device); + HeapFree(GetProcessHeap(),0,This); + TRACE("(%p) released\n", This); } static HRESULT IDirectSoundImpl_Create(IDirectSound8 **ppDS, BOOL has_ds8) @@ -255,7 +237,7 @@ static HRESULT IDirectSoundImpl_Create(IDirectSound8 **ppDS, BOOL has_ds8) return DSERR_OUTOFMEMORY; } - pDS->ref = 0; + pDS->numIfaces = 0; pDS->device = NULL; pDS->has_ds8 = has_ds8; @@ -292,9 +274,9 @@ static ULONG WINAPI IDirectSound_IUnknown_Release( IDirectSound_IUnknown *This = (IDirectSound_IUnknown *)iface; ULONG ref = InterlockedDecrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref + 1); - if (!ref) { + if (!ref && !InterlockedDecrement(&((IDirectSoundImpl *)This->pds)->numIfaces)) { ((IDirectSoundImpl*)This->pds)->pUnknown = NULL; - IDirectSoundImpl_Release(This->pds); + directsound_destroy((IDirectSoundImpl*)This->pds); HeapFree(GetProcessHeap(), 0, This); TRACE("(%p) released\n", This); } @@ -337,7 +319,7 @@ static HRESULT IDirectSound_IUnknown_Create( pdsunk->ref = 0; pdsunk->pds = pds; - IDirectSoundImpl_AddRef(pds); + InterlockedIncrement(&((IDirectSoundImpl *)pds)->numIfaces); *ppunk = (LPUNKNOWN)pdsunk; return DS_OK; @@ -371,9 +353,9 @@ static ULONG WINAPI IDirectSound_IDirectSound_Release( IDirectSound_IDirectSound *This = (IDirectSound_IDirectSound *)iface; ULONG ref = InterlockedDecrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref + 1); - if (!ref) { + if (!ref && !InterlockedDecrement(&((IDirectSoundImpl *)This->pds)->numIfaces)) { ((IDirectSoundImpl*)This->pds)->pDS = NULL; - IDirectSoundImpl_Release(This->pds); + directsound_destroy((IDirectSoundImpl*)This->pds); HeapFree(GetProcessHeap(), 0, This); TRACE("(%p) released\n", This); } @@ -499,7 +481,7 @@ static HRESULT IDirectSound_IDirectSound_Create( pdsds->ref = 0; pdsds->pds = pds; - IDirectSoundImpl_AddRef(pds); + InterlockedIncrement(&((IDirectSoundImpl *)pds)->numIfaces); *ppds = (LPDIRECTSOUND)pdsds; return DS_OK; @@ -533,9 +515,9 @@ static ULONG WINAPI IDirectSound8_IDirectSound8_Release( IDirectSound8_IDirectSound8 *This = (IDirectSound8_IDirectSound8 *)iface; ULONG ref = InterlockedDecrement(&(This->ref)); TRACE("(%p) ref was %d\n", This, ref + 1); - if (!ref) { + if (!ref && !InterlockedDecrement(&((IDirectSoundImpl *)This->pds)->numIfaces)) { ((IDirectSoundImpl*)This->pds)->pDS8 = NULL; - IDirectSoundImpl_Release(This->pds); + directsound_destroy((IDirectSoundImpl*)This->pds); HeapFree(GetProcessHeap(), 0, This); TRACE("(%p) released\n", This); } @@ -671,7 +653,7 @@ static HRESULT IDirectSound8_IDirectSound8_Create( pdsds->ref = 0; pdsds->pds = pds; - IDirectSoundImpl_AddRef(pds); + InterlockedIncrement(&((IDirectSoundImpl *)pds)->numIfaces); *ppds = (LPDIRECTSOUND8)pdsds; return DS_OK;
1
0
0
0
Michael Stefaniuc : dsound: Merge the two IUnknown/ IDirectSound implementations for DirectSound.
by Alexandre Julliard
19 Jul '12
19 Jul '12
Module: wine Branch: master Commit: 4992e6a5158fc525f2da5aacedcbace645d1c60c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4992e6a5158fc525f2da5aace…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jul 19 01:49:53 2012 +0200 dsound: Merge the two IUnknown/IDirectSound implementations for DirectSound. --- dlls/dsound/dsound.c | 322 ++---------------------------------------- dlls/dsound/dsound_private.h | 2 - 2 files changed, 10 insertions(+), 314 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=4992e6a5158fc525f2da5…
1
0
0
0
Michael Stefaniuc : dsound/tests: Add IDirectSound refcount and COM aggregation tests.
by Alexandre Julliard
19 Jul '12
19 Jul '12
Module: wine Branch: master Commit: e236a3c2d539250d66fc64ad9cb2c681f1e3dcea URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e236a3c2d539250d66fc64ad9…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jul 19 10:48:26 2012 +0200 dsound/tests: Add IDirectSound refcount and COM aggregation tests. --- dlls/dsound/tests/dsound.c | 8 ++++++- dlls/dsound/tests/dsound8.c | 51 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletions(-) diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index 4c46f67..894079d 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -173,7 +173,7 @@ EXIT: static void IDirectSound_tests(void) { HRESULT rc; - LPDIRECTSOUND dso=NULL; + IDirectSound *dso=(IDirectSound*)0xdeadbeef; LPCLASSFACTORY cf=NULL; trace("Testing IDirectSound\n"); @@ -188,6 +188,12 @@ static void IDirectSound_tests(void) ok(rc==S_OK,"CoGetClassObject(CLSID_DirectSound, IID_IUnknown) " "failed: %08x\n", rc); + /* COM aggregation */ + rc=CoCreateInstance(&CLSID_DirectSound, (IUnknown*)&dso, CLSCTX_INPROC_SERVER, + &IID_IDirectSound, (void**)&dso); + ok(rc==CLASS_E_NOAGGREGATION || broken(rc==DSERR_INVALIDPARAM), + "DirectMusicPerformance create failed: %08x, expected CLASS_E_NOAGGREGATION\n", rc); + /* try the COM class factory method of creation with no device specified */ rc=CoCreateInstance(&CLSID_DirectSound, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound, (void**)&dso); diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c index c1e672f..d76d4f6 100644 --- a/dlls/dsound/tests/dsound8.c +++ b/dlls/dsound/tests/dsound8.c @@ -1116,6 +1116,56 @@ static void test_first_device(void) ok(hr == S_OK, "DirectSoundEnumerateA failed: %08x\n", hr); } +static void test_COM(void) +{ + IDirectSound *ds; + IDirectSound8 *ds8 = (IDirectSound8*)0xdeadbeef; + IUnknown *unk, *unk8; + ULONG refcount; + HRESULT hr; + + /* COM aggregation */ + hr = CoCreateInstance(&CLSID_DirectSound8, (IUnknown*)&ds, CLSCTX_INPROC_SERVER, + &IID_IUnknown, (void**)&ds8); + ok(hr == CLASS_E_NOAGGREGATION, + "DirectSound create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr); + ok(!ds8, "ds8 = %p\n", ds8); + + /* Invalid RIID */ + hr = CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectSound3DBuffer, (void**)&ds8); + ok(hr == E_NOINTERFACE, + "DirectSound create failed: %08x, expected E_NOINTERFACE\n", hr); + + /* Same refcount for IDirectSound and IDirectSound8 */ + hr = CoCreateInstance(&CLSID_DirectSound8, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectSound8, + (void**)&ds8); + ok(hr == S_OK, "DirectSound create failed: %08x, expected S_OK\n", hr); + refcount = IDirectSound8_AddRef(ds8); + ok(refcount == 2, "refcount == %u, expected 2\n", refcount); + hr = IDirectSound8_QueryInterface(ds8, &IID_IDirectSound, (void**)&ds); + ok(hr == S_OK, "QueryInterface for IID_IDirectSound failed: %08x\n", hr); + refcount = IDirectSound8_AddRef(ds8); + todo_wine ok(refcount == 4, "refcount == %u, expected 4\n", refcount); + refcount = IDirectSound_AddRef(ds); + todo_wine ok(refcount == 5, "refcount == %u, expected 5\n", refcount); + + /* Separate refcount for IUnknown */ + hr = IDirectSound_QueryInterface(ds, &IID_IUnknown, (void**)&unk); + ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr); + refcount = IUnknown_AddRef(unk); + ok(refcount == 2, "refcount == %u, expected 2\n", refcount); + hr = IDirectSound_QueryInterface(ds8, &IID_IUnknown, (void**)&unk8); + ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr); + refcount = IUnknown_AddRef(unk8); + ok(refcount == 4, "refcount == %u, expected 4\n", refcount); + refcount = IDirectSound_AddRef(ds); + todo_wine ok(refcount == 6, "refcount == %u, expected 6\n", refcount); + + while (IDirectSound_Release(ds)); + while (IUnknown_Release(unk)); +} + START_TEST(dsound8) { HMODULE hDsound; @@ -1132,6 +1182,7 @@ START_TEST(dsound8) "DirectSoundCreate8"); if (pDirectSoundCreate8) { + test_COM(); IDirectSound8_tests(); dsound8_tests(); test_hw_buffers();
1
0
0
0
Heiko Hund : winhttp: Make strings in WINHTTP_PROXY_INFO non-const.
by Alexandre Julliard
19 Jul '12
19 Jul '12
Module: wine Branch: master Commit: 1ba968821a45fe1d590bd3bf8c6b97eb1f0c8a12 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1ba968821a45fe1d590bd3bf8…
Author: Heiko Hund <heiko.hund(a)sophos.com> Date: Thu Jul 19 08:22:59 2012 +0000 winhttp: Make strings in WINHTTP_PROXY_INFO non-const. --- dlls/winhttp/request.c | 16 ++++++++-------- dlls/winhttp/session.c | 8 ++++---- dlls/winhttp/tests/notification.c | 4 ++-- dlls/winhttp/tests/winhttp.c | 12 ++++++------ include/winhttp.h | 4 ++-- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 8870e50..8109290 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -2238,8 +2238,8 @@ static void free_request( struct winhttp_request *request ) CloseHandle( request->thread ); CloseHandle( request->wait ); CloseHandle( request->cancel ); - heap_free( (WCHAR *)request->proxy.lpszProxy ); - heap_free( (WCHAR *)request->proxy.lpszProxyBypass ); + heap_free( request->proxy.lpszProxy ); + heap_free( request->proxy.lpszProxyBypass ); heap_free( request->buffer ); heap_free( request->verb ); VariantClear( &request->data ); @@ -2430,16 +2430,16 @@ static HRESULT WINAPI winhttp_request_SetProxy( { case HTTPREQUEST_PROXYSETTING_DEFAULT: request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_DEFAULT_PROXY; - heap_free( (WCHAR *)request->proxy.lpszProxy ); - heap_free( (WCHAR *)request->proxy.lpszProxyBypass ); + heap_free( request->proxy.lpszProxy ); + heap_free( request->proxy.lpszProxyBypass ); request->proxy.lpszProxy = NULL; request->proxy.lpszProxyBypass = NULL; break; case HTTPREQUEST_PROXYSETTING_DIRECT: request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_NO_PROXY; - heap_free( (WCHAR *)request->proxy.lpszProxy ); - heap_free( (WCHAR *)request->proxy.lpszProxyBypass ); + heap_free( request->proxy.lpszProxy ); + heap_free( request->proxy.lpszProxyBypass ); request->proxy.lpszProxy = NULL; request->proxy.lpszProxyBypass = NULL; break; @@ -2448,12 +2448,12 @@ static HRESULT WINAPI winhttp_request_SetProxy( request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY; if (V_VT( &proxy_server ) == VT_BSTR) { - heap_free( (WCHAR *)request->proxy.lpszProxy ); + heap_free( request->proxy.lpszProxy ); request->proxy.lpszProxy = strdupW( V_BSTR( &proxy_server ) ); } if (V_VT( &bypass_list ) == VT_BSTR) { - heap_free( (WCHAR *)request->proxy.lpszProxyBypass ); + heap_free( request->proxy.lpszProxyBypass ); request->proxy.lpszProxyBypass = strdupW( V_BSTR( &bypass_list ) ); } break; diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index b4a46e0..e3e5e2b 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -229,14 +229,14 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR agent, DWORD access, LPCWSTR proxy, LPCWST session->access = info.dwAccessType; if (info.lpszProxy && !(session->proxy_server = strdupW( info.lpszProxy ))) { - GlobalFree( (LPWSTR)info.lpszProxy ); - GlobalFree( (LPWSTR)info.lpszProxyBypass ); + GlobalFree( info.lpszProxy ); + GlobalFree( info.lpszProxyBypass ); goto end; } if (info.lpszProxyBypass && !(session->proxy_bypass = strdupW( info.lpszProxyBypass ))) { - GlobalFree( (LPWSTR)info.lpszProxy ); - GlobalFree( (LPWSTR)info.lpszProxyBypass ); + GlobalFree( info.lpszProxy ); + GlobalFree( info.lpszProxyBypass ); goto end; } } diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c index 84a3569..8ef2115 100644 --- a/dlls/winhttp/tests/notification.c +++ b/dlls/winhttp/tests/notification.c @@ -68,9 +68,9 @@ static BOOL proxy_active(void) { active = (proxy_info.lpszProxy != NULL); if (active) - GlobalFree((HGLOBAL) proxy_info.lpszProxy); + GlobalFree(proxy_info.lpszProxy); if (proxy_info.lpszProxyBypass != NULL) - GlobalFree((HGLOBAL) proxy_info.lpszProxyBypass); + GlobalFree(proxy_info.lpszProxyBypass); } else active = FALSE; diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 9d75dbf..3bc686f 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -46,9 +46,9 @@ static BOOL proxy_active(void) { active = (proxy_info.lpszProxy != NULL); if (active) - GlobalFree((HGLOBAL) proxy_info.lpszProxy); + GlobalFree(proxy_info.lpszProxy); if (proxy_info.lpszProxyBypass != NULL) - GlobalFree((HGLOBAL) proxy_info.lpszProxyBypass); + GlobalFree(proxy_info.lpszProxyBypass); } else active = FALSE; @@ -1005,8 +1005,8 @@ static void set_default_proxy_reg_value( BYTE *buf, DWORD len, DWORD type ) static void test_set_default_proxy_config(void) { - static const WCHAR wideString[] = { 0x226f, 0x575b, 0 }; - static const WCHAR normalString[] = { 'f','o','o',0 }; + static WCHAR wideString[] = { 0x226f, 0x575b, 0 }; + static WCHAR normalString[] = { 'f','o','o',0 }; DWORD type, len; BYTE *saved_proxy_settings = NULL; WINHTTP_PROXY_INFO info; @@ -2699,8 +2699,8 @@ static void test_WinHttpGetProxyForUrl(void) trace("%u\n", info.dwAccessType); trace("%s\n", wine_dbgstr_w(info.lpszProxy)); trace("%s\n", wine_dbgstr_w(info.lpszProxyBypass)); - GlobalFree( (WCHAR *)info.lpszProxy ); - GlobalFree( (WCHAR *)info.lpszProxyBypass ); + GlobalFree( info.lpszProxy ); + GlobalFree( info.lpszProxyBypass ); } WinHttpCloseHandle( session ); } diff --git a/include/winhttp.h b/include/winhttp.h index b54bd92..cf0da83 100644 --- a/include/winhttp.h +++ b/include/winhttp.h @@ -487,8 +487,8 @@ typedef struct typedef struct { DWORD dwAccessType; - LPCWSTR lpszProxy; - LPCWSTR lpszProxyBypass; + LPWSTR lpszProxy; + LPWSTR lpszProxyBypass; } WINHTTP_PROXY_INFO, *LPWINHTTP_PROXY_INFO; typedef WINHTTP_PROXY_INFO WINHTTP_PROXY_INFOW; typedef LPWINHTTP_PROXY_INFO LPWINHTTP_PROXY_INFOW;
1
0
0
0
Nikolay Sivov : ole32: Use a single implementation for 1Ole stream initialization.
by Alexandre Julliard
19 Jul '12
19 Jul '12
Module: wine Branch: master Commit: 24a690e90e70228be6040bf8a370e7b9d55343ad URL:
http://source.winehq.org/git/wine.git/?a=commit;h=24a690e90e70228be6040bf8a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jul 19 10:35:08 2012 +0400 ole32: Use a single implementation for 1Ole stream initialization. --- dlls/ole32/defaulthandler.c | 37 ++++++------------------------------- 1 files changed, 6 insertions(+), 31 deletions(-) diff --git a/dlls/ole32/defaulthandler.c b/dlls/ole32/defaulthandler.c index 68d85ec..b43b962 100644 --- a/dlls/ole32/defaulthandler.c +++ b/dlls/ole32/defaulthandler.c @@ -58,6 +58,7 @@ #include "ole2.h" #include "compobj_private.h" +#include "storage32.h" #include "wine/unicode.h" #include "wine/debug.h" @@ -1583,10 +1584,8 @@ static HRESULT WINAPI DefaultHandler_IPersistStorage_IsDirty( } /*********************************************************************** - * init_ole_stream * - * Creates the '\1Ole' stream. - * The format of this stream is as follows: + * The format of '\1Ole' stream is as follows: * * DWORD Version == 0x02000001 * DWORD Flags - low bit set indicates the object is a link otherwise it's embedded. @@ -1611,29 +1610,6 @@ typedef struct } ole_stream_header_t; static const DWORD ole_stream_version = 0x02000001; -static void init_ole_stream(IStorage *storage) -{ - HRESULT hr; - IStream *stream; - - hr = IStorage_CreateStream(storage, OleStream, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stream); - if(SUCCEEDED(hr)) - { - DWORD written; - ole_stream_header_t header; - - header.version = ole_stream_version; - header.flags = 0; - header.link_update_opt = 0; - header.res = 0; - header.moniker_size = 0; - - IStream_Write(stream, &header, sizeof(header), &written); - IStream_Release(stream); - } - return; -} - static HRESULT load_ole_stream(DefaultHandler *This, IStorage *storage) { IStream *stream; @@ -1663,10 +1639,8 @@ static HRESULT load_ole_stream(DefaultHandler *This, IStorage *storage) IStream_Release(stream); } else - { - init_ole_stream(storage); - hr = S_OK; - } + hr = STORAGE_CreateOleStream(storage, 0); + return hr; } @@ -1682,7 +1656,8 @@ static HRESULT WINAPI DefaultHandler_IPersistStorage_InitNew( HRESULT hr; TRACE("(%p)->(%p)\n", iface, pStg); - init_ole_stream(pStg); + hr = STORAGE_CreateOleStream(pStg, 0); + if (hr != S_OK) return hr; hr = IPersistStorage_InitNew(This->dataCache_PersistStg, pStg);
1
0
0
0
Nikolay Sivov : msxml3: Accept selection namespaces string with trailing spaces.
by Alexandre Julliard
19 Jul '12
19 Jul '12
Module: wine Branch: master Commit: c3fd306f611e4e5b73797168de87537d5a6fefa7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c3fd306f611e4e5b73797168d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jul 19 10:24:43 2012 +0400 msxml3: Accept selection namespaces string with trailing spaces. --- dlls/msxml3/domdoc.c | 3 +++ dlls/msxml3/tests/domdoc.c | 6 ++++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 0f3eb50..c2dbe03 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -2872,6 +2872,9 @@ static HRESULT WINAPI domdoc_setProperty( while (*pTokEnd != ' ' && *pTokEnd != 0) ++pTokEnd; + /* so it failed to advance which means we've got some trailing spaces */ + if (pTokEnd == pTokBegin) break; + if (xmlStrncmp(pTokBegin, (xmlChar const*)"xmlns", 5) != 0) { hr = E_FAIL; diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index dfa6126..817cf97 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -5738,22 +5738,27 @@ static const selection_ns_t selection_ns_data[] = { { &CLSID_DOMDocument, "CLSID_DOMDocument", "\txmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, { &CLSID_DOMDocument, "CLSID_DOMDocument", "\n\rxmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, { &CLSID_DOMDocument, "CLSID_DOMDocument", " xmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, + { &CLSID_DOMDocument, "CLSID_DOMDocument", "xmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29' ", S_OK }, { &CLSID_DOMDocument2, "CLSID_DOMDocument2", "\txmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, { &CLSID_DOMDocument2, "CLSID_DOMDocument2", "\n\rxmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, { &CLSID_DOMDocument2, "CLSID_DOMDocument2", " xmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, + { &CLSID_DOMDocument2, "CLSID_DOMDocument2", "xmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29' ", S_OK }, { &CLSID_DOMDocument30, "CLSID_DOMDocument30", "\txmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, { &CLSID_DOMDocument30, "CLSID_DOMDocument30", "\n\rxmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, { &CLSID_DOMDocument30, "CLSID_DOMDocument30", " xmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, + { &CLSID_DOMDocument30, "CLSID_DOMDocument30", "xmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29' ", S_OK }, { &CLSID_DOMDocument40, "CLSID_DOMDocument40", "\txmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, { &CLSID_DOMDocument40, "CLSID_DOMDocument40", "\n\rxmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, { &CLSID_DOMDocument40, "CLSID_DOMDocument40", " xmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, + { &CLSID_DOMDocument40, "CLSID_DOMDocument40", "xmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29' ", S_OK }, { &CLSID_DOMDocument60, "CLSID_DOMDocument60", "\txmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, { &CLSID_DOMDocument60, "CLSID_DOMDocument60", "\n\rxmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, { &CLSID_DOMDocument60, "CLSID_DOMDocument60", " xmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29'", S_OK }, + { &CLSID_DOMDocument60, "CLSID_DOMDocument60", "xmlns:test='urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29' ", S_OK }, { NULL } }; @@ -6054,6 +6059,7 @@ if (0) IXMLDOMDocument2_Release(doc); ptr++; + free_bstrs(); } free_bstrs();
1
0
0
0
Henri Verbeet : wined3d: Enable "AlwaysOffscreen" by default.
by Alexandre Julliard
19 Jul '12
19 Jul '12
Module: wine Branch: master Commit: 09443f14e75e134328643b5d33aff61bdf4dca32 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=09443f14e75e134328643b5d3…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 18 21:32:34 2012 +0200 wined3d: Enable "AlwaysOffscreen" by default. --- dlls/d3d8/tests/visual.c | 20 +++++++++++--------- dlls/d3d9/tests/visual.c | 23 +++++++++++++---------- dlls/wined3d/wined3d_main.c | 8 ++++---- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index 191cf08..6aaf365 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -1983,11 +1983,6 @@ static void depth_buffer_test(IDirect3DDevice8 *device) hr = IDirect3DDevice8_SetRenderTarget(device, backbuffer, depth_stencil); ok(SUCCEEDED(hr), "SetRenderTarget failed, hr %#x.\n", hr); - IDirect3DSurface8_Release(depth_stencil); - IDirect3DSurface8_Release(backbuffer); - IDirect3DSurface8_Release(rt3); - IDirect3DSurface8_Release(rt2); - IDirect3DSurface8_Release(rt1); hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZWRITEENABLE, FALSE); ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); @@ -2015,6 +2010,12 @@ static void depth_buffer_test(IDirect3DDevice8 *device) hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); + + IDirect3DSurface8_Release(depth_stencil); + IDirect3DSurface8_Release(backbuffer); + IDirect3DSurface8_Release(rt3); + IDirect3DSurface8_Release(rt2); + IDirect3DSurface8_Release(rt1); } /* Test that partial depth copies work the way they're supposed to. The clear @@ -2086,10 +2087,6 @@ static void depth_buffer2_test(IDirect3DDevice8 *device) hr = IDirect3DDevice8_SetRenderTarget(device, backbuffer, depth_stencil); ok(SUCCEEDED(hr), "SetRenderTarget failed, hr %#x.\n", hr); - IDirect3DSurface8_Release(depth_stencil); - IDirect3DSurface8_Release(backbuffer); - IDirect3DSurface8_Release(rt2); - IDirect3DSurface8_Release(rt1); hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZWRITEENABLE, FALSE); ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); @@ -2115,6 +2112,11 @@ static void depth_buffer2_test(IDirect3DDevice8 *device) hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); + + IDirect3DSurface8_Release(depth_stencil); + IDirect3DSurface8_Release(backbuffer); + IDirect3DSurface8_Release(rt2); + IDirect3DSurface8_Release(rt1); } static void intz_test(IDirect3DDevice8 *device) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index be2d7dc..a67ce52 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -11362,10 +11362,6 @@ static void depth_buffer_test(IDirect3DDevice9 *device) hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); ok(SUCCEEDED(hr), "SetRenderTarget failed, hr %#x.\n", hr); - IDirect3DSurface9_Release(backbuffer); - IDirect3DSurface9_Release(rt3); - IDirect3DSurface9_Release(rt2); - IDirect3DSurface9_Release(rt1); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZWRITEENABLE, FALSE); ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); @@ -11393,6 +11389,11 @@ static void depth_buffer_test(IDirect3DDevice9 *device) hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); + + IDirect3DSurface9_Release(backbuffer); + IDirect3DSurface9_Release(rt3); + IDirect3DSurface9_Release(rt2); + IDirect3DSurface9_Release(rt1); } /* Test that partial depth copies work the way they're supposed to. The clear @@ -11461,9 +11462,6 @@ static void depth_buffer2_test(IDirect3DDevice9 *device) hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); ok(SUCCEEDED(hr), "SetRenderTarget failed, hr %#x.\n", hr); - IDirect3DSurface9_Release(backbuffer); - IDirect3DSurface9_Release(rt2); - IDirect3DSurface9_Release(rt1); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZWRITEENABLE, FALSE); ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); @@ -11489,6 +11487,10 @@ static void depth_buffer2_test(IDirect3DDevice9 *device) hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); + + IDirect3DSurface9_Release(backbuffer); + IDirect3DSurface9_Release(rt2); + IDirect3DSurface9_Release(rt1); } static void depth_blit_test(IDirect3DDevice9 *device) @@ -11595,9 +11597,6 @@ static void depth_blit_test(IDirect3DDevice9 *device) ok(SUCCEEDED(hr), "Clear failed, hr %#x.\n", hr); hr = IDirect3DDevice9_StretchRect(device, ds2, NULL, ds1, NULL, D3DTEXF_POINT); ok(SUCCEEDED(hr), "StretchRect failed, hr %#x.\n", hr); - IDirect3DSurface9_Release(ds3); - IDirect3DSurface9_Release(ds2); - IDirect3DSurface9_Release(ds1); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZWRITEENABLE, FALSE); ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); @@ -11624,6 +11623,10 @@ static void depth_blit_test(IDirect3DDevice9 *device) hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); + + IDirect3DSurface9_Release(ds3); + IDirect3DSurface9_Release(ds2); + IDirect3DSurface9_Release(ds1); } static void intz_test(IDirect3DDevice9 *device) diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index 526c749..fb8493c 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -87,7 +87,7 @@ struct wined3d_settings wined3d_settings = NULL, /* No wine logo by default */ TRUE, /* Multisampling enabled by default. */ FALSE, /* No strict draw ordering. */ - FALSE, /* Try to render onscreen by default. */ + TRUE, /* Don't try to render onscreen by default. */ }; /* Do not call while under the GL lock. */ @@ -338,10 +338,10 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) wined3d_settings.strict_draw_ordering = TRUE; } if (!get_config_key(hkey, appkey, "AlwaysOffscreen", buffer, size) - && !strcmp(buffer,"enabled")) + && !strcmp(buffer,"disabled")) { - TRACE("Always rendering backbuffers offscreen.\n"); - wined3d_settings.always_offscreen = TRUE; + TRACE("Not always rendering backbuffers offscreen.\n"); + wined3d_settings.always_offscreen = FALSE; } } if (wined3d_settings.vs_mode == VS_HW)
1
0
0
0
Henri Verbeet : wined3d: Disable the X11 / GL lock.
by Alexandre Julliard
19 Jul '12
19 Jul '12
Module: wine Branch: master Commit: 8a95eb060449e93bc38af1cabc928f0a959e9e14 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8a95eb060449e93bc38af1cab…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 18 21:32:33 2012 +0200 wined3d: Disable the X11 / GL lock. --- dlls/wined3d/wined3d_private.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 08e9370..bc9523f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -785,11 +785,11 @@ extern void (CDECL *wine_tsx11_unlock_ptr)(void) DECLSPEC_HIDDEN; extern int num_lock DECLSPEC_HIDDEN; #if 0 -#define ENTER_GL() ++num_lock; if (num_lock > 1) FIXME("Recursive use of GL lock to: %d\n", num_lock); wine_tsx11_lock_ptr() -#define LEAVE_GL() if (num_lock != 1) FIXME("Recursive use of GL lock: %d\n", num_lock); --num_lock; wine_tsx11_unlock_ptr() -#else #define ENTER_GL() wine_tsx11_lock_ptr() #define LEAVE_GL() wine_tsx11_unlock_ptr() +#else +#define ENTER_GL() do {} while(0) +#define LEAVE_GL() do {} while(0) #endif /*****************************************************************************
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
72
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
Results per page:
10
25
50
100
200