From db027d4a7f47ccaad0e7ca9142e2d970b3152fd9 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 3 Jun 2020 22:44:54 -0700 Subject: [PATCH] makeTestfile SetErrorMode() --- src/tools/makeTestfile.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/tools/makeTestfile.pl b/src/tools/makeTestfile.pl index 6c93093b8..582c4260b 100644 --- a/src/tools/makeTestfile.pl +++ b/src/tools/makeTestfile.pl @@ -49,6 +49,28 @@ if( $TA =~ /^win32-x86/ && $HA !~ /^win/ ) { $exec = "./$exe"; } +# Ensure that Windows interactive error handling is disabled. +# This setting is inherited by the test process. +# Set SEM_FAILCRITICALERRORS (1) Disable critical-error-handler dialog +# Clear SEM_NOGPFAULTERRORBOX (2) Enabled WER to allow automatic post mortem debugging (AeDebug) +# Clear SEM_NOALIGNMENTFAULTEXCEPT (4) Allow alignment fixups +# Set SEM_NOOPENFILEERRORBOX (0x8000) Prevent dialog on some I/O errors +# https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-seterrormode?redirectedfrom=MSDN +my $sem = $^O ne 'MSWin32' ? '' : <import(\$sem); + }; + eval { + require Win32API::File; + Win32API::File->import(\$sem); + } if \$@; + SetErrorMode(0x8001) unless \$@; +} +ENDBEGIN + open(my $OUT, '>', $target) or die "Can't create $target: $!\n"; print $OUT <