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
June 2023
----- 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
1 participants
633 discussions
Start a n
N
ew thread
Shaun Ren : sapi: Implement ISpMMSysAudio::Write.
by Alexandre Julliard
14 Jun '23
14 Jun '23
Module: wine Branch: master Commit: ef730b6e41f04d2810bbc6cc869d9fdf1d789c1d URL:
https://gitlab.winehq.org/wine/wine/-/commit/ef730b6e41f04d2810bbc6cc869d9f…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Tue May 30 23:58:32 2023 -0400 sapi: Implement ISpMMSysAudio::Write. --- dlls/sapi/mmaudio.c | 53 +++++++++++++++++++++++++++++++++++++++++++-- dlls/sapi/tests/mmaudio.c | 55 +++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 102 insertions(+), 6 deletions(-) diff --git a/dlls/sapi/mmaudio.c b/dlls/sapi/mmaudio.c index add670ff3dc..dadd767b9a1 100644 --- a/dlls/sapi/mmaudio.c +++ b/dlls/sapi/mmaudio.c @@ -400,9 +400,58 @@ static HRESULT WINAPI mmsysaudio_Read(ISpMMSysAudio *iface, void *pv, ULONG cb, static HRESULT WINAPI mmsysaudio_Write(ISpMMSysAudio *iface, const void *pv, ULONG cb, ULONG *cb_written) { - FIXME("(%p, %p, %lu, %p): stub.\n", iface, pv, cb, cb_written); + struct mmaudio *This = impl_from_ISpMMSysAudio(iface); + HRESULT hr = S_OK; + WAVEHDR *buf; - return E_NOTIMPL; + TRACE("(%p, %p, %lu, %p).\n", iface, pv, cb, cb_written); + + if (This->flow != FLOW_OUT) + return STG_E_ACCESSDENIED; + + if (cb_written) + *cb_written = 0; + + EnterCriticalSection(&This->cs); + + if (This->state == SPAS_CLOSED || This->state == SPAS_STOP) + { + LeaveCriticalSection(&This->cs); + return SP_AUDIO_STOPPED; + } + + if (!(buf = heap_alloc(sizeof(WAVEHDR) + cb))) + { + LeaveCriticalSection(&This->cs); + return E_OUTOFMEMORY; + } + memcpy((char *)(buf + 1), pv, cb); + buf->lpData = (char *)(buf + 1); + buf->dwBufferLength = cb; + buf->dwFlags = 0; + + if (waveOutPrepareHeader(This->hwave.out, buf, sizeof(WAVEHDR)) != MMSYSERR_NOERROR) + { + LeaveCriticalSection(&This->cs); + heap_free(buf); + return E_FAIL; + } + + waveOutWrite(This->hwave.out, buf, sizeof(WAVEHDR)); + + EnterCriticalSection(&This->pending_cs); + ++This->pending_buf_count; + TRACE("pending_buf_count = %Iu\n", This->pending_buf_count); + LeaveCriticalSection(&This->pending_cs); + + ResetEvent(This->event); + + LeaveCriticalSection(&This->cs); + + if (cb_written) + *cb_written = cb; + + return hr; } static HRESULT WINAPI mmsysaudio_Seek(ISpMMSysAudio *iface, LARGE_INTEGER move, DWORD origin, ULARGE_INTEGER *new_pos) diff --git a/dlls/sapi/tests/mmaudio.c b/dlls/sapi/tests/mmaudio.c index 85a3570f490..38df432c181 100644 --- a/dlls/sapi/tests/mmaudio.c +++ b/dlls/sapi/tests/mmaudio.c @@ -163,7 +163,10 @@ static void test_audio_out(void) ISpMMSysAudio *mmaudio; GUID fmtid; WAVEFORMATEX *wfx = NULL; + WAVEFORMATEX wfx2; UINT devid; + char *buf = NULL; + ULONG written; HRESULT hr; if (waveOutGetNumDevs() == 0) { @@ -182,6 +185,8 @@ static void test_audio_out(void) ok(hr == S_OK, "got %#lx.\n", hr); ok(IsEqualGUID(&fmtid, &SPDFID_WaveFormatEx), "got %s.\n", wine_dbgstr_guid(&fmtid)); ok(wfx != NULL, "wfx == NULL.\n"); + ok(wfx->wFormatTag == WAVE_FORMAT_PCM, "got %u.\n", wfx->wFormatTag); + ok(wfx->cbSize == 0, "got %u.\n", wfx->cbSize); hr = ISpMMSysAudio_SetFormat(mmaudio, &fmtid, wfx); ok(hr == S_OK, "got %#lx.\n", hr); @@ -201,10 +206,12 @@ static void test_audio_out(void) hr = ISpMMSysAudio_SetFormat(mmaudio, &fmtid, wfx); ok(hr == S_OK, "got %#lx.\n", hr); - wfx->nChannels = wfx->nChannels == 1 ? 2 : 1; - wfx->nAvgBytesPerSec = wfx->nSamplesPerSec * wfx->nChannels * wfx->wBitsPerSample / 8; - wfx->nBlockAlign = wfx->nChannels * wfx->wBitsPerSample / 8; - hr = ISpMMSysAudio_SetFormat(mmaudio, &fmtid, wfx); + memcpy(&wfx2, wfx, sizeof(wfx2)); + wfx2.nChannels = wfx->nChannels == 1 ? 2 : 1; + wfx2.nAvgBytesPerSec = wfx2.nSamplesPerSec * wfx2.nChannels * wfx2.wBitsPerSample / 8; + wfx2.nBlockAlign = wfx2.nChannels * wfx2.wBitsPerSample / 8; + + hr = ISpMMSysAudio_SetFormat(mmaudio, &fmtid, &wfx2); ok(hr == SPERR_DEVICE_BUSY, "got %#lx.\n", hr); devid = 0xdeadbeef; @@ -215,7 +222,47 @@ static void test_audio_out(void) hr = ISpMMSysAudio_SetState(mmaudio, SPAS_CLOSED, 0); ok(hr == S_OK, "got %#lx.\n", hr); + buf = calloc(1, wfx->nAvgBytesPerSec); + ok(buf != NULL, "failed to allocate buffer.\n"); + + hr = ISpMMSysAudio_Write(mmaudio, buf, wfx->nAvgBytesPerSec, NULL); + ok(hr == SP_AUDIO_STOPPED, "got %#lx.\n", hr); + + hr = ISpMMSysAudio_SetState(mmaudio, SPAS_STOP, 0); + todo_wine ok(hr == S_OK, "got %#lx.\n", hr); + if (hr == S_OK) + { + hr = ISpMMSysAudio_Write(mmaudio, buf, wfx->nAvgBytesPerSec, NULL); + ok(hr == SP_AUDIO_STOPPED, "got %#lx.\n", hr); + } + + hr = ISpMMSysAudio_SetState(mmaudio, SPAS_CLOSED, 0); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = ISpMMSysAudio_SetState(mmaudio, SPAS_RUN, 0); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = ISpMMSysAudio_Write(mmaudio, buf, wfx->nAvgBytesPerSec, NULL); + ok(hr == S_OK, "got %#lx.\n", hr); + + Sleep(200); + + hr = ISpMMSysAudio_SetState(mmaudio, SPAS_CLOSED, 0); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = ISpMMSysAudio_SetState(mmaudio, SPAS_RUN, 0); + ok(hr == S_OK, "got %#lx.\n", hr); + + written = 0xdeadbeef; + hr = ISpMMSysAudio_Write(mmaudio, buf, wfx->nAvgBytesPerSec * 200 / 1000, &written); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(written == wfx->nAvgBytesPerSec * 200 / 1000, "got %lu.\n", written); + + hr = ISpMMSysAudio_SetState(mmaudio, SPAS_CLOSED, 0); + ok(hr == S_OK, "got %#lx.\n", hr); + CoTaskMemFree(wfx); + free(buf); ISpMMSysAudio_Release(mmaudio); }
1
0
0
0
Shaun Ren : sapi: Free completed buffers asynchronously in SpMMAudio.
by Alexandre Julliard
14 Jun '23
14 Jun '23
Module: wine Branch: master Commit: 7bced2878a55d388beaeae76d58d693391e4de24 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7bced2878a55d388beaeae76d58d69…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Tue May 30 23:29:22 2023 -0400 sapi: Free completed buffers asynchronously in SpMMAudio. Also introduce async helpers. The buffers cannot be freed directly in wave_out_proc, because calling waveOut related functions in the callback could cause a deadlock. --- dlls/sapi/Makefile.in | 1 + dlls/sapi/async.c | 175 +++++++++++++++++++++++++++++++++++++++++++++++ dlls/sapi/mmaudio.c | 78 ++++++++++++++++++++- dlls/sapi/sapi_private.h | 24 +++++++ 4 files changed, 277 insertions(+), 1 deletion(-)
1
0
0
0
Shaun Ren : sapi: Partially implement ISpMMSysAudio::SetState.
by Alexandre Julliard
14 Jun '23
14 Jun '23
Module: wine Branch: master Commit: 107d95165a0902828124bb1d9bf5adda987c9810 URL:
https://gitlab.winehq.org/wine/wine/-/commit/107d95165a0902828124bb1d9bf5ad…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Sat May 27 17:20:03 2023 -0400 sapi: Partially implement ISpMMSysAudio::SetState. --- dlls/sapi/mmaudio.c | 73 +++++++++++++++++++++++++++++++++++++++++++++-- dlls/sapi/tests/mmaudio.c | 62 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 2 deletions(-) diff --git a/dlls/sapi/mmaudio.c b/dlls/sapi/mmaudio.c index 690e540122b..20e6cc5064f 100644 --- a/dlls/sapi/mmaudio.c +++ b/dlls/sapi/mmaudio.c @@ -53,7 +53,13 @@ struct mmaudio enum flow_type flow; ISpObjectToken *token; UINT device_id; + SPAUDIOSTATE state; WAVEFORMATEX *wfx; + union + { + HWAVEIN in; + HWAVEOUT out; + } hwave; CRITICAL_SECTION cs; }; @@ -363,6 +369,8 @@ static ULONG WINAPI mmsysaudio_Release(ISpMMSysAudio *iface) if (!ref) { + ISpMMSysAudio_SetState(iface, SPAS_CLOSED, 0); + if (This->token) ISpObjectToken_Release(This->token); heap_free(This->wfx); DeleteCriticalSection(&This->cs); @@ -481,9 +489,45 @@ static HRESULT WINAPI mmsysaudio_GetFormat(ISpMMSysAudio *iface, GUID *format, W static HRESULT WINAPI mmsysaudio_SetState(ISpMMSysAudio *iface, SPAUDIOSTATE state, ULONGLONG reserved) { - FIXME("(%p, %u, %s): stub.\n", iface, state, wine_dbgstr_longlong(reserved)); + struct mmaudio *This = impl_from_ISpMMSysAudio(iface); + HRESULT hr = S_OK; - return E_NOTIMPL; + TRACE("(%p, %u, %s).\n", iface, state, wine_dbgstr_longlong(reserved)); + + if (state != SPAS_CLOSED && state != SPAS_RUN) + { + FIXME("state %#x not implemented.\n", state); + return E_NOTIMPL; + } + + EnterCriticalSection(&This->cs); + + if (This->state == state) + goto done; + + if (This->state == SPAS_CLOSED) + { + if (waveOutOpen(&This->hwave.out, This->device_id, This->wfx, 0, 0, 0) != MMSYSERR_NOERROR) + { + hr = SPERR_GENERIC_MMSYS_ERROR; + goto done; + } + } + + if (state == SPAS_CLOSED && This->state != SPAS_CLOSED) + { + if (waveOutClose(This->hwave.out) != MMSYSERR_NOERROR) + { + hr = SPERR_GENERIC_MMSYS_ERROR; + goto done; + } + } + + This->state = state; + +done: + LeaveCriticalSection(&This->cs); + return hr; } static HRESULT WINAPI mmsysaudio_SetFormat(ISpMMSysAudio *iface, const GUID *guid, const WAVEFORMATEX *wfx) @@ -499,6 +543,18 @@ static HRESULT WINAPI mmsysaudio_SetFormat(ISpMMSysAudio *iface, const GUID *gui EnterCriticalSection(&This->cs); + if (!memcmp(wfx, This->wfx, sizeof(*wfx)) && !memcmp(wfx + 1, This->wfx + 1, wfx->cbSize)) + { + LeaveCriticalSection(&This->cs); + return S_OK; + } + + if (This->state != SPAS_CLOSED) + { + LeaveCriticalSection(&This->cs); + return SPERR_DEVICE_BUSY; + } + /* Determine whether the device supports the requested format. */ res = waveOutOpen(NULL, This->device_id, wfx, 0, 0, WAVE_FORMAT_QUERY); if (res != MMSYSERR_NOERROR) @@ -609,7 +665,19 @@ static HRESULT WINAPI mmsysaudio_SetDeviceId(ISpMMSysAudio *iface, UINT id) return E_INVALIDARG; EnterCriticalSection(&This->cs); + + if (id == This->device_id) + { + LeaveCriticalSection(&This->cs); + return S_OK; + } + if (This->state != SPAS_CLOSED) + { + LeaveCriticalSection(&This->cs); + return SPERR_DEVICE_BUSY; + } This->device_id = id; + LeaveCriticalSection(&This->cs); return S_OK; @@ -693,6 +761,7 @@ static HRESULT mmaudio_create(IUnknown *outer, REFIID iid, void **obj, enum flow This->flow = flow; This->token = NULL; This->device_id = WAVE_MAPPER; + This->state = SPAS_CLOSED; if (!(This->wfx = heap_alloc(sizeof(*This->wfx)))) { diff --git a/dlls/sapi/tests/mmaudio.c b/dlls/sapi/tests/mmaudio.c index 8611242e2b7..85a3570f490 100644 --- a/dlls/sapi/tests/mmaudio.c +++ b/dlls/sapi/tests/mmaudio.c @@ -158,11 +158,73 @@ static void test_formats(void) ISpMMSysAudio_Release(mmaudio); } +static void test_audio_out(void) +{ + ISpMMSysAudio *mmaudio; + GUID fmtid; + WAVEFORMATEX *wfx = NULL; + UINT devid; + HRESULT hr; + + if (waveOutGetNumDevs() == 0) { + skip("no wave out devices.\n"); + return; + } + + hr = CoCreateInstance(&CLSID_SpMMAudioOut, NULL, CLSCTX_INPROC_SERVER, + &IID_ISpMMSysAudio, (void **)&mmaudio); + ok(hr == S_OK, "failed to create SPMMAudioOut instance: %#lx.\n", hr); + + hr = ISpMMSysAudio_SetState(mmaudio, SPAS_CLOSED, 0); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = ISpMMSysAudio_GetFormat(mmaudio, &fmtid, &wfx); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(IsEqualGUID(&fmtid, &SPDFID_WaveFormatEx), "got %s.\n", wine_dbgstr_guid(&fmtid)); + ok(wfx != NULL, "wfx == NULL.\n"); + + hr = ISpMMSysAudio_SetFormat(mmaudio, &fmtid, wfx); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = ISpMMSysAudio_SetDeviceId(mmaudio, WAVE_MAPPER); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = ISpMMSysAudio_SetState(mmaudio, SPAS_RUN, 0); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = ISpMMSysAudio_SetDeviceId(mmaudio, WAVE_MAPPER); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = ISpMMSysAudio_SetDeviceId(mmaudio, 0); + ok(hr == SPERR_DEVICE_BUSY, "got %#lx.\n", hr); + + hr = ISpMMSysAudio_SetFormat(mmaudio, &fmtid, wfx); + ok(hr == S_OK, "got %#lx.\n", hr); + + wfx->nChannels = wfx->nChannels == 1 ? 2 : 1; + wfx->nAvgBytesPerSec = wfx->nSamplesPerSec * wfx->nChannels * wfx->wBitsPerSample / 8; + wfx->nBlockAlign = wfx->nChannels * wfx->wBitsPerSample / 8; + hr = ISpMMSysAudio_SetFormat(mmaudio, &fmtid, wfx); + ok(hr == SPERR_DEVICE_BUSY, "got %#lx.\n", hr); + + devid = 0xdeadbeef; + hr = ISpMMSysAudio_GetDeviceId(mmaudio, &devid); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(devid == WAVE_MAPPER, "got %#x.\n", devid); + + hr = ISpMMSysAudio_SetState(mmaudio, SPAS_CLOSED, 0); + ok(hr == S_OK, "got %#lx.\n", hr); + + CoTaskMemFree(wfx); + ISpMMSysAudio_Release(mmaudio); +} + START_TEST(mmaudio) { CoInitialize(NULL); test_interfaces(); test_device_id(); test_formats(); + test_audio_out(); CoUninitialize(); }
1
0
0
0
Alexandre Julliard : include: Don't support stdcall functions on non-i386.
by Alexandre Julliard
14 Jun '23
14 Jun '23
Module: wine Branch: master Commit: 250efdf0c6315661fdce64c6516a32eba78f0875 URL:
https://gitlab.winehq.org/wine/wine/-/commit/250efdf0c6315661fdce64c6516a32…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 14 11:16:10 2023 +0200 include: Don't support stdcall functions on non-i386. --- include/wine/asm.h | 49 +++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/include/wine/asm.h b/include/wine/asm.h index 61e197d9586..a158449d6a5 100644 --- a/include/wine/asm.h +++ b/include/wine/asm.h @@ -33,14 +33,6 @@ # define __ASM_LOCAL_LABEL(label) ".L" label #endif -#if defined(__WINE_PE_BUILD) && defined(__i386__) -# define __ASM_STDCALL(name,args) "_" name "@" #args -# define __ASM_FASTCALL(name,args) "@" name "@" #args -#else -# define __ASM_STDCALL(name,args) __ASM_NAME(name) -# define __ASM_FASTCALL(name,args) __ASM_NAME("__fastcall_" name) -#endif - #if defined(__GCC_HAVE_DWARF2_CFI_ASM) || ((defined(__APPLE__) || defined(__clang__)) && defined(__GNUC__) && !defined(__SEH__)) # define __ASM_CFI(str) str #else @@ -102,29 +94,40 @@ __ASM_BLOCK_END #define __ASM_GLOBAL_FUNC(name,code) __ASM_DEFINE_FUNC(__ASM_NAME(#name),code) -#define __ASM_STDCALL_FUNC(name,args,code) __ASM_DEFINE_FUNC(__ASM_STDCALL(#name,args),code) -#define __ASM_FASTCALL_FUNC(name,args,code) __ASM_DEFINE_FUNC(__ASM_FASTCALL(#name,args),code) /* import variables */ -#ifdef _WIN64 -#define __ASM_DEFINE_IMPORT(name) \ +#ifdef __WINE_PE_BUILD +# ifdef _WIN64 +# define __ASM_DEFINE_IMPORT(name) \ __ASM_BLOCK_BEGIN(__LINE__) \ asm(".data\n\t.balign 8\n\t.globl __imp_" name "\n__imp_" name ":\n\t.quad " name "\n\t.text"); \ __ASM_BLOCK_END -#else -#define __ASM_DEFINE_IMPORT(name) \ +# else +# define __ASM_DEFINE_IMPORT(name) \ __ASM_BLOCK_BEGIN(__LINE__) \ asm(".data\n\t.balign 4\n\t.globl __imp_" name "\n__imp_" name ":\n\t.long " name "\n\t.text"); \ __ASM_BLOCK_END +# endif +# define __ASM_GLOBAL_IMPORT(name) __ASM_DEFINE_IMPORT(__ASM_NAME(#name)) +#else +# define __ASM_GLOBAL_IMPORT(name) /* nothing */ #endif -#ifdef __WINE_PE_BUILD -#define __ASM_GLOBAL_IMPORT(name) __ASM_DEFINE_IMPORT(__ASM_NAME(#name)) -#define __ASM_STDCALL_IMPORT(name,args) __ASM_DEFINE_IMPORT(__ASM_STDCALL(#name,args)) -#else -#define __ASM_GLOBAL_IMPORT(name) /* nothing */ -#define __ASM_STDCALL_IMPORT(name,args) /* nothing */ +/* stdcall support */ + +#ifdef __i386__ +# ifdef __WINE_PE_BUILD +# define __ASM_STDCALL(name,args) "_" name "@" #args +# define __ASM_FASTCALL(name,args) "@" name "@" #args +# define __ASM_STDCALL_IMPORT(name,args) __ASM_DEFINE_IMPORT(__ASM_STDCALL(#name,args)) +# else +# define __ASM_STDCALL(name,args) __ASM_NAME(name) +# define __ASM_FASTCALL(name,args) __ASM_NAME("__fastcall_" name) +# define __ASM_STDCALL_IMPORT(name,args) /* nothing */ +# endif +# define __ASM_STDCALL_FUNC(name,args,code) __ASM_DEFINE_FUNC(__ASM_STDCALL(#name,args),code) +# define __ASM_FASTCALL_FUNC(name,args,code) __ASM_DEFINE_FUNC(__ASM_FASTCALL(#name,args),code) #endif /* fastcall support */ @@ -188,10 +191,4 @@ #endif /* __i386__ */ -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(__WINE_PE_BUILD) && !defined(__APPLE__) && !defined(__ANDROID__) -#define __ASM_OBSOLETE(func) __asm__( ".symver " #func "_obsolete," #func "@WINE_1.0" ) -#else -#undef __ASM_OBSOLETE -#endif - #endif /* __WINE_WINE_ASM_H */
1
0
0
0
Alexandre Julliard : wow64cpu: Don't define stdcall functions on non-i386.
by Alexandre Julliard
14 Jun '23
14 Jun '23
Module: wine Branch: master Commit: ed36f4bc8cbe9c4082bbfb739a41ac8503e256d7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ed36f4bc8cbe9c4082bbfb739a41ac…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 14 11:15:46 2023 +0200 wow64cpu: Don't define stdcall functions on non-i386. --- dlls/wow64cpu/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wow64cpu/cpu.c b/dlls/wow64cpu/cpu.c index aacd3ea4b85..5a679c56d1e 100644 --- a/dlls/wow64cpu/cpu.c +++ b/dlls/wow64cpu/cpu.c @@ -267,7 +267,7 @@ __ASM_GLOBAL_FUNC( unix_call_32to64, /********************************************************************** * BTCpuSimulate (wow64cpu.@) */ -__ASM_STDCALL_FUNC( BTCpuSimulate, 0, +__ASM_GLOBAL_FUNC( BTCpuSimulate, "subq $0x28,%rsp\n" __ASM_SEH(".seh_stackalloc 0x28\n\t") __ASM_SEH(".seh_endprologue\n\t")
1
0
0
0
Alexandre Julliard : ntdll: Don't define stdcall functions on non-i386.
by Alexandre Julliard
14 Jun '23
14 Jun '23
Module: wine Branch: master Commit: 2b6e32f3585823c9708c70aa70aa70036ca8f957 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2b6e32f3585823c9708c70aa70aa70…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 14 11:15:36 2023 +0200 ntdll: Don't define stdcall functions on non-i386. --- dlls/ntdll/exception.c | 9 +++++++-- dlls/ntdll/signal_arm.c | 8 ++++---- dlls/ntdll/signal_arm64.c | 8 ++++---- dlls/ntdll/signal_x86_64.c | 4 ++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index f6855bf651e..48d79c0cd18 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -670,7 +670,6 @@ BOOL WINAPI IsBadStringPtrA( LPCSTR str, UINT_PTR max ) __ENDTRY return FALSE; } -__ASM_STDCALL_IMPORT(IsBadStringPtrA,8) /************************************************************* * IsBadStringPtrW @@ -692,8 +691,14 @@ BOOL WINAPI IsBadStringPtrW( LPCWSTR str, UINT_PTR max ) __ENDTRY return FALSE; } -__ASM_STDCALL_IMPORT(IsBadStringPtrW,8) +#ifdef __i386__ +__ASM_STDCALL_IMPORT(IsBadStringPtrA,8) +__ASM_STDCALL_IMPORT(IsBadStringPtrW,8) +#else +__ASM_GLOBAL_IMPORT(IsBadStringPtrA) +__ASM_GLOBAL_IMPORT(IsBadStringPtrW) +#endif /********************************************************************** * RtlGetEnabledExtendedFeatures (NTDLL.@) diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 73759191bea..f5b2f8c1252 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -103,7 +103,7 @@ __ASM_GLOBAL_FUNC( __chkstk, "lsl r4, r4, #2\n\t" /*********************************************************************** * RtlCaptureContext (NTDLL.@) */ -__ASM_STDCALL_FUNC( RtlCaptureContext, 4, +__ASM_GLOBAL_FUNC( RtlCaptureContext, "str r1, [r0, #0x8]\n\t" /* context->R1 */ "mov r1, #0x0200000\n\t" /* CONTEXT_ARM */ "add r1, r1, #0x7\n\t" /* CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_FLOATING_POINT */ @@ -1451,7 +1451,7 @@ EXCEPTION_DISPOSITION WINAPI __C_specific_handler( EXCEPTION_RECORD *rec, /*********************************************************************** * RtlRaiseException (NTDLL.@) */ -__ASM_STDCALL_FUNC( RtlRaiseException, 4, +__ASM_GLOBAL_FUNC( RtlRaiseException, "push {r0, lr}\n\t" __ASM_EHABI(".save {r0, lr}\n\t") __ASM_SEH(".seh_save_regs {r0, lr}\n\t") @@ -1498,11 +1498,11 @@ __ASM_GLOBAL_FUNC( signal_start_thread, /********************************************************************** * DbgBreakPoint (NTDLL.@) */ -__ASM_STDCALL_FUNC( DbgBreakPoint, 0, "udf #0xfe; bx lr; nop; nop; nop; nop" ); +__ASM_GLOBAL_FUNC( DbgBreakPoint, "udf #0xfe; bx lr; nop; nop; nop; nop" ); /********************************************************************** * DbgUserBreakPoint (NTDLL.@) */ -__ASM_STDCALL_FUNC( DbgUserBreakPoint, 0, "udf #0xfe; bx lr; nop; nop; nop; nop" ); +__ASM_GLOBAL_FUNC( DbgUserBreakPoint, "udf #0xfe; bx lr; nop; nop; nop; nop" ); #endif /* __arm__ */ diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index a19aa2f54b0..dfc5c0e31ed 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -110,7 +110,7 @@ __ASM_GLOBAL_FUNC( __chkstk, "ret") /*********************************************************************** * RtlCaptureContext (NTDLL.@) */ -__ASM_STDCALL_FUNC( RtlCaptureContext, 8, +__ASM_GLOBAL_FUNC( RtlCaptureContext, "str xzr, [x0, #0x8]\n\t" /* context->X0 */ "stp x1, x2, [x0, #0x10]\n\t" /* context->X1,X2 */ "stp x3, x4, [x0, #0x20]\n\t" /* context->X3,X4 */ @@ -1489,7 +1489,7 @@ EXCEPTION_DISPOSITION WINAPI __C_specific_handler( EXCEPTION_RECORD *rec, /*********************************************************************** * RtlRaiseException (NTDLL.@) */ -__ASM_STDCALL_FUNC( RtlRaiseException, 4, +__ASM_GLOBAL_FUNC( RtlRaiseException, "sub sp, sp, #0x3b0\n\t" /* 0x390 (context) + 0x20 */ "stp x29, x30, [sp]\n\t" __ASM_SEH(".seh_stackalloc 0x3b0\n\t") @@ -1535,14 +1535,14 @@ __ASM_GLOBAL_FUNC( signal_start_thread, /********************************************************************** * DbgBreakPoint (NTDLL.@) */ -__ASM_STDCALL_FUNC( DbgBreakPoint, 0, "brk #0xf000; ret" +__ASM_GLOBAL_FUNC( DbgBreakPoint, "brk #0xf000; ret" "\n\tnop; nop; nop; nop; nop; nop; nop; nop" "\n\tnop; nop; nop; nop; nop; nop" ); /********************************************************************** * DbgUserBreakPoint (NTDLL.@) */ -__ASM_STDCALL_FUNC( DbgUserBreakPoint, 0, "brk #0xf000; ret" +__ASM_GLOBAL_FUNC( DbgUserBreakPoint, "brk #0xf000; ret" "\n\tnop; nop; nop; nop; nop; nop; nop; nop" "\n\tnop; nop; nop; nop; nop; nop" ); diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index d514ece8787..66cabfd5e64 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -1614,14 +1614,14 @@ __ASM_GLOBAL_FUNC( signal_start_thread, /********************************************************************** * DbgBreakPoint (NTDLL.@) */ -__ASM_STDCALL_FUNC( DbgBreakPoint, 0, "int $3; ret" +__ASM_GLOBAL_FUNC( DbgBreakPoint, "int $3; ret" "\n\tnop; nop; nop; nop; nop; nop; nop; nop" "\n\tnop; nop; nop; nop; nop; nop" ); /********************************************************************** * DbgUserBreakPoint (NTDLL.@) */ -__ASM_STDCALL_FUNC( DbgUserBreakPoint, 0, "int $3; ret" +__ASM_GLOBAL_FUNC( DbgUserBreakPoint, "int $3; ret" "\n\tnop; nop; nop; nop; nop; nop; nop; nop" "\n\tnop; nop; nop; nop; nop; nop" );
1
0
0
0
Alexandre Julliard : kernelbase: Don't define stdcall functions on non-i386.
by Alexandre Julliard
14 Jun '23
14 Jun '23
Module: wine Branch: master Commit: c908ad6fcd19ec2bd8bb1df4086a7026df645c3e URL:
https://gitlab.winehq.org/wine/wine/-/commit/c908ad6fcd19ec2bd8bb1df4086a70…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 14 11:15:13 2023 +0200 kernelbase: Don't define stdcall functions on non-i386. --- dlls/kernelbase/debug.c | 9 ++++++++- dlls/kernelbase/thread.c | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c index df1b9a63604..4353b0590f3 100644 --- a/dlls/kernelbase/debug.c +++ b/dlls/kernelbase/debug.c @@ -118,8 +118,10 @@ BOOL WINAPI DECLSPEC_HOTPATCH DebugActiveProcessStop( DWORD pid ) /*********************************************************************** * DebugBreak (kernelbase.@) */ -#if defined(__i386__) || defined(__x86_64__) +#ifdef __i386__ __ASM_STDCALL_FUNC( DebugBreak, 0, "jmp " __ASM_STDCALL("DbgBreakPoint", 0) ) +#elif defined(__x86_64__) +__ASM_GLOBAL_FUNC( DebugBreak, "jmp " __ASM_NAME("DbgBreakPoint") ) #else void WINAPI DebugBreak(void) { @@ -347,7 +349,12 @@ void WINAPI DECLSPEC_HOTPATCH RaiseException( DWORD code, DWORD flags, DWORD cou RtlRaiseException( &record ); } #endif + +#ifdef __i386__ __ASM_STDCALL_IMPORT(RaiseException,16) +#else +__ASM_GLOBAL_IMPORT(RaiseException) +#endif /******************************************************************* * RaiseFailFastException (kernelbase.@) diff --git a/dlls/kernelbase/thread.c b/dlls/kernelbase/thread.c index ccedb62f930..bb1145e3f66 100644 --- a/dlls/kernelbase/thread.c +++ b/dlls/kernelbase/thread.c @@ -807,7 +807,7 @@ __ASM_STDCALL_FUNC( switch_fiber, 8, "movl 0xc4(%ecx),%esp\n\t" /* new->Esp */ "jmp *0xb8(%ecx)" ) /* new->Eip */ #elif defined(__x86_64__) -__ASM_STDCALL_FUNC( switch_fiber, 8, +__ASM_GLOBAL_FUNC( switch_fiber, "movq %rbx,0x90(%rcx)\n\t" /* old->Rbx */ "leaq 0x8(%rsp),%rax\n\t" "movq %rax,0x98(%rcx)\n\t" /* old->Rsp */ @@ -851,7 +851,7 @@ __ASM_STDCALL_FUNC( switch_fiber, 8, "movq 0x98(%rdx),%rsp\n\t" /* new->Rsp */ "jmp *0xf8(%rdx)" ) /* new->Rip */ #elif defined(__arm__) -__ASM_STDCALL_FUNC( switch_fiber, 8, +__ASM_GLOBAL_FUNC( switch_fiber, "str r4, [r0, #0x14]\n\t" /* old->R4 */ "str r5, [r0, #0x18]\n\t" /* old->R5 */ "str r6, [r0, #0x1c]\n\t" /* old->R6 */ @@ -874,7 +874,7 @@ __ASM_STDCALL_FUNC( switch_fiber, 8, "ldr r2, [r1, #0x40]\n\t" /* new->Pc */ "bx r2" ) #elif defined(__aarch64__) -__ASM_STDCALL_FUNC( switch_fiber, 8, +__ASM_GLOBAL_FUNC( switch_fiber, "stp x19, x20, [x0, #0xa0]\n\t" /* old->X19,X20 */ "stp x21, x22, [x0, #0xb0]\n\t" /* old->X21,X22 */ "stp x23, x24, [x0, #0xc0]\n\t" /* old->X23,X24 */
1
0
0
0
Eric Pouech : kernel32/tests: Extend console inheritance tests.
by Alexandre Julliard
13 Jun '23
13 Jun '23
Module: wine Branch: master Commit: 766448f8ffe51b83105bd0795a5cbc7b8f7c8894 URL:
https://gitlab.winehq.org/wine/wine/-/commit/766448f8ffe51b83105bd0795a5cbc…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Tue Jun 13 14:40:10 2023 +0200 kernel32/tests: Extend console inheritance tests. - Define what the std handles are before inheriting them - Check access to parent console from child through std handles Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/kernel32/tests/console.c | 212 +++++++++++++++++++++++++++++++----------- 1 file changed, 157 insertions(+), 55 deletions(-)
1
0
0
0
Vladislav Timonin : shell32: Don't show size for inaccessible drives in My Computer.
by Alexandre Julliard
13 Jun '23
13 Jun '23
Module: wine Branch: master Commit: a0571a2d3a025cf07e0cea6281ad97a88654816c URL:
https://gitlab.winehq.org/wine/wine/-/commit/a0571a2d3a025cf07e0cea6281ad97…
Author: Vladislav Timonin <timoninvlad(a)yandex.ru> Date: Mon Jun 12 18:05:28 2023 +0700 shell32: Don't show size for inaccessible drives in My Computer. --- dlls/shell32/shfldr_mycomp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/shfldr_mycomp.c b/dlls/shell32/shfldr_mycomp.c index 7083ea18763..5aa540c9376 100644 --- a/dlls/shell32/shfldr_mycomp.c +++ b/dlls/shell32/shfldr_mycomp.c @@ -816,7 +816,8 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 *iface, break; _ILSimpleGetTextW(pidl, path, MAX_PATH); - GetDiskFreeSpaceExW(path, NULL, &bytes, NULL); + if (!GetDiskFreeSpaceExW(path, NULL, &bytes, NULL)) + break; psd->str.uType = STRRET_WSTR; psd->str.u.pOleStr = CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR)); @@ -827,7 +828,8 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 *iface, break; _ILSimpleGetTextW(pidl, path, MAX_PATH); - GetDiskFreeSpaceExW(path, &bytes, NULL, NULL); + if (!GetDiskFreeSpaceExW(path, &bytes, NULL, NULL)) + break; psd->str.uType = STRRET_WSTR; psd->str.u.pOleStr = CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
1
0
0
0
Vladislav Timonin : shell32: Show >4GB values in size columns of My Computer.
by Alexandre Julliard
13 Jun '23
13 Jun '23
Module: wine Branch: master Commit: 83641ce6b8e4b561b9dca899137401b56e9c12ff URL:
https://gitlab.winehq.org/wine/wine/-/commit/83641ce6b8e4b561b9dca899137401…
Author: Vladislav Timonin <timoninvlad(a)yandex.ru> Date: Sun Jun 11 19:04:43 2023 +0700 shell32: Show >4GB values in size columns of My Computer. --- dlls/shell32/shfldr_mycomp.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/dlls/shell32/shfldr_mycomp.c b/dlls/shell32/shfldr_mycomp.c index 2f4ebd580c1..7083ea18763 100644 --- a/dlls/shell32/shfldr_mycomp.c +++ b/dlls/shell32/shfldr_mycomp.c @@ -790,13 +790,12 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsEx (IShellFolder2 * iface, return E_NOTIMPL; } -/* FIXME: drive size >4GB is rolling over */ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 *iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS *psd) { IMyComputerFolderImpl *This = impl_from_IShellFolder2(iface); - char szPath[MAX_PATH]; - ULARGE_INTEGER ulBytes; + WCHAR path[MAX_PATH]; + ULARGE_INTEGER bytes; HRESULT hr = S_OK; TRACE ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd); @@ -813,22 +812,27 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 *iface, switch (iColumn) { case 2: /* total size */ - if (_ILIsDrive (pidl)) - { - _ILSimpleGetText (pidl, szPath, MAX_PATH); - GetDiskFreeSpaceExA (szPath, NULL, &ulBytes, NULL); - StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH); - } + if (!_ILIsDrive (pidl)) + break; + + _ILSimpleGetTextW(pidl, path, MAX_PATH); + GetDiskFreeSpaceExW(path, NULL, &bytes, NULL); + + psd->str.uType = STRRET_WSTR; + psd->str.u.pOleStr = CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR)); + StrFormatByteSizeW(bytes.QuadPart, psd->str.u.pOleStr, MAX_PATH); break; case 3: /* free size */ - if (_ILIsDrive (pidl)) - { - _ILSimpleGetText (pidl, szPath, MAX_PATH); - GetDiskFreeSpaceExA (szPath, &ulBytes, NULL, NULL); - StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH); - } - break; + if (!_ILIsDrive (pidl)) + break; + _ILSimpleGetTextW(pidl, path, MAX_PATH); + GetDiskFreeSpaceExW(path, &bytes, NULL, NULL); + + psd->str.uType = STRRET_WSTR; + psd->str.u.pOleStr = CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR)); + StrFormatByteSizeW(bytes.QuadPart, psd->str.u.pOleStr, MAX_PATH); + break; default: return shellfolder_get_file_details( iface, pidl, mycomputer_header, iColumn, psd ); }
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
64
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
Results per page:
10
25
50
100
200