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 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
817 discussions
Start a n
N
ew thread
Davide Beatrici : winecoreaudio: Implement and call set_event_handle in unixlib.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: c6a97c0f194911302e798e133fb2040259d16885 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c6a97c0f194911302e798e133fb204…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Sat Apr 8 04:43:24 2023 +0200 winecoreaudio: Implement and call set_event_handle in unixlib. --- dlls/winecoreaudio.drv/coreaudio.c | 48 +++++++++++++++++++++++++++++++++++--- dlls/winecoreaudio.drv/mmdevdrv.c | 25 +++++++------------- 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/dlls/winecoreaudio.drv/coreaudio.c b/dlls/winecoreaudio.drv/coreaudio.c index ee660b0887e..4191958b1ca 100644 --- a/dlls/winecoreaudio.drv/coreaudio.c +++ b/dlls/winecoreaudio.drv/coreaudio.c @@ -85,6 +85,7 @@ struct coreaudio_stream EDataFlow flow; DWORD flags; AUDCLNT_SHAREMODE share; + HANDLE event; BOOL playing; REFERENCE_TIME period; @@ -1308,7 +1309,9 @@ static NTSTATUS unix_start(void *args) OSSpinLockLock(&stream->lock); - if(stream->playing) + if((stream->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK) && !stream->event) + params->result = AUDCLNT_E_EVENTHANDLE_NOT_SET; + else if(stream->playing) params->result = AUDCLNT_E_NOT_STOPPED; else{ stream->playing = TRUE; @@ -1653,6 +1656,27 @@ static NTSTATUS unix_set_volumes(void *args) return STATUS_SUCCESS; } +static NTSTATUS unix_set_event_handle(void *args) +{ + struct set_event_handle_params *params = args; + struct coreaudio_stream *stream = handle_get_stream(params->stream); + HRESULT hr = S_OK; + + OSSpinLockLock(&stream->lock); + if(!stream->unit) + hr = AUDCLNT_E_DEVICE_INVALIDATED; + else if(!(stream->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK)) + hr = AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED; + else if(stream->event) + hr = HRESULT_FROM_WIN32(ERROR_INVALID_NAME); + else + stream->event = params->event; + OSSpinLockUnlock(&stream->lock); + + params->result = hr; + return STATUS_SUCCESS; +} + unixlib_entry_t __wine_unix_call_funcs[] = { unix_not_implemented, @@ -1679,7 +1703,7 @@ unixlib_entry_t __wine_unix_call_funcs[] = unix_get_frequency, unix_get_position, unix_set_volumes, - unix_not_implemented, + unix_set_event_handle, unix_not_implemented, unix_is_started, unix_not_implemented, @@ -1997,6 +2021,24 @@ static NTSTATUS unix_wow64_set_volumes(void *args) return unix_set_volumes(¶ms); } +static NTSTATUS unix_wow64_set_event_handle(void *args) +{ + struct + { + stream_handle stream; + PTR32 event; + HRESULT result; + } *params32 = args; + struct set_event_handle_params params = + { + .stream = params32->stream, + .event = ULongToHandle(params32->event) + }; + unix_set_event_handle(¶ms); + params32->result = params.result; + return STATUS_SUCCESS; +} + unixlib_entry_t __wine_unix_call_wow64_funcs[] = { unix_not_implemented, @@ -2023,7 +2065,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] = unix_wow64_get_frequency, unix_wow64_get_position, unix_wow64_set_volumes, - unix_not_implemented, + unix_wow64_set_event_handle, unix_not_implemented, unix_is_started, unix_not_implemented, diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index 8d1d14aa26f..e40b3c0f019 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -92,7 +92,6 @@ struct ACImpl { EDataFlow dataflow; UINT32 channel_count, period_ms; - DWORD flags; HANDLE event; float *vols; @@ -752,7 +751,6 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, return params.result; } - This->flags = flags; This->channel_count = fmt->nChannels; This->period_ms = period / 10000; @@ -942,9 +940,6 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface) if(!This->stream) return AUDCLNT_E_NOT_INITIALIZED; - if((This->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK) && !This->event) - return AUDCLNT_E_EVENTHANDLE_NOT_SET; - params.stream = This->stream; UNIX_CALL(start, ¶ms); @@ -996,7 +991,7 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface, HANDLE event) { ACImpl *This = impl_from_IAudioClient3(iface); - HRESULT hr = S_OK; + struct set_event_handle_params params; TRACE("(%p)->(%p)\n", This, event); @@ -1006,19 +1001,17 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface, if(!This->stream) return AUDCLNT_E_NOT_INITIALIZED; - EnterCriticalSection(&g_sessions_lock); + params.stream = This->stream; + params.event = event; + UNIX_CALL(set_event_handle, ¶ms); - if(!(This->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK)) - hr = AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED; - else if(This->event){ - FIXME("called twice\n"); - hr = HRESULT_FROM_WIN32(ERROR_INVALID_NAME); - }else + if(SUCCEEDED(params.result)){ + EnterCriticalSection(&g_sessions_lock); This->event = event; + LeaveCriticalSection(&g_sessions_lock); + } - LeaveCriticalSection(&g_sessions_lock); - - return hr; + return params.result; } static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid,
1
0
0
0
Davide Beatrici : winecoreaudio: Store flags in unixlib.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: 356a93732c858f27ef82275ef444c2ddad0553eb URL:
https://gitlab.winehq.org/wine/wine/-/commit/356a93732c858f27ef82275ef444c2…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Sat Apr 8 04:38:42 2023 +0200 winecoreaudio: Store flags in unixlib. --- dlls/winecoreaudio.drv/coreaudio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/winecoreaudio.drv/coreaudio.c b/dlls/winecoreaudio.drv/coreaudio.c index e651eee5d3a..ee660b0887e 100644 --- a/dlls/winecoreaudio.drv/coreaudio.c +++ b/dlls/winecoreaudio.drv/coreaudio.c @@ -81,7 +81,9 @@ struct coreaudio_stream AudioConverterRef converter; AudioStreamBasicDescription dev_desc; /* audio unit format, not necessarily the same as fmt */ AudioDeviceID dev_id; + EDataFlow flow; + DWORD flags; AUDCLNT_SHAREMODE share; BOOL playing; @@ -663,6 +665,7 @@ static NTSTATUS unix_create_stream(void *args) stream->period_frames = muldiv(params->period, stream->fmt->nSamplesPerSec, 10000000); stream->dev_id = dev_id_from_device(params->device); stream->flow = params->flow; + stream->flags = params->flags; stream->share = params->share; stream->bufsize_frames = muldiv(params->duration, stream->fmt->nSamplesPerSec, 10000000);
1
0
0
0
Davide Beatrici : winecoreaudio: Retain precision when storing period in unixlib.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: 57dfaf1d0cb60cf6c930440ac96b84f45cda28da URL:
https://gitlab.winehq.org/wine/wine/-/commit/57dfaf1d0cb60cf6c930440ac96b84…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Sat Apr 8 04:32:42 2023 +0200 winecoreaudio: Retain precision when storing period in unixlib. --- dlls/winecoreaudio.drv/coreaudio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/winecoreaudio.drv/coreaudio.c b/dlls/winecoreaudio.drv/coreaudio.c index 073dacf4bad..e651eee5d3a 100644 --- a/dlls/winecoreaudio.drv/coreaudio.c +++ b/dlls/winecoreaudio.drv/coreaudio.c @@ -85,7 +85,8 @@ struct coreaudio_stream AUDCLNT_SHAREMODE share; BOOL playing; - UINT32 period_ms, period_frames; + REFERENCE_TIME period; + UINT32 period_frames; UINT32 bufsize_frames, resamp_bufsize_frames; UINT32 lcl_offs_frames, held_frames, wri_offs_frames, tmp_buffer_frames; UINT32 cap_bufsize_frames, cap_offs_frames, cap_held_frames; @@ -658,7 +659,7 @@ static NTSTATUS unix_create_stream(void *args) goto end; } - stream->period_ms = params->period / 10000; + stream->period = params->period; stream->period_frames = muldiv(params->period, stream->fmt->nSamplesPerSec, 10000000); stream->dev_id = dev_id_from_device(params->device); stream->flow = params->flow; @@ -1272,8 +1273,7 @@ static NTSTATUS unix_get_latency(void *args) latency += stream_latency; /* pretend we process audio in Period chunks, so max latency includes * the period time */ - *params->latency = muldiv(latency, 10000000, stream->fmt->nSamplesPerSec) - + stream->period_ms * 10000; + *params->latency = muldiv(latency, 10000000, stream->fmt->nSamplesPerSec) + stream->period; OSSpinLockUnlock(&stream->lock); params->result = S_OK;
1
0
0
0
Francois Gouget : iphlpapi: Fix the GAA_FLAG_INCLUDE_GATEWAYS constant name.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: 8d2146934ccce09b2db8fe6719ebc9c4da223335 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8d2146934ccce09b2db8fe6719ebc9…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri Apr 7 16:17:21 2023 +0200 iphlpapi: Fix the GAA_FLAG_INCLUDE_GATEWAYS constant name. --- dlls/iphlpapi/iphlpapi_main.c | 4 ++-- dlls/netprofm/list.c | 2 +- dlls/wbemprox/builtin.c | 4 ++-- dlls/wininet/internet.c | 2 +- include/iptypes.h | 2 +- programs/ipconfig/ipconfig.c | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 4afe3470630..d22209ff719 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -1018,7 +1018,7 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG luid = (family == AF_INET) ? &key4->luid : &key6->luid; if (luid->Value != aa->Luid.Value) continue; - if (flags & GAA_FLAG_INCLUDE_ALL_GATEWAYS) + if (flags & GAA_FLAG_INCLUDE_GATEWAYS) { memset( &sockaddr, 0, sizeof(sockaddr) ); if (family == AF_INET) @@ -1268,7 +1268,7 @@ static DWORD adapters_addresses_alloc( ULONG family, ULONG flags, IP_ADAPTER_ADD if (err) goto err; } - if (flags & (GAA_FLAG_INCLUDE_ALL_GATEWAYS | GAA_FLAG_INCLUDE_PREFIX)) + if (flags & (GAA_FLAG_INCLUDE_GATEWAYS | GAA_FLAG_INCLUDE_PREFIX)) { err = call_families( gateway_and_prefix_addresses_alloc, aa, family, flags ); if (err) goto err; diff --git a/dlls/netprofm/list.c b/dlls/netprofm/list.c index 3f10bcb8005..40e03cb94f7 100644 --- a/dlls/netprofm/list.c +++ b/dlls/netprofm/list.c @@ -1747,7 +1747,7 @@ static void init_networks( struct list_manager *mgr ) IP_ADAPTER_ADDRESSES *buf, *aa; GUID id; ULONG ret, flags = GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | - GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_INCLUDE_ALL_GATEWAYS; + GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_INCLUDE_GATEWAYS; list_init( &mgr->networks ); list_init( &mgr->connections ); diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 9cae1750b73..7c4e530a6d0 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -3086,11 +3086,11 @@ static enum fill_status fill_networkadapterconfig( struct table *table, const st DWORD size = 0, ret; enum fill_status status = FILL_STATUS_UNFILTERED; - ret = GetAdaptersAddresses( AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_GATEWAYS, NULL, NULL, &size ); + ret = GetAdaptersAddresses( AF_UNSPEC, GAA_FLAG_INCLUDE_GATEWAYS, NULL, NULL, &size ); if (ret != ERROR_BUFFER_OVERFLOW) return FILL_STATUS_FAILED; if (!(buffer = malloc( size ))) return FILL_STATUS_FAILED; - if (GetAdaptersAddresses( AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_GATEWAYS, NULL, buffer, &size )) + if (GetAdaptersAddresses( AF_UNSPEC, GAA_FLAG_INCLUDE_GATEWAYS, NULL, buffer, &size )) { free( buffer ); return FILL_STATUS_FAILED; diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 6dabb0fc5e3..6155d60938a 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -1221,7 +1221,7 @@ BOOL WINAPI InternetGetConnectedStateExW(LPDWORD lpdwStatus, LPWSTR lpszConnecti for (;;) { ULONG flags = GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER | - GAA_FLAG_SKIP_FRIENDLY_NAME | GAA_FLAG_INCLUDE_ALL_GATEWAYS; + GAA_FLAG_SKIP_FRIENDLY_NAME | GAA_FLAG_INCLUDE_GATEWAYS; ULONG errcode = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, buf, &size); if (errcode == ERROR_SUCCESS) diff --git a/include/iptypes.h b/include/iptypes.h index c1ee7322b01..d8609654748 100644 --- a/include/iptypes.h +++ b/include/iptypes.h @@ -325,7 +325,7 @@ typedef IP_ADAPTER_ADDRESSES_LH *PIP_ADAPTER_ADDRESSES; #define GAA_FLAG_INCLUDE_PREFIX 0x00000010 #define GAA_FLAG_SKIP_FRIENDLY_NAME 0x00000020 #define GAA_FLAG_INCLUDE_WINS_INFO 0x00000040 -#define GAA_FLAG_INCLUDE_ALL_GATEWAYS 0x00000080 +#define GAA_FLAG_INCLUDE_GATEWAYS 0x00000080 #define GAA_FLAG_INCLUDE_ALL_INTERFACES 0x00000100 #define GAA_FLAG_INCLUDE_ALL_COMPARTMENTS 0x00000200 #define GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER 0x00000400 diff --git a/programs/ipconfig/ipconfig.c b/programs/ipconfig/ipconfig.c index b787947885d..40324a0a493 100644 --- a/programs/ipconfig/ipconfig.c +++ b/programs/ipconfig/ipconfig.c @@ -145,14 +145,14 @@ static void print_basic_information(void) IP_ADAPTER_ADDRESSES *adapters; ULONG out = 0; - if (GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_GATEWAYS, + if (GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_GATEWAYS, NULL, NULL, &out) == ERROR_BUFFER_OVERFLOW) { adapters = HeapAlloc(GetProcessHeap(), 0, out); if (!adapters) exit(1); - if (GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_GATEWAYS, + if (GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_GATEWAYS, NULL, adapters, &out) == ERROR_SUCCESS) { IP_ADAPTER_ADDRESSES *p; @@ -293,14 +293,14 @@ static void print_full_information(void) HeapFree(GetProcessHeap(), 0, info); } - if (GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_GATEWAYS, + if (GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_GATEWAYS, NULL, NULL, &out) == ERROR_BUFFER_OVERFLOW) { adapters = HeapAlloc(GetProcessHeap(), 0, out); if (!adapters) exit(1); - if (GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_ALL_GATEWAYS, + if (GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_GATEWAYS, NULL, adapters, &out) == ERROR_SUCCESS) { IP_ADAPTER_ADDRESSES *p;
1
0
0
0
Zebediah Figura : tests: Add a test for readback map stability.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: vkd3d Branch: master Commit: 94ff9ba5e7963947406128cb2cf7a41e02692d08 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/94ff9ba5e7963947406128cb2cf7a…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Dec 8 19:57:04 2022 -0600 tests: Add a test for readback map stability. Resident Evil 2 accesses a resource immediately after unmapping it. --- tests/d3d12.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/tests/d3d12.c b/tests/d3d12.c index ac95fe47..8a7e6b30 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -36196,6 +36196,105 @@ static void test_clock_calibration(void) destroy_test_context(&context); } +static void test_readback_map_stability(void) +{ + D3D12_TEXTURE_COPY_LOCATION dst_location, src_location; + ID3D12GraphicsCommandList *command_list; + unsigned int width, height, row_pitch; + D3D12_RESOURCE_DESC resource_desc; + struct test_context context; + ID3D12CommandQueue *queue; + ID3D12Resource *buffer; + D3D12_RANGE read_range; + ID3D12Device *device; + void *data, *data2; + uint32_t colour; + HRESULT hr; + + static const float green[] = {0.0f, 1.0f, 0.0f, 1.0f}; + static const float blue[] = {0.0f, 0.0f, 1.0f, 1.0f}; + + if (!init_test_context(&context, NULL)) + return; + device = context.device; + queue = context.queue; + command_list = context.list; + + resource_desc = ID3D12Resource_GetDesc(context.render_target); + width = align(resource_desc.Width, format_block_width(resource_desc.Format)); + height = align(resource_desc.Height, format_block_height(resource_desc.Format)); + row_pitch = align(width * format_size(resource_desc.Format), D3D12_TEXTURE_DATA_PITCH_ALIGNMENT); + buffer = create_readback_buffer(device, row_pitch * height); + + dst_location.pResource = buffer; + dst_location.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT; + dst_location.PlacedFootprint.Offset = 0; + dst_location.PlacedFootprint.Footprint.Format = resource_desc.Format; + dst_location.PlacedFootprint.Footprint.Width = width; + dst_location.PlacedFootprint.Footprint.Height = height; + dst_location.PlacedFootprint.Footprint.Depth = 1; + dst_location.PlacedFootprint.Footprint.RowPitch = row_pitch; + + src_location.pResource = context.render_target; + src_location.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX; + src_location.SubresourceIndex = 0; + + read_range.Begin = 0; + read_range.End = row_pitch * height; + + ID3D12GraphicsCommandList_ClearRenderTargetView(context.list, context.rtv, green, 0, NULL); + transition_resource_state(command_list, context.render_target, + D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); + + ID3D12GraphicsCommandList_CopyTextureRegion(command_list, &dst_location, 0, 0, 0, &src_location, NULL); + + hr = ID3D12GraphicsCommandList_Close(command_list); + assert_that(hr == S_OK, "Failed to close command list, hr %#x.\n", hr); + exec_command_list(queue, command_list); + wait_queue_idle(device, queue); + + hr = ID3D12Resource_Map(buffer, 0, &read_range, &data); + assert_that(hr == S_OK, "Failed to map readback buffer, hr %#x.\n", hr); + + colour = *(uint32_t *)data; + ok(colour == 0xff00ff00, "Got colour %08x.\n", colour); + + ID3D12Resource_Unmap(buffer, 0, NULL); + + colour = *(uint32_t *)data; + ok(colour == 0xff00ff00, "Got colour %08x.\n", colour); + + reset_command_list(command_list, context.allocator); + transition_resource_state(command_list, context.render_target, + D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET); + + ID3D12GraphicsCommandList_ClearRenderTargetView(context.list, context.rtv, blue, 0, NULL); + transition_resource_state(command_list, context.render_target, + D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); + + ID3D12GraphicsCommandList_CopyTextureRegion(command_list, &dst_location, 0, 0, 0, &src_location, NULL); + + hr = ID3D12GraphicsCommandList_Close(command_list); + assert_that(hr == S_OK, "Failed to close command list, hr %#x.\n", hr); + exec_command_list(queue, command_list); + wait_queue_idle(device, queue); + + colour = *(uint32_t *)data; + ok(colour == 0xffff0000, "Got colour %08x.\n", colour); + + hr = ID3D12Resource_Map(buffer, 0, &read_range, &data2); + assert_that(hr == S_OK, "Failed to map readback buffer, hr %#x.\n", hr); + + ok(data2 == data, "Expected map pointer to be stable.\n"); + colour = *(uint32_t *)data2; + ok(colour == 0xffff0000, "Got colour %08x.\n", colour); + + ID3D12Resource_Unmap(buffer, 0, NULL); + + ID3D12Resource_Release(buffer); + destroy_test_context(&context); +} + START_TEST(d3d12) { parse_args(argc, argv); @@ -36373,4 +36472,5 @@ START_TEST(d3d12) run_test(test_unbounded_resource_arrays); run_test(test_unbounded_samplers); run_test(test_clock_calibration); + run_test(test_readback_map_stability); }
1
0
0
0
Philip Rebohle : vkd3d: Persistently map host-visible heaps on creation.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: vkd3d Branch: master Commit: c8a33431e3d610457426bd0a5b8561241009788c URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/c8a33431e3d610457426bd0a5b856…
Author: Philip Rebohle <philip.rebohle(a)tu-dortmund.de> Date: Thu Apr 16 23:15:05 2020 +0200 vkd3d: Persistently map host-visible heaps on creation. --- libs/vkd3d/resource.c | 216 ++++++++++++++++++++++---------------------------- 1 file changed, 94 insertions(+), 122 deletions(-)
1
0
0
0
Zhiyi Zhang : wined3d: Add GPU information for AMD Raphael.
by Alexandre Julliard
07 Apr '23
07 Apr '23
Module: wine Branch: master Commit: 9909631f23c037e90fe3ef1ccfeebfff2804d7ed URL:
https://gitlab.winehq.org/wine/wine/-/commit/9909631f23c037e90fe3ef1ccfeebf…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Thu Apr 6 18:15:58 2023 +0800 wined3d: Add GPU information for AMD Raphael. --- dlls/wined3d/directx.c | 1 + dlls/wined3d/wined3d_private.h | 1 + 2 files changed, 2 insertions(+) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 8f719cd605e..b77c1f4e133 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -540,6 +540,7 @@ static const struct wined3d_gpu_description gpu_description_table[] = {HW_VENDOR_AMD, CARD_AMD_RADEON_PRO_V620, "Radeon Pro V620", DRIVER_AMD_RX, 32768}, {HW_VENDOR_AMD, CARD_AMD_RADEON_PRO_V620_VF, "Radeon Pro V620 VF", DRIVER_AMD_RX, 32768}, {HW_VENDOR_AMD, CARD_AMD_VANGOGH, "AMD VANGOGH", DRIVER_AMD_RX, 4096}, + {HW_VENDOR_AMD, CARD_AMD_RAPHAEL, "AMD Radeon(TM) Graphics", DRIVER_AMD_RX, 4096}, /* Red Hat */ {HW_VENDOR_REDHAT, CARD_REDHAT_VIRGL, "Red Hat VirtIO GPU", DRIVER_REDHAT_VIRGL, 1024}, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f808852ffef..0309c997751 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3085,6 +3085,7 @@ enum wined3d_pci_device CARD_AMD_RADEON_PRO_V620 = 0x73a1, CARD_AMD_RADEON_PRO_V620_VF = 0x73ae, CARD_AMD_VANGOGH = 0x163f, + CARD_AMD_RAPHAEL = 0x164e, CARD_NVIDIA_RIVA_128 = 0x0018, CARD_NVIDIA_RIVA_TNT = 0x0020,
1
0
0
0
Jacek Caban : winevulkan: Add support for VK_KHR_map_memory2.
by Alexandre Julliard
07 Apr '23
07 Apr '23
Module: wine Branch: master Commit: 0a56a4ada251cd1071acfbbf64a28ec4afdd28c3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/0a56a4ada251cd1071acfbbf64a28e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Apr 7 18:25:05 2023 +0200 winevulkan: Add support for VK_KHR_map_memory2. --- dlls/winevulkan/loader_thunks.c | 25 ++++++++++ dlls/winevulkan/loader_thunks.h | 17 +++++++ dlls/winevulkan/make_vulkan | 3 +- dlls/winevulkan/vulkan.c | 62 ++++++++++++++++++++--- dlls/winevulkan/vulkan_thunks.c | 108 ++++++++++++++++++++++++++++++++++++++++ dlls/winevulkan/vulkan_thunks.h | 6 +++ include/wine/vulkan.h | 26 ++++++++++ 7 files changed, 239 insertions(+), 8 deletions(-)
1
0
0
0
Vijay Kiran Kamuju : msvcp110: Add std::_Rethrow_future_exception implementation.
by Alexandre Julliard
07 Apr '23
07 Apr '23
Module: wine Branch: master Commit: 389fbcf961732528d8cc4351e299256ae5782b96 URL:
https://gitlab.winehq.org/wine/wine/-/commit/389fbcf961732528d8cc4351e29925…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Sat Apr 1 11:23:41 2023 +0000 msvcp110: Add std::_Rethrow_future_exception implementation. --- dlls/msvcp110/msvcp110.spec | 2 +- dlls/msvcp120/msvcp120.spec | 2 +- dlls/msvcp120_app/msvcp120_app.spec | 2 +- dlls/msvcp140/msvcp140.spec | 2 +- dlls/msvcp90/exception.c | 53 +++++++++++++++++++++++-------------- dlls/msvcp_win/msvcp_win.spec | 2 +- 6 files changed, 38 insertions(+), 25 deletions(-) diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec index 2de95bf94ef..074ca946b19 100644 --- a/dlls/msvcp110/msvcp110.spec +++ b/dlls/msvcp110/msvcp110.spec @@ -1732,7 +1732,7 @@ @ cdecl -arch=win64 ?_Rep@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@G_K@Z(ptr ptr ptr long long) num_put_wchar__Rep @ cdecl -arch=win32 ?_Rep@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@_WI@Z(ptr ptr long ptr long long) num_put_wchar__Rep @ cdecl -arch=win64 ?_Rep@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@_W_K@Z(ptr ptr ptr long long) num_put_wchar__Rep -@ stub ?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z +@ cdecl -norelay ?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z() _Rethrow_future_exception @ stub -arch=win32 ?_Rng_abort@std@@YAXPBD@Z @ stub -arch=win64 ?_Rng_abort@std@@YAXPEBD@Z @ cdecl -arch=win32 ?_Segment_index_of@_Concurrent_vector_base_v4@details@Concurrency@@KAII@Z(long) _vector_base_v4__Segment_index_of diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec index e0adc83113f..0d2a5fe0fca 100644 --- a/dlls/msvcp120/msvcp120.spec +++ b/dlls/msvcp120/msvcp120.spec @@ -1693,7 +1693,7 @@ @ cdecl -arch=win64 ?_Rep@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@G_K@Z(ptr ptr ptr long long) num_put_wchar__Rep @ cdecl -arch=win32 ?_Rep@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@_WI@Z(ptr ptr long ptr long long) num_put_wchar__Rep @ cdecl -arch=win64 ?_Rep@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@_W_K@Z(ptr ptr ptr long long) num_put_wchar__Rep -@ stub ?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z +@ cdecl -norelay ?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z() _Rethrow_future_exception @ stub -arch=win32 ?_Rng_abort@std@@YAXPBD@Z @ stub -arch=win64 ?_Rng_abort@std@@YAXPEBD@Z @ cdecl -arch=win32 ?_Segment_index_of@_Concurrent_vector_base_v4@details@Concurrency@@KAII@Z(long) _vector_base_v4__Segment_index_of diff --git a/dlls/msvcp120_app/msvcp120_app.spec b/dlls/msvcp120_app/msvcp120_app.spec index dd8e3ebf173..d11ba788898 100644 --- a/dlls/msvcp120_app/msvcp120_app.spec +++ b/dlls/msvcp120_app/msvcp120_app.spec @@ -1693,7 +1693,7 @@ @ cdecl -arch=win64 ?_Rep@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@G_K@Z(ptr ptr ptr long long) msvcp120.?_Rep@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@G_K@Z @ cdecl -arch=win32 ?_Rep@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@_WI@Z(ptr ptr long ptr long long) msvcp120.?_Rep@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@_WI@Z @ cdecl -arch=win64 ?_Rep@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@_W_K@Z(ptr ptr ptr long long) msvcp120.?_Rep@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@_W_K@Z -@ stub ?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z +@ cdecl -norelay ?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z() msvcp120.?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z @ stub -arch=win32 ?_Rng_abort@std@@YAXPBD@Z @ stub -arch=win64 ?_Rng_abort@std@@YAXPEBD@Z @ cdecl -arch=win32 ?_Segment_index_of@_Concurrent_vector_base_v4@details@Concurrency@@KAII@Z(long) msvcp120.?_Segment_index_of@_Concurrent_vector_base_v4@details@Concurrency@@KAII@Z diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index dd619c637e1..8e57b828182 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -1595,7 +1595,7 @@ @ cdecl -arch=arm ?_Reset@_ContextCallback@details@Concurrency@@AAAXXZ(ptr) _ContextCallback__Reset @ thiscall -arch=i386 ?_Reset@_ContextCallback@details@Concurrency@@AAEXXZ(ptr) _ContextCallback__Reset @ cdecl -arch=win64 ?_Reset@_ContextCallback@details@Concurrency@@AEAAXXZ(ptr) _ContextCallback__Reset -@ stub ?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z +@ cdecl -norelay ?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z() _Rethrow_future_exception @ stub -arch=win32 ?_Rng_abort@std@@YAXPBD@Z @ stub -arch=win64 ?_Rng_abort@std@@YAXPEBD@Z @ cdecl -arch=win32 ?_Schedule_chore@details@Concurrency@@YAHPAU_Threadpool_chore@12@@Z(ptr) _Schedule_chore diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 8ceaa91e884..66a5061a4f0 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -947,6 +947,38 @@ bool __cdecl MSVCP__uncaught_exception(void) return __uncaught_exception(); } +#if _MSVCP_VER >= 110 +typedef struct +{ + EXCEPTION_RECORD *rec; + LONG *ref; /* not binary compatible with native */ +} exception_ptr; + +static void exception_ptr_rethrow(const exception_ptr *ep) +{ + TRACE("(%p)\n", ep); + + if (!ep->rec) + { + static const char *exception_msg = "bad exception"; + exception e; + + MSVCP_exception_ctor(&e, &exception_msg); + _CxxThrowException(&e, &exception_cxx_type); + return; + } + + RaiseException(ep->rec->ExceptionCode, ep->rec->ExceptionFlags & (~EH_UNWINDING), + ep->rec->NumberParameters, ep->rec->ExceptionInformation); +} + +/* ?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z */ +void __cdecl _Rethrow_future_exception(const exception_ptr ep) +{ + exception_ptr_rethrow(&ep); +} +#endif + #if _MSVCP_VER >= 140 void** CDECL __current_exception(void); @@ -1002,12 +1034,6 @@ int __cdecl __uncaught_exceptions(void) return *__processing_throw(); } -typedef struct -{ - EXCEPTION_RECORD *rec; - LONG *ref; /* not binary compatible with native */ -} exception_ptr; - /********************************************************************* * ?__ExceptionPtrCreate@@YAXPAX@Z * ?__ExceptionPtrCreate@@YAXPEAX@Z @@ -1102,20 +1128,7 @@ void __cdecl __ExceptionPtrAssign(exception_ptr *ep, const exception_ptr *assign */ void __cdecl __ExceptionPtrRethrow(const exception_ptr *ep) { - TRACE("(%p)\n", ep); - - if (!ep->rec) - { - static const char *exception_msg = "bad exception"; - exception e; - - MSVCP_exception_ctor(&e, &exception_msg); - _CxxThrowException(&e, &exception_cxx_type); - return; - } - - RaiseException(ep->rec->ExceptionCode, ep->rec->ExceptionFlags & (~EH_UNWINDING), - ep->rec->NumberParameters, ep->rec->ExceptionInformation); + exception_ptr_rethrow(ep); } /********************************************************************* diff --git a/dlls/msvcp_win/msvcp_win.spec b/dlls/msvcp_win/msvcp_win.spec index d2fae9f1e14..0e05582e251 100644 --- a/dlls/msvcp_win/msvcp_win.spec +++ b/dlls/msvcp_win/msvcp_win.spec @@ -1595,7 +1595,7 @@ @ cdecl -arch=arm ?_Reset@_ContextCallback@details@Concurrency@@AAAXXZ(ptr) msvcp140.?_Reset@_ContextCallback@details@Concurrency@@AAAXXZ @ thiscall -arch=i386 ?_Reset@_ContextCallback@details@Concurrency@@AAEXXZ(ptr) msvcp140.?_Reset@_ContextCallback@details@Concurrency@@AAEXXZ @ cdecl -arch=win64 ?_Reset@_ContextCallback@details@Concurrency@@AEAAXXZ(ptr) msvcp140.?_Reset@_ContextCallback@details@Concurrency@@AEAAXXZ -@ stub ?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z +@ cdecl -norelay ?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z() msvcp140.?_Rethrow_future_exception@std@@YAXVexception_ptr@1@@Z @ stub -arch=win32 ?_Rng_abort@std@@YAXPBD@Z @ stub -arch=win64 ?_Rng_abort@std@@YAXPEBD@Z @ cdecl -arch=win32 ?_Schedule_chore@details@Concurrency@@YAHPAU_Threadpool_chore@12@@Z(ptr) msvcp140.?_Schedule_chore@details@Concurrency@@YAHPAU_Threadpool_chore@12@@Z
1
0
0
0
Francois Gouget : kernel32/tests: Improve the WideCharToMultiByte() null-termination and truncation tests.
by Alexandre Julliard
07 Apr '23
07 Apr '23
Module: wine Branch: master Commit: 11934d2c92ad645cad739640a52151fbb112269b URL:
https://gitlab.winehq.org/wine/wine/-/commit/11934d2c92ad645cad739640a52151…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri Apr 7 15:52:37 2023 +0200 kernel32/tests: Improve the WideCharToMultiByte() null-termination and truncation tests. Check the content of the output buffer in addition to checking the return value. Also show that multibyte characters are not truncated when the output buffer is too small. --- dlls/kernel32/tests/codepage.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/dlls/kernel32/tests/codepage.c b/dlls/kernel32/tests/codepage.c index 0a5185d1804..08d2514e3e4 100644 --- a/dlls/kernel32/tests/codepage.c +++ b/dlls/kernel32/tests/codepage.c @@ -54,6 +54,7 @@ static void test_destination_buffer(void) len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buffer, needed+1, NULL, NULL); ok( (len > 0), "returned %d with %lu and '%s' (expected '> 0')\n", len, GetLastError(), buffer); + ok(!lstrcmpA(buffer, "foobar"), "expected \"foobar\" got \"%s\"\n", buffer); memset(buffer, 'x', maxsize); buffer[maxsize] = '\0'; @@ -61,6 +62,7 @@ static void test_destination_buffer(void) len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buffer, needed, NULL, NULL); ok( (len > 0), "returned %d with %lu and '%s' (expected '> 0')\n", len, GetLastError(), buffer); + ok(!lstrcmpA(buffer, "foobar"), "expected \"foobar\" got \"%s\"\n", buffer); memset(buffer, 'x', maxsize); buffer[maxsize] = '\0'; @@ -69,6 +71,8 @@ static void test_destination_buffer(void) ok( !len && (GetLastError() == ERROR_INSUFFICIENT_BUFFER), "returned %d with %lu and '%s' (expected '0' with " "ERROR_INSUFFICIENT_BUFFER)\n", len, GetLastError(), buffer); + ok(!strncmp(buffer, "foobar", 6), "expected \"foobar\" got \"%s\"\n", buffer); + ok(buffer[6] == 'x', "expected buf[5]=='x', got \"%s\"\n", buffer); memset(buffer, 'x', maxsize); buffer[maxsize] = '\0'; @@ -77,6 +81,8 @@ static void test_destination_buffer(void) ok( !len && (GetLastError() == ERROR_INSUFFICIENT_BUFFER), "returned %d with %lu and '%s' (expected '0' with " "ERROR_INSUFFICIENT_BUFFER)\n", len, GetLastError(), buffer); + ok(buffer[0] == 'f', "expected buf[1]=='f', got \"%s\"\n", buffer); + ok(buffer[1] == 'x', "expected buf[1]=='x', got \"%s\"\n", buffer); SetLastError(0xdeadbeef); len = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, buffer, 0, NULL, NULL); @@ -428,6 +434,23 @@ static void test_string_conversion(LPBOOL bUsedDefaultChar) ok(!strcmp(mbs, "\xf3\xe7\x3d\xa3\xbf\xa3\xbf\xa3\xbf"), "mbs is %s\n", mbs); if(bUsedDefaultChar) ok(*bUsedDefaultChar == TRUE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); + /* Show that characters are not truncated */ + ZeroMemory(mbs, 5); + ret = WideCharToMultiByte(936, 0, dbwcs2, -1, mbs, 1, (const char *)default_char, bUsedDefaultChar); + ok(!ret, "ret is %d\n", ret); + ok(mbs[0] == '\0', "mbs is %s\n", mbs); + if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() is %lu\n", GetLastError()); + + /* And destination is not null-terminated even when too short */ + FillMemory(mbs, 5, 'x'); + mbs[5] = '\0'; + ret = WideCharToMultiByte(936, 0, dbwcs2, -1, mbs, 2, (const char *)default_char, bUsedDefaultChar); + ok(!ret, "ret is %d\n", ret); + ok(!strcmp(mbs, "\xf3\xe7""xxx"), "mbs is %s\n", mbs); + if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() is %lu\n", GetLastError()); + /* Length-only tests */ SetLastError(0xdeadbeef); ret = WideCharToMultiByte(1252, 0, &wc2, 1, NULL, 0, NULL, bUsedDefaultChar);
1
0
0
0
← Newer
1
...
55
56
57
58
59
60
61
...
82
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
Results per page:
10
25
50
100
200