This matches Windows behaviour. In particular, redirecting stderr with freopen()
followed by assert(0) will print the failure message to the relevant file.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
The motivation for this patch is that WriteConsoleW() and therefore _cwprintf()
consistently swallow messages when I try to run Wine tests. I don't know if this
is a bug, but it turns out there was an easier fix than trying to delve into
console code...
dlls/msvcrt/exit.c | 2 +-
dlls/msvcrt/msvcrt.h | 3 +++
dlls/msvcrt/scanf.c | 2 --
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcrt/exit.c b/dlls/msvcrt/exit.c
index f631d4d727b..cb38b35de9a 100644
--- a/dlls/msvcrt/exit.c
+++ b/dlls/msvcrt/exit.c
@@ -305,7 +305,7 @@ void CDECL MSVCRT__wassert(const MSVCRT_wchar_t* str, const MSVCRT_wchar_t* file
DoMessageBoxW(assertion_failed, text);
}
else
- _cwprintf(format_console, str, file, line);
+ MSVCRT_fwprintf(MSVCRT_stderr, format_console, str, file, line);
MSVCRT_raise(MSVCRT_SIGABRT);
MSVCRT__exit(3);
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index 3ffc785d065..dc89c6af23e 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -447,6 +447,8 @@ struct MSVCRT__iobuf {
typedef struct MSVCRT__iobuf MSVCRT_FILE;
+extern MSVCRT_FILE MSVCRT__iob[];
+
struct MSVCRT_lconv {
char* decimal_point;
char* thousands_sep;
@@ -1107,6 +1109,7 @@ MSVCRT___time32_t __cdecl MSVCRT__time32(MSVCRT___time32_t*);
MSVCRT___time64_t __cdecl MSVCRT__time64(MSVCRT___time64_t*);
MSVCRT_FILE* __cdecl MSVCRT__fdopen(int, const char *);
MSVCRT_FILE* __cdecl MSVCRT__wfdopen(int, const MSVCRT_wchar_t *);
+int WINAPIV MSVCRT_fwprintf(MSVCRT_FILE *file, const MSVCRT_wchar_t *format, ...);
int __cdecl MSVCRT_vsnprintf(char *str, MSVCRT_size_t len, const char *format, __ms_va_list valist);
int __cdecl MSVCRT_vsnwprintf(MSVCRT_wchar_t *str, MSVCRT_size_t len,
const MSVCRT_wchar_t *format, __ms_va_list valist );
diff --git a/dlls/msvcrt/scanf.c b/dlls/msvcrt/scanf.c
index 04f87077e16..4b2ac2ed4a1 100644
--- a/dlls/msvcrt/scanf.c
+++ b/dlls/msvcrt/scanf.c
@@ -35,8 +35,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
-extern MSVCRT_FILE MSVCRT__iob[];
-
/* helper function for *scanf. Returns the value of character c in the
* given base, or -1 if the given character is not a digit of the base.
*/
--
2.27.0
I've written patches to implement support for
WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS in winhttp; this script will
be required for the tests.
Signed-off-by: Owen Rudge <orudge(a)codeweavers.com>
---
winetest/tests/redirecttest.php | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 winetest/tests/redirecttest.php
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/netio.sys/netio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/netio.sys/netio.c b/dlls/netio.sys/netio.c
index b0ca6801799..53d74f994db 100644
--- a/dlls/netio.sys/netio.c
+++ b/dlls/netio.sys/netio.c
@@ -1,7 +1,7 @@
/*
* WSK (Winsock Kernel) driver library.
*
- * Copyright 2020 Paul Gofman <pgofman(a)codeweavers.com> for Codeweavers
+ * Copyright 2020 Paul Gofman <pgofman(a)codeweavers.com> for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
--
2.20.1
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/ntoskrnl.exe/tests/driver4.c | 2 +-
dlls/ntoskrnl.exe/tests/utils.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/driver4.c b/dlls/ntoskrnl.exe/tests/driver4.c
index 48de151f31f..45ea90260a8 100644
--- a/dlls/ntoskrnl.exe/tests/driver4.c
+++ b/dlls/ntoskrnl.exe/tests/driver4.c
@@ -1,7 +1,7 @@
/*
* ntoskrnl.exe testing framework
*
- * Copyright 2020 Paul Gofman for Codeweavers
+ * Copyright 2020 Paul Gofman for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
diff --git a/dlls/ntoskrnl.exe/tests/utils.h b/dlls/ntoskrnl.exe/tests/utils.h
index da0b02ac006..be0f58f837c 100644
--- a/dlls/ntoskrnl.exe/tests/utils.h
+++ b/dlls/ntoskrnl.exe/tests/utils.h
@@ -4,7 +4,7 @@
* Copyright 2015 Sebastian Lackner
* Copyright 2015 Michael M??ller
* Copyright 2015 Christian Costa
- * Copyright 2020 Paul Gofman for Codeweavers
+ * Copyright 2020 Paul Gofman for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
--
2.20.1