From 665fe1374cb0213bf259adf91a65b0b5739dbc09 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 15 Apr 2026 21:06:52 +0000
Subject: [PATCH 1/2] Use ComVariant in GetNativeVariantForObject tests
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/b87f2dcb-ecea-4af2-b091-551b6de94281
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
---
...ystem.Runtime.InteropServices.Tests.csproj | 1 -
.../InteropServices/Marshal/Common/Variant.cs | 17 -----
.../GetNativeVariantForObjectTests.Windows.cs | 4 +-
.../Marshal/GetNativeVariantForObjectTests.cs | 73 +++++++++----------
4 files changed, 38 insertions(+), 57 deletions(-)
delete mode 100644 src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/Common/Variant.cs
diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj
index acb1d91dae2d82..9ebc831152ff28 100644
--- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj
+++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj
@@ -141,7 +141,6 @@
-
diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/Common/Variant.cs b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/Common/Variant.cs
deleted file mode 100644
index bc97d99bb052a2..00000000000000
--- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/Common/Variant.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.InteropServices.Tests.Common
-{
- public struct Variant
- {
-#pragma warning disable 0649
- public ushort vt;
- public ushort wReserved1;
- public ushort wReserved2;
- public ushort wReserved3;
- public IntPtr bstrVal;
- public IntPtr pRecInfo;
-#pragma warning restore 0649
- }
-}
diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/GetNativeVariantForObjectTests.Windows.cs b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/GetNativeVariantForObjectTests.Windows.cs
index ea466ac7d31767..0b6737a8326307 100644
--- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/GetNativeVariantForObjectTests.Windows.cs
+++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/GetNativeVariantForObjectTests.Windows.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
+using System.Runtime.InteropServices.Marshalling;
using System.Runtime.InteropServices.Tests.Common;
using Xunit;
@@ -108,8 +109,7 @@ public static IEnumerable