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 2007
----- 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
3 participants
957 discussions
Start a n
N
ew thread
Maarten Lankhorst : dsound: Constify DSOUND_CheckEvent.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: 3b9877fa1412f14e8ae4c97f13bd7df222a712e8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3b9877fa1412f14e8ae4c97f1…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Sun Jul 29 21:39:46 2007 +0200 dsound: Constify DSOUND_CheckEvent. --- dlls/dsound/dsound_private.h | 2 +- dlls/dsound/mixer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index cfbf6bd..f55f46d 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -429,7 +429,7 @@ HRESULT DSOUND_FullDuplexCreate(REFIID riid, LPDIRECTSOUNDFULLDUPLEX* ppDSFD); /* mixer.c */ -void DSOUND_CheckEvent(IDirectSoundBufferImpl *dsb, DWORD playpos, int len); +void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len); void DSOUND_RecalcVolPan(PDSVOLUMEPAN volpan); void DSOUND_AmpFactorToVolPan(PDSVOLUMEPAN volpan); void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb); diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 12243fe..d927df9 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -106,7 +106,7 @@ void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb) * "last played" position for the buffer (i.e. dsb->playpos) and "len" bytes * beyond that position. */ -void DSOUND_CheckEvent(IDirectSoundBufferImpl *dsb, DWORD playpos, int len) +void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len) { int i; DWORD offset;
1
0
0
0
Maarten Lankhorst : dsound: Remove some more unused variables.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: bfa05bf232ddd97444531d64c304b65189dff003 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bfa05bf232ddd97444531d64c…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Sun Jul 29 21:06:23 2007 +0200 dsound: Remove some more unused variables. --- dlls/dsound/dsound_private.h | 2 +- dlls/dsound/primary.c | 1 - 2 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 3516c18..cfbf6bd 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -84,7 +84,7 @@ struct DirectSoundDevice PWAVEFORMATEX pwfx; HWAVEOUT hwo; LPWAVEHDR pwave[DS_HEL_FRAGS]; - UINT timerID, pwplay, pwwrite, pwqueue, prebuf, precount; + UINT timerID, pwplay, pwqueue, prebuf; DWORD fraglen; PIDSDRIVERBUFFER hwbuf; LPBYTE buffer; diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 271243d..7b7b464 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -134,7 +134,6 @@ static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) } device->pwplay = 0; - device->pwwrite = 0; device->pwqueue = 0; device->playpos = 0; device->mixpos = 0;
1
0
0
0
Maarten Lankhorst : dsound: Silence the IDirectSoundBuffer_Initialize warnings.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: 34893a914b2ef73f6f86404026c4188c3c4053e1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=34893a914b2ef73f6f8640402…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Sun Jul 29 21:29:33 2007 +0200 dsound: Silence the IDirectSoundBuffer_Initialize warnings. --- dlls/dsound/buffer.c | 4 +--- dlls/dsound/primary.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c index d0a6fe6..d7da379 100644 --- a/dlls/dsound/buffer.c +++ b/dlls/dsound/buffer.c @@ -793,9 +793,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Initialize( LPDIRECTSOUNDBUFFER8 iface,LPDIRECTSOUND dsound,LPCDSBUFFERDESC dbsd ) { IDirectSoundBufferImpl *This = (IDirectSoundBufferImpl *)iface; - FIXME("(%p,%p,%p):stub\n",This,dsound,dbsd); - DPRINTF("Re-Init!!!\n"); - WARN("already initialized\n"); + WARN("(%p) already initialized\n", This); return DSERR_ALREADYINITIALIZED; } diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 16509d6..271243d 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -952,9 +952,7 @@ static HRESULT WINAPI PrimaryBufferImpl_Initialize( LPDIRECTSOUNDBUFFER iface,LPDIRECTSOUND dsound,LPCDSBUFFERDESC dbsd ) { PrimaryBufferImpl *This = (PrimaryBufferImpl *)iface; - FIXME("(%p,%p,%p):stub\n",This,dsound,dbsd); - DPRINTF("Re-Init!!!\n"); - WARN("already initialized\n"); + WARN("(%p) already initialized\n", This); return DSERR_ALREADYINITIALIZED; }
1
0
0
0
Maarten Lankhorst : dsound: Fix locking in mixer.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: a335f68bfba761c61f6678d389eb70e78240b9fb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a335f68bfba761c61f6678d38…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Sun Jul 29 21:27:41 2007 +0200 dsound: Fix locking in mixer. --- dlls/dsound/mixer.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 1e40305..12243fe 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -891,7 +891,7 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) } if (lock) - IDsDriverBuffer_Lock(device->hwbuf, &buf1, &size1, &buf2, &size2, device->mixpos, maxq, 0); + IDsDriverBuffer_Lock(device->hwbuf, &buf1, &size1, &buf2, &size2, writepos, maxq, 0); /* do the mixing */ frag = DSOUND_MixToPrimary(device, writepos, maxq, recover, &all_stopped); @@ -960,9 +960,11 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) } else { /* update the wave queue if using wave system */ - if(device->hwbuf == NULL){ + if(device->hwbuf == NULL) DSOUND_WaveQueue(device, TRUE); - } + else + /* Keep alsa happy, which needs GetPosition called once every 10 ms */ + IDsDriverBuffer_GetPosition(device->hwbuf, NULL, NULL); /* in the DSSCL_WRITEPRIMARY mode, the app is totally in charge... */ if (device->state == STATE_STARTING) {
1
0
0
0
Maarten Lankhorst : dsound: Small mixer optimizations.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: 8aaeb0d4ed821a3f776f751e9890b8bdaad0822f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8aaeb0d4ed821a3f776f751e9…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Sun Jul 29 21:24:21 2007 +0200 dsound: Small mixer optimizations. --- dlls/dsound/mixer.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index e17525c..1e40305 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -587,20 +587,19 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2) * primary buffer. * * dsb = the secondary buffer - * playpos = the current play position in the device buffer (primary buffer) * writepos = the current safe-to-write position in the device buffer * mixlen = the maximum number of bytes in the primary buffer to mix, from the * current writepos. * * Returns: the number of bytes beyond the writepos that were mixed. */ -static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD playpos, DWORD writepos, DWORD mixlen) +static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD mixlen) { /* The buffer's primary_mixpos may be before or after the the device * buffer's mixpos, but both must be ahead of writepos. */ DWORD primary_done, buflen = dsb->buflen / dsb->pwfx->nBlockAlign * dsb->device->pwfx->nBlockAlign; - TRACE("(%p,%d,%d,%d)\n",dsb,playpos,writepos,mixlen); + TRACE("(%p,%d,%d)\n",dsb,writepos,mixlen); TRACE("writepos=%d, buf_mixpos=%d, primary_mixpos=%d, mixlen=%d\n", writepos, dsb->buf_mixpos, dsb->primary_mixpos, mixlen); TRACE("looping=%d, startpos=%d, leadin=%d, buflen=%d\n", dsb->playflags, dsb->startpos, dsb->leadin, dsb->buflen); @@ -611,7 +610,7 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD playpos, DWORD wri if(mixlen < primary_done) { /* Should *NEVER* happen */ - ERR("Fatal error. Under/Overflow? primary_done=%d, mixpos=%d, primary_mixpos=%d, writepos=%d, playpos=%d\n", primary_done,dsb->buf_mixpos,dsb->primary_mixpos, writepos, playpos); + ERR("Fatal error. Under/Overflow? primary_done=%d, mixpos=%d, primary_mixpos=%d, writepos=%d, mixlen=%d\n", primary_done,dsb->buf_mixpos,dsb->primary_mixpos, writepos, mixlen); return 0; } @@ -679,7 +678,7 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD playpos, DWORD wri * Returns: the length beyond the writepos that was mixed to. */ -static DWORD DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD playpos, DWORD writepos, +static DWORD DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, DWORD mixlen, BOOL recover, BOOL *all_stopped) { INT i, len; @@ -689,7 +688,7 @@ static DWORD DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD playpos, /* unless we find a running buffer, all have stopped */ *all_stopped = TRUE; - TRACE("(%d,%d,%d,%d)\n", playpos, writepos, mixlen, recover); + TRACE("(%d,%d,%d)\n", writepos, mixlen, recover); for (i = 0; i < device->nrofbuffers; i++) { dsb = device->buffers[i]; @@ -711,7 +710,7 @@ static DWORD DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD playpos, } /* mix next buffer into the main buffer */ - len = DSOUND_MixOne(dsb, playpos, writepos, mixlen); + len = DSOUND_MixOne(dsb, writepos, mixlen); /* if the buffer was starting, it must be playing now */ if (dsb->state == STATE_STARTING) @@ -873,7 +872,6 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) writelead = DSOUND_BufPtrDiff(device->buflen, writepos, playpos); /* find the maximum we can prebuffer from current write position */ - maxq = prebuff_max - prebuff_left; maxq = (writelead < prebuff_max) ? (prebuff_max - writelead) : 0; TRACE("prebuff_left = %d, prebuff_max = %dx%d=%d, writelead=%d\n", @@ -881,7 +879,9 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) /* check for underrun. underrun occurs when the write position passes the mix position */ if((prebuff_left > prebuff_max) || (device->state == STATE_STOPPED) || (device->state == STATE_STARTING)){ - TRACE("Buffer starting or buffer underrun\n"); + if (device->state == STATE_STOPPING || device->state == STATE_PLAYING) + WARN("Probable buffer underrun\n"); + else TRACE("Buffer starting or buffer underrun\n"); /* recover mixing for all buffers */ recover = TRUE; @@ -894,7 +894,7 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) IDsDriverBuffer_Lock(device->hwbuf, &buf1, &size1, &buf2, &size2, device->mixpos, maxq, 0); /* do the mixing */ - frag = DSOUND_MixToPrimary(device, playpos, writepos, maxq, recover, &all_stopped); + frag = DSOUND_MixToPrimary(device, writepos, maxq, recover, &all_stopped); /* update the mix position, taking wrap-around into acount */ device->mixpos = writepos + frag;
1
0
0
0
Maarten Lankhorst : dsound: Reset state when stopping device.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: de9cecaaa86802ba105b1735721725fc08f557cd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=de9cecaaa86802ba105b17357…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Sun Jul 29 21:04:09 2007 +0200 dsound: Reset state when stopping device. --- dlls/dsound/primary.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 8edf477..16509d6 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -316,6 +316,13 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) (LPVOID)&(device->hwbuf)); if (err != DS_OK) WARN("IDsDriver_CreateSoundBuffer failed\n"); + else if (device->state == STATE_STOPPING) + device->state = STATE_STOPPED; + else if (device->state == STATE_PLAYING) + device->state = STATE_STARTING; + if (err == DS_OK) + FillMemory(device->buffer, device->buflen, (device->pwfx->wBitsPerSample == 8) ? 128 : 0); + } else { WARN("waveOutOpen failed\n"); }
1
0
0
0
Maarten Lankhorst : dsound: Replace buffer critical section with a rw-lock.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: 237b2938294dbe258bf03fee01a7394d46f0911d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=237b2938294dbe258bf03fee0…
Author: Maarten Lankhorst <m.b.lankhorst(a)gmail.com> Date: Sun Jul 29 21:01:43 2007 +0200 dsound: Replace buffer critical section with a rw-lock. --- dlls/dsound/buffer.c | 49 ++++++++++++++++++----------------------- dlls/dsound/dsound_private.h | 2 +- dlls/dsound/mixer.c | 4 +- dlls/dsound/primary.c | 4 +- 4 files changed, 27 insertions(+), 32 deletions(-) diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c index aa6ef50..d0a6fe6 100644 --- a/dlls/dsound/buffer.c +++ b/dlls/dsound/buffer.c @@ -216,7 +216,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetVolume( } /* **** */ - EnterCriticalSection(&(This->lock)); + RtlAcquireResourceExclusive(&This->lock, TRUE); if (This->dsbd.dwFlags & DSBCAPS_CTRL3D) { oldVol = This->ds3db_lVolume; @@ -239,7 +239,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetVolume( } } - LeaveCriticalSection(&(This->lock)); + RtlReleaseResource(&This->lock); /* **** */ return hres; @@ -288,7 +288,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFrequency( } /* **** */ - EnterCriticalSection(&(This->lock)); + RtlAcquireResourceExclusive(&This->lock, TRUE); oldFreq = This->freq; This->freq = freq; @@ -298,7 +298,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFrequency( DSOUND_RecalcFormat(This); } - LeaveCriticalSection(&(This->lock)); + RtlReleaseResource(&This->lock); /* **** */ return DS_OK; @@ -312,7 +312,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Play( TRACE("(%p,%08x,%08x,%08x)\n",This,reserved1,reserved2,flags); /* **** */ - EnterCriticalSection(&(This->lock)); + RtlAcquireResourceExclusive(&This->lock, TRUE); This->playflags = flags; if (This->state == STATE_STOPPED) { @@ -329,7 +329,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Play( This->state = STATE_PLAYING; } - LeaveCriticalSection(&(This->lock)); + RtlReleaseResource(&This->lock); /* **** */ return hres; @@ -342,7 +342,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Stop(LPDIRECTSOUNDBUFFER8 iface) TRACE("(%p)\n",This); /* **** */ - EnterCriticalSection(&(This->lock)); + RtlAcquireResourceExclusive(&This->lock, TRUE); if (This->state == STATE_PLAYING) This->state = STATE_STOPPING; @@ -357,7 +357,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Stop(LPDIRECTSOUNDBUFFER8 iface) } DSOUND_CheckEvent(This, 0, 0); - LeaveCriticalSection(&(This->lock)); + RtlReleaseResource(&This->lock); /* **** */ return hres; @@ -380,8 +380,7 @@ static ULONG WINAPI IDirectSoundBufferImpl_Release(LPDIRECTSOUNDBUFFER8 iface) if (!ref) { DirectSoundDevice_RemoveBuffer(This->device, This); - This->lock.DebugInfo->Spare[0] = 0; - DeleteCriticalSection(&(This->lock)); + RtlDeleteResource(&This->lock); if (This->hwbuf) { IDsDriverBuffer_Release(This->hwbuf); @@ -568,7 +567,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Lock( } /* **** */ - EnterCriticalSection(&(This->lock)); + RtlAcquireResourceShared(&This->lock, TRUE); if (!(This->device->drvdesc.dwFlags & DSDDESC_DONTNEEDSECONDARYLOCK) && This->hwbuf) { hres = IDsDriverBuffer_Lock(This->hwbuf, @@ -578,7 +577,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Lock( 0); if (hres != DS_OK) { WARN("IDsDriverBuffer_Lock failed\n"); - LeaveCriticalSection(&(This->lock)); + RtlReleaseResource(&This->lock); return hres; } } else { @@ -603,7 +602,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Lock( } } - LeaveCriticalSection(&(This->lock)); + RtlReleaseResource(&This->lock); /* **** */ return DS_OK; @@ -617,7 +616,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetCurrentPosition( TRACE("(%p,%d)\n",This,newpos); /* **** */ - EnterCriticalSection(&(This->lock)); + RtlAcquireResourceExclusive(&This->lock, TRUE); /* start mixing from this new location instead */ newpos %= This->buflen; @@ -634,7 +633,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetCurrentPosition( WARN("IDsDriverBuffer_SetPosition failed\n"); } - LeaveCriticalSection(&(This->lock)); + RtlReleaseResource(&This->lock); /* **** */ return hres; @@ -661,7 +660,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetPan( } /* **** */ - EnterCriticalSection(&(This->lock)); + RtlAcquireResourceExclusive(&This->lock, TRUE); if (This->volpan.lPan != pan) { This->volpan.lPan = pan; @@ -674,7 +673,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetPan( } } - LeaveCriticalSection(&(This->lock)); + RtlReleaseResource(&This->lock); /* **** */ return hres; @@ -710,7 +709,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Unlock( TRACE("(%p,%p,%d,%p,%d)\n", This,p1,x1,p2,x2); /* **** */ - EnterCriticalSection(&(This->lock)); + RtlAcquireResourceShared(&This->lock, TRUE); if (!(This->device->drvdesc.dwFlags & DSDDESC_DONTNEEDSECONDARYLOCK) && This->hwbuf) { hres = IDsDriverBuffer_Unlock(This->hwbuf, p1, x1, p2, x2); @@ -718,7 +717,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Unlock( WARN("IDsDriverBuffer_Unlock failed\n"); } - LeaveCriticalSection(&(This->lock)); + RtlReleaseResource(&This->lock); /* **** */ return hres; @@ -1099,8 +1098,7 @@ HRESULT IDirectSoundBufferImpl_Create( } else DSOUND_RecalcVolPan(&(dsb->volpan)); - InitializeCriticalSection(&(dsb->lock)); - dsb->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectSoundBufferImpl.lock"); + RtlInitializeResource(&dsb->lock); /* register buffer if not primary */ if (!(dsbd->dwFlags & DSBCAPS_PRIMARYBUFFER)) { @@ -1108,8 +1106,7 @@ HRESULT IDirectSoundBufferImpl_Create( if (err != DS_OK) { HeapFree(GetProcessHeap(),0,dsb->buffer->memory); HeapFree(GetProcessHeap(),0,dsb->buffer); - dsb->lock.DebugInfo->Spare[0] = 0; - DeleteCriticalSection(&(dsb->lock)); + RtlDeleteResource(&dsb->lock); HeapFree(GetProcessHeap(),0,dsb->pwfx); HeapFree(GetProcessHeap(),0,dsb); dsb = NULL; @@ -1237,14 +1234,12 @@ HRESULT IDirectSoundBufferImpl_Duplicate( CopyMemory(dsb->pwfx, pdsb->pwfx, size); - InitializeCriticalSection(&(dsb->lock)); - dsb->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectSoundBufferImpl.lock"); + RtlInitializeResource(&dsb->lock); /* register buffer */ hres = DirectSoundDevice_AddBuffer(device, dsb); if (hres != DS_OK) { - dsb->lock.DebugInfo->Spare[0] = 0; - DeleteCriticalSection(&(dsb->lock)); + RtlDeleteResource(&dsb->lock); HeapFree(GetProcessHeap(),0,dsb->buffer); HeapFree(GetProcessHeap(),0,dsb->pwfx); HeapFree(GetProcessHeap(),0,dsb); diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index fcd4133..3516c18 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -157,7 +157,7 @@ struct IDirectSoundBufferImpl /* IDirectSoundBufferImpl fields */ SecondaryBufferImpl* secondary; DirectSoundDevice* device; - CRITICAL_SECTION lock; + RTL_RWLOCK lock; PIDSDRIVERBUFFER hwbuf; PWAVEFORMATEX pwfx; BufferMemory* buffer; diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index b5af5fb..e17525c 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -697,7 +697,7 @@ static DWORD DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD playpos, if (dsb->buflen && dsb->state && !dsb->hwbuf) { TRACE("Checking %p, mixlen=%d\n", dsb, mixlen); - EnterCriticalSection(&(dsb->lock)); + RtlAcquireResourceShared(&dsb->lock, TRUE); /* if buffer is stopping it is stopped now */ if (dsb->state == STATE_STOPPING) { @@ -729,7 +729,7 @@ static DWORD DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD playpos, *all_stopped = FALSE; } - LeaveCriticalSection(&(dsb->lock)); + RtlReleaseResource(&dsb->lock); } } diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index a89889c..8edf477 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -460,12 +460,12 @@ HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex) IDirectSoundBufferImpl** dsb = device->buffers; for (i = 0; i < device->nrofbuffers; i++, dsb++) { /* **** */ - EnterCriticalSection(&((*dsb)->lock)); + RtlAcquireResourceExclusive(&(*dsb)->lock, TRUE); (*dsb)->freqAdjust = ((*dsb)->freq << DSOUND_FREQSHIFT) / wfex->nSamplesPerSec; - LeaveCriticalSection(&((*dsb)->lock)); + RtlReleaseResource(&(*dsb)->lock); /* **** */ } }
1
0
0
0
Evan Stade : gdiplus: Fixed a typo.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: 629e013d7f25ce06fb7eb48491b781f51efcf7ea URL:
http://source.winehq.org/git/wine.git/?a=commit;h=629e013d7f25ce06fb7eb4849…
Author: Evan Stade <estade(a)gmail.com> Date: Fri Jul 27 16:07:50 2007 -0700 gdiplus: Fixed a typo. --- dlls/gdiplus/graphics.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index cb56c73..92662b5 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -750,7 +750,7 @@ static GpStatus draw_poly(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF * &ptcopy[j - 1].X, &ptcopy[j - 1].Y, pen->customstart->inset * pen->width); - draw_cap(graphics, pen->brush->lb.lbColor, pen->endcap, pen->width, pen->customstart, + draw_cap(graphics, pen->brush->lb.lbColor, pen->startcap, pen->width, pen->customstart, pt[j].X, pt[j].Y, pt[j - 1].X, pt[j - 1].Y);
1
0
0
0
Evan Stade : gdiplus: Check custom dash array for bad properties.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: b6b7e915c30a83cd5a6dce6606d5f149e4ae1de1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b6b7e915c30a83cd5a6dce660…
Author: Evan Stade <estade(a)gmail.com> Date: Fri Jul 27 16:07:47 2007 -0700 gdiplus: Check custom dash array for bad properties. --- dlls/gdiplus/pen.c | 12 ++++++++++++ dlls/gdiplus/tests/pen.c | 6 ++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index 7d7237b..b85f158 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -223,9 +223,21 @@ GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen *pen, GpCustomLineCap* custom GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash, INT count) { + INT i; + REAL sum = 0; + if(!pen || !dash) return InvalidParameter; + for(i = 0; i < count; i++){ + sum += dash[i]; + if(dash[i] < 0.0) + return InvalidParameter; + } + + if(sum == 0.0 && count) + return InvalidParameter; + GdipFree(pen->dashes); pen->dashes = NULL; diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c index 3fede54..fc792a6 100644 --- a/dlls/gdiplus/tests/pen.c +++ b/dlls/gdiplus/tests/pen.c @@ -176,12 +176,10 @@ static void test_dasharray(void) /* Some invalid array values. */ status = GdipSetPenDashArray(pen, &dashes[7], 5); - todo_wine - expect(InvalidParameter, status); + expect(InvalidParameter, status); dashes[9] = -1.0; status = GdipSetPenDashArray(pen, &dashes[7], 5); - todo_wine - expect(InvalidParameter, status); + expect(InvalidParameter, status); /* Try to set with count = 0. */ GdipSetPenDashStyle(pen, DashStyleDot);
1
0
0
0
Evan Stade : gdiplus/tests: More GdipSetPenDashArray tests.
by Alexandre Julliard
30 Jul '07
30 Jul '07
Module: wine Branch: master Commit: a35206e08eb30df1b0be80833ab67f7f8109ff45 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a35206e08eb30df1b0be80833…
Author: Evan Stade <estade(a)gmail.com> Date: Fri Jul 27 16:07:43 2007 -0700 gdiplus/tests: More GdipSetPenDashArray tests. --- dlls/gdiplus/tests/pen.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c index 5221423..3fede54 100644 --- a/dlls/gdiplus/tests/pen.c +++ b/dlls/gdiplus/tests/pen.c @@ -133,6 +133,7 @@ static void test_dasharray(void) dashes[4] = 14.0; dashes[5] = -100.0; dashes[6] = -100.0; + dashes[7] = dashes[8] = dashes[9] = dashes[10] = dashes[11] = 0.0; /* setting the array sets the type to custom */ GdipGetPenDashStyle(pen, &style); @@ -173,6 +174,15 @@ static void test_dasharray(void) expectf(-100.0, dashes[5]); expectf(-100.0, dashes[6]); + /* Some invalid array values. */ + status = GdipSetPenDashArray(pen, &dashes[7], 5); + todo_wine + expect(InvalidParameter, status); + dashes[9] = -1.0; + status = GdipSetPenDashArray(pen, &dashes[7], 5); + todo_wine + expect(InvalidParameter, status); + /* Try to set with count = 0. */ GdipSetPenDashStyle(pen, DashStyleDot); status = GdipSetPenDashArray(pen, dashes, 0);
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
96
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
Results per page:
10
25
50
100
200