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
April 2022
----- 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
1024 discussions
Start a n
N
ew thread
Huw Davies : wineoss: Use the sessions lock to lock the client's data.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 8298ca9e2664a7423ff3b0954cff9e95730e410e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8298ca9e2664a7423ff3b095…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Apr 12 07:59:01 2022 +0100 wineoss: Use the sessions lock to lock the client's data. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/mmdevdrv.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 2b490482df0..13037e07821 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -901,17 +901,14 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, } EnterCriticalSection(&g_sessions_lock); - EnterCriticalSection(&This->lock); if(This->stream){ - LeaveCriticalSection(&This->lock); LeaveCriticalSection(&g_sessions_lock); return AUDCLNT_E_ALREADY_INITIALIZED; } stream = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*This->stream)); if(!stream){ - LeaveCriticalSection(&This->lock); LeaveCriticalSection(&g_sessions_lock); return E_OUTOFMEMORY; } @@ -991,11 +988,9 @@ exit: if(stream->fd >= 0) close(stream->fd); HeapFree(GetProcessHeap(), 0, stream->local_buffer); HeapFree(GetProcessHeap(), 0, stream); - LeaveCriticalSection(&This->lock); } else { list_add_tail(&This->session->clients, &This->entry); This->stream = stream; - LeaveCriticalSection(&This->lock); set_stream_volumes(This); } @@ -1337,20 +1332,24 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface) TRACE("(%p)\n", This); + EnterCriticalSection(&g_sessions_lock); EnterCriticalSection(&This->lock); if(!This->stream){ LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return AUDCLNT_E_NOT_INITIALIZED; } if((stream->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK) && !stream->event){ LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return AUDCLNT_E_EVENTHANDLE_NOT_SET; } if(stream->playing){ LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return AUDCLNT_E_NOT_STOPPED; } @@ -1364,6 +1363,7 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface) stream->playing = TRUE; LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return S_OK; } @@ -1481,23 +1481,23 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid, return E_POINTER; *ppv = NULL; - EnterCriticalSection(&This->lock); + EnterCriticalSection(&g_sessions_lock); if(!This->stream){ - LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return AUDCLNT_E_NOT_INITIALIZED; } if(IsEqualIID(riid, &IID_IAudioRenderClient)){ if(This->dataflow != eRender){ - LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return AUDCLNT_E_WRONG_ENDPOINT_TYPE; } IAudioRenderClient_AddRef(&This->IAudioRenderClient_iface); *ppv = &This->IAudioRenderClient_iface; }else if(IsEqualIID(riid, &IID_IAudioCaptureClient)){ if(This->dataflow != eCapture){ - LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return AUDCLNT_E_WRONG_ENDPOINT_TYPE; } IAudioCaptureClient_AddRef(&This->IAudioCaptureClient_iface); @@ -1512,7 +1512,7 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid, if(!This->session_wrapper){ This->session_wrapper = AudioSessionWrapper_Create(This); if(!This->session_wrapper){ - LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return E_OUTOFMEMORY; } }else @@ -1523,7 +1523,7 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid, if(!This->session_wrapper){ This->session_wrapper = AudioSessionWrapper_Create(This); if(!This->session_wrapper){ - LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return E_OUTOFMEMORY; } }else @@ -1534,7 +1534,7 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid, if(!This->session_wrapper){ This->session_wrapper = AudioSessionWrapper_Create(This); if(!This->session_wrapper){ - LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return E_OUTOFMEMORY; } }else @@ -1544,11 +1544,11 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid, } if(*ppv){ - LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return S_OK; } - LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); FIXME("stub %s\n", debugstr_guid(riid)); return E_NOINTERFACE; @@ -2245,9 +2245,9 @@ static ULONG WINAPI AudioSessionControl_Release(IAudioSessionControl2 *iface) TRACE("(%p) Refcount now %u\n", This, ref); if(!ref){ if(This->client){ - EnterCriticalSection(&This->client->lock); + EnterCriticalSection(&g_sessions_lock); This->client->session_wrapper = NULL; - LeaveCriticalSection(&This->client->lock); + LeaveCriticalSection(&g_sessions_lock); AudioClient_Release(&This->client->IAudioClient3_iface); } HeapFree(GetProcessHeap(), 0, This); @@ -2635,14 +2635,14 @@ static HRESULT WINAPI AudioStreamVolume_SetChannelVolume( if(index >= This->channel_count) return E_INVALIDARG; - EnterCriticalSection(&This->lock); + EnterCriticalSection(&g_sessions_lock); This->vols[index] = level; TRACE("OSS doesn't support setting volume\n"); set_stream_volumes(This); - LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return S_OK; } @@ -2679,7 +2679,7 @@ static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( if(count != This->channel_count) return E_INVALIDARG; - EnterCriticalSection(&This->lock); + EnterCriticalSection(&g_sessions_lock); for(i = 0; i < count; ++i) This->vols[i] = levels[i]; @@ -2687,7 +2687,7 @@ static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( TRACE("OSS doesn't support setting volume\n"); set_stream_volumes(This); - LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return S_OK; } @@ -2706,12 +2706,12 @@ static HRESULT WINAPI AudioStreamVolume_GetAllVolumes( if(count != This->channel_count) return E_INVALIDARG; - EnterCriticalSection(&This->lock); + EnterCriticalSection(&g_sessions_lock); for(i = 0; i < count; ++i) levels[i] = This->vols[i]; - LeaveCriticalSection(&This->lock); + LeaveCriticalSection(&g_sessions_lock); return S_OK; }
1
0
0
0
Huw Davies : wineoss: Store the mute state in the stream.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 8b7ed43d8a4836f24ac9d011803f8df85a1ee5b9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8b7ed43d8a4836f24ac9d011…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Apr 12 07:59:00 2022 +0100 wineoss: Store the mute state in the stream. Despite only mute being supported in this driver, set_stream_volumes() is called whenever the volume info is changed to match the other drivers and to allow a more complete volume implementation in the future. The implementation will eventually move to the unixlib. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/mmdevdrv.c | 36 +++++++++++++++++++++++++++++++----- dlls/wineoss.drv/unixlib.h | 2 +- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 238ed5af0ba..2b490482df0 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -340,6 +340,15 @@ static int open_device(const char *device, EDataFlow flow) return open(device, flags, 0); } +static void set_stream_volumes(ACImpl *This) +{ + struct oss_stream *stream = This->stream; + + EnterCriticalSection(&This->lock); + stream->mute = This->session->mute; + LeaveCriticalSection(&This->lock); +} + static const OSSDevice *get_ossdevice_from_guid(const GUID *guid) { OSSDevice *dev_item; @@ -982,12 +991,14 @@ exit: if(stream->fd >= 0) close(stream->fd); HeapFree(GetProcessHeap(), 0, stream->local_buffer); HeapFree(GetProcessHeap(), 0, stream); + LeaveCriticalSection(&This->lock); } else { list_add_tail(&This->session->clients, &This->entry); This->stream = stream; + LeaveCriticalSection(&This->lock); + set_stream_volumes(This); } - LeaveCriticalSection(&This->lock); LeaveCriticalSection(&g_sessions_lock); return hr; @@ -1164,7 +1175,7 @@ static void silence_buffer(struct oss_stream *stream, BYTE *buffer, UINT32 frame memset(buffer, 0, frames * stream->fmt->nBlockAlign); } -static void oss_write_data(struct oss_stream *stream, BOOL mute) +static void oss_write_data(struct oss_stream *stream) { ssize_t written_bytes; UINT32 written_frames, in_oss_frames, write_limit, max_period, write_offs_frames, new_frames; @@ -1235,7 +1246,7 @@ static void oss_write_data(struct oss_stream *stream, BOOL mute) buf = stream->local_buffer + write_offs_frames * stream->fmt->nBlockAlign; - if(mute) + if(stream->mute) silence_buffer(stream, buf, to_write_frames); written_bytes = write(stream->fd, buf, to_write_bytes); @@ -1259,7 +1270,7 @@ static void oss_write_data(struct oss_stream *stream, BOOL mute) to_write_frames = min(write_limit - written_frames, new_frames - written_frames); to_write_bytes = to_write_frames * stream->fmt->nBlockAlign; - if(mute) + if(stream->mute) silence_buffer(stream, stream->local_buffer, to_write_frames); TRACE("wrapping to write %lu frames from beginning\n", to_write_frames); @@ -1308,7 +1319,7 @@ static void CALLBACK oss_period_callback(void *user, BOOLEAN timer) if(stream->playing){ if(stream->flow == eRender && stream->held_frames) - oss_write_data(stream, This->session->mute); + oss_write_data(stream); else if(stream->flow == eCapture) oss_read_data(stream); } @@ -2476,6 +2487,7 @@ static HRESULT WINAPI SimpleAudioVolume_SetMasterVolume( { AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); AudioSession *session = This->session; + ACImpl *client; TRACE("(%p)->(%f, %s)\n", session, level, wine_dbgstr_guid(context)); @@ -2490,6 +2502,8 @@ static HRESULT WINAPI SimpleAudioVolume_SetMasterVolume( session->master_vol = level; TRACE("OSS doesn't support setting volume\n"); + LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) + set_stream_volumes(client); LeaveCriticalSection(&g_sessions_lock); @@ -2517,6 +2531,7 @@ static HRESULT WINAPI SimpleAudioVolume_SetMute(ISimpleAudioVolume *iface, { AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); AudioSession *session = This->session; + ACImpl *client; TRACE("(%p)->(%u, %s)\n", session, mute, debugstr_guid(context)); @@ -2524,6 +2539,9 @@ static HRESULT WINAPI SimpleAudioVolume_SetMute(ISimpleAudioVolume *iface, session->mute = mute; + LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) + set_stream_volumes(client); + LeaveCriticalSection(&g_sessions_lock); return S_OK; @@ -2622,6 +2640,7 @@ static HRESULT WINAPI AudioStreamVolume_SetChannelVolume( This->vols[index] = level; TRACE("OSS doesn't support setting volume\n"); + set_stream_volumes(This); LeaveCriticalSection(&This->lock); @@ -2666,6 +2685,7 @@ static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( This->vols[i] = levels[i]; TRACE("OSS doesn't support setting volume\n"); + set_stream_volumes(This); LeaveCriticalSection(&This->lock); @@ -2763,6 +2783,7 @@ static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume( { AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); AudioSession *session = This->session; + ACImpl *client; TRACE("(%p)->(%d, %f, %s)\n", session, index, level, wine_dbgstr_guid(context)); @@ -2781,6 +2802,8 @@ static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume( session->channel_vols[index] = level; TRACE("OSS doesn't support setting volume\n"); + LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) + set_stream_volumes(client); LeaveCriticalSection(&g_sessions_lock); @@ -2812,6 +2835,7 @@ static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes( { AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); AudioSession *session = This->session; + ACImpl *client; int i; TRACE("(%p)->(%d, %p, %s)\n", session, count, levels, @@ -2832,6 +2856,8 @@ static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes( session->channel_vols[i] = levels[i]; TRACE("OSS doesn't support setting volume\n"); + LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry) + set_stream_volumes(client); LeaveCriticalSection(&g_sessions_lock); diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h index e0817cbc9c1..26fd6d08e7e 100644 --- a/dlls/wineoss.drv/unixlib.h +++ b/dlls/wineoss.drv/unixlib.h @@ -28,7 +28,7 @@ struct oss_stream int fd; - BOOL playing; + BOOL playing, mute; UINT64 written_frames, last_pos_frames; UINT32 period_us, period_frames, bufsize_frames, held_frames, tmp_buffer_frames, in_oss_frames; UINT32 oss_bufsize_bytes, lcl_offs_frames; /* offs into local_buffer where valid data starts */
1
0
0
0
Huw Davies : wineoss: Use the stream ptr to indicate the init state.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 8fc9bdff00a498832bda5a5d649564d5225d54fd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8fc9bdff00a498832bda5a5d…
Author: Huw Davies <huw(a)codeweavers.com> Date: Tue Apr 12 07:58:59 2022 +0100 wineoss: Use the stream ptr to indicate the init state. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineoss.drv/mmdevdrv.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index f7c7864e2af..238ed5af0ba 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -113,7 +113,6 @@ struct ACImpl { UINT32 channel_count; struct oss_stream *stream; - BOOL initted; HANDLE timer; CRITICAL_SECTION lock; @@ -532,7 +531,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface) IUnknown_Release(This->pUnkFTMarshal); This->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->lock); - if(This->initted){ + if(This->session){ EnterCriticalSection(&g_sessions_lock); list_remove(&This->entry); LeaveCriticalSection(&g_sessions_lock); @@ -895,7 +894,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, EnterCriticalSection(&g_sessions_lock); EnterCriticalSection(&This->lock); - if(This->initted){ + if(This->stream){ LeaveCriticalSection(&This->lock); LeaveCriticalSection(&g_sessions_lock); return AUDCLNT_E_ALREADY_INITIALIZED; @@ -986,7 +985,6 @@ exit: } else { list_add_tail(&This->session->clients, &This->entry); This->stream = stream; - This->initted = TRUE; } LeaveCriticalSection(&This->lock); @@ -1008,7 +1006,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface, EnterCriticalSection(&This->lock); - if(!This->initted){ + if(!This->stream){ LeaveCriticalSection(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } @@ -1035,7 +1033,7 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient3 *iface, EnterCriticalSection(&This->lock); - if(!This->initted){ + if(!This->stream){ LeaveCriticalSection(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } @@ -1062,7 +1060,7 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient3 *iface, EnterCriticalSection(&This->lock); - if(!This->initted){ + if(!This->stream){ LeaveCriticalSection(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } @@ -1330,7 +1328,7 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface) EnterCriticalSection(&This->lock); - if(!This->initted){ + if(!This->stream){ LeaveCriticalSection(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } @@ -1368,7 +1366,7 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient3 *iface) EnterCriticalSection(&This->lock); - if(!This->initted){ + if(!This->stream){ LeaveCriticalSection(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } @@ -1395,7 +1393,7 @@ static HRESULT WINAPI AudioClient_Reset(IAudioClient3 *iface) EnterCriticalSection(&This->lock); - if(!This->initted){ + if(!This->stream){ LeaveCriticalSection(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } @@ -1438,7 +1436,7 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface, EnterCriticalSection(&This->lock); - if(!This->initted){ + if(!This->stream){ LeaveCriticalSection(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } @@ -1474,7 +1472,7 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid, EnterCriticalSection(&This->lock); - if(!This->initted){ + if(!This->stream){ LeaveCriticalSection(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; }
1
0
0
0
Alexandre Julliard : win32u: Support UTF-8 as the default Ansi codepage.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 5cc2d4adc5d183ed322b48bf3a7ec8359ef2abd5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5cc2d4adc5d183ed322b48bf…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 12 10:17:13 2022 +0200 win32u: Support UTF-8 as the default Ansi codepage. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/win32u/font.c | 44 +++++++++++++++++++++++++++++++++++++++----- dlls/win32u/gdiobj.c | 40 ++++++++++++---------------------------- 2 files changed, 51 insertions(+), 33 deletions(-) diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index 86786b160fb..c5a5a5806ba 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -199,6 +199,7 @@ static struct font_gamma_ramp font_gamma_ramp; static void add_face_to_cache( struct gdi_font_face *face ); static void remove_face_from_cache( struct gdi_font_face *face ); +static CPTABLEINFO utf8_cp; static CPTABLEINFO oem_cp; CPTABLEINFO ansi_cp = { 0 }; @@ -370,6 +371,11 @@ static const struct nls_update_font_list "coure.fon", "serife.fon", "smalle.fon", "sserife.fon", "sseriff.fon", "Tahoma","Times New Roman" /* FIXME unverified */ }, + /* UTF-8 */ + { CP_UTF8, CP_UTF8, "vga850.fon", "vgafix.fon", "vgasys.fon", + "coure.fon", "serife.fon", "smalle.fon", "sserife.fon", "sseriff.fon", + "Tahoma", "Times New Roman" /* FIXME unverified */ + }, /* Eastern Europe */ { 1250, 852, "vga852.fon", "vgafixe.fon", "vgasyse.fon", "couree.fon", "serifee.fon", "smallee.fon", "sserifee.fon", "sseriffe.fon", @@ -2717,6 +2723,7 @@ static void update_font_system_link_info(void) static void update_codepage( UINT screen_dpi ) { + USHORT utf8_hdr[2] = { 0, CP_UTF8 }; char value_buffer[FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[40 * sizeof(WCHAR)])]; KEY_VALUE_PARTIAL_INFORMATION *info = (void *)value_buffer; char cpbuf[40]; @@ -2733,8 +2740,15 @@ static void update_codepage( UINT screen_dpi ) if (size == sizeof(DWORD) && info->Type == REG_DWORD) font_dpi = *(DWORD *)info->Data; - RtlInitCodePageTable( NtCurrentTeb()->Peb->AnsiCodePageData, &ansi_cp ); - RtlInitCodePageTable( NtCurrentTeb()->Peb->OemCodePageData, &oem_cp ); + RtlInitCodePageTable( utf8_hdr, &utf8_cp ); + if (NtCurrentTeb()->Peb->AnsiCodePageData) + RtlInitCodePageTable( NtCurrentTeb()->Peb->AnsiCodePageData, &ansi_cp ); + else + ansi_cp = utf8_cp; + if (NtCurrentTeb()->Peb->OemCodePageData) + RtlInitCodePageTable( NtCurrentTeb()->Peb->OemCodePageData, &oem_cp ); + else + oem_cp = utf8_cp; sprintf( cpbuf, "%u,%u", ansi_cp.CodePage, oem_cp.CodePage ); asciiz_to_unicode( cpbufW, cpbuf ); @@ -3210,6 +3224,7 @@ CPTABLEINFO *get_cptable( WORD cp ) SIZE_T size; if (cp == CP_ACP) return &ansi_cp; + if (cp == CP_UTF8) return &utf8_cp; for (i = 0; i < ARRAY_SIZE(tables) && tables[i].CodePage; i++) if (tables[i].CodePage == cp) return &tables[i]; @@ -3227,7 +3242,11 @@ DWORD win32u_wctomb( CPTABLEINFO *info, char *dst, DWORD dstlen, const WCHAR *sr { DWORD ret; - RtlUnicodeToCustomCPN( info, dst, dstlen, &ret, src, srclen * sizeof(WCHAR) ); + if (info->CodePage == CP_UTF8) + RtlUnicodeToUTF8N( dst, dstlen, &ret, src, srclen * sizeof(WCHAR) ); + else + RtlUnicodeToCustomCPN( info, dst, dstlen, &ret, src, srclen * sizeof(WCHAR) ); + return ret; } @@ -3235,7 +3254,11 @@ DWORD win32u_mbtowc( CPTABLEINFO *info, WCHAR *dst, DWORD dstlen, const char *sr { DWORD ret; - RtlCustomCPToUnicodeN( info, dst, dstlen * sizeof(WCHAR), &ret, src, srclen ); + if (info->CodePage == CP_UTF8) + RtlUTF8ToUnicodeN( dst, dstlen * sizeof(WCHAR), &ret, src, srclen ); + else + RtlCustomCPToUnicodeN( info, dst, dstlen * sizeof(WCHAR), &ret, src, srclen ); + return ret / sizeof(WCHAR); } @@ -3245,7 +3268,18 @@ static BOOL wc_to_index( UINT cp, WCHAR wc, unsigned char *dst, BOOL allow_defau if (!(info = get_cptable( cp ))) return FALSE; - if (info->DBCSCodePage) + if (info->CodePage == CP_UTF8) + { + if (wc < 0x80) + { + *dst = wc; + return TRUE; + } + if (!allow_default) return FALSE; + *dst = info->DefaultChar; + return TRUE; + } + else if (info->DBCSCodePage) { WCHAR *uni2cp = info->WideCharTable; if (uni2cp[wc] & 0xff00) return FALSE; diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index 78fab0189c9..d71807c8c04 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -464,38 +464,22 @@ void make_gdi_object_system( HGDIOBJ handle, BOOL set) /****************************************************************************** * get_default_fonts */ -static const struct DefaultFontInfo* get_default_fonts(UINT charset) +static const struct DefaultFontInfo* get_default_fonts(void) { - unsigned int n; + unsigned int n; + CHARSETINFO csi; - for(n = 0; n < ARRAY_SIZE( default_fonts ); n++) - { - if ( default_fonts[n].charset == charset ) - return &default_fonts[n]; - } - - FIXME( "unhandled charset 0x%08x - use ANSI_CHARSET for default stock objects\n", charset ); - return &default_fonts[0]; -} - - -/****************************************************************************** - * get_default_charset (internal) - * - * get the language-dependent charset that can handle CP_ACP correctly. - */ -static UINT get_default_charset( void ) -{ - CHARSETINFO csi; + if (ansi_cp.CodePage == CP_UTF8) return &default_fonts[0]; csi.ciCharset = ANSI_CHARSET; - if ( !translate_charset_info( ULongToPtr(ansi_cp.CodePage), &csi, TCI_SRCCODEPAGE ) ) - { - FIXME( "unhandled codepage %u - use ANSI_CHARSET for default stock objects\n", ansi_cp.CodePage ); - return ANSI_CHARSET; - } + translate_charset_info( ULongToPtr(ansi_cp.CodePage), &csi, TCI_SRCCODEPAGE ); + + for(n = 0; n < ARRAY_SIZE( default_fonts ); n++) + if ( default_fonts[n].charset == csi.ciCharset ) + return &default_fonts[n]; - return csi.ciCharset; + FIXME( "unhandled charset 0x%08x - use ANSI_CHARSET for default stock objects\n", csi.ciCharset ); + return &default_fonts[0]; } @@ -654,7 +638,7 @@ static void init_stock_objects( unsigned int dpi ) create_font( &AnsiVarFont ); /* language-dependent stock fonts */ - deffonts = get_default_fonts(get_default_charset()); + deffonts = get_default_fonts(); create_font( &deffonts->SystemFont ); create_font( &deffonts->DeviceDefaultFont );
1
0
0
0
Alexandre Julliard : win32u: Use CPTABLEINFO to store the Ansi/OEM codepages.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: d8db12a958ba312a517e7ade7f2c43428cdba600 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d8db12a958ba312a517e7ade…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 12 10:14:27 2022 +0200 win32u: Use CPTABLEINFO to store the Ansi/OEM codepages. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/win32u/font.c | 84 +++++++++++++++++--------------------------- dlls/win32u/freetype.c | 2 +- dlls/win32u/gdiobj.c | 6 ++-- dlls/win32u/ntgdi_private.h | 1 - dlls/win32u/sysparams.c | 4 +-- dlls/win32u/win32u_private.h | 4 ++- 6 files changed, 41 insertions(+), 60 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=d8db12a958ba312a517e…
1
0
0
0
Alexandre Julliard : win32u: Use character sizes in the codepage conversion functions.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 63ad05bc02d2c56689559afaa71b2fe2cb6ef3c0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=63ad05bc02d2c56689559afa…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 12 10:10:34 2022 +0200 win32u: Use character sizes in the codepage conversion functions. For consistency with ntdll. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/win32u/font.c | 6 +++--- dlls/win32u/freetype.c | 10 ++++------ dlls/win32u/win32u_private.h | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index 82daf9ad2ba..ac1e40ebf2f 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -3243,7 +3243,7 @@ DWORD win32u_wctomb( CPTABLEINFO *info, char *dst, DWORD dstlen, const WCHAR *sr if (!info && !(info = get_cptable( get_acp() ))) return 0; - RtlUnicodeToCustomCPN( info, dst, dstlen, &ret, src, srclen ); + RtlUnicodeToCustomCPN( info, dst, dstlen, &ret, src, srclen * sizeof(WCHAR) ); return ret; } @@ -3253,8 +3253,8 @@ DWORD win32u_mbtowc( CPTABLEINFO *info, WCHAR *dst, DWORD dstlen, const char *sr if (!info && !(info = get_cptable( get_acp() ))) return 0; - RtlCustomCPToUnicodeN( info, dst, dstlen, &ret, src, srclen ); - return ret; + RtlCustomCPToUnicodeN( info, dst, dstlen * sizeof(WCHAR), &ret, src, srclen ); + return ret / sizeof(WCHAR); } static BOOL wc_to_index( UINT cp, WCHAR wc, unsigned char *dst, BOOL allow_default ) diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index 0703d32740e..e0c98d9106a 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -782,9 +782,8 @@ static WCHAR *copy_name_table_string( const FT_SfntName *name ) case TT_PLATFORM_MACINTOSH: if (!(cp = get_mac_code_page( name ))) return NULL; ret = malloc( (name->string_len + 1) * sizeof(WCHAR) ); - i = win32u_mbtowc( cp, ret, name->string_len * sizeof(WCHAR), - (char *)name->string, name->string_len ); - ret[i / sizeof(WCHAR)] = 0; + i = win32u_mbtowc( cp, ret, name->string_len, (char *)name->string, name->string_len ); + ret[i] = 0; return ret; } return NULL; @@ -1142,8 +1141,7 @@ static WCHAR *decode_opentype_name( struct opentype_name *name ) { CPTABLEINFO *cptable = get_cptable( name->codepage ); if (!cptable) return NULL; - len = win32u_mbtowc( cptable, buffer, sizeof(buffer), name->bytes, name->length ); - len /= sizeof(WCHAR); + len = win32u_mbtowc( cptable, buffer, ARRAY_SIZE(buffer), name->bytes, name->length ); } buffer[ARRAY_SIZE(buffer) - 1] = 0; @@ -2526,7 +2524,7 @@ static BOOL freetype_get_glyph_index( struct gdi_font *font, UINT *glyph, BOOL u DWORD len; char ch; - len = win32u_wctomb( NULL, &ch, 1, &wc, sizeof(wc) ); + len = win32u_wctomb( NULL, &ch, 1, &wc, 1 ); if (len) *glyph = get_glyph_index_symbol( font, (unsigned char)ch ); } return TRUE; diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index f570bde39fe..3adb30e8d5c 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -593,7 +593,7 @@ static inline WCHAR *towstr( const char *str ) { DWORD len = strlen( str ) + 1; WCHAR *ret = malloc( len * sizeof(WCHAR) ); - if (ret) win32u_mbtowc( NULL, ret, len * sizeof(WCHAR), str, len ); + if (ret) win32u_mbtowc( NULL, ret, len, str, len ); return ret; }
1
0
0
0
Alexandre Julliard : win32u: Use the ntdll functions for codepage conversions.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 65ff9caca02af9544f3fc62c1e12fd90f6176af2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=65ff9caca02af9544f3fc62c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 12 10:10:17 2022 +0200 win32u: Use the ntdll functions for codepage conversions. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/win32u/font.c | 99 ++++---------------------------------------- dlls/win32u/win32u_private.h | 5 +-- 2 files changed, 9 insertions(+), 95 deletions(-) diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index 2bf68141d6d..82daf9ad2ba 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -3221,7 +3221,6 @@ static UINT get_glyph_index_symbol( struct gdi_font *font, UINT glyph ) CPTABLEINFO *get_cptable( WORD cp ) { static CPTABLEINFO tables[100]; - CPTABLEINFO *info; unsigned int i; USHORT *ptr; SIZE_T size; @@ -3234,112 +3233,28 @@ CPTABLEINFO *get_cptable( WORD cp ) ERR( "too many code pages\n" ); return NULL; } - - info = &tables[i]; - info->CodePage = ptr[1]; - info->MaximumCharacterSize = ptr[2]; - info->DefaultChar = ptr[3]; - info->UniDefaultChar = ptr[4]; - info->TransDefaultChar = ptr[5]; - info->TransUniDefaultChar = ptr[6]; - memcpy( info->LeadByte, ptr + 7, sizeof(info->LeadByte) ); - ptr += ptr[0]; - - info->WideCharTable = ptr + ptr[0] + 1; - info->MultiByteTable = ++ptr; - ptr += 256; - if (*ptr++) ptr += 256; /* glyph table */ - info->DBCSRanges = ptr; - if (*ptr) /* dbcs ranges */ - { - info->DBCSCodePage = 1; - info->DBCSOffsets = ptr + 1; - } - else - { - info->DBCSCodePage = 0; - info->DBCSOffsets = NULL; - } - - return info; + RtlInitCodePageTable( ptr, &tables[i] ); + return &tables[i]; } DWORD win32u_wctomb( CPTABLEINFO *info, char *dst, DWORD dstlen, const WCHAR *src, DWORD srclen ) { - DWORD i, ret; + DWORD ret; if (!info && !(info = get_cptable( get_acp() ))) return 0; - srclen /= sizeof(WCHAR); - if (info->DBCSCodePage) - { - WCHAR *uni2cp = info->WideCharTable; - - for (i = dstlen; srclen && i; i--, srclen--, src++) - { - if (uni2cp[*src] & 0xff00) - { - if (i == 1) break; /* do not output a partial char */ - i--; - *dst++ = uni2cp[*src] >> 8; - } - *dst++ = (char)uni2cp[*src]; - } - ret = dstlen - i; - } - else - { - char *uni2cp = info->WideCharTable; - ret = min( srclen, dstlen ); - for (i = 0; i < ret; i++) dst[i] = uni2cp[src[i]]; - } + RtlUnicodeToCustomCPN( info, dst, dstlen, &ret, src, srclen ); return ret; } DWORD win32u_mbtowc( CPTABLEINFO *info, WCHAR *dst, DWORD dstlen, const char *src, DWORD srclen ) { - DWORD i, ret; + DWORD ret; if (!info && !(info = get_cptable( get_acp() ))) return 0; - if (!dst) - { - /* only compute length */ - if (info->DBCSOffsets) - { - for (ret = 0; srclen--; src++, ret++) - { - if (!info->DBCSOffsets[(unsigned char)*src]) continue; - if (!srclen--) break; - src++; - } - } - else ret = srclen; - return ret * sizeof(WCHAR); - } - - dstlen /= sizeof(WCHAR); - if (info->DBCSOffsets) - { - for (i = dstlen; srclen && i; i--, srclen--, src++, dst++) - { - USHORT off = info->DBCSOffsets[(unsigned char)*src]; - if (off && srclen > 1) - { - src++; - srclen--; - *dst = info->DBCSOffsets[off + (unsigned char)*src]; - } - else *dst = info->MultiByteTable[(unsigned char)*src]; - } - ret = dstlen - i; - } - else - { - ret = min( srclen, dstlen ); - for (i = 0; i < ret; i++) dst[i] = info->MultiByteTable[(unsigned char)src[i]]; - } - return ret * sizeof(WCHAR); + RtlCustomCPToUnicodeN( info, dst, dstlen, &ret, src, srclen ); + return ret; } static BOOL wc_to_index( UINT cp, WCHAR wc, unsigned char *dst, BOOL allow_default ) diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index d552850e303..f570bde39fe 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -592,9 +592,8 @@ static inline WCHAR *win32u_wcsdup( const WCHAR *str ) static inline WCHAR *towstr( const char *str ) { DWORD len = strlen( str ) + 1; - DWORD size = win32u_mbtowc( NULL, NULL, 0, str, len ); - WCHAR *ret = malloc( size ); - if (ret) win32u_mbtowc( NULL, ret, size, str, len ); + WCHAR *ret = malloc( len * sizeof(WCHAR) ); + if (ret) win32u_mbtowc( NULL, ret, len * sizeof(WCHAR), str, len ); return ret; }
1
0
0
0
Alexandre Julliard : ntdll: Export a few more codepage functions from ntdll.so.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 6eae7a24e2f91b348b854b2d6e6c62ef4cc471e7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6eae7a24e2f91b348b854b2d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 12 10:09:45 2022 +0200 ntdll: Export a few more codepage functions from ntdll.so. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/env.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 47bc0118802..89297472a34 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -2252,6 +2252,39 @@ WCHAR WINAPI RtlDowncaseUnicodeChar( WCHAR wch ) return ntdll_towlower( wch ); } +/****************************************************************** + * RtlInitCodePageTable (ntdll.so) + */ +void WINAPI RtlInitCodePageTable( USHORT *ptr, CPTABLEINFO *info ) +{ + static const CPTABLEINFO utf8_cpinfo = { CP_UTF8, 4, '?', 0xfffd, '?', '?' }; + + if (ptr[1] == CP_UTF8) *info = utf8_cpinfo; + else init_codepage_table( ptr, info ); +} + +/************************************************************************** + * RtlCustomCPToUnicodeN (ntdll.so) + */ +NTSTATUS WINAPI RtlCustomCPToUnicodeN( CPTABLEINFO *info, WCHAR *dst, DWORD dstlen, DWORD *reslen, + const char *src, DWORD srclen ) +{ + unsigned int ret = cp_mbstowcs( info, dst, dstlen / sizeof(WCHAR), src, srclen ); + if (reslen) *reslen = ret * sizeof(WCHAR); + return STATUS_SUCCESS; +} + +/************************************************************************** + * RtlUnicodeToCustomCPN (ntdll.so) + */ +NTSTATUS WINAPI RtlUnicodeToCustomCPN( CPTABLEINFO *info, char *dst, DWORD dstlen, DWORD *reslen, + const WCHAR *src, DWORD srclen ) +{ + unsigned int ret = cp_wcstombs( info, dst, dstlen, src, srclen / sizeof(WCHAR) ); + if (reslen) *reslen = ret; + return STATUS_SUCCESS; +} + /********************************************************************** * RtlUTF8ToUnicodeN (ntdll.so) */ @@ -2269,6 +2302,23 @@ NTSTATUS WINAPI RtlUTF8ToUnicodeN( WCHAR *dst, DWORD dstlen, DWORD *reslen, cons return status; } +/************************************************************************** + * RtlUnicodeToUTF8N (ntdll.so) + */ +NTSTATUS WINAPI RtlUnicodeToUTF8N( char *dst, DWORD dstlen, DWORD *reslen, const WCHAR *src, DWORD srclen ) +{ + unsigned int ret; + NTSTATUS status; + + if (!dst) + status = utf8_wcstombs_size( src, srclen / sizeof(WCHAR), &ret ); + else + status = utf8_wcstombs( dst, dstlen, &ret, src, srclen / sizeof(WCHAR) ); + + *reslen = ret; + return status; +} + /********************************************************************** * RtlNtStatusToDosError (ntdll.so) */
1
0
0
0
Alexandre Julliard : ntdll: Default to UTF-8 codepage at startup.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: b47379c1f8aa323f04f178dc38baa3df85e4af41 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b47379c1f8aa323f04f178dc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 12 21:39:14 2022 +0200 ntdll: Default to UTF-8 codepage at startup. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/locale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c index 609573b71cb..36fe3e92863 100644 --- a/dlls/ntdll/locale.c +++ b/dlls/ntdll/locale.c @@ -40,7 +40,7 @@ BYTE NlsMbCodePageTag = 0; BYTE NlsMbOemCodePageTag = 0; static const WCHAR *locale_strings; -static NLSTABLEINFO nls_info; +static NLSTABLEINFO nls_info = { { CP_UTF8 }, { CP_UTF8 } }; static struct norm_table *norm_tables[16]; static const NLS_LOCALE_LCID_INDEX *lcids_index; static const NLS_LOCALE_LCNAME_INDEX *lcnames_index;
1
0
0
0
Nikolay Sivov : evr: Add IAMFilterMiscFlags interface.
by Alexandre Julliard
12 Apr '22
12 Apr '22
Module: wine Branch: master Commit: 0b9c35edb49364e56b93fe46a98a4b8c4802a0eb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0b9c35edb49364e56b93fe46…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Apr 12 09:32:06 2022 +0300 evr: Add IAMFilterMiscFlags interface. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/evr/evr.c | 42 ++++++++++++++++++++++++++++++++++++++++++ dlls/evr/tests/evr.c | 21 ++++++++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c index 5e6ca03ea3d..e64151b650c 100644 --- a/dlls/evr/evr.c +++ b/dlls/evr/evr.c @@ -34,6 +34,7 @@ struct evr { struct strmbase_renderer renderer; IEVRFilterConfig IEVRFilterConfig_iface; + IAMFilterMiscFlags IAMFilterMiscFlags_iface; }; static struct evr *impl_from_strmbase_renderer(struct strmbase_renderer *iface) @@ -47,6 +48,8 @@ static HRESULT evr_query_interface(struct strmbase_renderer *iface, REFIID iid, if (IsEqualGUID(iid, &IID_IEVRFilterConfig)) *out = &filter->IEVRFilterConfig_iface; + else if (IsEqualGUID(iid, &IID_IAMFilterMiscFlags)) + *out = &filter->IAMFilterMiscFlags_iface; else return E_NOINTERFACE; @@ -132,6 +135,44 @@ static const IEVRFilterConfigVtbl filter_config_vtbl = filter_config_GetNumberOfStreams, }; +static struct evr *impl_from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface) +{ + return CONTAINING_RECORD(iface, struct evr, IAMFilterMiscFlags_iface); +} + +static HRESULT WINAPI filter_misc_flags_QueryInterface(IAMFilterMiscFlags *iface, REFIID iid, void **out) +{ + struct evr *filter = impl_from_IAMFilterMiscFlags(iface); + return IUnknown_QueryInterface(filter->renderer.filter.outer_unk, iid, out); +} + +static ULONG WINAPI filter_misc_flags_AddRef(IAMFilterMiscFlags *iface) +{ + struct evr *filter = impl_from_IAMFilterMiscFlags(iface); + return IUnknown_AddRef(filter->renderer.filter.outer_unk); +} + +static ULONG WINAPI filter_misc_flags_Release(IAMFilterMiscFlags *iface) +{ + struct evr *filter = impl_from_IAMFilterMiscFlags(iface); + return IUnknown_Release(filter->renderer.filter.outer_unk); +} + +static ULONG WINAPI filter_misc_flags_GetMiscFlags(IAMFilterMiscFlags *iface) +{ + TRACE("%p.\n", iface); + + return AM_FILTER_MISC_FLAGS_IS_RENDERER; +} + +static const IAMFilterMiscFlagsVtbl filter_misc_flags_vtbl = +{ + filter_misc_flags_QueryInterface, + filter_misc_flags_AddRef, + filter_misc_flags_Release, + filter_misc_flags_GetMiscFlags, +}; + HRESULT evr_filter_create(IUnknown *outer, void **out) { struct evr *object; @@ -142,6 +183,7 @@ HRESULT evr_filter_create(IUnknown *outer, void **out) strmbase_renderer_init(&object->renderer, outer, &CLSID_EnhancedVideoRenderer, L"EVR Input0", &renderer_ops); object->IEVRFilterConfig_iface.lpVtbl = &filter_config_vtbl; + object->IAMFilterMiscFlags_iface.lpVtbl = &filter_misc_flags_vtbl; TRACE("Created EVR %p.\n", object); *out = &object->renderer.filter.IUnknown_inner; diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 93e262e52a3..fa9ad2a0b35 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -276,7 +276,7 @@ static void test_interfaces(void) IBaseFilter *filter = create_evr(); ULONG ref; - todo_wine check_interface(filter, &IID_IAMFilterMiscFlags, TRUE); + check_interface(filter, &IID_IAMFilterMiscFlags, TRUE); check_interface(filter, &IID_IBaseFilter, TRUE); check_interface(filter, &IID_IEVRFilterConfig, TRUE); check_interface(filter, &IID_IMediaFilter, TRUE); @@ -551,6 +551,24 @@ static void test_unconnected_eos(void) ok(!ref, "Got outstanding refcount %ld.\n", ref); } +static void test_misc_flags(void) +{ + IBaseFilter *filter = create_evr(); + IAMFilterMiscFlags *misc_flags; + ULONG ref, flags; + HRESULT hr; + + hr = IBaseFilter_QueryInterface(filter, &IID_IAMFilterMiscFlags, (void **)&misc_flags); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + flags = IAMFilterMiscFlags_GetMiscFlags(misc_flags); + ok(flags == AM_FILTER_MISC_FLAGS_IS_RENDERER, "Unexpected flags %#lx.\n", flags); + IAMFilterMiscFlags_Release(misc_flags); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %ld.\n", ref); +} + static IMFMediaType * create_video_type(const GUID *subtype) { IMFMediaType *video_type; @@ -3207,6 +3225,7 @@ START_TEST(evr) test_find_pin(); test_pin_info(); test_unconnected_eos(); + test_misc_flags(); test_default_mixer(); test_default_mixer_type_negotiation();
1
0
0
0
← Newer
1
...
62
63
64
65
66
67
68
...
103
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Results per page:
10
25
50
100
200