2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
- #if NET
6
-
7
5
using System ;
8
6
9
7
namespace Microsoft . Data . SqlClient
@@ -22,21 +20,33 @@ internal readonly ref struct PacketHandle
22
20
{
23
21
public const int NativePointerType = 1 ;
24
22
public const int NativePacketType = 2 ;
23
+ #if NET
25
24
public const int ManagedPacketType = 3 ;
26
25
27
26
public readonly SNI . SNIPacket ManagedPacket ;
27
+ #endif
28
28
public readonly SNIPacket NativePacket ;
29
29
public readonly IntPtr NativePointer ;
30
30
public readonly int Type ;
31
31
32
+ #if NET
32
33
private PacketHandle ( IntPtr nativePointer , SNIPacket nativePacket , SNI . SNIPacket managedPacket , int type )
33
34
{
34
35
Type = type ;
35
36
ManagedPacket = managedPacket ;
36
37
NativePointer = nativePointer ;
37
38
NativePacket = nativePacket ;
38
39
}
40
+ #else
41
+ private PacketHandle ( IntPtr nativePointer , SNIPacket nativePacket , int type )
42
+ {
43
+ Type = type ;
44
+ NativePointer = nativePointer ;
45
+ NativePacket = nativePacket ;
46
+ }
47
+ #endif
39
48
49
+ #if NET
40
50
public static PacketHandle FromManagedPacket ( SNI . SNIPacket managedPacket ) =>
41
51
new PacketHandle ( default , default , managedPacket , ManagedPacketType ) ;
42
52
@@ -45,9 +55,12 @@ public static PacketHandle FromNativePointer(IntPtr nativePointer) =>
45
55
46
56
public static PacketHandle FromNativePacket ( SNIPacket nativePacket ) =>
47
57
new PacketHandle ( default , nativePacket , default , NativePacketType ) ;
58
+ #else
59
+ public static PacketHandle FromNativePointer ( IntPtr nativePointer ) =>
60
+ new PacketHandle ( nativePointer , default , NativePointerType ) ;
48
61
49
-
62
+ public static PacketHandle FromNativePacket ( SNIPacket nativePacket ) =>
63
+ new PacketHandle ( default , nativePacket , NativePacketType ) ;
64
+ #endif
50
65
}
51
66
}
52
-
53
- #endif
0 commit comments