diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
index bb77ffba3e..c4020a797d 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
+++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj
@@ -848,6 +848,9 @@
Microsoft\Data\SqlClient\LocalDb\LocalDbApi.Windows.cs
+
+ Microsoft\Data\SqlClient\PacketHandle.netcore.Windows.cs
+
Microsoft\Data\SqlClient\SqlColumnEncryptionCngProvider.Windows.cs
@@ -867,7 +870,6 @@
Microsoft\Data\SqlTypes\SqlFileStream.Windows.cs
-
@@ -886,9 +888,11 @@
Microsoft\Data\SqlClient\LocalDb\LocalDbApi.Unix.cs
+
+ Microsoft\Data\SqlClient\PacketHandle.netcore.Unix.cs
+
-
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/PacketHandle.Unix.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/PacketHandle.netcore.Unix.cs
similarity index 67%
rename from src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/PacketHandle.Unix.cs
rename to src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/PacketHandle.netcore.Unix.cs
index 63ba0014c4..3ec188d79d 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/PacketHandle.Unix.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/PacketHandle.netcore.Unix.cs
@@ -2,15 +2,17 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using System;
+#if NET
namespace Microsoft.Data.SqlClient
{
- // this structure is used for transporting packet handle references between the TdsParserStateObject
- // base class and Managed or Native implementations.
- // It prevents the native IntPtr type from being boxed and prevents the need to cast from object which loses compile time type safety
- // It carries type information so that assertions about the type of handle can be made in the implemented abstract methods
- // it is a ref struct so that it can only be used to transport the handles and not store them
+ // This structure is used for transporting packet handle references between the
+ // TdsParserStateObject base class and Managed or Native implementations.
+ // It prevents the native IntPtr type from being boxed and prevents the need to cast from
+ // object which loses compile time type safety.
+ // It carries type information so that assertions about the type of handle can be made in the
+ // implemented abstract methods.
+ // It is a ref struct so that it can only be used to transport the handles and not store them
// N.B. If you change this type you must also change the version for the other platform
@@ -29,6 +31,9 @@ private PacketHandle(SNI.SNIPacket managedPacket, int type)
ManagedPacket = managedPacket;
}
- public static PacketHandle FromManagedPacket(SNI.SNIPacket managedPacket) => new PacketHandle(managedPacket, ManagedPacketType);
+ public static PacketHandle FromManagedPacket(SNI.SNIPacket managedPacket) =>
+ new PacketHandle(managedPacket, ManagedPacketType);
}
}
+
+#endif
diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/PacketHandle.Windows.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/PacketHandle.netcore.Windows.cs
similarity index 66%
rename from src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/PacketHandle.Windows.cs
rename to src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/PacketHandle.netcore.Windows.cs
index 15c2ae58eb..aca8292100 100644
--- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/PacketHandle.Windows.cs
+++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/PacketHandle.netcore.Windows.cs
@@ -2,15 +2,19 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#if NET
+
using System;
namespace Microsoft.Data.SqlClient
{
- // this structure is used for transporting packet handle references between the TdsParserStateObject
- // base class and Managed or Native implementations.
- // It prevents the native IntPtr type from being boxed and prevents the need to cast from object which loses compile time type safety
- // It carries type information so that assertions about the type of handle can be made in the implemented abstract methods
- // it is a ref struct so that it can only be used to transport the handles and not store them
+ // This structure is used for transporting packet handle references between the
+ // TdsParserStateObject base class and Managed or Native implementations.
+ // It prevents the native IntPtr type from being boxed and prevents the need to cast from
+ // object which loses compile time type safety.
+ // It carries type information so that assertions about the type of handle can be made in the
+ // implemented abstract methods.
+ // It is a ref struct so that it can only be used to transport the handles and not store them
// N.B. If you change this type you must also change the version for the other platform
@@ -20,10 +24,9 @@ internal readonly ref struct PacketHandle
public const int NativePacketType = 2;
public const int ManagedPacketType = 3;
- public readonly IntPtr NativePointer;
- public readonly SNIPacket NativePacket;
-
public readonly SNI.SNIPacket ManagedPacket;
+ public readonly SNIPacket NativePacket;
+ public readonly IntPtr NativePointer;
public readonly int Type;
private PacketHandle(IntPtr nativePointer, SNIPacket nativePacket, SNI.SNIPacket managedPacket, int type)
@@ -34,12 +37,17 @@ private PacketHandle(IntPtr nativePointer, SNIPacket nativePacket, SNI.SNIPacket
NativePacket = nativePacket;
}
- public static PacketHandle FromManagedPacket(SNI.SNIPacket managedPacket) => new PacketHandle(default, default, managedPacket, ManagedPacketType);
+ public static PacketHandle FromManagedPacket(SNI.SNIPacket managedPacket) =>
+ new PacketHandle(default, default, managedPacket, ManagedPacketType);
- public static PacketHandle FromNativePointer(IntPtr nativePointer) => new PacketHandle(nativePointer, default, default, NativePointerType);
+ public static PacketHandle FromNativePointer(IntPtr nativePointer) =>
+ new PacketHandle(nativePointer, default, default, NativePointerType);
- public static PacketHandle FromNativePacket(SNIPacket nativePacket) => new PacketHandle(default, nativePacket, default, NativePacketType);
+ public static PacketHandle FromNativePacket(SNIPacket nativePacket) =>
+ new PacketHandle(default, nativePacket, default, NativePacketType);
}
-}
\ No newline at end of file
+}
+
+#endif