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
January 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
972 discussions
Start a n
N
ew thread
Michael Stefaniuc : dsound/tests: Remove some returns in the capture buffer tests.
by Alexandre Julliard
12 Jan '12
12 Jan '12
Module: wine Branch: master Commit: 4ac20cbc0fed529b691ea47ace12e5f0a0e87b48 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4ac20cbc0fed529b691ea47ac…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jan 12 00:31:18 2012 +0100 dsound/tests: Remove some returns in the capture buffer tests. --- dlls/dsound/tests/capture.c | 12 ------------ 1 files changed, 0 insertions(+), 12 deletions(-) diff --git a/dlls/dsound/tests/capture.c b/dlls/dsound/tests/capture.c index 87a5a59..760f0cc 100644 --- a/dlls/dsound/tests/capture.c +++ b/dlls/dsound/tests/capture.c @@ -379,8 +379,6 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, (void **)&(state.notify)); ok((rc==DS_OK)&&(state.notify!=NULL), "IDirectSoundCaptureBuffer_QueryInterface() failed: %08x\n", rc); - if (rc!=DS_OK) - return; for (i = 0; i < NOTIFICATIONS; i++) { state.posnotify[i].dwOffset = (i * state.size) + state.size - 1; @@ -390,27 +388,19 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, rc=IDirectSoundNotify_SetNotificationPositions(state.notify,NOTIFICATIONS, state.posnotify); ok(rc==DS_OK,"IDirectSoundNotify_SetNotificationPositions() failed: %08x\n", rc); - if (rc!=DS_OK) - return; ref=IDirectSoundNotify_Release(state.notify); ok(ref==0,"IDirectSoundNotify_Release(): has %d references, should have " "0\n",ref); - if (ref!=0) - return; if (record) { rc=IDirectSoundCaptureBuffer_Start(dscbo,DSCBSTART_LOOPING); ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Start() failed: %08x\n", rc); - if (rc!=DS_OK) - return; rc=IDirectSoundCaptureBuffer_GetStatus(dscbo,&status); ok(rc==DS_OK,"IDirectSoundCaptureBuffer_GetStatus() failed: %08x\n", rc); ok(status==(DSCBSTATUS_CAPTURING|DSCBSTATUS_LOOPING), "GetStatus: bad status: %x\n",status); - if (rc!=DS_OK) - return; /* wait for the notifications */ for (i = 0; i < (NOTIFICATIONS * 2); i++) { @@ -428,8 +418,6 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco, rc=IDirectSoundCaptureBuffer_Stop(dscbo); ok(rc==DS_OK,"IDirectSoundCaptureBuffer_Stop() failed: %08x\n", rc); - if (rc!=DS_OK) - return; } }
1
0
0
0
Michael Stefaniuc : dsound: Make capture behave like native in regards to COM aggregation.
by Alexandre Julliard
12 Jan '12
12 Jan '12
Module: wine Branch: master Commit: a3120ce80ecca76c2138bb86a5ed9238659917af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a3120ce80ecca76c2138bb86a…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jan 12 00:28:21 2012 +0100 dsound: Make capture behave like native in regards to COM aggregation. --- dlls/dsound/capture.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c index 29d34dc..90cddb7 100644 --- a/dlls/dsound/capture.c +++ b/dlls/dsound/capture.c @@ -1065,6 +1065,11 @@ static HRESULT WINAPI IDirectSoundCaptureImpl_CreateCaptureBuffer(IDirectSoundCa TRACE( "(%p,%p,%p,%p)\n",iface,lpcDSCBufferDesc,lplpDSCaptureBuffer,pUnk); + if (pUnk) { + WARN("invalid parameter: pUnk != NULL\n"); + return DSERR_NOAGGREGATION; + } + if (lpcDSCBufferDesc == NULL) { WARN("invalid parameter: lpcDSCBufferDesc == NULL)\n"); return DSERR_INVALIDPARAM; @@ -1270,7 +1275,6 @@ HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID lpcGUID, IDirectSoundCapture **p if (pUnkOuter) { WARN("invalid parameter: pUnkOuter != NULL\n"); - *ppDSC = NULL; return DSERR_NOAGGREGATION; }
1
0
0
0
Michael Stefaniuc : dsound: Merge IDirectSoundNotify into the capture buffer object.
by Alexandre Julliard
12 Jan '12
12 Jan '12
Module: wine Branch: master Commit: 13a4b03b443521127a48b8de111f9f7aab993cc8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=13a4b03b443521127a48b8de1…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jan 12 00:19:48 2012 +0100 dsound: Merge IDirectSoundNotify into the capture buffer object. --- dlls/dsound/capture.c | 122 ++++++++++++++---------------------------- dlls/dsound/dsound_private.h | 8 +-- 2 files changed, 44 insertions(+), 86 deletions(-) diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c index 8e6c77d..29d34dc 100644 --- a/dlls/dsound/capture.c +++ b/dlls/dsound/capture.c @@ -64,69 +64,59 @@ static void capturebuffer_destroy(IDirectSoundCaptureBufferImpl *This) /* remove from DirectSoundCaptureDevice */ This->device->capture_buffer = NULL; - if (This->notify) - IDirectSoundNotify_Release((LPDIRECTSOUNDNOTIFY)This->notify); - HeapFree(GetProcessHeap(), 0, This->notifies); HeapFree(GetProcessHeap(), 0, This); TRACE("(%p) released\n", This); } -/***************************************************************************** - * IDirectSoundCaptureNotify implementation structure - */ -struct IDirectSoundCaptureNotifyImpl -{ - /* IUnknown fields */ - const IDirectSoundNotifyVtbl *lpVtbl; - LONG ref; - IDirectSoundCaptureBufferImpl* dscb; -}; - /******************************************************************************* * IDirectSoundNotify */ +static inline struct IDirectSoundCaptureBufferImpl *impl_from_IDirectSoundNotify(IDirectSoundNotify *iface) +{ + return CONTAINING_RECORD(iface, IDirectSoundCaptureBufferImpl, IDirectSoundNotify_iface); +} + static HRESULT WINAPI IDirectSoundNotifyImpl_QueryInterface(IDirectSoundNotify *iface, REFIID riid, void **ppobj) { - IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface; - TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); + IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundNotify(iface); - if (This->dscb == NULL) { - WARN("invalid parameter\n"); - return E_INVALIDARG; - } + TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppobj); - return IDirectSoundCaptureBuffer_QueryInterface((LPDIRECTSOUNDCAPTUREBUFFER)This->dscb, riid, ppobj); + return IDirectSoundCaptureBuffer_QueryInterface(&This->IDirectSoundCaptureBuffer8_iface, riid, ppobj); } static ULONG WINAPI IDirectSoundNotifyImpl_AddRef(IDirectSoundNotify *iface) { - IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface; - ULONG ref = InterlockedIncrement(&(This->ref)); + IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundNotify(iface); + ULONG ref = InterlockedIncrement(&This->refn); + TRACE("(%p) ref was %d\n", This, ref - 1); + + if(ref == 1) + InterlockedIncrement(&This->numIfaces); + return ref; } static ULONG WINAPI IDirectSoundNotifyImpl_Release(IDirectSoundNotify *iface) { - IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface; - ULONG ref = InterlockedDecrement(&(This->ref)); + IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundNotify(iface); + ULONG ref = InterlockedDecrement(&This->refn); + TRACE("(%p) ref was %d\n", This, ref + 1); - if (!ref) { - This->dscb->notify=NULL; - IDirectSoundCaptureBuffer_Release((LPDIRECTSOUNDCAPTUREBUFFER)This->dscb); - HeapFree(GetProcessHeap(),0,This); - TRACE("(%p) released\n", This); - } + if (!ref && !InterlockedDecrement(&This->numIfaces)) + capturebuffer_destroy(This); + return ref; } static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(IDirectSoundNotify *iface, DWORD howmuch, const DSBPOSITIONNOTIFY *notify) { - IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface; + IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundNotify(iface); TRACE("(%p,0x%08x,%p)\n",This,howmuch,notify); if (howmuch > 0 && notify == NULL) { @@ -144,23 +134,23 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(IDirectSou if (howmuch > 0) { /* Make an internal copy of the caller-supplied array. * Replace the existing copy if one is already present. */ - if (This->dscb->notifies) - This->dscb->notifies = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - This->dscb->notifies, howmuch * sizeof(DSBPOSITIONNOTIFY)); + if (This->notifies) + This->notifies = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->notifies, + howmuch * sizeof(DSBPOSITIONNOTIFY)); else - This->dscb->notifies = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - howmuch * sizeof(DSBPOSITIONNOTIFY)); + This->notifies = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + howmuch * sizeof(DSBPOSITIONNOTIFY)); - if (This->dscb->notifies == NULL) { + if (!This->notifies) { WARN("out of memory\n"); return DSERR_OUTOFMEMORY; } - CopyMemory(This->dscb->notifies, notify, howmuch * sizeof(DSBPOSITIONNOTIFY)); - This->dscb->nrofnotifies = howmuch; + CopyMemory(This->notifies, notify, howmuch * sizeof(DSBPOSITIONNOTIFY)); + This->nrofnotifies = howmuch; } else { - HeapFree(GetProcessHeap(), 0, This->dscb->notifies); - This->dscb->notifies = NULL; - This->dscb->nrofnotifies = 0; + HeapFree(GetProcessHeap(), 0, This->notifies); + This->notifies = NULL; + This->nrofnotifies = 0; } return S_OK; @@ -174,30 +164,6 @@ static const IDirectSoundNotifyVtbl dscnvt = IDirectSoundNotifyImpl_SetNotificationPositions }; -static HRESULT IDirectSoundCaptureNotifyImpl_Create( - IDirectSoundCaptureBufferImpl *dscb, - IDirectSoundCaptureNotifyImpl **pdscn) -{ - IDirectSoundCaptureNotifyImpl * dscn; - TRACE("(%p,%p)\n",dscb,pdscn); - - dscn = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*dscn)); - - if (dscn == NULL) { - WARN("out of memory\n"); - return DSERR_OUTOFMEMORY; - } - - dscn->ref = 0; - dscn->lpVtbl = &dscnvt; - dscn->dscb = dscb; - dscb->notify = dscn; - IDirectSoundCaptureBuffer_AddRef((LPDIRECTSOUNDCAPTUREBUFFER)dscb); - - *pdscn = dscn; - return DS_OK; -} - static const char * const captureStateString[] = { "STATE_STOPPED", @@ -219,7 +185,6 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(IDirectSoundC REFIID riid, void **ppobj) { IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); - HRESULT hres; TRACE( "(%p,%s,%p)\n", This, debugstr_guid(riid), ppobj ); @@ -230,18 +195,6 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(IDirectSoundC *ppobj = NULL; - if ( IsEqualGUID( &IID_IDirectSoundNotify, riid ) ) { - if (!This->notify){ - hres = IDirectSoundCaptureNotifyImpl_Create(This, &This->notify); - if(FAILED(hres)) - return hres; - } - - IDirectSoundNotify_AddRef((LPDIRECTSOUNDNOTIFY)This->notify); - *ppobj = This->notify; - return DS_OK; - } - if ( IsEqualGUID( &IID_IDirectSoundCaptureBuffer, riid ) || IsEqualGUID( &IID_IDirectSoundCaptureBuffer8, riid ) ) { IDirectSoundCaptureBuffer8_AddRef(iface); @@ -249,6 +202,12 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(IDirectSoundC return S_OK; } + if ( IsEqualGUID( &IID_IDirectSoundNotify, riid ) ) { + IDirectSoundNotify_AddRef(&This->IDirectSoundNotify_iface); + *ppobj = &This->IDirectSoundNotify_iface; + return S_OK; + } + FIXME("(%p,%s,%p) unsupported GUID\n", This, debugstr_guid(riid), ppobj); return E_NOINTERFACE; } @@ -707,9 +666,9 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create( This->numIfaces = 0; This->ref = 0; + This->refn = 0; This->device = device; This->device->capture_buffer = This; - This->notify = NULL; This->nrofnotifies = 0; This->pdscbd = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, @@ -724,6 +683,7 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create( } This->IDirectSoundCaptureBuffer8_iface.lpVtbl = &dscbvt; + This->IDirectSoundNotify_iface.lpVtbl = &dscnvt; err = IMMDevice_Activate(device->mmdevice, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&device->client); diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 34419d1..da309a1 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -49,7 +49,6 @@ typedef struct IDirectSoundBufferImpl IDirectSoundBufferImpl; typedef struct IDirectSoundCaptureImpl IDirectSoundCaptureImpl; typedef struct IDirectSoundCaptureBufferImpl IDirectSoundCaptureBufferImpl; typedef struct IDirectSoundNotifyImpl IDirectSoundNotifyImpl; -typedef struct IDirectSoundCaptureNotifyImpl IDirectSoundCaptureNotifyImpl; typedef struct IDirectSound3DListenerImpl IDirectSound3DListenerImpl; typedef struct IDirectSound3DBufferImpl IDirectSound3DBufferImpl; typedef struct IKsBufferPropertySetImpl IKsBufferPropertySetImpl; @@ -248,15 +247,14 @@ struct DirectSoundCaptureDevice struct IDirectSoundCaptureBufferImpl { IDirectSoundCaptureBuffer8 IDirectSoundCaptureBuffer8_iface; + IDirectSoundNotify IDirectSoundNotify_iface; LONG numIfaces; /* "in use interfaces" refcount */ - LONG ref; + LONG ref, refn; /* IDirectSoundCaptureBuffer fields */ DirectSoundCaptureDevice* device; LPDSCBUFFERDESC pdscbd; DWORD flags; - - /* IDirectSoundCaptureNotifyImpl fields */ - IDirectSoundCaptureNotifyImpl* notify; + /* IDirectSoundNotify fields */ LPDSBPOSITIONNOTIFY notifies; int nrofnotifies; };
1
0
0
0
Michael Stefaniuc : dsound: Add an extra refcount for the capture buffer object.
by Alexandre Julliard
12 Jan '12
12 Jan '12
Module: wine Branch: master Commit: 3dac0e5a4fd12cd89936d9cf1e87753845c996b4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3dac0e5a4fd12cd89936d9cf1…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jan 12 00:11:20 2012 +0100 dsound: Add an extra refcount for the capture buffer object. --- dlls/dsound/capture.c | 68 ++++++++++++++++++++++++------------------ dlls/dsound/dsound_private.h | 1 + 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c index c233ebc..8e6c77d 100644 --- a/dlls/dsound/capture.c +++ b/dlls/dsound/capture.c @@ -44,6 +44,34 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound); +static void capturebuffer_destroy(IDirectSoundCaptureBufferImpl *This) +{ + if (This->device->state == STATE_CAPTURING) + This->device->state = STATE_STOPPING; + + HeapFree(GetProcessHeap(),0, This->pdscbd); + + if (This->device->client) { + IAudioClient_Release(This->device->client); + This->device->client = NULL; + } + + if (This->device->capture) { + IAudioCaptureClient_Release(This->device->capture); + This->device->capture = NULL; + } + + /* remove from DirectSoundCaptureDevice */ + This->device->capture_buffer = NULL; + + if (This->notify) + IDirectSoundNotify_Release((LPDIRECTSOUNDNOTIFY)This->notify); + + HeapFree(GetProcessHeap(), 0, This->notifies); + HeapFree(GetProcessHeap(), 0, This); + TRACE("(%p) released\n", This); +} + /***************************************************************************** * IDirectSoundCaptureNotify implementation structure */ @@ -228,46 +256,26 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(IDirectSoundC static ULONG WINAPI IDirectSoundCaptureBufferImpl_AddRef(IDirectSoundCaptureBuffer8 *iface) { IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); - ULONG ref = InterlockedIncrement(&(This->ref)); + ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) ref was %d\n", This, ref - 1); + + if(ref == 1) + InterlockedIncrement(&This->numIfaces); + return ref; } static ULONG WINAPI IDirectSoundCaptureBufferImpl_Release(IDirectSoundCaptureBuffer8 *iface) { IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface); - ULONG ref = InterlockedDecrement(&(This->ref)); + ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref was %d\n", This, ref + 1); - if (!ref) { - TRACE("deleting object\n"); - if (This->device->state == STATE_CAPTURING) - This->device->state = STATE_STOPPING; - - HeapFree(GetProcessHeap(),0, This->pdscbd); - - if (This->device->client) { - IAudioClient_Release(This->device->client); - This->device->client = NULL; - } - - if (This->device->capture) { - IAudioCaptureClient_Release(This->device->capture); - This->device->capture = NULL; - } - - /* remove from DirectSoundCaptureDevice */ - This->device->capture_buffer = NULL; - - if (This->notify) - IDirectSoundNotify_Release((LPDIRECTSOUNDNOTIFY)This->notify); + if (!ref && !InterlockedDecrement(&This->numIfaces)) + capturebuffer_destroy(This); - HeapFree(GetProcessHeap(), 0, This->notifies); - HeapFree( GetProcessHeap(), 0, This ); - TRACE("(%p) released\n", This); - } return ref; } @@ -697,7 +705,8 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create( LPBYTE newbuf; DWORD buflen; - This->ref = 1; + This->numIfaces = 0; + This->ref = 0; This->device = device; This->device->capture_buffer = This; This->notify = NULL; @@ -771,6 +780,7 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create( device->buflen = buflen; } + IDirectSoundCaptureBuffer_AddRef(&This->IDirectSoundCaptureBuffer8_iface); *ppobj = This; TRACE("returning DS_OK\n"); diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 6f3dd02..34419d1 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -248,6 +248,7 @@ struct DirectSoundCaptureDevice struct IDirectSoundCaptureBufferImpl { IDirectSoundCaptureBuffer8 IDirectSoundCaptureBuffer8_iface; + LONG numIfaces; /* "in use interfaces" refcount */ LONG ref; /* IDirectSoundCaptureBuffer fields */ DirectSoundCaptureDevice* device;
1
0
0
0
Michael Stefaniuc : dsound: Drop "Capture" from the IDirectSoundNotify method names.
by Alexandre Julliard
12 Jan '12
12 Jan '12
Module: wine Branch: master Commit: e8f7ddf774edd26fe7bf8d3c6f39dd0fce9c044c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8f7ddf774edd26fe7bf8d3c6…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jan 12 00:09:01 2012 +0100 dsound: Drop "Capture" from the IDirectSoundNotify method names. --- dlls/dsound/capture.c | 26 +++++++++++--------------- 1 files changed, 11 insertions(+), 15 deletions(-) diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c index 70d70fb..c233ebc 100644 --- a/dlls/dsound/capture.c +++ b/dlls/dsound/capture.c @@ -56,12 +56,10 @@ struct IDirectSoundCaptureNotifyImpl }; /******************************************************************************* - * IDirectSoundCaptureNotify + * IDirectSoundNotify */ -static HRESULT WINAPI IDirectSoundCaptureNotifyImpl_QueryInterface( - LPDIRECTSOUNDNOTIFY iface, - REFIID riid, - LPVOID *ppobj) +static HRESULT WINAPI IDirectSoundNotifyImpl_QueryInterface(IDirectSoundNotify *iface, REFIID riid, + void **ppobj) { IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface; TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); @@ -74,7 +72,7 @@ static HRESULT WINAPI IDirectSoundCaptureNotifyImpl_QueryInterface( return IDirectSoundCaptureBuffer_QueryInterface((LPDIRECTSOUNDCAPTUREBUFFER)This->dscb, riid, ppobj); } -static ULONG WINAPI IDirectSoundCaptureNotifyImpl_AddRef(LPDIRECTSOUNDNOTIFY iface) +static ULONG WINAPI IDirectSoundNotifyImpl_AddRef(IDirectSoundNotify *iface) { IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface; ULONG ref = InterlockedIncrement(&(This->ref)); @@ -82,7 +80,7 @@ static ULONG WINAPI IDirectSoundCaptureNotifyImpl_AddRef(LPDIRECTSOUNDNOTIFY ifa return ref; } -static ULONG WINAPI IDirectSoundCaptureNotifyImpl_Release(LPDIRECTSOUNDNOTIFY iface) +static ULONG WINAPI IDirectSoundNotifyImpl_Release(IDirectSoundNotify *iface) { IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface; ULONG ref = InterlockedDecrement(&(This->ref)); @@ -97,10 +95,8 @@ static ULONG WINAPI IDirectSoundCaptureNotifyImpl_Release(LPDIRECTSOUNDNOTIFY if return ref; } -static HRESULT WINAPI IDirectSoundCaptureNotifyImpl_SetNotificationPositions( - LPDIRECTSOUNDNOTIFY iface, - DWORD howmuch, - LPCDSBPOSITIONNOTIFY notify) +static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(IDirectSoundNotify *iface, + DWORD howmuch, const DSBPOSITIONNOTIFY *notify) { IDirectSoundCaptureNotifyImpl *This = (IDirectSoundCaptureNotifyImpl *)iface; TRACE("(%p,0x%08x,%p)\n",This,howmuch,notify); @@ -144,10 +140,10 @@ static HRESULT WINAPI IDirectSoundCaptureNotifyImpl_SetNotificationPositions( static const IDirectSoundNotifyVtbl dscnvt = { - IDirectSoundCaptureNotifyImpl_QueryInterface, - IDirectSoundCaptureNotifyImpl_AddRef, - IDirectSoundCaptureNotifyImpl_Release, - IDirectSoundCaptureNotifyImpl_SetNotificationPositions, + IDirectSoundNotifyImpl_QueryInterface, + IDirectSoundNotifyImpl_AddRef, + IDirectSoundNotifyImpl_Release, + IDirectSoundNotifyImpl_SetNotificationPositions }; static HRESULT IDirectSoundCaptureNotifyImpl_Create(
1
0
0
0
Michael Stefaniuc : dsound: COM cleanup for the IDirectSoundCaptureBuffer8 iface.
by Alexandre Julliard
12 Jan '12
12 Jan '12
Module: wine Branch: master Commit: f1d7414971529436ae8c700e8791f9fa9e8eff84 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f1d7414971529436ae8c700e8…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Jan 12 00:06:48 2012 +0100 dsound: COM cleanup for the IDirectSoundCaptureBuffer8 iface. --- dlls/dsound/capture.c | 151 +++++++++++++++++------------------------- dlls/dsound/dsound_private.h | 7 +-- 2 files changed, 62 insertions(+), 96 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f1d7414971529436ae8c7…
1
0
0
0
Henri Verbeet : wined3d: Get rid of the WINED3DBASISTYPE typedef.
by Alexandre Julliard
12 Jan '12
12 Jan '12
Module: wine Branch: master Commit: 7dac3e0921b7b2267fc618b544bca958378cd915 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7dac3e0921b7b2267fc618b54…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jan 11 21:27:33 2012 +0100 wined3d: Get rid of the WINED3DBASISTYPE typedef. --- dlls/wined3d/drawprim.c | 2 +- dlls/wined3d/utils.c | 12 +++++++----- dlls/wined3d/wined3d_private.h | 2 +- include/wine/wined3d.h | 15 +++++++-------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 61fbb85..707e364 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -834,7 +834,7 @@ HRESULT tesselate_rectpatch(struct wined3d_device *This, struct WineD3DRectPatch */ ERR("Vertex stride is not a multiple of sizeof(GLfloat)\n"); } - if (info->basis != WINED3DBASIS_BEZIER) + if (info->basis != WINED3D_BASIS_BEZIER) FIXME("Basis is %s, how to handle this?\n", debug_d3dbasis(info->basis)); if (info->degree != WINED3D_DEGREE_CUBIC) FIXME("Degree is %s, how to handle this?\n", debug_d3ddegree(info->degree)); diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 10db6d8..917d297 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -2398,11 +2398,13 @@ const char *debug_glerror(GLenum error) { } } -const char *debug_d3dbasis(WINED3DBASISTYPE basis) { - switch(basis) { - case WINED3DBASIS_BEZIER: return "WINED3DBASIS_BEZIER"; - case WINED3DBASIS_BSPLINE: return "WINED3DBASIS_BSPLINE"; - case WINED3DBASIS_INTERPOLATE: return "WINED3DBASIS_INTERPOLATE"; +const char *debug_d3dbasis(enum wined3d_basis_type basis) +{ + switch (basis) + { + case WINED3D_BASIS_BEZIER: return "WINED3D_BASIS_BEZIER"; + case WINED3D_BASIS_BSPLINE: return "WINED3D_BASIS_BSPLINE"; + case WINED3D_BASIS_INTERPOLATE: return "WINED3D_BASIS_INTERPOLATE"; default: return "unrecognized"; } } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 15e29ec..80162b2 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2508,7 +2508,7 @@ const char *debug_d3dtstype(enum wined3d_transform_state tstype) DECLSPEC_HIDDEN const char *debug_d3dpool(WINED3DPOOL pool) DECLSPEC_HIDDEN; const char *debug_fbostatus(GLenum status) DECLSPEC_HIDDEN; const char *debug_glerror(GLenum error) DECLSPEC_HIDDEN; -const char *debug_d3dbasis(WINED3DBASISTYPE basis) DECLSPEC_HIDDEN; +const char *debug_d3dbasis(enum wined3d_basis_type basis) DECLSPEC_HIDDEN; const char *debug_d3ddegree(enum wined3d_degree_type order) DECLSPEC_HIDDEN; const char *debug_d3dtop(enum wined3d_texture_op d3dtop) DECLSPEC_HIDDEN; void dump_color_fixup_desc(struct color_fixup_desc fixup) DECLSPEC_HIDDEN; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index d5cf9aa..5366c18 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -641,13 +641,12 @@ enum wined3d_transform_state #define WINED3D_TS_WORLD_MATRIX(index) (enum wined3d_transform_state)(index + 256) -typedef enum _WINED3DBASISTYPE +enum wined3d_basis_type { - WINED3DBASIS_BEZIER = 0, - WINED3DBASIS_BSPLINE = 1, - WINED3DBASIS_INTERPOLATE = 2, - WINED3DBASIS_FORCE_DWORD = 0x7fffffff -} WINED3DBASISTYPE; + WINED3D_BASIS_BEZIER = 0, + WINED3D_BASIS_BSPLINE = 1, + WINED3D_BASIS_INTERPOLATE = 2, +}; typedef enum _WINED3DCUBEMAP_FACES { @@ -1583,7 +1582,7 @@ struct wined3d_rect_patch_info UINT width; UINT height; UINT stride; - WINED3DBASISTYPE basis; + enum wined3d_basis_type basis; enum wined3d_degree_type degree; }; @@ -1591,7 +1590,7 @@ struct wined3d_tri_patch_info { UINT start_vertex_offset; UINT vertex_count; - WINED3DBASISTYPE basis; + enum wined3d_basis_type basis; enum wined3d_degree_type degree; };
1
0
0
0
Henri Verbeet : wined3d: Get rid of the WINED3DTRANSFORMSTATETYPE typedef.
by Alexandre Julliard
12 Jan '12
12 Jan '12
Module: wine Branch: master Commit: f38e94af7cc22941876634bb05925801690c5235 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f38e94af7cc22941876634bb0…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jan 11 21:27:32 2012 +0100 wined3d: Get rid of the WINED3DTRANSFORMSTATETYPE typedef. --- dlls/ddraw/device.c | 69 ++++-- dlls/ddraw/executebuffer.c | 2 +- dlls/ddraw/viewport.c | 4 +- dlls/wined3d/context.c | 8 +- dlls/wined3d/device.c | 16 +- dlls/wined3d/state.c | 611 ++++++++++++++++++++-------------------- dlls/wined3d/stateblock.c | 10 +- dlls/wined3d/utils.c | 37 ++-- dlls/wined3d/wined3d_private.h | 8 +- include/wine/wined3d.h | 45 ++-- 10 files changed, 419 insertions(+), 391 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f38e94af7cc2294187663…
1
0
0
0
Henri Verbeet : ddraw/tests: Fix some surface locking calls.
by Alexandre Julliard
12 Jan '12
12 Jan '12
Module: wine Branch: master Commit: d6dfb7914a8074c3c21ae49c6133a66fb5fe9b44 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d6dfb7914a8074c3c21ae49c6…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jan 11 21:27:31 2012 +0100 ddraw/tests: Fix some surface locking calls. In ddraw7 DDLOCK_WAIT is the default behaviour, in earlier versions it's DDLOCK_DONOTWAIT. --- dlls/ddraw/tests/ddraw1.c | 2 +- dlls/ddraw/tests/ddraw2.c | 2 +- dlls/ddraw/tests/ddraw4.c | 2 +- dlls/ddraw/tests/ddraw7.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 13464af..846ca19 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -283,7 +283,7 @@ static void test_clipper_blt(void) hr = IDirectDrawSurface_Blt(dst_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#x.\n", hr); - hr = IDirectDrawSurface_Lock(src_surface, NULL, &surface_desc, 0, NULL); + hr = IDirectDrawSurface_Lock(src_surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#x.\n", hr); ((DWORD *)surface_desc.lpSurface)[0] = 0xff0000ff; ((DWORD *)surface_desc.lpSurface)[1] = 0xff00ff00; diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 8146ff6..d94af1a 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -290,7 +290,7 @@ static void test_clipper_blt(void) hr = IDirectDrawSurface_Blt(dst_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#x.\n", hr); - hr = IDirectDrawSurface_Lock(src_surface, NULL, &surface_desc, 0, NULL); + hr = IDirectDrawSurface_Lock(src_surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#x.\n", hr); ((DWORD *)surface_desc.lpSurface)[0] = 0xff0000ff; ((DWORD *)surface_desc.lpSurface)[1] = 0xff00ff00; diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 65725b3..144f372 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -585,7 +585,7 @@ static void test_clipper_blt(void) hr = IDirectDrawSurface4_Blt(dst_surface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#x.\n", hr); - hr = IDirectDrawSurface4_Lock(src_surface, NULL, &surface_desc, 0, NULL); + hr = IDirectDrawSurface4_Lock(src_surface, NULL, &surface_desc, DDLOCK_WAIT, NULL); ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#x.\n", hr); ((DWORD *)surface_desc.lpSurface)[0] = 0xff0000ff; ((DWORD *)surface_desc.lpSurface)[1] = 0xff00ff00; diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 0826346..f130c01 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -86,7 +86,7 @@ static D3DCOLOR get_surface_color(IDirectDrawSurface7 *surface, UINT x, UINT y) memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); - hr = IDirectDrawSurface7_Lock(surface, &rect, &surface_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); + hr = IDirectDrawSurface7_Lock(surface, &rect, &surface_desc, DDLOCK_READONLY, NULL); ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); if (FAILED(hr)) return 0xdeadbeef;
1
0
0
0
Henri Verbeet : wined3d: Hold the wined3d mutex in device_process_message() .
by Alexandre Julliard
12 Jan '12
12 Jan '12
Module: wine Branch: master Commit: be3a9b5ecb7f15f908323cf4b7ad09f3035a62ca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=be3a9b5ecb7f15f908323cf4b…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jan 11 21:27:30 2012 +0100 wined3d: Hold the wined3d mutex in device_process_message(). --- dlls/wined3d/device.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 3551a14..b5d5111 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -6020,8 +6020,12 @@ void get_drawable_size_backbuffer(const struct wined3d_context *context, UINT *w LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL unicode, UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) { + wined3d_mutex_lock(); + if (device->filter_messages) { + wined3d_mutex_unlock(); + TRACE("Filtering message: window %p, message %#x, wparam %#lx, lparam %#lx.\n", window, message, wparam, lparam); if (unicode) @@ -6043,6 +6047,8 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL device->device_parent->ops->mode_changed(device->device_parent); } + wined3d_mutex_unlock(); + if (unicode) return CallWindowProcW(proc, window, message, wparam, lparam); else
1
0
0
0
← Newer
1
...
61
62
63
64
65
66
67
...
98
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Results per page:
10
25
50
100
200