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
November 2019
----- 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
895 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Initialize the system and user locales directly in ntdll.
by Alexandre Julliard
20 Nov '19
20 Nov '19
Module: wine Branch: master Commit: f1bfd2c0b11844b9d50905d5c424c71473f281da URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f1bfd2c0b11844b9d50905d5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 20 09:56:25 2019 +0100 ntdll: Initialize the system and user locales directly in ntdll. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/locale.c | 4 -- dlls/ntdll/locale.c | 162 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+), 4 deletions(-) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index b2a5831a9e..4126589220 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -3555,10 +3555,6 @@ void LOCALE_Init(void) setup_unix_locales(); if (!lcid_LC_MESSAGES) lcid_LC_MESSAGES = lcid_LC_CTYPE; - NtSetDefaultUILanguage( LANGIDFROMLCID(lcid_LC_MESSAGES) ); - NtSetDefaultLocale( TRUE, lcid_LC_MESSAGES ); - NtSetDefaultLocale( FALSE, lcid_LC_CTYPE ); - ansi_cp = get_lcid_codepage( LOCALE_USER_DEFAULT ); GetLocaleInfoW( LOCALE_USER_DEFAULT, LOCALE_IDEFAULTMACCODEPAGE | LOCALE_RETURN_NUMBER, (LPWSTR)&mac_cp, sizeof(mac_cp)/sizeof(WCHAR) ); diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c index 73f72b1986..27e38d6e40 100644 --- a/dlls/ntdll/locale.c +++ b/dlls/ntdll/locale.c @@ -27,6 +27,11 @@ #include <string.h> #include <stdlib.h> +#ifdef __APPLE__ +# include <CoreFoundation/CFLocale.h> +# include <CoreFoundation/CFString.h> +#endif + #include "ntstatus.h" #define WIN32_NO_STATUS #include "ntdll_misc.h" @@ -165,10 +170,167 @@ void init_unix_codepage(void) { } #endif /* __APPLE__ || __ANDROID__ */ +/* Unix format is: lang[_country][.charset][@modifier] + * Windows format is: lang[-script][-country][_modifier] */ +static LCID unix_locale_to_lcid( const char *unix_name ) +{ + static const WCHAR sepW[] = {'_','.','@',0}; + static const WCHAR posixW[] = {'P','O','S','I','X',0}; + static const WCHAR cW[] = {'C',0}; + static const WCHAR euroW[] = {'e','u','r','o',0}; + static const WCHAR latinW[] = {'l','a','t','i','n',0}; + static const WCHAR latnW[] = {'-','L','a','t','n',0}; + WCHAR buffer[LOCALE_NAME_MAX_LENGTH], win_name[LOCALE_NAME_MAX_LENGTH]; + WCHAR *p, *country = NULL, *modifier = NULL; + LCID lcid; + + if (!unix_name || !unix_name[0] || !strcmp( unix_name, "C" )) + { + unix_name = getenv( "LC_ALL" ); + if (!unix_name || !unix_name[0]) return 0; + } + + if (ntdll_umbstowcs( 0, unix_name, strlen(unix_name) + 1, buffer, ARRAY_SIZE(buffer) ) < 0) return 0; + + if (!(p = strpbrkW( buffer, sepW ))) + { + if (!strcmpW( buffer, posixW ) || !strcmpW( buffer, cW )) + return MAKELCID( MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT), SORT_DEFAULT ); + strcpyW( win_name, buffer ); + } + else + { + if (*p == '_') + { + *p++ = 0; + country = p; + p = strpbrkW( p, sepW + 1 ); + } + if (p && *p == '.') + { + *p++ = 0; + /* charset, ignore */ + p = strchrW( p, '@' ); + } + if (p) + { + *p++ = 0; + modifier = p; + } + } + + /* rebuild a Windows name */ + + strcpyW( win_name, buffer ); + if (modifier) + { + if (!strcmpW( modifier, latinW )) strcatW( win_name, latnW ); + else if (!strcmpW( modifier, euroW )) {} /* ignore */ + else return 0; + } + if (country) + { + p = win_name + strlenW(win_name); + *p++ = '-'; + strcpyW( p, country ); + } + + if (!RtlLocaleNameToLcid( win_name, &lcid, 0 )) return lcid; + + /* try neutral name */ + if (country) + { + p[-1] = 0; + if (!RtlLocaleNameToLcid( win_name, &lcid, 2 )) + { + if (SUBLANGID(lcid) == SUBLANG_NEUTRAL) + lcid = MAKELANGID( PRIMARYLANGID(lcid), SUBLANG_DEFAULT ); + return lcid; + } + } + return 0; +} + +/****************************************************************** + * init_locale + */ void init_locale( HMODULE module ) { + LCID system_lcid, user_lcid; + kernel32_handle = module; + + setlocale( LC_ALL, "" ); + + system_lcid = unix_locale_to_lcid( setlocale( LC_CTYPE, NULL )); + user_lcid = unix_locale_to_lcid( setlocale( LC_MESSAGES, NULL )); + +#ifdef __APPLE__ + if (!system_lcid) + { + char buffer[LOCALE_NAME_MAX_LENGTH]; + + CFLocaleRef locale = CFLocaleCopyCurrent(); + CFStringRef lang = CFLocaleGetValue( locale, kCFLocaleLanguageCode ); + CFStringRef country = CFLocaleGetValue( locale, kCFLocaleCountryCode ); + CFStringRef locale_string; + + if (country) + locale_string = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@_%@"), lang, country); + else + locale_string = CFStringCreateCopy(NULL, lang); + + CFStringGetCString(locale_string, buffer, sizeof(buffer), kCFStringEncodingUTF8); + system_lcid = unix_locale_to_lcid( buffer ); + CFRelease(locale); + CFRelease(locale_string); + } + if (!user_lcid) + { + /* Retrieve the preferred language as chosen in System Preferences. */ + char buffer[LOCALE_NAME_MAX_LENGTH]; + CFArrayRef preferred_langs = CFLocaleCopyPreferredLanguages(); + if (preferred_langs && CFArrayGetCount( preferred_langs )) + { + CFStringRef preferred_lang = CFArrayGetValueAtIndex( preferred_langs, 0 ); + CFDictionaryRef components = CFLocaleCreateComponentsFromLocaleIdentifier( NULL, preferred_lang ); + if (components) + { + CFStringRef lang = CFDictionaryGetValue( components, kCFLocaleLanguageCode ); + CFStringRef country = CFDictionaryGetValue( components, kCFLocaleCountryCode ); + CFLocaleRef locale = NULL; + CFStringRef locale_string; + + if (!country) + { + locale = CFLocaleCopyCurrent(); + country = CFLocaleGetValue( locale, kCFLocaleCountryCode ); + } + if (country) + locale_string = CFStringCreateWithFormat( NULL, NULL, CFSTR("%@_%@"), lang, country ); + else + locale_string = CFStringCreateCopy( NULL, lang ); + CFStringGetCString( locale_string, buffer, sizeof(buffer), kCFStringEncodingUTF8 ); + CFRelease( locale_string ); + if (locale) CFRelease( locale ); + CFRelease( components ); + user_lcid = unix_locale_to_lcid( buffer ); + } + } + if (preferred_langs) CFRelease( preferred_langs ); + } +#endif + + if (!system_lcid) system_lcid = MAKELCID( MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT), SORT_DEFAULT ); + if (!user_lcid) user_lcid = system_lcid; + + NtSetDefaultUILanguage( LANGIDFROMLCID(user_lcid) ); + NtSetDefaultLocale( TRUE, user_lcid ); + NtSetDefaultLocale( FALSE, system_lcid ); + TRACE( "system=%04x user=%04x\n", system_lcid, user_lcid ); + + setlocale( LC_NUMERIC, "C" ); /* FIXME: oleaut32 depends on this */ }
1
0
0
0
Alexandre Julliard : ntdll: Fix counting of environment strings.
by Alexandre Julliard
20 Nov '19
20 Nov '19
Module: wine Branch: master Commit: 599deed91cc6a91fa83072ac21d8516a4647e174 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=599deed91cc6a91fa83072ac…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 20 16:24:49 2019 +0100 ntdll: Fix counting of environment strings. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=48141
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index 6c7ca1e499..79a1805618 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -526,7 +526,7 @@ char **build_envp( const WCHAR *envW ) if (!(env = RtlAllocateHeap( GetProcessHeap(), 0, length ))) return NULL; ntdll_wcstoumbs( 0, envW, lenW, env, length, NULL, NULL ); - for (p = env; *p; p += strlen(p) + 1) + for (p = env; *p; p += strlen(p) + 1, count++) if (is_special_env_var( p )) length += 4; /* prefix it with "WINE" */ for (i = 0; i < ARRAY_SIZE( unix_vars ); i++)
1
0
0
0
Nikolay Sivov : strmbase: Remove unused function.
by Alexandre Julliard
20 Nov '19
20 Nov '19
Module: wine Branch: master Commit: 462d8ae419b7d9944ddaae1e411612e8fd961f36 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=462d8ae419b7d9944ddaae1e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Nov 19 10:35:01 2019 +0300 strmbase: Remove unused function. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/strmbase/transform.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index e567804ba3..12a99eef67 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -29,11 +29,6 @@ static const WCHAR wcsOutputPinName[] = {'O','u','t',0}; static const IPinVtbl TransformFilter_InputPin_Vtbl; static const IPinVtbl TransformFilter_OutputPin_Vtbl; -static inline TransformFilter *impl_from_IBaseFilter( IBaseFilter *iface ) -{ - return CONTAINING_RECORD(iface, TransformFilter, filter.IBaseFilter_iface); -} - static inline TransformFilter *impl_from_strmbase_filter(struct strmbase_filter *iface) { return CONTAINING_RECORD(iface, TransformFilter, filter);
1
0
0
0
Zebediah Figura : qedit/samplegrabber: Reimplement the sink pin over the strmbase sink.
by Alexandre Julliard
20 Nov '19
20 Nov '19
Module: wine Branch: master Commit: 95f33d68d38d38bca3271472c3a9e3f836742a7f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=95f33d68d38d38bca3271472…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Nov 19 20:18:03 2019 -0600 qedit/samplegrabber: Reimplement the sink pin over the strmbase sink. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qedit/samplegrabber.c | 535 +++++++-------------------------------- dlls/qedit/tests/samplegrabber.c | 3 +- 2 files changed, 88 insertions(+), 450 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=95f33d68d38d38bca327…
1
0
0
0
Zebediah Figura : strmbase: Get rid of the BaseInputPinFuncTable typedef.
by Alexandre Julliard
20 Nov '19
20 Nov '19
Module: wine Branch: master Commit: e438824ab33e42aeaff3f765f436d7fc8682d806 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e438824ab33e42aeaff3f765…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Nov 19 20:18:02 2019 -0600 strmbase: Get rid of the BaseInputPinFuncTable typedef. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qcap/avico.c | 4 ++-- dlls/qcap/avimux.c | 5 ++--- dlls/qcap/smartteefilter.c | 5 ++--- dlls/strmbase/pin.c | 2 +- dlls/strmbase/renderer.c | 4 ++-- dlls/strmbase/transform.c | 4 ++-- include/wine/strmbase.h | 9 +++++---- 7 files changed, 16 insertions(+), 17 deletions(-) diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 9b32ddb336..1cbeb70f03 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -499,7 +499,7 @@ static HRESULT WINAPI AVICompressorIn_Receive(struct strmbase_sink *base, IMedia return hres; } -static const BaseInputPinFuncTable AVICompressorBaseInputPinVtbl = +static const struct strmbase_sink_ops sink_ops = { .base.pin_query_accept = sink_query_accept, .base.pin_get_media_type = strmbase_pin_get_media_type, @@ -597,7 +597,7 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr) compressor->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl; strmbase_sink_init(&compressor->sink, &AVICompressorInputPinVtbl, - &compressor->filter, sink_name, &AVICompressorBaseInputPinVtbl, NULL); + &compressor->filter, sink_name, &sink_ops, NULL); strmbase_source_init(&compressor->source, &AVICompressorOutputPinVtbl, &compressor->filter, source_name, &source_ops); diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index 0e162dfcde..51a1a503af 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -1483,7 +1483,7 @@ static HRESULT WINAPI AviMuxIn_Receive(struct strmbase_sink *base, IMediaSample return hr; } -static const BaseInputPinFuncTable AviMuxIn_BaseInputFuncTable = +static const struct strmbase_sink_ops sink_ops = { .base.pin_query_accept = sink_query_accept, .base.pin_get_media_type = strmbase_pin_get_media_type, @@ -1944,8 +1944,7 @@ static HRESULT create_input_pin(AviMux *avimux) if (!(object = heap_alloc_zero(sizeof(*object)))) return E_OUTOFMEMORY; - strmbase_sink_init(&object->pin, &AviMuxIn_PinVtbl, &avimux->filter, name, - &AviMuxIn_BaseInputFuncTable, NULL); + strmbase_sink_init(&object->pin, &AviMuxIn_PinVtbl, &avimux->filter, name, &sink_ops, NULL); object->pin.IMemInputPin_iface.lpVtbl = &AviMuxIn_MemInputPinVtbl; object->IAMStreamControl_iface.lpVtbl = &AviMuxIn_AMStreamControlVtbl; object->IPropertyBag_iface.lpVtbl = &AviMuxIn_PropertyBagVtbl; diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index be19fd5c09..e3740bed13 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -285,7 +285,7 @@ static HRESULT WINAPI SmartTeeFilterInput_Receive(struct strmbase_sink *base, IM return hrPreview; } -static const BaseInputPinFuncTable SmartTeeFilterInputFuncs = +static const struct strmbase_sink_ops sink_ops = { .base.pin_query_accept = sink_query_accept, .base.pin_get_media_type = sink_get_media_type, @@ -418,8 +418,7 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr) memset(object, 0, sizeof(*object)); strmbase_filter_init(&object->filter, &SmartTeeFilterVtbl, outer, &CLSID_SmartTee, &filter_ops); - strmbase_sink_init(&object->sink, &SmartTeeFilterInputVtbl, &object->filter, - inputW, &SmartTeeFilterInputFuncs, NULL); + strmbase_sink_init(&object->sink, &SmartTeeFilterInputVtbl, &object->filter, inputW, &sink_ops, NULL); hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER, &IID_IMemAllocator, (void **)&object->sink.pAllocator); if (FAILED(hr)) diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 39512c066b..92a2fe55b9 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -1001,7 +1001,7 @@ static const IMemInputPinVtbl MemInputPin_Vtbl = }; void strmbase_sink_init(struct strmbase_sink *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter, - const WCHAR *name, const BaseInputPinFuncTable *func_table, IMemAllocator *allocator) + const WCHAR *name, const struct strmbase_sink_ops *func_table, IMemAllocator *allocator) { memset(pin, 0, sizeof(*pin)); pin->pin.IPin_iface.lpVtbl = vtbl; diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 2e8566b064..0c33b5ea84 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -302,7 +302,7 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp return BaseRendererImpl_Receive(filter, sample); } -static const BaseInputPinFuncTable input_BaseInputFuncTable = +static const struct strmbase_sink_ops sink_ops = { .base.pin_query_accept = sink_query_accept, .base.pin_query_interface = sink_query_interface, @@ -511,7 +511,7 @@ HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown filter->pFuncsTable = ops; strmbase_sink_init(&filter->sink, &BaseRenderer_InputPin_Vtbl, &filter->filter, - sink_name, &input_BaseInputFuncTable, NULL); + sink_name, &sink_ops, NULL); hr = CreatePosPassThru(outer ? outer : (IUnknown *)&filter->filter.IBaseFilter_iface, TRUE, &filter->sink.pin.IPin_iface, &filter->pPosition); diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index 3811569da1..e567804ba3 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -210,7 +210,7 @@ static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void return S_OK; } -static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = +static const struct strmbase_sink_ops sink_ops = { .base.pin_query_accept = sink_query_accept, .base.pin_get_media_type = strmbase_pin_get_media_type, @@ -353,7 +353,7 @@ static HRESULT strmbase_transform_init(IUnknown *outer, const CLSID *clsid, ZeroMemory(&filter->pmt, sizeof(filter->pmt)); strmbase_sink_init(&filter->sink, &TransformFilter_InputPin_Vtbl, &filter->filter, - wcsInputPinName, &tf_input_BaseInputFuncTable, NULL); + wcsInputPinName, &sink_ops, NULL); strmbase_source_init(&filter->source, &TransformFilter_OutputPin_Vtbl, &filter->filter, wcsOutputPinName, &source_ops); diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 99c579f8df..fd79e9726d 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -84,16 +84,17 @@ struct strmbase_sink BOOL flushing, end_of_stream; IMemAllocator *preferred_allocator; - const struct BaseInputPinFuncTable *pFuncsTable; + const struct strmbase_sink_ops *pFuncsTable; }; typedef HRESULT (WINAPI *BaseInputPin_Receive)(struct strmbase_sink *This, IMediaSample *pSample); -typedef struct BaseInputPinFuncTable { +struct strmbase_sink_ops +{ BasePinFuncTable base; /* Optional */ BaseInputPin_Receive pfnReceive; -} BaseInputPinFuncTable; +}; /* Base Pin */ HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt); @@ -143,7 +144,7 @@ HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface); HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); void strmbase_sink_init(struct strmbase_sink *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter, - const WCHAR *name, const BaseInputPinFuncTable *func_table, IMemAllocator *allocator); + const WCHAR *name, const struct strmbase_sink_ops *ops, IMemAllocator *allocator); void strmbase_sink_cleanup(struct strmbase_sink *pin); struct strmbase_filter
1
0
0
0
Zebediah Figura : strmbase: Get rid of the BaseInputPin typedef.
by Alexandre Julliard
20 Nov '19
20 Nov '19
Module: wine Branch: master Commit: 580ca7557dcdebf854383411cae44f3d047cc867 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=580ca7557dcdebf854383411…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Nov 19 20:18:01 2019 -0600 strmbase: Get rid of the BaseInputPin typedef. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/amstream/ddrawstream.c | 7 ------- dlls/qcap/avico.c | 4 ++-- dlls/qcap/avimux.c | 7 +++---- dlls/qcap/smartteefilter.c | 4 ++-- dlls/strmbase/pin.c | 40 +++++++++++++++++++--------------------- dlls/strmbase/renderer.c | 2 +- dlls/strmbase/transform.c | 2 +- include/wine/strmbase.h | 14 +++++++------- 8 files changed, 35 insertions(+), 45 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=580ca7557dcdebf85438…
1
0
0
0
Zebediah Figura : qedit/samplegrabber: Reimplement the source pin over the strmbase source.
by Alexandre Julliard
20 Nov '19
20 Nov '19
Module: wine Branch: master Commit: 2c8e152ff06ae3e460276401b4b6bdaa1ffc676d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2c8e152ff06ae3e460276401…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Nov 19 20:18:00 2019 -0600 qedit/samplegrabber: Reimplement the source pin over the strmbase source. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qedit/samplegrabber.c | 239 +++++++++++++++++---------------------- dlls/qedit/tests/samplegrabber.c | 1 + 2 files changed, 104 insertions(+), 136 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=2c8e152ff06ae3e46027…
1
0
0
0
Jeff Smith : msvcrt: Correct behavior of strftime formats %c %x.
by Alexandre Julliard
20 Nov '19
20 Nov '19
Module: wine Branch: master Commit: 8bee5d85d805a735dd7940e6fd805ac22fd5e662 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8bee5d85d805a735dd7940e6…
Author: Jeff Smith <whydoubt(a)gmail.com> Date: Tue Nov 19 23:15:01 2019 +0100 msvcrt: Correct behavior of strftime formats %c %x. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/tests/time.c | 48 +++++++-------- dlls/msvcrt/time.c | 150 +++++++++++++++++++++++++++++++-------------- dlls/ucrtbase/tests/misc.c | 46 +++++++------- 3 files changed, 152 insertions(+), 92 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=8bee5d85d805a735dd79…
1
0
0
0
Piotr Caban : ucrtbase: Add _Strftime tests.
by Alexandre Julliard
20 Nov '19
20 Nov '19
Module: wine Branch: master Commit: 21a2fde62197cf28601805bd9393b0212400e2ba URL:
https://source.winehq.org/git/wine.git/?a=commit;h=21a2fde62197cf28601805bd…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Nov 19 23:14:53 2019 +0100 ucrtbase: Add _Strftime tests. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ucrtbase/tests/misc.c | 113 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index fa5f29372c..6c8dd88cf0 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -104,6 +104,29 @@ typedef struct MSVCRT__exception { double retval; } MSVCRT__exception; +typedef struct { + const char *short_wday[7]; + const char *wday[7]; + const char *short_mon[12]; + const char *mon[12]; + const char *am; + const char *pm; + const char *short_date; + const char *date; + const char *time; + int unk[2]; + const wchar_t *short_wdayW[7]; + const wchar_t *wdayW[7]; + const wchar_t *short_monW[12]; + const wchar_t *monW[12]; + const wchar_t *amW; + const wchar_t *pmW; + const wchar_t *short_dateW; + const wchar_t *dateW; + const wchar_t *timeW; + const wchar_t *locnameW; +} __lc_time_data; + typedef int (CDECL *MSVCRT_matherr_func)(struct MSVCRT__exception *); static HMODULE module; @@ -138,6 +161,7 @@ static void (CDECL *p___setusermatherr)(MSVCRT_matherr_func); static int* (CDECL *p_errno)(void); static char* (CDECL *p_asctime)(const struct tm *); static size_t (__cdecl *p_strftime)(char *, size_t, const char *, const struct tm *); +static size_t (__cdecl *p__Strftime)(char*, size_t, const char*, const struct tm*, void*); static struct tm* (__cdecl *p__gmtime32)(const __time32_t*); static void (CDECL *p_exit)(int); static int (CDECL *p__crt_atexit)(void (CDECL*)(void)); @@ -513,6 +537,7 @@ static BOOL init(void) p_errno = (void*)GetProcAddress(module, "_errno"); p_asctime = (void*)GetProcAddress(module, "asctime"); p_strftime = (void*)GetProcAddress(module, "strftime"); + p__Strftime = (void*)GetProcAddress(module, "_Strftime"); p__gmtime32 = (void*)GetProcAddress(module, "_gmtime32"); p__crt_atexit = (void*)GetProcAddress(module, "_crt_atexit"); p_exit = (void*)GetProcAddress(module, "exit"); @@ -949,6 +974,81 @@ static void test_strftime(void) {"%X", "23:59:60", { 60, 59, 23, 1, 0, 70, 4, 0, 0 }, TRUE}, }; + const struct { + const char *format; + const char *ret; + const wchar_t *short_date; + const wchar_t *date; + const wchar_t *time; + struct tm tm; + BOOL todo; + } tests_td[] = { + { "%c", "x z", L"x", L"y", L"z", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#c", "y z", L"x", L"y", L"z", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "M1", 0, 0, L"MMM", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "1", 0, 0, L"h", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "01", 0, 0, L"hh", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "h01", 0, 0, L"hhh", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "hh01", 0, 0, L"hhhh", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "1", 0, 0, L"H", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "01", 0, 0, L"HH", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "H13", 0, 0, L"HHH", { 0, 0, 13, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "0", 0, 0, L"m", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "00", 0, 0, L"mm", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "m00", 0, 0, L"mmm", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "T", 0, 0, L"t", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "TAM", 0, 0, L"tt", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "TAM", 0, 0, L"ttttttttt", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "TAM", 0, 0, L"a", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "TAM", 0, 0, L"aaaaa", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "TAM", 0, 0, L"A", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "TAM", 0, 0, L"AAAAA", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "1", L"d", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "01", L"dd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "D1", L"ddd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "Day1", L"dddd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "dDay1", L"ddddd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "1", L"M", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "01", L"MM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "M1", L"MMM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "Mon1", L"MMMM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "MMon1", L"MMMMM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "y", L"y", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "70", L"yy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "y70", L"yyy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "1970", L"yyyy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "y1970", L"yyyyy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "ggggggggggg", L"ggggggggggg", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "1", 0, L"d", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "01", 0, L"dd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "D1", 0, L"ddd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "Day1", 0, L"dddd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "dDay1", 0, L"ddddd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "1", 0, L"M", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "01", 0, L"MM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "M1", 0, L"MMM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "Mon1", 0, L"MMMM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "MMon1", 0, L"MMMMM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "y", 0, L"y", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "70", 0, L"yy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "y70", 0, L"yyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "1970", 0, L"yyyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "y1970", 0, L"yyyyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + }; + + __lc_time_data time_data = { + { "d1", "d2", "d3", "d4", "d5", "d6", "d7" }, + { "day1", "day2", "day3", "day4", "day5", "day6", "day7" }, + { "m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9", "m10", "m11", "m12" }, + { "mon1", "mon2", "mon3", "mon4", "mon5", "mon6", "mon7", "mon8", "mon9", "mon10", "mon11", "mon12" }, + "tam", "tpm", 0, 0, 0, { 1, 0 }, + { L"D1", L"D2", L"D3", L"D4", L"D5", L"D6", L"D7" }, + { L"Day1", L"Day2", L"Day3", L"Day4", L"Day5", L"Day6", L"Day7" }, + { L"M1", L"M2", L"M3", L"M4", L"M5", L"M6", L"M7", L"M8", L"M9", L"M10", L"M11", L"M12" }, + { L"Mon1", L"Mon2", L"Mon3", L"Mon4", L"Mon5", L"Mon6", L"Mon7", L"Mon8", L"Mon9", L"Mon10", L"Mon11", L"Mon12" }, + L"TAM", L"TPM" + }; + const struct tm epoch = { 0, 0, 0, 1, 0, 70, 4, 0, 0 }; char buf[256]; int i, ret; @@ -973,6 +1073,19 @@ static void test_strftime(void) ok((buf[0] == '+' || buf[0] == '-') && isdigit(buf[1]) && isdigit(buf[2]) && isdigit(buf[3]) && isdigit(buf[4]), "got %s\n", buf); + + for (i=0; i<ARRAY_SIZE(tests_td); i++) + { + time_data.short_dateW = tests_td[i].short_date; + time_data.dateW = tests_td[i].date; + time_data.timeW = tests_td[i].time; + ret = p__Strftime(buf, sizeof(buf), tests_td[i].format, &tests_td[i].tm, &time_data); + ok(ret == strlen(buf), "%d) ret = %d\n", i, ret); + todo_wine_if(tests_td[i].todo) { + ok(!strcmp(buf, tests_td[i].ret), "%d) buf = \"%s\", expected \"%s\"\n", + i, buf, tests_td[i].ret); + } + } } static LONG* get_failures_counter(HANDLE *map)
1
0
0
0
Piotr Caban : msvcrt: Add _Strftime tests.
by Alexandre Julliard
20 Nov '19
20 Nov '19
Module: wine Branch: master Commit: fbe97003fd63c81eff396bc743ae00a20fa30711 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fbe97003fd63c81eff396bc7…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Nov 19 23:14:49 2019 +0100 msvcrt: Add _Strftime tests. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/tests/time.c | 107 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c index 4a3d81d2dd..561ef853ec 100644 --- a/dlls/msvcrt/tests/time.c +++ b/dlls/msvcrt/tests/time.c @@ -36,6 +36,20 @@ #define MINSPERHOUR 60 #define HOURSPERDAY 24 +typedef struct { + const char *short_wday[7]; + const char *wday[7]; + const char *short_mon[12]; + const char *mon[12]; + const char *am; + const char *pm; + const char *short_date; + const char *date; + const char *time; + LCID lcid; + int unk[2]; +} __lc_time_data; + static __time32_t (__cdecl *p_mkgmtime32)(struct tm*); static struct tm* (__cdecl *p_gmtime32)(__time32_t*); static struct tm* (__cdecl *p_gmtime)(time_t*); @@ -50,6 +64,7 @@ static long* (__cdecl *p___p__dstbias)(void); static long* (__cdecl *p__dstbias)(void); static long* (__cdecl *p___p__timezone)(void); static size_t (__cdecl *p_strftime)(char *, size_t, const char *, const struct tm *); +static size_t (__cdecl *p__Strftime)(char*, size_t, const char*, const struct tm*, void*); static size_t (__cdecl *p_wcsftime)(wchar_t *, size_t, const wchar_t *, const struct tm *); static char* (__cdecl *p_asctime)(const struct tm *); @@ -71,6 +86,7 @@ static void init(void) p__dstbias = (void*)GetProcAddress(hmod, "__dstbias"); p___p__timezone = (void*)GetProcAddress(hmod, "__p__timezone"); p_strftime = (void*)GetProcAddress(hmod, "strftime"); + p__Strftime = (void*)GetProcAddress(hmod, "_Strftime"); p_wcsftime = (void*)GetProcAddress(hmod, "wcsftime"); p_asctime = (void*)GetProcAddress(hmod, "asctime"); } @@ -640,6 +656,76 @@ static void test_strftime(void) {"%W", "52", { 0, 0, 0, 1, 0, 70, 0, 365, 0 }}, }; + const struct { + const char *format; + const char *ret; + const char *short_date; + const char *date; + const char *time; + struct tm tm; + BOOL todo; + } tests_td[] = { + { "%c", "x z", "x", "y", "z", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#c", "y z", "x", "y", "z", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "m1", 0, 0, "MMM", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "1", 0, 0, "h", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "01", 0, 0, "hh", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "h01", 0, 0, "hhh", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "hh01", 0, 0, "hhhh", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "1", 0, 0, "H", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "01", 0, 0, "HH", { 0, 0, 1, 1, 0, 70, 0, 0, 0 }}, + { "%X", "H13", 0, 0, "HHH", { 0, 0, 13, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "0", 0, 0, "m", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "00", 0, 0, "mm", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%X", "m00", 0, 0, "mmm", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "t", 0, 0, "t", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "tam", 0, 0, "tt", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "tam", 0, 0, "ttttttttt", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "tam", 0, 0, "a", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "tam", 0, 0, "aaaaa", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "tam", 0, 0, "A", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%X", "tam", 0, 0, "AAAAA", { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "1", "d", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "01", "dd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "d1", "ddd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "day1", "dddd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "dday1", "ddddd", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "1", "M", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "01", "MM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "m1", "MMM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "mon1", "MMMM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "Mmon1", "MMMMM", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "y", "y", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "70", "yy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "y70", "yyy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "1970", "yyyy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%x", "y1970", "yyyyy", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%x", "ggggggggggg", "ggggggggggg", 0, 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "1", 0, "d", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "01", 0, "dd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "d1", 0, "ddd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "day1", 0, "dddd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "dday1", 0, "ddddd", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "1", 0, "M", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "01", 0, "MM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "m1", 0, "MMM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "mon1", 0, "MMMM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "Mmon1", 0, "MMMMM", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "y", 0, "y", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "70", 0, "yy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "y70", 0, "yyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + { "%#x", "1970", 0, "yyyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, + { "%#x", "y1970", 0, "yyyyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }, TRUE}, + }; + + __lc_time_data time_data = { + { "d1", "d2", "d3", "d4", "d5", "d6", "d7" }, + { "day1", "day2", "day3", "day4", "day5", "day6", "day7" }, + { "m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9", "m10", "m11", "m12" }, + { "mon1", "mon2", "mon3", "mon4", "mon5", "mon6", "mon7", "mon8", "mon9", "mon10", "mon11", "mon12" }, + "tam", "tpm" + }; + static const wchar_t cW[] = { '%','c',0 }; time_t gmt; struct tm* gmt_tm; @@ -729,6 +815,27 @@ static void test_strftime(void) retA = p_strftime(bufA, 256, "\x82%c", gmt_tm); ok(retA == 3, "expected 3, got %ld\n", retA); ok(!strcmp(bufA, "\x82%c"), "got %s\n", bufA); + + setlocale(LC_ALL, "C"); + if(!p__Strftime) { + win_skip("_Strftime is not available\n"); + return; + } + + /* TODO: find meaning of unk[0] */ + time_data.unk[0] = 1; + for (i=0; i<ARRAY_SIZE(tests_td); i++) + { + time_data.short_date = tests_td[i].short_date; + time_data.date = tests_td[i].date; + time_data.time = tests_td[i].time; + retA = p__Strftime(buf, sizeof(buf), tests_td[i].format, &tests_td[i].tm, &time_data); + ok(retA == strlen(buf), "%d) ret = %ld\n", i, retA); + todo_wine_if(tests_td[i].todo) { + ok(!strcmp(buf, tests_td[i].ret), "%d) buf = \"%s\", expected \"%s\"\n", + i, buf, tests_td[i].ret); + } + } } static void test_asctime(void)
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
90
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
Results per page:
10
25
50
100
200