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 2020
----- 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
851 discussions
Start a n
N
ew thread
Alexandre Julliard : msvcrt: Reimplement _fpclass().
by Alexandre Julliard
16 Nov '20
16 Nov '20
Module: wine Branch: master Commit: fd51f229f68ac17670aaa525cb4f6acc01807346 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fd51f229f68ac17670aaa525…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Nov 16 12:10:53 2020 +0100 msvcrt: Reimplement _fpclass(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - .../api-ms-win-crt-math-l1-1-0.spec | 2 +- .../api-ms-win-crt-private-l1-1-0.spec | 2 +- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr120_app/msvcr120_app.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/math.c | 66 ++++++++++++---------- dlls/msvcrt/msvcrt.spec | 2 +- dlls/ucrtbase/ucrtbase.spec | 4 +- include/config.h.in | 3 - 14 files changed, 48 insertions(+), 45 deletions(-) diff --git a/configure b/configure index 42c9090c912..e6409e264f9 100755 --- a/configure +++ b/configure @@ -17728,7 +17728,6 @@ for ac_func in \ finitef \ fnmatch \ fork \ - fpclass \ fstatfs \ fstatvfs \ futimens \ diff --git a/configure.ac b/configure.ac index 9103484d597..f70329b41ae 100644 --- a/configure.ac +++ b/configure.ac @@ -2167,7 +2167,6 @@ AC_CHECK_FUNCS(\ finitef \ fnmatch \ fork \ - fpclass \ fstatfs \ fstatvfs \ futimens \ diff --git a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec index 579b97fee34..5f0cce6f05d 100644 --- a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec +++ b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec @@ -79,7 +79,7 @@ @ cdecl _finite(double) ucrtbase._finite @ cdecl -arch=!i386 _finitef(float) ucrtbase._finitef @ cdecl _fpclass(double) ucrtbase._fpclass -@ stub _fpclassf +@ cdecl -arch=!i386 _fpclassf(float) ucrtbase._fpclassf @ cdecl -arch=i386 -ret64 _ftol() ucrtbase._ftol @ cdecl -arch=win64 _get_FMA3_enable() ucrtbase._get_FMA3_enable @ cdecl _hypot(double double) ucrtbase._hypot diff --git a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec index 6fcbab0f108..2a912bba7bf 100644 --- a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec +++ b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec @@ -282,7 +282,7 @@ @ cdecl _o__findnext64i32(long ptr) ucrtbase._o__findnext64i32 @ cdecl _o__flushall() ucrtbase._o__flushall @ cdecl _o__fpclass(double) ucrtbase._o__fpclass -@ stub _o__fpclassf +@ cdecl -arch=!i386 _o__fpclassf(float) ucrtbase._o__fpclassf @ cdecl _o__fputc_nolock(long ptr) ucrtbase._o__fputc_nolock @ cdecl _o__fputchar(long) ucrtbase._o__fputchar @ cdecl _o__fputwc_nolock(long ptr) ucrtbase._o__fputwc_nolock diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 780c86ee715..fc15a97cfd8 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -824,7 +824,7 @@ @ cdecl _flushall() MSVCRT__flushall @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass -# stub -arch=x86_64 _fpclassf +@ cdecl -arch=!i386 _fpclassf(float) MSVCRT__fpclassf @ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ stub _fprintf_l diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 54196f63690..ff3b4a4dd0b 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1171,7 +1171,7 @@ @ cdecl _flushall() MSVCRT__flushall @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass -# stub -arch=x86_64 _fpclassf +@ cdecl -arch=!i386 _fpclassf(float) MSVCRT__fpclassf @ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ stub _fprintf_l diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index f1e6fe210a7..08c817d8133 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1171,7 +1171,7 @@ @ cdecl _flushall() MSVCRT__flushall @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass -# stub -arch=x86_64 _fpclassf +@ cdecl -arch=!i386 _fpclassf(float) MSVCRT__fpclassf @ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ stub _fprintf_l diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 87a55210951..f74140c2311 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1099,7 +1099,7 @@ @ cdecl _flushall() msvcr120._flushall @ extern _fmode msvcr120._fmode @ cdecl _fpclass(double) msvcr120._fpclass -# stub -arch=x86_64 _fpclassf +@ cdecl -arch=!i386 _fpclassf(float) msvcr120._fpclassf @ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) msvcr120._fpieee_flt @ cdecl _fpreset() msvcr120._fpreset @ stub _fprintf_l diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 97e30c5563f..5f68ef2ec9b 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -490,7 +490,7 @@ @ cdecl _flushall() MSVCRT__flushall @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass -# stub -arch=x86_64 _fpclassf +@ cdecl -arch=!i386 _fpclassf(float) MSVCRT__fpclassf @ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ stub _fprintf_l diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 5ea0226b3ba..c1cae65c933 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -473,7 +473,7 @@ @ cdecl _flushall() MSVCRT__flushall @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass -# stub -arch=win64 _fpclassf(float) +@ cdecl -arch=!i386 _fpclassf(float) MSVCRT__fpclassf @ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ stub _fprintf_l diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index f113943c392..aa0c6f2f3de 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -208,6 +208,28 @@ float CDECL MSVCRT__logbf( float num ) #ifndef __i386__ +/********************************************************************* + * _fpclassf (MSVCRT.@) + */ +int CDECL MSVCRT__fpclassf( float num ) +{ + union { float f; UINT32 i; } u = { num }; + int e = u.i >> 23 & 0xff; + int s = u.i >> 31; + + switch (e) + { + case 0: + if (u.i << 1) return s ? MSVCRT__FPCLASS_ND : MSVCRT__FPCLASS_PD; + return s ? MSVCRT__FPCLASS_NZ : MSVCRT__FPCLASS_PZ; + case 0xff: + if (u.i << 9) return ((u.i >> 22) & 1) ? MSVCRT__FPCLASS_QNAN : MSVCRT__FPCLASS_SNAN; + return s ? MSVCRT__FPCLASS_NINF : MSVCRT__FPCLASS_PINF; + default: + return s ? MSVCRT__FPCLASS_NN : MSVCRT__FPCLASS_PN; + } +} + /********************************************************************* * _finitef (MSVCRT.@) */ @@ -1391,35 +1413,21 @@ __ASM_GLOBAL_FUNC(MSVCRT__ftol, */ int CDECL MSVCRT__fpclass(double num) { -#if defined(HAVE_FPCLASS) || defined(fpclass) - switch (fpclass( num )) - { - case FP_SNAN: return MSVCRT__FPCLASS_SNAN; - case FP_QNAN: return MSVCRT__FPCLASS_QNAN; - case FP_NINF: return MSVCRT__FPCLASS_NINF; - case FP_PINF: return MSVCRT__FPCLASS_PINF; - case FP_NDENORM: return MSVCRT__FPCLASS_ND; - case FP_PDENORM: return MSVCRT__FPCLASS_PD; - case FP_NZERO: return MSVCRT__FPCLASS_NZ; - case FP_PZERO: return MSVCRT__FPCLASS_PZ; - case FP_NNORM: return MSVCRT__FPCLASS_NN; - case FP_PNORM: return MSVCRT__FPCLASS_PN; - default: return MSVCRT__FPCLASS_PN; - } -#elif defined (fpclassify) - switch (fpclassify( num )) - { - case FP_NAN: return MSVCRT__FPCLASS_QNAN; - case FP_INFINITE: return signbit(num) ? MSVCRT__FPCLASS_NINF : MSVCRT__FPCLASS_PINF; - case FP_SUBNORMAL: return signbit(num) ?MSVCRT__FPCLASS_ND : MSVCRT__FPCLASS_PD; - case FP_ZERO: return signbit(num) ? MSVCRT__FPCLASS_NZ : MSVCRT__FPCLASS_PZ; - } - return signbit(num) ? MSVCRT__FPCLASS_NN : MSVCRT__FPCLASS_PN; -#else - if (!isfinite(num)) - return MSVCRT__FPCLASS_QNAN; - return num == 0.0 ? MSVCRT__FPCLASS_PZ : (num < 0 ? MSVCRT__FPCLASS_NN : MSVCRT__FPCLASS_PN); -#endif + union { double f; UINT64 i; } u = { num }; + int e = u.i >> 52 & 0x7ff; + int s = u.i >> 63; + + switch (e) + { + case 0: + if (u.i << 1) return s ? MSVCRT__FPCLASS_ND : MSVCRT__FPCLASS_PD; + return s ? MSVCRT__FPCLASS_NZ : MSVCRT__FPCLASS_PZ; + case 0x7ff: + if (u.i << 12) return ((u.i >> 51) & 1) ? MSVCRT__FPCLASS_QNAN : MSVCRT__FPCLASS_SNAN; + return s ? MSVCRT__FPCLASS_NINF : MSVCRT__FPCLASS_PINF; + default: + return s ? MSVCRT__FPCLASS_NN : MSVCRT__FPCLASS_PN; + } } /********************************************************************* diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index f6eead8a518..cdf8859e1dd 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -456,7 +456,7 @@ @ cdecl _flushall() MSVCRT__flushall @ extern _fmode MSVCRT__fmode @ cdecl _fpclass(double) MSVCRT__fpclass -# stub -arch=win64 _fpclassf(float) +@ cdecl -arch=!i386 _fpclassf(float) MSVCRT__fpclassf @ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() # stub _fprintf_l(ptr str ptr) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 5f65b97a981..23e7824fe36 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -324,7 +324,7 @@ @ cdecl -arch=!i386 _finitef(float) MSVCRT__finitef @ cdecl _flushall() MSVCRT__flushall @ cdecl _fpclass(double) MSVCRT__fpclass -@ stub _fpclassf +@ cdecl -arch=!i386 _fpclassf(float) MSVCRT__fpclassf @ cdecl -arch=i386,x86_64,arm,arm64 _fpieee_flt(long ptr ptr) @ cdecl _fpreset() @ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock @@ -946,7 +946,7 @@ @ cdecl _o__findnext64i32(long ptr) MSVCRT__findnext64i32 @ cdecl _o__flushall() MSVCRT__flushall @ cdecl _o__fpclass(double) MSVCRT__fpclass -@ stub _o__fpclassf +@ cdecl -arch=!i386 _o__fpclassf(float) MSVCRT__fpclassf @ cdecl _o__fputc_nolock(long ptr) MSVCRT__fputc_nolock @ cdecl _o__fputchar(long) MSVCRT__fputchar @ cdecl _o__fputwc_nolock(long ptr) MSVCRT__fputwc_nolock diff --git a/include/config.h.in b/include/config.h.in index f2dfe2c9fa3..241fa7ede38 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -192,9 +192,6 @@ /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK -/* Define to 1 if you have the `fpclass' function. */ -#undef HAVE_FPCLASS - /* Define if FreeType 2 is installed */ #undef HAVE_FREETYPE
1
0
0
0
Alexandre Julliard : msvcrt: Reimplement _dclass() using musl code.
by Alexandre Julliard
16 Nov '20
16 Nov '20
Module: wine Branch: master Commit: 23008a0f27e9ba28f0e4b19be8f3175875f72d82 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=23008a0f27e9ba28f0e4b19b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Nov 16 12:09:43 2020 +0100 msvcrt: Reimplement _dclass() using musl code. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/math.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index a9cf224575a..f113943c392 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -3678,35 +3678,32 @@ LDOUBLE CDECL MSVCR120_truncl(LDOUBLE x) /********************************************************************* * _dclass (MSVCR120.@) + * + * Copied from musl: src/math/__fpclassify.c */ short CDECL MSVCR120__dclass(double x) { - switch (MSVCRT__fpclass(x)) { - case MSVCRT__FPCLASS_QNAN: - case MSVCRT__FPCLASS_SNAN: - return MSVCRT_FP_NAN; - case MSVCRT__FPCLASS_NINF: - case MSVCRT__FPCLASS_PINF: - return MSVCRT_FP_INFINITE; - case MSVCRT__FPCLASS_ND: - case MSVCRT__FPCLASS_PD: - return MSVCRT_FP_SUBNORMAL; - case MSVCRT__FPCLASS_NN: - case MSVCRT__FPCLASS_PN: - default: - return MSVCRT_FP_NORMAL; - case MSVCRT__FPCLASS_NZ: - case MSVCRT__FPCLASS_PZ: - return MSVCRT_FP_ZERO; - } + union { double f; UINT64 i; } u = { x }; + int e = u.i >> 52 & 0x7ff; + + if (!e) return u.i << 1 ? MSVCRT_FP_SUBNORMAL : MSVCRT_FP_ZERO; + if (e == 0x7ff) return (u.i << 12) ? MSVCRT_FP_NAN : MSVCRT_FP_INFINITE; + return MSVCRT_FP_NORMAL; } /********************************************************************* * _fdclass (MSVCR120.@) + * + * Copied from musl: src/math/__fpclassifyf.c */ short CDECL MSVCR120__fdclass(float x) { - return MSVCR120__dclass(x); + union { float f; UINT32 i; } u = { x }; + int e = u.i >> 23 & 0xff; + + if (!e) return u.i << 1 ? MSVCRT_FP_SUBNORMAL : MSVCRT_FP_ZERO; + if (e == 0xff) return u.i << 9 ? MSVCRT_FP_NAN : MSVCRT_FP_INFINITE; + return MSVCRT_FP_NORMAL; } /********************************************************************* @@ -3730,7 +3727,7 @@ short CDECL MSVCR120__dtest(double *x) */ short CDECL MSVCR120__fdtest(float *x) { - return MSVCR120__dclass(*x); + return MSVCR120__fdclass(*x); } /*********************************************************************
1
0
0
0
Zebediah Figura : makefiles: Disable implicit rules.
by Alexandre Julliard
16 Nov '20
16 Nov '20
Module: wine Branch: master Commit: 52dc0ccf6debccc0dbab273d39605bb7aeeeb456 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=52dc0ccf6debccc0dbab273d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Nov 15 11:12:43 2020 -0600 makefiles: Disable implicit rules. This improves the time of a full-tree build with no out-of-date objects from ~3.7s to ~0.7s on one of my development machines. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/makedep.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/makedep.c b/tools/makedep.c index 90a21ef825c..8812be4e40c 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -4076,6 +4076,9 @@ static void output_dependencies( struct makefile *make ) } else output_stub_makefile( make ); + /* disable implicit rules */ + output( ".SUFFIXES:\n" ); + fclose( output_file ); output_file = NULL; rename_temp_file( output_file_name );
1
0
0
0
Zebediah Figura : quartz: Immediately return failure from IFilterGraph::RemoveFilter() if IPin::Disconnect() fails.
by Alexandre Julliard
16 Nov '20
16 Nov '20
Module: wine Branch: master Commit: bd1174e1255f339f13da3fb19f412e7aa43c9ea4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bd1174e1255f339f13da3fb1…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Nov 15 11:04:37 2020 -0600 quartz: Immediately return failure from IFilterGraph::RemoveFilter() if IPin::Disconnect() fails. Do not try to stop the filter. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/filtergraph.c | 44 +++++++++++++++++++---------------------- dlls/quartz/tests/filtergraph.c | 4 ++-- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 872b355cd35..b3aebabbdad 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -704,14 +704,11 @@ static HRESULT WINAPI FilterGraph2_RemoveFilter(IFilterGraph2 *iface, IBaseFilte TRACE("(%p/%p)->(%p)\n", This, iface, pFilter); - /* FIXME: check graph is stopped */ - LIST_FOR_EACH_ENTRY(entry, &This->filters, struct filter, entry) { if (entry->filter == pFilter) { IEnumPins *penumpins = NULL; - FILTER_STATE state; if (This->defaultclock && This->refClockProvider == pFilter) { @@ -726,31 +723,30 @@ static HRESULT WINAPI FilterGraph2_RemoveFilter(IFilterGraph2 *iface, IBaseFilte IPin *ppin; while(IEnumPins_Next(penumpins, 1, &ppin, NULL) == S_OK) { - IPin *victim = NULL; - HRESULT h; - IPin_ConnectedTo(ppin, &victim); - if (victim) + IPin *peer = NULL; + HRESULT hr; + + IPin_ConnectedTo(ppin, &peer); + if (peer) { - h = IPin_Disconnect(victim); - TRACE("Disconnect other side: %08x\n", h); - if (h == VFW_E_NOT_STOPPED) + if (FAILED(hr = IPin_Disconnect(peer))) { - PIN_INFO pinfo; - IPin_QueryPinInfo(victim, &pinfo); - - IBaseFilter_GetState(pinfo.pFilter, 0, &state); - if (state == State_Running) - IBaseFilter_Pause(pinfo.pFilter); - IBaseFilter_Stop(pinfo.pFilter); - IBaseFilter_Release(pinfo.pFilter); - h = IPin_Disconnect(victim); - TRACE("Disconnect retry: %08x\n", h); + WARN("Failed to disconnect peer %p, hr %#x.\n", peer, hr); + IPin_Release(peer); + IPin_Release(ppin); + IEnumPins_Release(penumpins); + return hr; } - IPin_Release(victim); - } - h = IPin_Disconnect(ppin); - TRACE("Disconnect 2: %08x\n", h); + IPin_Release(peer); + if (FAILED(hr = IPin_Disconnect(ppin))) + { + WARN("Failed to disconnect pin %p, hr %#x.\n", ppin, hr); + IPin_Release(ppin); + IEnumPins_Release(penumpins); + return hr; + } + } IPin_Release(ppin); } IEnumPins_Release(penumpins); diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 7b2aa25a932..e7ee4e5c446 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3130,7 +3130,7 @@ todo_wine source_pin.require_stopped_disconnect = TRUE; hr = IFilterGraph2_RemoveFilter(graph, &source.IBaseFilter_iface); - todo_wine ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); ok(source_pin.peer == &sink_pin.IPin_iface, "Got peer %p.\n", source_pin.peer); ok(!sink_pin.peer, "Got peer %p.\n", sink_pin.peer); @@ -3139,7 +3139,7 @@ todo_wine source_pin.require_stopped_disconnect = FALSE; sink_pin.require_stopped_disconnect = TRUE; hr = IFilterGraph2_RemoveFilter(graph, &source.IBaseFilter_iface); - todo_wine ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); ok(source_pin.peer == &sink_pin.IPin_iface, "Got peer %p.\n", source_pin.peer); ok(sink_pin.peer == &source_pin.IPin_iface, "Got peer %p.\n", sink_pin.peer);
1
0
0
0
Zebediah Figura : quartz/tests: Add more tests for interaction between pin connection and graph state.
by Alexandre Julliard
16 Nov '20
16 Nov '20
Module: wine Branch: master Commit: be1ccdf73f3c1aa2e99add09a6e298e772a8aa6d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=be1ccdf73f3c1aa2e99add09…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Nov 15 11:04:36 2020 -0600 quartz/tests: Add more tests for interaction between pin connection and graph state. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/filtergraph.c | 48 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 1821919a094..7b2aa25a932 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -801,6 +801,8 @@ struct testpin AM_MEDIA_TYPE *request_mt, *accept_mt; const struct testpin *require_connected_pin; + BOOL require_stopped_disconnect; + HRESULT Connect_hr; HRESULT EnumMediaTypes_hr; HRESULT QueryInternalConnections_hr; @@ -958,6 +960,9 @@ static HRESULT WINAPI testpin_Disconnect(IPin *iface) if (!pin->peer) return S_FALSE; + if (pin->require_stopped_disconnect && pin->filter->state != State_Stopped) + return VFW_E_NOT_STOPPED; + IPin_Release(pin->peer); pin->peer = NULL; return S_OK; @@ -2885,6 +2890,7 @@ static void test_connect_direct(void) struct testfilter source, sink, parser1, parser2; IFilterGraph2 *graph = create_graph(); + IMediaControl *control; AM_MEDIA_TYPE mt; HRESULT hr; @@ -2905,6 +2911,12 @@ static void test_connect_direct(void) hr = IFilterGraph2_AddFilter(graph, &sink.IBaseFilter_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* The filter graph does not prevent connection while it is running; only + * individual filters do. */ + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source_pin.IPin_iface, &sink_pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(source_pin.peer == &sink_pin.IPin_iface, "Got peer %p.\n", source_pin.peer); @@ -2999,6 +3011,14 @@ todo_wine /* Test Reconnect[Ex](). */ + hr = IFilterGraph2_Reconnect(graph, &source_pin.IPin_iface); + todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Reconnect(graph, &sink_pin.IPin_iface); + todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); + + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Reconnect(graph, &source_pin.IPin_iface); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); hr = IFilterGraph2_Reconnect(graph, &sink_pin.IPin_iface); @@ -3097,17 +3117,35 @@ todo_wine ok(!source_pin.peer, "Got peer %p.\n", source_pin.peer); ok(!sink_pin.peer, "Got peer %p.\n", sink_pin.peer); - /* Or when the graph is destroyed. */ + /* If the filter cannot be disconnected, then RemoveFilter() fails. */ + hr = IFilterGraph2_AddFilter(graph, &source.IBaseFilter_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); - - hr = IFilterGraph2_ConnectDirect(graph, &source_pin.IPin_iface, &sink_pin.IPin_iface, NULL); + hr = IFilterGraph2_ConnectDirect(graph, &source_pin.IPin_iface, &sink_pin.IPin_iface, &mt); + ok(hr == S_OK, "Got hr %#x.\n", hr); + sink_pin.peer = &source_pin.IPin_iface; + IPin_AddRef(sink_pin.peer); + hr = IMediaControl_Pause(control); ok(hr == S_OK, "Got hr %#x.\n", hr); + + source_pin.require_stopped_disconnect = TRUE; + hr = IFilterGraph2_RemoveFilter(graph, &source.IBaseFilter_iface); + todo_wine ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); ok(source_pin.peer == &sink_pin.IPin_iface, "Got peer %p.\n", source_pin.peer); - ok(!source_pin.mt, "Got mt %p.\n", source_pin.mt); ok(!sink_pin.peer, "Got peer %p.\n", sink_pin.peer); - IPin_AddRef(sink_pin.peer = &source_pin.IPin_iface); + sink_pin.peer = &source_pin.IPin_iface; + IPin_AddRef(sink_pin.peer); + source_pin.require_stopped_disconnect = FALSE; + sink_pin.require_stopped_disconnect = TRUE; + hr = IFilterGraph2_RemoveFilter(graph, &source.IBaseFilter_iface); + todo_wine ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + ok(source_pin.peer == &sink_pin.IPin_iface, "Got peer %p.\n", source_pin.peer); + ok(sink_pin.peer == &source_pin.IPin_iface, "Got peer %p.\n", sink_pin.peer); + + /* Filters are stopped, and pins disconnected, when the graph is destroyed. */ + + IMediaControl_Release(control); hr = IFilterGraph2_Release(graph); ok(!hr, "Got outstanding refcount %d.\n", hr); ok(source.ref == 1, "Got outstanding refcount %d.\n", source.ref);
1
0
0
0
Zebediah Figura : quartz/tests: Store a testfilter pointer inside the testpin structure.
by Alexandre Julliard
16 Nov '20
16 Nov '20
Module: wine Branch: master Commit: 316396275cf9bfdf058f79d31039cccc74334354 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=316396275cf9bfdf058f79d3…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Nov 15 11:04:35 2020 -0600 quartz/tests: Store a testfilter pointer inside the testpin structure. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/filtergraph.c | 79 ++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index b0f287e7fe2..1821919a094 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -789,7 +789,7 @@ struct testpin IPin IPin_iface; LONG ref; PIN_DIRECTION dir; - IBaseFilter *filter; + struct testfilter *filter; IPin *peer; AM_MEDIA_TYPE *mt; WCHAR name[10]; @@ -806,6 +806,40 @@ struct testpin HRESULT QueryInternalConnections_hr; }; +struct testfilter +{ + IBaseFilter IBaseFilter_iface; + LONG ref; + IFilterGraph *graph; + WCHAR *name; + IReferenceClock *clock; + + IEnumPins IEnumPins_iface; + struct testpin *pins; + unsigned int pin_count, enum_idx; + + FILTER_STATE state; + REFERENCE_TIME start_time; + HRESULT state_hr, GetState_hr, seek_hr; + FILTER_STATE expect_stop_prev, expect_run_prev; + + IAMFilterMiscFlags IAMFilterMiscFlags_iface; + ULONG misc_flags; + + IMediaSeeking IMediaSeeking_iface; + LONG seeking_ref; + DWORD seek_caps; + BOOL support_testguid, support_media_time; + GUID time_format; + LONGLONG seek_duration, seek_current, seek_stop; + double seek_rate; + + IReferenceClock IReferenceClock_iface; + + IFileSourceFilter IFileSourceFilter_iface; + WCHAR filename[MAX_PATH]; +}; + static inline struct testpin *impl_from_IEnumMediaTypes(IEnumMediaTypes *iface) { return CONTAINING_RECORD(iface, struct testpin, IEnumMediaTypes_iface); @@ -954,8 +988,8 @@ static HRESULT WINAPI testpin_QueryPinInfo(IPin *iface, PIN_INFO *info) struct testpin *pin = impl_from_IPin(iface); if (winetest_debug > 1) trace("%p->QueryPinInfo()\n", pin); - info->pFilter = pin->filter; - IBaseFilter_AddRef(pin->filter); + info->pFilter = &pin->filter->IBaseFilter_iface; + IBaseFilter_AddRef(info->pFilter); info->dir = pin->dir; wcscpy(info->achName, pin->name); return S_OK; @@ -1158,40 +1192,6 @@ static void testsource_init(struct testpin *pin, const AM_MEDIA_TYPE *types, int pin->type_count = type_count; } -struct testfilter -{ - IBaseFilter IBaseFilter_iface; - LONG ref; - IFilterGraph *graph; - WCHAR *name; - IReferenceClock *clock; - - IEnumPins IEnumPins_iface; - struct testpin *pins; - unsigned int pin_count, enum_idx; - - FILTER_STATE state; - REFERENCE_TIME start_time; - HRESULT state_hr, GetState_hr, seek_hr; - FILTER_STATE expect_stop_prev, expect_run_prev; - - IAMFilterMiscFlags IAMFilterMiscFlags_iface; - ULONG misc_flags; - - IMediaSeeking IMediaSeeking_iface; - LONG seeking_ref; - DWORD seek_caps; - BOOL support_testguid, support_media_time; - GUID time_format; - LONGLONG seek_duration, seek_current, seek_stop; - double seek_rate; - - IReferenceClock IReferenceClock_iface; - - IFileSourceFilter IFileSourceFilter_iface; - WCHAR filename[MAX_PATH]; -}; - static inline struct testfilter *impl_from_IEnumPins(IEnumPins *iface) { return CONTAINING_RECORD(iface, struct testfilter, IEnumPins_iface); @@ -1842,7 +1842,7 @@ static void testfilter_init(struct testfilter *filter, struct testpin *pins, int filter->pins = pins; filter->pin_count = pin_count; for (i = 0; i < pin_count; i++) - pins[i].filter = &filter->IBaseFilter_iface; + pins[i].filter = filter; filter->state = State_Stopped; filter->expect_stop_prev = filter->expect_run_prev = State_Paused; @@ -3232,9 +3232,6 @@ static void test_filter_state(void) IFilterGraph2_QueryInterface(graph, &IID_IMediaFilter, (void **)&filter); IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); - source_pin.filter = &source.IBaseFilter_iface; - sink_pin.filter = &sink.IBaseFilter_iface; - IFilterGraph2_AddFilter(graph, &source.IBaseFilter_iface, NULL); IFilterGraph2_AddFilter(graph, &sink.IBaseFilter_iface, NULL); IFilterGraph2_AddFilter(graph, &dummy.IBaseFilter_iface, NULL);
1
0
0
0
Zebediah Figura : quartz: Don't stop the filter in IFilterGraph::RemoveFilter().
by Alexandre Julliard
16 Nov '20
16 Nov '20
Module: wine Branch: master Commit: d19aac6edb9e65f9280f8ae51082e5a0b75c0257 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d19aac6edb9e65f9280f8ae5…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Nov 15 11:04:34 2020 -0600 quartz: Don't stop the filter in IFilterGraph::RemoveFilter(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/filtergraph.c | 5 ----- dlls/quartz/tests/filtergraph.c | 6 ++---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index b7f15695a6d..872b355cd35 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -720,11 +720,6 @@ static HRESULT WINAPI FilterGraph2_RemoveFilter(IFilterGraph2 *iface, IBaseFilte } TRACE("Removing filter %s.\n", debugstr_w(entry->name)); - IBaseFilter_GetState(pFilter, 0, &state); - if (state == State_Running) - IBaseFilter_Pause(pFilter); - if (state != State_Stopped) - IBaseFilter_Stop(pFilter); hr = IBaseFilter_EnumPins(pFilter, &penumpins); if (SUCCEEDED(hr)) { diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 2e1a8b7ad66..b0f287e7fe2 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3721,14 +3721,12 @@ todo_wine hr = IFilterGraph2_RemoveFilter(graph, &dummy.IBaseFilter_iface); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(dummy.state == State_Paused, "Got state %#x.\n", dummy.state); + ok(dummy.state == State_Paused, "Got state %#x.\n", dummy.state); hr = IFilterGraph2_AddFilter(graph, &dummy.IBaseFilter_iface, L"dummy"); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(dummy.state == State_Paused, "Got state %#x.\n", dummy.state); + ok(dummy.state == State_Paused, "Got state %#x.\n", dummy.state); - if (dummy.state == State_Stopped) - dummy.expect_stop_prev = State_Stopped; hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#x.\n", hr); check_filter_state(graph, State_Stopped);
1
0
0
0
Zebediah Figura : quartz/tests: Test adding and removing filters while the graph is running.
by Alexandre Julliard
16 Nov '20
16 Nov '20
Module: wine Branch: master Commit: 57eddc004b3337382f5dacd0b6cae8ac4295bfae URL:
https://source.winehq.org/git/wine.git/?a=commit;h=57eddc004b3337382f5dacd0…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Nov 15 11:04:33 2020 -0600 quartz/tests: Test adding and removing filters while the graph is running. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/filtergraph.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 4d2a3195b6d..2e1a8b7ad66 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -3708,6 +3708,35 @@ todo_wine hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* Add and remove a filter while the graph is running. */ + + hr = IFilterGraph2_AddFilter(graph, &dummy.IBaseFilter_iface, L"dummy"); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(dummy.state == State_Stopped, "Got state %#x.\n", dummy.state); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + check_filter_state(graph, State_Paused); + ok(dummy.state == State_Paused, "Got state %#x.\n", dummy.state); + + hr = IFilterGraph2_RemoveFilter(graph, &dummy.IBaseFilter_iface); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(dummy.state == State_Paused, "Got state %#x.\n", dummy.state); + + hr = IFilterGraph2_AddFilter(graph, &dummy.IBaseFilter_iface, L"dummy"); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(dummy.state == State_Paused, "Got state %#x.\n", dummy.state); + + if (dummy.state == State_Stopped) + dummy.expect_stop_prev = State_Stopped; + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + check_filter_state(graph, State_Stopped); + + hr = IFilterGraph2_RemoveFilter(graph, &dummy.IBaseFilter_iface); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(dummy.state == State_Stopped, "Got state %#x.\n", dummy.state); + /* Destroying the graph while it's running stops all filters. */ hr = IMediaControl_Run(control);
1
0
0
0
Anton Baskanov : amstream: Wait for presentation time in AMDirectDrawStream::Receive.
by Alexandre Julliard
16 Nov '20
16 Nov '20
Module: wine Branch: master Commit: b2148c2fffd61cc7a58f9c8ca2d7fff28e4f41b2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b2148c2fffd61cc7a58f9c8c…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Thu Nov 12 01:45:54 2020 +0700 amstream: Wait for presentation time in AMDirectDrawStream::Receive. Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/amstream/ddrawstream.c | 22 +++- dlls/amstream/tests/amstream.c | 280 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 301 insertions(+), 1 deletion(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=b2148c2fffd61cc7a58f…
1
0
0
0
Anton Baskanov : amstream/tests: Add comments to AMDirectDrawStream::CompletionStatus tests.
by Alexandre Julliard
16 Nov '20
16 Nov '20
Module: wine Branch: master Commit: a68f2bd7b4631bce8795d78fe74c6b621de451b4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a68f2bd7b4631bce8795d78f…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Thu Nov 12 01:45:53 2020 +0700 amstream/tests: Add comments to AMDirectDrawStream::CompletionStatus tests. Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/amstream/tests/amstream.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index da5ef8f56a1..6b1a9e4575f 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -7951,12 +7951,14 @@ static void test_ddrawstreamsample_completion_status(void) hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &stream_sample2); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* Initial status is S_OK. */ hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* Update changes the status to MS_S_PENDING. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); @@ -7966,6 +7968,7 @@ static void test_ddrawstreamsample_completion_status(void) hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, 100); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); + /* Each Receive call changes the status of one queued sample to S_OK in the same order Update was called. */ hr = IDirectDrawStreamSample_Update(stream_sample2, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); @@ -7996,6 +7999,7 @@ static void test_ddrawstreamsample_completion_status(void) hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* COMPSTAT_NOUPDATEOK removes the sample from the queue and changes the status to MS_S_NOUPDATE. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); @@ -8020,6 +8024,7 @@ static void test_ddrawstreamsample_completion_status(void) hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* COMPSTAT_ABORT removes the sample from the queue and changes the status to MS_S_NOUPDATE. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); @@ -8044,18 +8049,21 @@ static void test_ddrawstreamsample_completion_status(void) hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* COMPSTAT_WAIT has no effect when combined with COMPSTAT_NOUPDATEOK. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_NOUPDATEOK | COMPSTAT_WAIT, INFINITE); ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr); + /* COMPSTAT_WAIT has no effect when combined with COMPSTAT_ABORT. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_ABORT | COMPSTAT_WAIT, INFINITE); ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr); + /* EndOfStream changes the status of the queued samples to MS_S_ENDOFSTREAM. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); @@ -8068,6 +8076,7 @@ static void test_ddrawstreamsample_completion_status(void) hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_WAIT, INFINITE); ok(hr == MS_S_ENDOFSTREAM, "Got hr %#x.\n", hr); + /* Update after EndOfStream changes the status to MS_S_ENDOFSTREAM. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_ENDOFSTREAM, "Got hr %#x.\n", hr); @@ -8082,18 +8091,22 @@ static void test_ddrawstreamsample_completion_status(void) hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* Continuous update can be canceled by COMPSTAT_NOUPDATEOK. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC | SSUPDATE_CONTINUOUS, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_NOUPDATEOK, 0); ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr); + /* Continuous update can be canceled by COMPSTAT_ABORT. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC | SSUPDATE_CONTINUOUS, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_ABORT, 0); ok(hr == MS_S_NOUPDATE, "Got hr %#x.\n", hr); + /* If a sample is in countinuous update mode, when Receive is called it's status remains MS_S_PENDING + * and the sample is moved to the end of the queue. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC | SSUPDATE_CONTINUOUS, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); @@ -8136,6 +8149,7 @@ static void test_ddrawstreamsample_completion_status(void) hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, COMPSTAT_NOUPDATEOK, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* In continuous update mode, flushing does not affect the status. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC | SSUPDATE_CONTINUOUS, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); @@ -8151,6 +8165,7 @@ static void test_ddrawstreamsample_completion_status(void) hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); + /* In continuous update mode, stopping and running the stream does not affect the status. */ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -8163,6 +8178,7 @@ static void test_ddrawstreamsample_completion_status(void) hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); + /* In continuous update mode, EndOfStream changes the status to MS_S_ENDOFSTREAM. */ hr = IPin_EndOfStream(pin); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -8174,6 +8190,7 @@ static void test_ddrawstreamsample_completion_status(void) hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* COMPSTAT_WAIT resets the sample to the non-continuous update mode. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC | SSUPDATE_CONTINUOUS, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); @@ -8189,6 +8206,7 @@ static void test_ddrawstreamsample_completion_status(void) hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* In continuous update mode, CompletionStatus with COMPSTAT_WAIT returns when Receive is called. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC | SSUPDATE_CONTINUOUS, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); @@ -8216,6 +8234,7 @@ static void test_ddrawstreamsample_completion_status(void) hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* CompletionStatus with COMPSTAT_WAIT returns when Receive is called. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); @@ -8235,6 +8254,7 @@ static void test_ddrawstreamsample_completion_status(void) ok(!WaitForSingleObject(thread, 2000), "Wait timed out.\n"); CloseHandle(thread); + /* CompletionStatus with COMPSTAT_WAIT returns when EndOfStream is called. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); @@ -8256,6 +8276,7 @@ static void test_ddrawstreamsample_completion_status(void) hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_RUN); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* Stopping and running the stream does not affect the status and does not remove the sample from the queue. */ hr = IDirectDrawStreamSample_Update(stream_sample1, SSUPDATE_ASYNC, NULL, NULL, 0); ok(hr == MS_S_PENDING, "Got hr %#x.\n", hr); @@ -8277,6 +8298,7 @@ static void test_ddrawstreamsample_completion_status(void) hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0); ok(hr == S_OK, "Got hr %#x.\n", hr); + /* When the stream is stopped Update does not change the status. */ hr = IAMMultiMediaStream_SetState(mmstream, STREAMSTATE_STOP); ok(hr == S_OK, "Got hr %#x.\n", hr);
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
86
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
Results per page:
10
25
50
100
200