From 61e9b33de2004ebc5bd83246bf26546aa523883b Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Sat, 26 Nov 2022 15:30:19 -0600 Subject: [PATCH 1/2] Add mixed-mode test for setting current thread apartment state. --- tools/tests/mixedmode-apt.cs | 20 ++++++++++++++++++++ tools/tests/tests.make | 2 ++ vstests | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tools/tests/mixedmode-apt.cs diff --git a/tools/tests/mixedmode-apt.cs b/tools/tests/mixedmode-apt.cs new file mode 100644 index 00000000..a952373d --- /dev/null +++ b/tools/tests/mixedmode-apt.cs @@ -0,0 +1,20 @@ +/* Having a native or mixed-mode .exe in our tests-x86 dir causes + * problems, and in some cases we want to control what dependencies + * are in what path, so just chain to the real exe. */ +using System; +using System.Diagnostics; +using System.IO; +using System.Reflection; + +class MixedModeExe +{ + static int Main() + { + string exedir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + var process = new Process(); + process.StartInfo.FileName = Path.Combine(exedir, "vstests", "mixedapartmentstate.exe"); + process.Start(); + process.WaitForExit(); + return process.ExitCode; + } +} diff --git a/tools/tests/tests.make b/tools/tests/tests.make index c8338526..699381ca 100644 --- a/tools/tests/tests.make +++ b/tools/tests/tests.make @@ -7,6 +7,7 @@ TEST_CS_EXE_SRCS = \ dllimport-preload.cs \ interactioncommand.cs \ marshalansi.cs \ + mixedmode-apt.cs \ mixedmode-call.cs \ mixedmode-dllimport-0.cs \ mixedmode-dllimport-assemblydirectory.cs \ @@ -60,6 +61,7 @@ endif TEST_INSTALL_FILES = $(TEST_RAW_FILES:%=tools/tests/%) TEST_BINARY_FILES = \ + mixedapartmentstate.exe \ mixedmodeexe.exe \ mixedmodelibrary.dll \ nativelibrary.dll diff --git a/vstests b/vstests index 12d1b274..97d37051 160000 --- a/vstests +++ b/vstests @@ -1 +1 @@ -Subproject commit 12d1b274b76c97be7e9aea644b1c8d80b980e5aa +Subproject commit 97d370513170ca344bd1285cc0d02498539b4c07 From f92ff53e465690176c278a7c4415f5de3ff94157 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Sat, 26 Nov 2022 15:30:47 -0600 Subject: [PATCH 2/2] mono update: Fix [Try]SetApartmentState for current thread. --- mono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mono b/mono index 33be4db6..b9b8bd1b 160000 --- a/mono +++ b/mono @@ -1 +1 @@ -Subproject commit 33be4db6db5cdaf35216796e36fc3e87a7189aa6 +Subproject commit b9b8bd1b56a9189dbb42aec1b06b9c17c016d448