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
May 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
737 discussions
Start a n
N
ew thread
Henri Verbeet : d3d9: Properly retrieve an interface pointer in d3d9_texture_cube_UnlockRect().
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: f9fe89b3860a5857154140fb223a025dda079a6e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f9fe89b3860a5857154140fb2…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue May 1 20:25:25 2012 +0200 d3d9: Properly retrieve an interface pointer in d3d9_texture_cube_UnlockRect(). --- dlls/d3d9/texture.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index d74cc67..c9114ef 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -793,6 +793,7 @@ static HRESULT WINAPI d3d9_texture_cube_UnlockRect(IDirect3DCubeTexture9 *iface, { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); struct wined3d_resource *sub_resource; + IDirect3DSurface9Impl *surface_impl; UINT sub_resource_idx; HRESULT hr; @@ -803,7 +804,10 @@ static HRESULT WINAPI d3d9_texture_cube_UnlockRect(IDirect3DCubeTexture9 *iface, if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx))) hr = D3DERR_INVALIDCALL; else - hr = IDirect3DSurface9_UnlockRect((IDirect3DSurface9 *)wined3d_resource_get_parent(sub_resource)); + { + surface_impl = wined3d_resource_get_parent(sub_resource); + hr = IDirect3DSurface9_UnlockRect(&surface_impl->IDirect3DSurface9_iface); + } wined3d_mutex_unlock(); return hr;
1
0
0
0
Henri Verbeet : d3d9: Properly retrieve an interface pointer in d3d9_texture_cube_LockRect().
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: 5d30402ad8e2d460519c540b97b26ec0e22212f1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5d30402ad8e2d460519c540b9…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue May 1 20:25:24 2012 +0200 d3d9: Properly retrieve an interface pointer in d3d9_texture_cube_LockRect(). --- dlls/d3d9/texture.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index 0a1212b..d74cc67 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -767,6 +767,7 @@ static HRESULT WINAPI d3d9_texture_cube_LockRect(IDirect3DCubeTexture9 *iface, { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); struct wined3d_resource *sub_resource; + IDirect3DSurface9Impl *surface_impl; UINT sub_resource_idx; HRESULT hr; @@ -778,8 +779,10 @@ static HRESULT WINAPI d3d9_texture_cube_LockRect(IDirect3DCubeTexture9 *iface, if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx))) hr = D3DERR_INVALIDCALL; else - hr = IDirect3DSurface9_LockRect((IDirect3DSurface9 *)wined3d_resource_get_parent(sub_resource), - locked_rect, rect, flags); + { + surface_impl = wined3d_resource_get_parent(sub_resource); + hr = IDirect3DSurface9_LockRect(&surface_impl->IDirect3DSurface9_iface, locked_rect, rect, flags); + } wined3d_mutex_unlock(); return hr;
1
0
0
0
André Hentschel : winedbg: Complete the Thumb disassembler.
by Alexandre Julliard
02 May '12
02 May '12
Module: wine Branch: master Commit: f86ea4cbe9fb81c3c8edc583214f8149d6df2fcc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f86ea4cbe9fb81c3c8edc5832…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Tue May 1 19:45:45 2012 +0200 winedbg: Complete the Thumb disassembler. --- programs/winedbg/be_arm.c | 77 +++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 71 insertions(+), 6 deletions(-) diff --git a/programs/winedbg/be_arm.c b/programs/winedbg/be_arm.c index 7da28b6..8ceb14c 100644 --- a/programs/winedbg/be_arm.c +++ b/programs/winedbg/be_arm.c @@ -67,7 +67,7 @@ static char const tbl_shifts[][4] = { }; static char const tbl_hiops_t[][4] = { -"add", "cmp", "mov", "bx" + "add", "cmp", "mov", "bx" }; static char const tbl_aluops_t[][4] = { @@ -76,7 +76,11 @@ static char const tbl_aluops_t[][4] = { }; static char const tbl_immops_t[][4] = { -"mov", "cmp", "add", "sub" + "mov", "cmp", "add", "sub" +}; + +static char const tbl_sregops_t[][5] = { + "strh", "ldsb", "ldrh", "ldsh" }; static UINT db_get_inst(void* addr, int size) @@ -368,7 +372,7 @@ static WORD thumb_disasm_aluop(WORD inst, ADDRESS64 *addr) return 0; } -static WORD thumb_disasm_blocktrans(WORD inst, ADDRESS64 *addr) +static WORD thumb_disasm_pushpop(WORD inst, ADDRESS64 *addr) { short lrpc = (inst >> 8) & 0x01; short load = (inst >> 11) & 0x01; @@ -388,7 +392,30 @@ static WORD thumb_disasm_blocktrans(WORD inst, ADDRESS64 *addr) else dbg_printf("%s, ", tbl_regs[i]); } if (lrpc) - dbg_printf(", %s", load ? "pc" : "lr"); + dbg_printf("%s%s", last ? ", " : "", load ? "pc" : "lr"); + + dbg_printf("}"); + return 0; +} + +static WORD thumb_disasm_blocktrans(WORD inst, ADDRESS64 *addr) +{ + short load = (inst >> 11) & 0x01; + short i; + short last; + + for (i=7;i>=0;i--) + if ((inst>>i) & 1) break; + last = i; + + dbg_printf("\n\t%s\t%s!, {", load ? "ldmia" : "stmia", tbl_regs[(inst >> 8) & 0x07]); + + for (i=0;i<=7;i++) + if ((inst>>i) & 1) + { + if (i == last) dbg_printf("%s", tbl_regs[i]); + else dbg_printf("%s, ", tbl_regs[i]); + } dbg_printf("}"); return 0; @@ -417,6 +444,18 @@ static WORD thumb_disasm_condbranch(WORD inst, ADDRESS64 *addr) return 0; } +static WORD thumb_disasm_uncondbranch(WORD inst, ADDRESS64 *addr) +{ + short offset = (inst & 0x07ff) << 1; + + if (offset & 0x0800) offset |= 0xf000; + offset += 4; + + dbg_printf("\n\tb\t"); + db_printsym(addr->Offset + offset); + return 0; +} + static WORD thumb_disasm_loadadr(WORD inst, ADDRESS64 *addr) { WORD src = (inst >> 11) & 0x01; @@ -471,6 +510,28 @@ static WORD thumb_disasm_ldrimm(WORD inst, ADDRESS64 *addr) return 0; } +static WORD thumb_disasm_ldrhimm(WORD inst, ADDRESS64 *addr) +{ + WORD offset = (inst & 0x07c0) >> 5; + dbg_printf("\n\t%s\t%s, [%s, #%u]", (inst & 0x0800)?"ldrh":"strh", + tbl_regs[inst & 0x07], tbl_regs[(inst >> 3) & 0x07], offset); + return 0; +} + +static WORD thumb_disasm_ldrreg(WORD inst, ADDRESS64 *addr) +{ + dbg_printf("\n\t%s%s\t%s, [%s, %s]", (inst & 0x0800)?"ldr":"str", (inst & 0x0400)?"b":"", + tbl_regs[inst & 0x07], tbl_regs[(inst >> 3) & 0x07], tbl_regs[(inst >> 6) & 0x07]); + return 0; +} + +static WORD thumb_disasm_ldrsreg(WORD inst, ADDRESS64 *addr) +{ + dbg_printf("\n\t%s\t%s, [%s, %s]", tbl_sregops_t[(inst >> 10) & 0x03], + tbl_regs[inst & 0x07], tbl_regs[(inst >> 3) & 0x07], tbl_regs[(inst >> 6) & 0x07]); + return 0; +} + static WORD thumb_disasm_immop(WORD inst, ADDRESS64 *addr) { WORD op = (inst >> 11) & 0x03; @@ -531,16 +592,20 @@ struct inst_thumb16 static const struct inst_thumb16 tbl_thumb16[] = { { 0xfc00, 0x4400, thumb_disasm_hireg }, { 0xfc00, 0x4000, thumb_disasm_aluop }, - { 0xf600, 0xb400, thumb_disasm_blocktrans }, + { 0xf600, 0xb400, thumb_disasm_pushpop }, + { 0xf000, 0xc000, thumb_disasm_blocktrans }, { 0xf800, 0xf000, thumb_disasm_longbl }, { 0xf000, 0xd000, thumb_disasm_condbranch }, + { 0xf800, 0xe000, thumb_disasm_uncondbranch }, { 0xf000, 0xa000, thumb_disasm_loadadr }, { 0xf800, 0x4800, thumb_disasm_ldrpcrel }, { 0xf000, 0x9000, thumb_disasm_ldrsprel }, { 0xff00, 0xb000, thumb_disasm_addsprel }, { 0xe000, 0x6000, thumb_disasm_ldrimm }, + { 0xf000, 0x8000, thumb_disasm_ldrhimm }, + { 0xf200, 0x5000, thumb_disasm_ldrreg }, + { 0xf200, 0x5200, thumb_disasm_ldrsreg }, { 0xe000, 0x2000, thumb_disasm_immop }, - { 0xf000, 0xd000, thumb_disasm_condbranch }, { 0xff00, 0xdf00, thumb_disasm_swi }, { 0xff00, 0xbf00, thumb_disasm_nop }, { 0xf800, 0x1800, thumb_disasm_addsub },
1
0
0
0
Alexander E. Patrakov : dsound: Clean up channels.
by Alexandre Julliard
01 May '12
01 May '12
Module: wine Branch: master Commit: 93a0ca7c6c4e111e90d3735f232f796202e77ccd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=93a0ca7c6c4e111e90d3735f2…
Author: Alexander E. Patrakov <patrakov(a)gmail.com> Date: Mon Dec 12 14:07:49 2011 -0600 dsound: Clean up channels. --- dlls/dsound/dsound_convert.c | 18 ++++++++++ dlls/dsound/dsound_private.h | 8 +++- dlls/dsound/mixer.c | 77 +++++++++++++++++++----------------------- 3 files changed, 59 insertions(+), 44 deletions(-) diff --git a/dlls/dsound/dsound_convert.c b/dlls/dsound/dsound_convert.c index b670c04..63f1eb0 100644 --- a/dlls/dsound/dsound_convert.c +++ b/dlls/dsound/dsound_convert.c @@ -104,6 +104,18 @@ static float getieee32(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD chann const bitsgetfunc getbpp[5] = {get8, get16, get24, get32, getieee32}; +float get_mono(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel) +{ + DWORD channels = dsb->pwfx->nChannels; + DWORD c; + float val = 0; + /* XXX: does Windows include LFE into the mix? */ + for (c = 0; c < channels; c++) + val += dsb->get_aux(dsb, pos, c); + val /= channels; + return val; +} + static void put8(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) { BYTE* buf = dsb->device->tmp_buffer; @@ -158,6 +170,12 @@ static void put32(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, f const bitsputfunc putbpp[4] = {put8, put16, put24, put32}; +void put_mono2stereo(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) +{ + dsb->put_aux(dsb, pos, 0, value); + dsb->put_aux(dsb, pos, 1, value); +} + static void mix8(signed char *src, INT *dst, unsigned len) { TRACE("%p - %p %d\n", src, dst, len); diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 9f30bff..5d1d62a 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -193,12 +193,16 @@ struct IDirectSoundBufferImpl LONG ds3db_lVolume; BOOL ds3db_need_recalc; /* Used for bit depth conversion */ - bitsgetfunc get; - bitsputfunc put; + int mix_channels; + bitsgetfunc get, get_aux; + bitsputfunc put, put_aux; struct list entry; }; +float get_mono(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel) DECLSPEC_HIDDEN; +void put_mono2stereo(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) DECLSPEC_HIDDEN; + HRESULT IDirectSoundBufferImpl_Create( DirectSoundDevice *device, IDirectSoundBufferImpl **ppdsb, diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 4f73831..5fa15b2 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -178,6 +178,8 @@ static void DSOUND_RecalcFreqAcc(IDirectSoundBufferImpl *dsb) */ void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb) { + DWORD ichannels = dsb->pwfx->nChannels; + DWORD ochannels = dsb->device->pwfx->nChannels; BOOL needremix = TRUE, needresample = (dsb->freq != dsb->device->pwfx->nSamplesPerSec); DWORD bAlign = dsb->pwfx->nBlockAlign, pAlign = dsb->device->pwfx->nBlockAlign; WAVEFORMATEXTENSIBLE *pwfxe; @@ -200,8 +202,36 @@ void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb) dsb->freqAcc = dsb->freqAccNext = 0; dsb->freqneeded = needresample; - dsb->get = ieee ? getbpp[4] : getbpp[dsb->pwfx->wBitsPerSample/8 - 1]; - dsb->put = putbpp[dsb->device->pwfx->wBitsPerSample/8 - 1]; + dsb->get_aux = ieee ? getbpp[4] : getbpp[dsb->pwfx->wBitsPerSample/8 - 1]; + dsb->put_aux = putbpp[dsb->device->pwfx->wBitsPerSample/8 - 1]; + + dsb->get = dsb->get_aux; + dsb->put = dsb->put_aux; + + if (ichannels == ochannels) + { + dsb->mix_channels = ichannels; + if (ichannels > 32) { + FIXME("Copying %u channels is unsupported, limiting to first 32\n", ichannels); + dsb->mix_channels = 32; + } + } + else if (ichannels == 1) + { + dsb->mix_channels = 1; + dsb->put = put_mono2stereo; + } + else if (ochannels == 1) + { + dsb->mix_channels = 1; + dsb->get = get_mono; + } + else + { + if (ichannels > 2) + FIXME("Conversion from %u to %u channels is not implemented, falling back to stereo\n", ichannels, ochannels); + dsb->mix_channels = 2; + } if (needremix) { @@ -278,38 +308,13 @@ static inline void cp_fields(const IDirectSoundBufferImpl *dsb, DWORD ipos = dsb->sec_mixpos; UINT istride = dsb->pwfx->nBlockAlign; UINT adj = dsb->freqAdjust; - DirectSoundDevice *device = dsb->device; - float value; ULONG adv; DWORD opos = 0; while (count-- > 0) { - if (device->pwfx->nChannels == dsb->pwfx->nChannels || - (device->pwfx->nChannels == 2 && dsb->pwfx->nChannels == 6) || - (device->pwfx->nChannels == 8 && dsb->pwfx->nChannels == 2) || - (device->pwfx->nChannels == 6 && dsb->pwfx->nChannels == 2)) { - value = dsb->get(dsb, ipos, 0); - dsb->put(dsb, opos, 0, value); - if (device->pwfx->nChannels == 2 || dsb->pwfx->nChannels == 2) { - value = dsb->get(dsb, ipos, 1); - dsb->put(dsb, opos, 1, value); - } - } - - if (device->pwfx->nChannels == 1 && dsb->pwfx->nChannels == 2) - { - float val = (dsb->get(dsb, ipos, 0) + dsb->get(dsb, ipos, 1)) / 2.; - - dsb->put(dsb, opos, 0, val); - } - - if (device->pwfx->nChannels == 2 && dsb->pwfx->nChannels == 1) - { - value = dsb->get(dsb, ipos, 0); - dsb->put(dsb, opos, 0, value); - dsb->put(dsb, opos, 1, value); - } - + DWORD channel; + for (channel = 0; channel < dsb->mix_channels; channel++) + dsb->put(dsb, opos, channel, dsb->get(dsb, ipos, channel)); freqAcc += adj; adv = (freqAcc >> DSOUND_FREQSHIFT); freqAcc &= (1 << DSOUND_FREQSHIFT) - 1; @@ -361,18 +366,6 @@ static void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD tmp_l dsb->device->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, tmp_len); } - /* Check for same sample rate */ - if (dsb->freq == dsb->device->pwfx->nSamplesPerSec) { - TRACE("(%p) Same sample rate %d = primary %d\n", dsb, - dsb->freq, dsb->device->pwfx->nSamplesPerSec); - - cp_fields(dsb, oAdvance, size, 0); - return; - } - - /* Mix in different sample rates */ - TRACE("(%p) Adjusting frequency: %d -> %d\n", dsb, dsb->freq, dsb->device->pwfx->nSamplesPerSec); - DSOUND_secpos_to_bufpos(dsb, dsb->sec_mixpos, dsb->sec_mixpos, &freqAcc); /* FIXME: Small problem here when we're overwriting buf_mixpos, it then STILL uses old freqAcc, not sure if it matters or not */
1
0
0
0
Alexander E. Patrakov : dsound: Replace convert() functions with get() and put().
by Alexandre Julliard
01 May '12
01 May '12
Module: wine Branch: master Commit: f88f3d41495bd71e9dd8d7f729b10033ec4c8d15 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f88f3d41495bd71e9dd8d7f72…
Author: Alexander E. Patrakov <patrakov(a)gmail.com> Date: Mon Nov 7 10:25:49 2011 -0600 dsound: Replace convert() functions with get() and put(). --- dlls/dsound/dsound_convert.c | 400 ++++++++---------------------------------- dlls/dsound/dsound_private.h | 12 +- dlls/dsound/mixer.c | 77 +++++---- 3 files changed, 123 insertions(+), 366 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f88f3d41495bd71e9dd8d…
1
0
0
0
Alexander E. Patrakov : dsound: Clean up cp_fields.
by Alexandre Julliard
01 May '12
01 May '12
Module: wine Branch: master Commit: ab4ef6636d2e2662a696988000981f70f7ce9fb4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ab4ef6636d2e2662a69698800…
Author: Alexander E. Patrakov <patrakov(a)gmail.com> Date: Mon Dec 12 14:03:19 2011 -0600 dsound: Clean up cp_fields. --- dlls/dsound/mixer.c | 23 ++++++++++------------- 1 files changed, 10 insertions(+), 13 deletions(-) diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 95f8e9f..4f73831 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -269,16 +269,19 @@ void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len } /** - * Copy a single frame from the given input buffer to the given output buffer. + * Copy frames from the given input buffer to the given output buffer. * Translate 8 <-> 16 bits and mono <-> stereo */ -static inline void cp_fields(const IDirectSoundBufferImpl *dsb, const BYTE *ibuf, - UINT istride, UINT ostride, UINT count, UINT freqAcc, UINT adj) +static inline void cp_fields(const IDirectSoundBufferImpl *dsb, + UINT ostride, UINT count, UINT freqAcc) { + DWORD ipos = dsb->sec_mixpos; + UINT istride = dsb->pwfx->nBlockAlign; + UINT adj = dsb->freqAdjust; DirectSoundDevice *device = dsb->device; float value; ULONG adv; - DWORD ipos = dsb->sec_mixpos, opos = 0; + DWORD opos = 0; while (count-- > 0) { if (device->pwfx->nChannels == dsb->pwfx->nChannels || @@ -345,13 +348,10 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2) */ static void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD tmp_len) { - INT size; - BYTE *ibp; - INT iAdvance = dsb->pwfx->nBlockAlign; INT oAdvance = dsb->device->pwfx->nBlockAlign; + INT size = tmp_len / oAdvance; DWORD freqAcc; - ibp = dsb->buffer->memory + dsb->sec_mixpos; if (dsb->device->tmp_buffer_len < tmp_len || !dsb->device->tmp_buffer) { dsb->device->tmp_buffer_len = tmp_len; @@ -361,15 +361,12 @@ static void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD tmp_l dsb->device->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, tmp_len); } - TRACE("(%p, %p)\n", dsb, ibp); - size = tmp_len / oAdvance; - /* Check for same sample rate */ if (dsb->freq == dsb->device->pwfx->nSamplesPerSec) { TRACE("(%p) Same sample rate %d = primary %d\n", dsb, dsb->freq, dsb->device->pwfx->nSamplesPerSec); - cp_fields(dsb, ibp, iAdvance, oAdvance, size, 0, 1 << DSOUND_FREQSHIFT); + cp_fields(dsb, oAdvance, size, 0); return; } @@ -379,7 +376,7 @@ static void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD tmp_l DSOUND_secpos_to_bufpos(dsb, dsb->sec_mixpos, dsb->sec_mixpos, &freqAcc); /* FIXME: Small problem here when we're overwriting buf_mixpos, it then STILL uses old freqAcc, not sure if it matters or not */ - cp_fields(dsb, ibp, iAdvance, oAdvance, size, freqAcc, dsb->freqAdjust); + cp_fields(dsb, oAdvance, size, freqAcc); } /** Apply volume to the given soundbuffer from (primary) position writepos and length len
1
0
0
0
Alexander E. Patrakov : dsound: Clean up MixToTemporary().
by Alexandre Julliard
01 May '12
01 May '12
Module: wine Branch: master Commit: 0195e0199059afc28787083ddc5137de845fece7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0195e0199059afc28787083dd…
Author: Alexander E. Patrakov <patrakov(a)gmail.com> Date: Mon Nov 7 10:17:09 2011 -0600 dsound: Clean up MixToTemporary(). --- dlls/dsound/dsound_convert.c | 2 +- dlls/dsound/mixer.c | 59 +++++++++++++----------------------------- 2 files changed, 19 insertions(+), 42 deletions(-) diff --git a/dlls/dsound/dsound_convert.c b/dlls/dsound/dsound_convert.c index 63e3dbe..dd982c6 100644 --- a/dlls/dsound/dsound_convert.c +++ b/dlls/dsound/dsound_convert.c @@ -66,8 +66,8 @@ static inline void src_advance(const void **src, UINT stride, INT *count, UINT * ULONG adv = (*freqAcc >> DSOUND_FREQSHIFT); *freqAcc &= (1 << DSOUND_FREQSHIFT) - 1; *(const char **)src += adv * stride; - *count -= adv; } + *count -= 1; } static void convert_8_to_8 (const void *src, void *dst, UINT src_stride, diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 7d0ea66..1cb7e05 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -138,8 +138,6 @@ DWORD DSOUND_secpos_to_bufpos(const IDirectSoundBufferImpl *dsb, DWORD secpos, D } /** Convert a resampled pointer that fits for primary to a 'native' sample pointer - * freqAccNext is used here rather than freqAcc: In case the app wants to fill up to - * the play position it won't overwrite it */ static DWORD DSOUND_bufpos_to_secpos(const IDirectSoundBufferImpl *dsb, DWORD bufpos) { @@ -148,12 +146,15 @@ static DWORD DSOUND_bufpos_to_secpos(const IDirectSoundBufferImpl *dsb, DWORD bu DWORD64 acc; framelen = bufpos/oAdv; - acc = framelen * (DWORD64)dsb->freqAdjust + (DWORD64)dsb->freqAccNext; + acc = framelen * (DWORD64)dsb->freqAdjust + (DWORD64)dsb->freqAcc; acc = acc >> DSOUND_FREQSHIFT; pos = (DWORD)acc * iAdv; - if (pos >= dsb->buflen) - /* Because of differences between freqAcc and freqAccNext, this might happen */ + if (pos >= dsb->buflen) { + /* FIXME: can this happen at all? */ + ERR("pos >= dsb->buflen: %d >= %d, capping\n", pos, dsb->buflen); pos = dsb->buflen - iAdv; + } + TRACE("Converted %d/%d to %d/%d\n", bufpos, dsb->tmp_buffer_len, pos, dsb->buflen); return pos; } @@ -334,41 +335,32 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2) * * NOTE: writepos + len <= buflen. When called by mixer, MixOne makes sure of this. */ -static void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD len) +static void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD tmp_len) { INT size; - BYTE *ibp, *obp, *obp_begin; + BYTE *ibp, *obp; INT iAdvance = dsb->pwfx->nBlockAlign; INT oAdvance = dsb->device->pwfx->nBlockAlign; - DWORD freqAcc, overshot, maxlen; - - assert(writepos + len <= dsb->buflen); - if (writepos + len < dsb->buflen) - len += dsb->pwfx->nBlockAlign; + DWORD freqAcc; - maxlen = DSOUND_secpos_to_bufpos(dsb, len, 0, NULL); - - ibp = dsb->buffer->memory + writepos; - if (dsb->device->tmp_buffer_len < maxlen || !dsb->device->tmp_buffer) + ibp = dsb->buffer->memory + dsb->sec_mixpos; + if (dsb->device->tmp_buffer_len < tmp_len || !dsb->device->tmp_buffer) { - dsb->device->tmp_buffer_len = maxlen; + dsb->device->tmp_buffer_len = tmp_len; if (dsb->device->tmp_buffer) - dsb->device->tmp_buffer = HeapReAlloc(GetProcessHeap(), 0, dsb->device->tmp_buffer, maxlen); + dsb->device->tmp_buffer = HeapReAlloc(GetProcessHeap(), 0, dsb->device->tmp_buffer, tmp_len); else - dsb->device->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, maxlen); - obp_begin = dsb->device->tmp_buffer; + dsb->device->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, tmp_len); } - else - obp_begin = dsb->device->tmp_buffer; + obp = dsb->device->tmp_buffer; TRACE("(%p, %p)\n", dsb, ibp); - size = len / iAdvance; + size = tmp_len / oAdvance; /* Check for same sample rate */ if (dsb->freq == dsb->device->pwfx->nSamplesPerSec) { TRACE("(%p) Same sample rate %d = primary %d\n", dsb, dsb->freq, dsb->device->pwfx->nSamplesPerSec); - obp = obp_begin; cp_fields(dsb, ibp, obp, iAdvance, oAdvance, size, 0, 1 << DSOUND_FREQSHIFT); return; @@ -377,22 +369,7 @@ static void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD write /* Mix in different sample rates */ TRACE("(%p) Adjusting frequency: %d -> %d\n", dsb, dsb->freq, dsb->device->pwfx->nSamplesPerSec); - DSOUND_secpos_to_bufpos(dsb, writepos, dsb->sec_mixpos, &freqAcc); - overshot = freqAcc >> DSOUND_FREQSHIFT; - if (overshot) - { - if (overshot >= size) - return; - size -= overshot; - writepos += overshot * iAdvance; - if (writepos >= dsb->buflen) - return; - ibp = dsb->buffer->memory + writepos; - freqAcc &= (1 << DSOUND_FREQSHIFT) - 1; - TRACE("Overshot: %d, freqAcc: %04x\n", overshot, freqAcc); - } - - obp = obp_begin; + DSOUND_secpos_to_bufpos(dsb, dsb->sec_mixpos, dsb->sec_mixpos, &freqAcc); /* FIXME: Small problem here when we're overwriting buf_mixpos, it then STILL uses old freqAcc, not sure if it matters or not */ cp_fields(dsb, ibp, obp, iAdvance, oAdvance, size, freqAcc, dsb->freqAdjust); @@ -497,7 +474,7 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO } /* Resample buffer to temporary buffer specifically allocated for this purpose, if needed */ - DSOUND_MixToTemporary(dsb, dsb->sec_mixpos, DSOUND_bufpos_to_secpos(dsb, dsb->buf_mixpos+len) - dsb->sec_mixpos); + DSOUND_MixToTemporary(dsb, len); ibuf = dsb->device->tmp_buffer; /* Apply volume if needed */
1
0
0
0
Erich Hoover : ws2_32/tests: Test for IOCP behavior without AcceptEx call.
by Alexandre Julliard
01 May '12
01 May '12
Module: wine Branch: master Commit: 74560c1d3995ac75eb2a6db46dfcd06018dd1f05 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=74560c1d3995ac75eb2a6db46…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Mon Apr 30 21:14:18 2012 -0600 ws2_32/tests: Test for IOCP behavior without AcceptEx call. --- dlls/ws2_32/tests/sock.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index f2e988e..b71be34 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -5717,6 +5717,30 @@ static void test_completion_port(void) ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %u\n", num_bytes); ok(!olp, "Overlapped structure is at %p\n", olp); + /* Test IOCP without AcceptEx */ + + if ((src = setup_iocp_src(&bindAddress)) == INVALID_SOCKET) + goto end; + + SetLastError(0xdeadbeef); + + io_port = CreateIoCompletionPort((HANDLE)src, previous_port, 125, 0); + ok(io_port != NULL, "failed to create completion port %u\n", GetLastError()); + + closesocket(src); + src = INVALID_SOCKET; + + SetLastError(0xdeadbeef); + key = 0xdeadbeef; + num_bytes = 0xdeadbeef; + olp = (WSAOVERLAPPED *)0xdeadbeef; + bret = GetQueuedCompletionStatus( io_port, &num_bytes, &key, &olp, 200 ); + ok(bret == FALSE, "failed to get completion status %u\n", bret); + ok(GetLastError() == WAIT_TIMEOUT, "Last error was %d\n", GetLastError()); + ok(key == 0xdeadbeef, "Key is %lu\n", key); + ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %u\n", num_bytes); + ok(!olp, "Overlapped structure is at %p\n", olp); + /* */ if ((src = setup_iocp_src(&bindAddress)) == INVALID_SOCKET)
1
0
0
0
Erich Hoover : ws2_32/tests: Test for AcceptEx IOCP behavior for a duplicated handle.
by Alexandre Julliard
01 May '12
01 May '12
Module: wine Branch: master Commit: a766ee4b1d6cf01b4f200d655efba63ca2982973 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a766ee4b1d6cf01b4f200d655…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Mon Apr 30 21:14:11 2012 -0600 ws2_32/tests: Test for AcceptEx IOCP behavior for a duplicated handle. --- dlls/ws2_32/tests/sock.c | 166 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 165 insertions(+), 1 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 54fa086..f2e988e 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -5330,7 +5330,8 @@ static void test_completion_port(void) { HANDLE previous_port, io_port; WSAOVERLAPPED ov, *olp; - SOCKET src, dest, connector = INVALID_SOCKET; + SOCKET src, dest, dup, connector = INVALID_SOCKET; + WSAPROTOCOL_INFOA info; char buf[1024]; WSABUF bufs; DWORD num_bytes, flags; @@ -5553,6 +5554,169 @@ static void test_completion_port(void) ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %u\n", num_bytes); ok(!olp, "Overlapped structure is at %p\n", olp); + /* Test IOCP with duplicated handle */ + + if ((src = setup_iocp_src(&bindAddress)) == INVALID_SOCKET) + goto end; + + SetLastError(0xdeadbeef); + + io_port = CreateIoCompletionPort((HANDLE)src, previous_port, 125, 0); + ok(io_port != NULL, "failed to create completion port %u\n", GetLastError()); + + WSADuplicateSocket( src, GetCurrentProcessId(), &info ); + dup = WSASocket(AF_INET, SOCK_STREAM, 0, &info, 0, WSA_FLAG_OVERLAPPED); + ok(dup != INVALID_SOCKET, "failed to duplicate socket!\n"); + + bret = pAcceptEx(dup, dest, buf, sizeof(buf) - 2*(sizeof(struct sockaddr_in) + 16), + sizeof(struct sockaddr_in) + 16, sizeof(struct sockaddr_in) + 16, + &num_bytes, &ov); + ok(bret == FALSE, "AcceptEx returned %d\n", bret); + ok(GetLastError() == ERROR_IO_PENDING, "Last error was %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + key = 0xdeadbeef; + num_bytes = 0xdeadbeef; + olp = (WSAOVERLAPPED *)0xdeadbeef; + bret = GetQueuedCompletionStatus( io_port, &num_bytes, &key, &olp, 200 ); + ok(bret == FALSE, "failed to get completion status %u\n", bret); + ok(GetLastError() == WAIT_TIMEOUT, "Last error was %d\n", GetLastError()); + ok(key == 0xdeadbeef, "Key is %lu\n", key); + ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %u\n", num_bytes); + ok(!olp, "Overlapped structure is at %p\n", olp); + + + closesocket(src); + src = INVALID_SOCKET; + closesocket(dup); + dup = INVALID_SOCKET; + + /* Test IOCP with duplicated handle (closing duplicated handle) */ + + if ((src = setup_iocp_src(&bindAddress)) == INVALID_SOCKET) + goto end; + + SetLastError(0xdeadbeef); + + io_port = CreateIoCompletionPort((HANDLE)src, previous_port, 125, 0); + ok(io_port != NULL, "failed to create completion port %u\n", GetLastError()); + + WSADuplicateSocket( src, GetCurrentProcessId(), &info ); + dup = WSASocket(AF_INET, SOCK_STREAM, 0, &info, 0, WSA_FLAG_OVERLAPPED); + ok(dup != INVALID_SOCKET, "failed to duplicate socket!\n"); + + bret = pAcceptEx(dup, dest, buf, sizeof(buf) - 2*(sizeof(struct sockaddr_in) + 16), + sizeof(struct sockaddr_in) + 16, sizeof(struct sockaddr_in) + 16, + &num_bytes, &ov); + ok(bret == FALSE, "AcceptEx returned %d\n", bret); + ok(GetLastError() == ERROR_IO_PENDING, "Last error was %d\n", GetLastError()); + + closesocket(dup); + dup = INVALID_SOCKET; + + SetLastError(0xdeadbeef); + key = 0xdeadbeef; + num_bytes = 0xdeadbeef; + olp = (WSAOVERLAPPED *)0xdeadbeef; + + bret = GetQueuedCompletionStatus(io_port, &num_bytes, &key, &olp, 100); + ok(bret == FALSE, "failed to get completion status %u\n", bret); + todo_wine ok(GetLastError() == ERROR_OPERATION_ABORTED, "Last error was %d\n", GetLastError()); + todo_wine ok(key == 125, "Key is %lu\n", key); + todo_wine ok(num_bytes == 0, "Number of bytes transferred is %u\n", num_bytes); + todo_wine ok(olp == &ov, "Overlapped structure is at %p\n", olp); + todo_wine ok(olp && (broken(olp->Internal == (ULONG)STATUS_PENDING) || (olp->Internal == (ULONG)STATUS_CANCELLED)), + "Internal status is %lx\n", olp ? olp->Internal : 0); + + SetLastError(0xdeadbeef); + key = 0xdeadbeef; + num_bytes = 0xdeadbeef; + olp = (WSAOVERLAPPED *)0xdeadbeef; + bret = GetQueuedCompletionStatus( io_port, &num_bytes, &key, &olp, 200 ); + ok(bret == FALSE, "failed to get completion status %u\n", bret); + ok(GetLastError() == WAIT_TIMEOUT, "Last error was %d\n", GetLastError()); + ok(key == 0xdeadbeef, "Key is %lu\n", key); + ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %u\n", num_bytes); + ok(!olp, "Overlapped structure is at %p\n", olp); + + closesocket(src); + src = INVALID_SOCKET; + + bret = GetQueuedCompletionStatus(io_port, &num_bytes, &key, &olp, 100); + ok(bret == FALSE, "failed to get completion status %u\n", bret); + todo_wine ok(GetLastError() == ERROR_OPERATION_ABORTED, "Last error was %d\n", GetLastError()); + todo_wine ok(key == 125, "Key is %lu\n", key); + todo_wine ok(num_bytes == 0, "Number of bytes transferred is %u\n", num_bytes); + todo_wine ok(olp == &ov, "Overlapped structure is at %p\n", olp); + todo_wine ok(olp && (olp->Internal == (ULONG)STATUS_CANCELLED), "Internal status is %lx\n", olp ? olp->Internal : 0); + + SetLastError(0xdeadbeef); + key = 0xdeadbeef; + num_bytes = 0xdeadbeef; + olp = (WSAOVERLAPPED *)0xdeadbeef; + bret = GetQueuedCompletionStatus( io_port, &num_bytes, &key, &olp, 200 ); + ok(bret == FALSE, "failed to get completion status %u\n", bret); + ok(GetLastError() == WAIT_TIMEOUT, "Last error was %d\n", GetLastError()); + ok(key == 0xdeadbeef, "Key is %lu\n", key); + ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %u\n", num_bytes); + ok(!olp, "Overlapped structure is at %p\n", olp); + + /* Test IOCP with duplicated handle (closing original handle) */ + + if ((src = setup_iocp_src(&bindAddress)) == INVALID_SOCKET) + goto end; + + SetLastError(0xdeadbeef); + + io_port = CreateIoCompletionPort((HANDLE)src, previous_port, 125, 0); + ok(io_port != NULL, "failed to create completion port %u\n", GetLastError()); + + WSADuplicateSocket( src, GetCurrentProcessId(), &info ); + dup = WSASocket(AF_INET, SOCK_STREAM, 0, &info, 0, WSA_FLAG_OVERLAPPED); + ok(dup != INVALID_SOCKET, "failed to duplicate socket!\n"); + + bret = pAcceptEx(dup, dest, buf, sizeof(buf) - 2*(sizeof(struct sockaddr_in) + 16), + sizeof(struct sockaddr_in) + 16, sizeof(struct sockaddr_in) + 16, + &num_bytes, &ov); + ok(bret == FALSE, "AcceptEx returned %d\n", bret); + ok(GetLastError() == ERROR_IO_PENDING, "Last error was %d\n", GetLastError()); + + closesocket(src); + src = INVALID_SOCKET; + + SetLastError(0xdeadbeef); + key = 0xdeadbeef; + num_bytes = 0xdeadbeef; + olp = (WSAOVERLAPPED *)0xdeadbeef; + bret = GetQueuedCompletionStatus( io_port, &num_bytes, &key, &olp, 200 ); + ok(bret == FALSE, "failed to get completion status %u\n", bret); + ok(GetLastError() == WAIT_TIMEOUT, "Last error was %d\n", GetLastError()); + ok(key == 0xdeadbeef, "Key is %lu\n", key); + ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %u\n", num_bytes); + ok(!olp, "Overlapped structure is at %p\n", olp); + + closesocket(dup); + dup = INVALID_SOCKET; + + bret = GetQueuedCompletionStatus(io_port, &num_bytes, &key, &olp, 100); + ok(bret == FALSE, "failed to get completion status %u\n", bret); + todo_wine ok(GetLastError() == ERROR_OPERATION_ABORTED, "Last error was %d\n", GetLastError()); + todo_wine ok(key == 125, "Key is %lu\n", key); + todo_wine ok(num_bytes == 0, "Number of bytes transferred is %u\n", num_bytes); + todo_wine ok(olp == &ov, "Overlapped structure is at %p\n", olp); + todo_wine ok(olp && (olp->Internal == (ULONG)STATUS_CANCELLED), "Internal status is %lx\n", olp ? olp->Internal : 0); + + SetLastError(0xdeadbeef); + key = 0xdeadbeef; + num_bytes = 0xdeadbeef; + olp = (WSAOVERLAPPED *)0xdeadbeef; + bret = GetQueuedCompletionStatus( io_port, &num_bytes, &key, &olp, 200 ); + ok(bret == FALSE, "failed to get completion status %u\n", bret); + ok(GetLastError() == WAIT_TIMEOUT, "Last error was %d\n", GetLastError()); + ok(key == 0xdeadbeef, "Key is %lu\n", key); + ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %u\n", num_bytes); + ok(!olp, "Overlapped structure is at %p\n", olp); + /* */ if ((src = setup_iocp_src(&bindAddress)) == INVALID_SOCKET)
1
0
0
0
Erich Hoover : ws2_32/tests: Test for AcceptEx IOCP behavior for cancelled sockets.
by Alexandre Julliard
01 May '12
01 May '12
Module: wine Branch: master Commit: 23a785af7e5a3e876b0c49c790fe30298cf0cdfa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=23a785af7e5a3e876b0c49c79…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Mon Apr 30 21:13:37 2012 -0600 ws2_32/tests: Test for AcceptEx IOCP behavior for cancelled sockets. --- dlls/ws2_32/tests/sock.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index ac5cef5..54fa086 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -5510,6 +5510,49 @@ static void test_completion_port(void) ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %u\n", num_bytes); ok(!olp, "Overlapped structure is at %p\n", olp); + /* Test IOCP response on socket close (IOCP created before AcceptEx) */ + + if ((src = setup_iocp_src(&bindAddress)) == INVALID_SOCKET) + goto end; + + SetLastError(0xdeadbeef); + + io_port = CreateIoCompletionPort((HANDLE)src, previous_port, 125, 0); + ok(io_port != NULL, "failed to create completion port %u\n", GetLastError()); + + bret = pAcceptEx(src, dest, buf, sizeof(buf) - 2*(sizeof(struct sockaddr_in) + 16), + sizeof(struct sockaddr_in) + 16, sizeof(struct sockaddr_in) + 16, + &num_bytes, &ov); + ok(bret == FALSE, "AcceptEx returned %d\n", bret); + ok(GetLastError() == ERROR_IO_PENDING, "Last error was %d\n", GetLastError()); + + closesocket(src); + src = INVALID_SOCKET; + + SetLastError(0xdeadbeef); + key = 0xdeadbeef; + num_bytes = 0xdeadbeef; + olp = (WSAOVERLAPPED *)0xdeadbeef; + + bret = GetQueuedCompletionStatus(io_port, &num_bytes, &key, &olp, 100); + ok(bret == FALSE, "failed to get completion status %u\n", bret); + todo_wine ok(GetLastError() == ERROR_OPERATION_ABORTED, "Last error was %d\n", GetLastError()); + todo_wine ok(key == 125, "Key is %lu\n", key); + todo_wine ok(num_bytes == 0, "Number of bytes transferred is %u\n", num_bytes); + todo_wine ok(olp == &ov, "Overlapped structure is at %p\n", olp); + todo_wine ok(olp && (olp->Internal == (ULONG)STATUS_CANCELLED), "Internal status is %lx\n", olp ? olp->Internal : 0); + + SetLastError(0xdeadbeef); + key = 0xdeadbeef; + num_bytes = 0xdeadbeef; + olp = (WSAOVERLAPPED *)0xdeadbeef; + bret = GetQueuedCompletionStatus( io_port, &num_bytes, &key, &olp, 200 ); + ok(bret == FALSE, "failed to get completion status %u\n", bret); + ok(GetLastError() == WAIT_TIMEOUT, "Last error was %d\n", GetLastError()); + ok(key == 0xdeadbeef, "Key is %lu\n", key); + ok(num_bytes == 0xdeadbeef, "Number of bytes transferred is %u\n", num_bytes); + ok(!olp, "Overlapped structure is at %p\n", olp); + /* */ if ((src = setup_iocp_src(&bindAddress)) == INVALID_SOCKET)
1
0
0
0
← Newer
1
...
68
69
70
71
72
73
74
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
Results per page:
10
25
50
100
200