[src] Make sure the (IntPtr/NativeHandle, bool) ctor is always preserved (conditionally) for types that subclass NativeObject. Fixes #13699. (#13708)

Also add test to make sure we never forget again.

Fixes https://github.com/xamarin/xamarin-macios/issues/13699.
This commit is contained in:
Rolf Bjarne Kvinge 2022-01-14 15:26:23 +01:00 коммит произвёл GitHub
Родитель 8050ca36ed
Коммит a34ca54cc2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
109 изменённых файлов: 233 добавлений и 0 удалений

Просмотреть файл

@ -166,6 +166,7 @@ namespace AddressBook {
return new ABAddressBook (handle, true);
}
[Preserve (Conditional = true)]
internal ABAddressBook (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -97,6 +97,7 @@ namespace AddressBook {
Handle = ABGroupCreateInSource (source.Handle);
}
[Preserve (Conditional = true)]
internal ABGroup (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -219,6 +219,7 @@ namespace AddressBook {
internal Converter<NativeHandle, T> toManaged;
internal Converter<T, NativeHandle> toNative;
[Preserve (Conditional = true)]
internal ABMultiValue (NativeHandle handle, bool owns)
: this (handle,
v => (T) (object) Runtime.GetNSObject (v)!,
@ -315,6 +316,7 @@ namespace AddressBook {
#endif
public class ABMutableMultiValue<T> : ABMultiValue<T>
{
[Preserve (Conditional = true)]
internal ABMutableMultiValue (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -621,6 +621,7 @@ namespace AddressBook {
{
}
[Preserve (Conditional = true)]
internal ABPerson (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -58,6 +58,7 @@ namespace AddressBook {
#endif
#endif
public class ABSource : ABRecord {
[Preserve (Conditional = true)]
internal ABSource (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -102,6 +102,7 @@ namespace AudioToolbox
public event AudioConverterComplexInputData? InputData;
[Preserve (Conditional = true)]
internal AudioConverter (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -565,6 +565,7 @@ namespace AudioToolbox {
}
#endif
[Preserve (Conditional = true)]
internal AudioFile (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -83,6 +83,7 @@ namespace AudioToolbox {
[DllImport (Constants.AudioToolboxLibrary)]
extern static /* OSStatus */ MusicPlayerStatus DisposeMusicPlayer (/* MusicPlayer */ IntPtr inPlayer);
[Preserve (Conditional = true)]
MusicPlayer (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -43,6 +43,7 @@ namespace AudioToolbox {
public class MusicSequence : DisposableObject
{
#if !COREBUILD
[Preserve (Conditional = true)]
internal MusicSequence (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -235,6 +235,7 @@ namespace AudioUnit
public class AudioComponent : DisposableObject {
#if !COREBUILD
[Preserve (Conditional = true)]
internal AudioComponent (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -313,6 +313,7 @@ namespace AudioUnit
Dictionary<uint, RenderDelegate>? renderer;
Dictionary<uint, InputDelegate>? inputs;
[Preserve (Conditional = true)]
internal AudioUnit (NativeHandle handle, bool owns)
: base (handle, owns)
{
@ -1044,6 +1045,7 @@ namespace AudioUnit
{
}
[Preserve (Conditional = true)]
internal AURenderEventEnumerator (NativeHandle handle, bool owns)
{
Handle = handle;

Просмотреть файл

@ -28,6 +28,7 @@ namespace CoreServices {
#endif
public class CFHTTPAuthentication : CFType {
[Preserve (Conditional = true)]
internal CFHTTPAuthentication (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -31,6 +31,7 @@ namespace CoreServices {
#endif
public partial class CFHTTPMessage : CFType {
[Preserve (Conditional = true)]
internal CFHTTPMessage (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -34,6 +34,7 @@ namespace CoreServices {
#endif
public partial class CFHTTPStream : CFReadStream {
[Preserve (Conditional = true)]
internal CFHTTPStream (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -50,6 +50,7 @@ namespace CoreServices {
#endif
#endif
class CFHost : NativeObject {
[Preserve (Conditional = true)]
internal CFHost (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -59,6 +59,7 @@ namespace CoreFoundation {
}
#endif
[Preserve (Conditional = true)]
#if NET
internal CFAllocator (NativeHandle handle, bool owns)
#else

Просмотреть файл

@ -37,6 +37,7 @@ namespace CoreFoundation {
public string Creator { get; private set; }
}
[Preserve (Conditional = true)]
internal CFBundle (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -40,6 +40,7 @@ using NativeHandle = System.IntPtr;
namespace CoreFoundation {
class CFData : NativeObject {
[Preserve (Conditional = true)]
internal CFData (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -45,6 +45,7 @@ namespace CoreFoundation {
public static IntPtr KeyCallbacks;
public static IntPtr ValueCallbacks;
[Preserve (Conditional = true)]
internal CFDictionary (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -50,6 +50,7 @@ namespace CoreFoundation
}
#endif
[Preserve (Conditional = true)]
#if NET
internal CFMachPort (NativeHandle handle, bool owns)
#else

Просмотреть файл

@ -58,6 +58,7 @@ namespace CoreFoundation {
public class CFNotificationCenter : NativeObject {
// If this becomes public for some reason, and more than three instances are created, you should revisit the lookup code
[Preserve (Conditional = true)]
internal CFNotificationCenter (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -38,6 +38,7 @@ namespace CoreFoundation
static nint CFNumberTypeID = CFNumberGetTypeID ();
[Preserve (Conditional = true)]
#if NET
internal CFPropertyList (NativeHandle handle, bool owns)
#else

Просмотреть файл

@ -56,6 +56,7 @@ namespace CoreFoundation {
}
#endif
[Preserve (Conditional = true)]
internal CFReadStream (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -79,6 +79,7 @@ namespace CoreFoundation {
}
#endif
[Preserve (Conditional = true)]
#if NET
internal CFRunLoopSource (NativeHandle handle, bool owns)
#else

Просмотреть файл

@ -33,7 +33,9 @@ using System;
using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using CoreFoundation;
using Foundation;
using ObjCRuntime;
#if !NET
@ -335,6 +337,7 @@ namespace CoreFoundation {
}
}
[Preserve (Conditional = true)]
CFSocket (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -727,6 +727,7 @@ namespace CoreFoundation {
}
#endif
[Preserve (Conditional = true)]
protected CFStream (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -8,6 +8,7 @@ using System;
using System.Runtime.InteropServices;
using CoreFoundation;
using Foundation;
using ObjCRuntime;
#if !NET
@ -28,6 +29,7 @@ namespace CoreFoundation {
}
#endif
[Preserve (Conditional = true)]
internal CFType (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -60,6 +60,7 @@ namespace CoreFoundation {
/* CFURLPathStyle */ nint pathStyle,
/* Boolean */ [MarshalAs (UnmanagedType.I1)] bool isDirectory);
[Preserve (Conditional = true)]
internal CFUrl (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -48,6 +48,7 @@ using NativeHandle = System.IntPtr;
namespace CoreFoundation {
public class CFWriteStream : CFStream {
[Preserve (Conditional = true)]
internal CFWriteStream (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -760,6 +760,7 @@ namespace CoreFoundation {
public class DispatchGroup : DispatchObject
{
#if !COREBUILD
[Preserve (Conditional = true)]
private DispatchGroup (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -26,6 +26,7 @@ namespace CoreFoundation {
[Mac (10, 10)]
#endif
public sealed class DispatchBlock : NativeObject {
[Preserve (Conditional = true)]
internal DispatchBlock (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -39,6 +39,7 @@ namespace CoreFoundation {
public partial class DispatchData : DispatchObject {
#if !COREBUILD
[Preserve (Conditional = true)]
#if NET
internal DispatchData (NativeHandle handle, bool owns) : base (handle, owns)
#else

Просмотреть файл

@ -21,6 +21,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using Foundation;
using ObjCRuntime;
using System.Runtime.InteropServices;
using System.Collections.Generic;
@ -74,6 +76,7 @@ namespace CoreFoundation {
[DllImport ("__Internal")]
extern static void xamarin_os_log (IntPtr logHandle, OSLogLevel level, string message);
[Preserve (Conditional = true)]
internal OSLog (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -87,6 +87,7 @@ namespace CoreGraphics {
}
#endif
[Preserve (Conditional = true)]
internal CGEvent (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -38,6 +38,7 @@ namespace CoreGraphics {
}
#endif
[Preserve (Conditional = true)]
#if NET
internal CGEventSource (NativeHandle handle, bool owns)
#else

Просмотреть файл

@ -30,6 +30,8 @@
using System;
using System.Runtime.InteropServices;
using Foundation;
using ObjCRuntime;
#if !NET
@ -57,6 +59,7 @@ namespace CoreGraphics {
}
#endif
[Preserve (Conditional = true)]
internal CGPDFPage (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -293,6 +293,7 @@ namespace CoreMedia {
[Watch (6,0)]
#endif
public class CMAudioFormatDescription : CMFormatDescription {
[Preserve (Conditional = true)]
internal CMAudioFormatDescription (NativeHandle handle, bool owns)
: base (handle, owns)
{
@ -305,6 +306,7 @@ namespace CoreMedia {
[Watch (6,0)]
#endif
public partial class CMVideoFormatDescription : CMFormatDescription {
[Preserve (Conditional = true)]
internal CMVideoFormatDescription (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -34,6 +34,7 @@ namespace CoreMedia {
}
#endif
[Preserve (Conditional = true)]
internal CMClock (NativeHandle handle, bool owns)
: base (handle, owns)
{
@ -122,6 +123,7 @@ namespace CoreMedia {
}
#endif
[Preserve (Conditional = true)]
private CMTimebase (NativeHandle handle, bool owns)
: base (handle, owns)
{
@ -741,6 +743,7 @@ namespace CoreMedia {
}
#endif
[Preserve (Conditional = true)]
internal CMClockOrTimebase (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -1485,6 +1485,7 @@ namespace CoreText {
}
public partial class CTFont : NativeObject {
[Preserve (Conditional = true)]
internal CTFont (NativeHandle handle, bool owns)
: base (handle, owns, true)
{

Просмотреть файл

@ -99,6 +99,7 @@ namespace CoreText {
}
public class CTFontCollection : NativeObject {
[Preserve (Conditional = true)]
internal CTFontCollection (NativeHandle handle, bool owns)
: base (handle, owns, verify: true)
{

Просмотреть файл

@ -355,6 +355,7 @@ namespace CoreText {
}
public class CTFontDescriptor : NativeObject {
[Preserve (Conditional = true)]
internal CTFontDescriptor (NativeHandle handle, bool owns)
: base (handle, owns, true)
{

Просмотреть файл

@ -112,6 +112,7 @@ namespace CoreText {
}
public class CTFrame : NativeObject {
[Preserve (Conditional = true)]
internal CTFrame (NativeHandle handle, bool owns)
: base (handle, owns, verify: true)
{

Просмотреть файл

@ -43,6 +43,7 @@ using NativeHandle = System.IntPtr;
namespace CoreText {
public class CTFramesetter : NativeObject {
[Preserve (Conditional = true)]
internal CTFramesetter (NativeHandle handle, bool owns)
: base (handle, owns, true)
{

Просмотреть файл

@ -56,6 +56,7 @@ namespace CoreText {
#endregion
public class CTGlyphInfo : NativeObject {
[Preserve (Conditional = true)]
internal CTGlyphInfo (NativeHandle handle, bool owns)
: base (handle, owns, true)
{

Просмотреть файл

@ -64,6 +64,7 @@ namespace CoreText {
}
public class CTLine : NativeObject {
[Preserve (Conditional = true)]
internal CTLine (NativeHandle handle, bool owns)
: base (handle, owns, true)
{

Просмотреть файл

@ -320,6 +320,7 @@ namespace CoreText {
}
public class CTParagraphStyle : NativeObject {
[Preserve (Conditional = true)]
internal CTParagraphStyle (NativeHandle handle, bool owns)
: base (handle, owns, true)
{

Просмотреть файл

@ -53,6 +53,7 @@ namespace CoreText {
}
public class CTRun : NativeObject {
[Preserve (Conditional = true)]
internal CTRun (NativeHandle handle, bool owns)
: base (handle, owns, true)
{

Просмотреть файл

@ -179,6 +179,7 @@ namespace CoreText {
}
public class CTRunDelegate : NativeObject, IDisposable {
[Preserve (Conditional = true)]
internal CTRunDelegate (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -84,6 +84,7 @@ namespace CoreText {
#endregion
public class CTTextTab : NativeObject {
[Preserve (Conditional = true)]
internal CTTextTab (NativeHandle handle, bool owns)
: base (handle, owns, verify: true)
{

Просмотреть файл

@ -110,6 +110,7 @@ namespace CoreText {
#endregion
public class CTTypesetter : NativeObject {
[Preserve (Conditional = true)]
internal CTTypesetter (NativeHandle handle, bool owns)
: base (handle, owns, verify: true)
{

Просмотреть файл

@ -31,6 +31,7 @@ namespace CoreVideo {
[iOS (8,0), Mac (12,0), MacCatalyst (15,0)]
#endif
public class CVMetalTexture : NativeObject {
[Preserve (Conditional = true)]
internal CVMetalTexture (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -42,6 +42,7 @@ namespace CoreVideo {
/* CFDictionaryRef __nullable */ IntPtr textureAttributes,
/* CVMetalTextureCacheRef __nullable * __nonnull */ out IntPtr cacheOut);
[Preserve (Conditional = true)]
internal CVMetalTextureCache (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -30,6 +30,7 @@
#if MONOMAC
using System;
using Foundation;
using ObjCRuntime;
using System.Runtime.InteropServices;
using System.Collections.Generic;
@ -72,6 +73,7 @@ namespace Darwin {
{
}
[Preserve (Conditional = true)]
SystemLog (NativeHandle handle, bool owns)
: base (handle, owns)
{
@ -199,6 +201,7 @@ namespace Darwin {
True = 7
}
[Preserve (Conditional = true)]
internal Message (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -32,6 +32,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWAdvertiseDescriptor : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWAdvertiseDescriptor (NativeHandle handle, bool owns) : base (handle, owns)
#else

Просмотреть файл

@ -35,6 +35,7 @@ namespace Network {
#endif
public class NWBrowseResult : NativeObject {
[Preserve (Conditional = true)]
internal NWBrowseResult (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -45,6 +45,7 @@ namespace Network {
bool queueSet = false;
object startLock = new Object ();
[Preserve (Conditional = true)]
internal NWBrowser (NativeHandle handle, bool owns) : base (handle, owns)
{
SetChangesHandler (InternalChangesHandler);

Просмотреть файл

@ -33,6 +33,7 @@ namespace Network {
#endif
public class NWBrowserDescriptor: NativeObject {
[Preserve (Conditional = true)]
internal NWBrowserDescriptor (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -54,6 +54,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWConnection : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWConnection (NativeHandle handle, bool owns) : base (handle, owns) {}
#else

Просмотреть файл

@ -45,6 +45,7 @@ namespace Network {
[SupportedOSPlatform ("maccatalyst14.0")]
#endif
public class NWConnectionGroup : NativeObject {
[Preserve (Conditional = true)]
protected internal NWConnectionGroup (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -35,6 +35,7 @@ namespace Network {
#endif
public class NWContentContext : NativeObject {
bool global;
[Preserve (Conditional = true)]
#if NET
internal NWContentContext (NativeHandle handle, bool owns) : base (handle, owns)
#else

Просмотреть файл

@ -36,6 +36,7 @@ namespace Network {
#endif
public class NWDataTransferReport : NativeObject {
[Preserve (Conditional = true)]
internal NWDataTransferReport (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -34,6 +34,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWEndpoint : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWEndpoint (NativeHandle handle, bool owns) : base (handle, owns) {}
#else

Просмотреть файл

@ -30,6 +30,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWError : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWError (NativeHandle handle, bool owns) : base (handle, owns)
#else

Просмотреть файл

@ -39,6 +39,7 @@ namespace Network {
#endif
public class NWEstablishmentReport : NativeObject {
[Preserve (Conditional = true)]
internal NWEstablishmentReport (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -41,6 +41,7 @@ namespace Network {
#endif
public class NWEthernetChannel : NativeObject {
[Preserve (Conditional = true)]
internal NWEthernetChannel (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -42,6 +42,7 @@ namespace Network {
[SupportedOSPlatform ("macos10.15")]
#endif
public class NWFramer : NativeObject {
[Preserve (Conditional = true)]
internal NWFramer (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -39,6 +39,7 @@ namespace Network {
[SupportedOSPlatform ("macos10.15")]
#endif
public class NWFramerMessage : NWProtocolMetadata {
[Preserve (Conditional = true)]
internal NWFramerMessage (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -29,6 +29,7 @@ namespace Network {
#endif
public class NWIPMetadata : NWProtocolMetadata {
[Preserve (Conditional = true)]
internal NWIPMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWIPMetadata () : this (nw_ip_create_metadata (), owns: true) {}

Просмотреть файл

@ -33,6 +33,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWInterface : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWInterface (NativeHandle handle, bool owns) : base (handle, owns) {}
#else

Просмотреть файл

@ -34,6 +34,7 @@ namespace Network {
public class NWListener : NativeObject {
bool connectionHandlerWasSet = false;
object connectionHandlerLock = new object ();
[Preserve (Conditional = true)]
#if NET
internal NWListener (NativeHandle handle, bool owns) : base (handle, owns)
#else

Просмотреть файл

@ -25,6 +25,7 @@ namespace Network {
[SupportedOSPlatform ("maccatalyst14.0")]
#endif
public class NWMulticastGroup : NativeObject {
[Preserve (Conditional = true)]
internal NWMulticastGroup (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -25,6 +25,7 @@ namespace Network {
[DllImport (Constants.NetworkLibrary)]
static extern OS_nw_group_descriptor nw_group_descriptor_create_multiplex (OS_nw_endpoint remoteEndpoint);
[Preserve (Conditional = true)]
internal NWMultiplexGroup (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWMultiplexGroup (NWEndpoint endpoint)

Просмотреть файл

@ -12,6 +12,8 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
using CoreFoundation;
@ -34,6 +36,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWParameters : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWParameters (NativeHandle handle, bool owns) : base (handle, owns) {}
#else

Просмотреть файл

@ -31,6 +31,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWPath : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWPath (NativeHandle handle, bool owns) : base (handle, owns) {}
#else

Просмотреть файл

@ -33,6 +33,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWPathMonitor : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWPathMonitor (NativeHandle handle, bool owns) : base (handle, owns) {}
#else

Просмотреть файл

@ -24,6 +24,7 @@ namespace Network {
public static NWPrivacyContext Default =>
new NWPrivacyContext (NWPrivacyContextConstants._DefaultContext, false);
[Preserve (Conditional = true)]
#if NET
internal NWPrivacyContext (NativeHandle handle, bool owns) : base (handle, owns) {}
#else

Просмотреть файл

@ -33,6 +33,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWProtocolDefinition : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWProtocolDefinition (NativeHandle handle, bool owns) : base (handle, owns) {}
#else

Просмотреть файл

@ -35,6 +35,7 @@ namespace Network {
[SupportedOSPlatform ("macos10.15")]
#endif
public class NWProtocolIPOptions : NWProtocolOptions {
[Preserve (Conditional = true)]
internal NWProtocolIPOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
public void SetVersion (NWIPVersion version)

Просмотреть файл

@ -58,6 +58,7 @@ namespace Network {
}
#endif
[Preserve (Conditional = true)]
#if NET
internal NWProtocolMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
#else

Просмотреть файл

@ -34,6 +34,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWProtocolOptions : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWProtocolOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
#else

Просмотреть файл

@ -1,6 +1,7 @@
using System;
using System.Runtime.InteropServices;
using Foundation;
using ObjCRuntime;
using Security;
using System.Runtime.Versioning;
@ -24,6 +25,7 @@ namespace Network {
#endif
public class NWProtocolQuicOptions : NWProtocolOptions {
[Preserve (Conditional = true)]
internal NWProtocolQuicOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWProtocolQuicOptions () : this (nw_quic_create_options (), owns: true) {}

Просмотреть файл

@ -36,6 +36,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWProtocolStack : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWProtocolStack (NativeHandle handle, bool owns) : base (handle, owns) {}
#else

Просмотреть файл

@ -35,6 +35,7 @@ namespace Network {
#endif
public class NWProtocolTcpOptions : NWProtocolOptions {
[Preserve (Conditional = true)]
internal NWProtocolTcpOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWProtocolTcpOptions () : this (nw_tcp_create_options (), owns: true) {}

Просмотреть файл

@ -33,6 +33,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWProtocolTlsOptions : NWProtocolOptions {
[Preserve (Conditional = true)]
internal NWProtocolTlsOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWProtocolTlsOptions () : this (nw_tls_create_options (), owns: true) {}

Просмотреть файл

@ -29,6 +29,7 @@ namespace Network {
[SupportedOSPlatform ("tvos12.0")]
#endif
public class NWProtocolUdpOptions : NWProtocolOptions {
[Preserve (Conditional = true)]
internal NWProtocolUdpOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWProtocolUdpOptions () : this (nw_udp_create_options (), owns: true) {}

Просмотреть файл

@ -2,6 +2,7 @@ using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Foundation;
using ObjCRuntime;
using Security;
@ -23,6 +24,7 @@ namespace Network {
#endif
public class NWQuicMetadata : NWProtocolMetadata {
[Preserve (Conditional = true)]
#if NET
internal NWQuicMetadata (NativeHandle handle, bool owns) : base (handle, owns) { }
#else

Просмотреть файл

@ -25,6 +25,7 @@ namespace Network {
#endif
public class NWResolutionReport : NativeObject {
[Preserve (Conditional = true)]
internal NWResolutionReport (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -2,6 +2,8 @@
using System;
using System.Runtime.InteropServices;
using Foundation;
using ObjCRuntime;
using CoreFoundation;
using System.Runtime.Versioning;
@ -22,6 +24,7 @@ namespace Network {
#endif
public class NWResolverConfig : NativeObject {
[Preserve (Conditional = true)]
#if NET
internal NWResolverConfig (NativeHandle handle, bool owns) : base (handle, owns) {}
#else

Просмотреть файл

@ -29,6 +29,7 @@ namespace Network {
#endif
public class NWTcpMetadata : NWProtocolMetadata {
[Preserve (Conditional = true)]
internal NWTcpMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
public uint AvailableReceiveBuffer => nw_tcp_get_available_receive_buffer (GetCheckedHandle ());

Просмотреть файл

@ -30,6 +30,7 @@ namespace Network {
#endif
public class NWTlsMetadata : NWProtocolMetadata {
[Preserve (Conditional = true)]
internal NWTlsMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
public SecProtocolMetadata SecProtocolMetadata

Просмотреть файл

@ -37,6 +37,7 @@ namespace Network {
[SupportedOSPlatform ("macos10.15")]
#endif
public class NWTxtRecord : NativeObject {
[Preserve (Conditional = true)]
internal NWTxtRecord (NativeHandle handle, bool owns) : base (handle, owns) { }
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -30,6 +30,7 @@ namespace Network {
#endif
public class NWUdpMetadata : NWProtocolMetadata {
[Preserve (Conditional = true)]
internal NWUdpMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
public NWUdpMetadata () : this (nw_udp_create_metadata (), owns: true) {}

Просмотреть файл

@ -36,6 +36,7 @@ namespace Network {
#endif
public class NWWebSocketMetadata : NWProtocolMetadata {
[Preserve (Conditional = true)]
internal NWWebSocketMetadata (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -38,6 +38,7 @@ namespace Network {
bool skipHandShake = false;
nuint maximumMessageSize;
[Preserve (Conditional = true)]
internal NWWebSocketOptions (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -33,6 +33,7 @@ namespace Network {
[SupportedOSPlatform ("macos10.15")]
#endif
public class NWWebSocketRequest : NativeObject {
[Preserve (Conditional = true)]
internal NWWebSocketRequest (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary)]

Просмотреть файл

@ -34,6 +34,7 @@ namespace Network {
#endif
public class NWWebSocketResponse : NativeObject {
[Preserve (Conditional = true)]
internal NWWebSocketResponse (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.NetworkLibrary, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]

Просмотреть файл

@ -26,6 +26,7 @@ using NativeHandle = System.IntPtr;
namespace PrintCore {
public class PMPrintCoreBase : NativeObject {
[Preserve (Conditional = true)]
internal PMPrintCoreBase (NativeHandle handle, bool owns)
: base (handle, owns)
{
@ -56,6 +57,7 @@ namespace PrintCore {
[DllImport (Constants.PrintCoreLibrary)]
extern static PMStatusCode PMCreateSession (out IntPtr session);
[Preserve (Conditional = true)]
internal PMPrintSession (NativeHandle handle, bool owns) : base (handle, owns) {}
static IntPtr Create ()
@ -160,6 +162,7 @@ namespace PrintCore {
[DllImport (Constants.PrintCoreLibrary)]
extern static PMStatusCode PMCreatePrintSettings (out IntPtr session);
[Preserve (Conditional = true)]
internal PMPrintSettings (NativeHandle handle, bool owns)
: base (handle, owns)
{
@ -319,6 +322,7 @@ namespace PrintCore {
[DllImport (Constants.PrintCoreLibrary)]
extern static PMStatusCode PMCreatePageFormatWithPMPaper (out IntPtr handle, IntPtr paper);
[Preserve (Conditional = true)]
internal PMPageFormat (NativeHandle handle, bool owns): base (handle, owns) {}
static IntPtr Create (PMPaper? paper = null)
@ -398,6 +402,7 @@ namespace PrintCore {
}
public class PMPaper : PMPrintCoreBase {
[Preserve (Conditional = true)]
internal PMPaper (NativeHandle handle, bool owns) : base (handle, owns) {}
[DllImport (Constants.PrintCoreLibrary)]
extern static PMStatusCode PMPaperGetID (IntPtr handle, out IntPtr str);
@ -465,6 +470,7 @@ namespace PrintCore {
[DllImport (Constants.PrintCoreLibrary)]
extern static IntPtr PMPrinterCreateFromPrinterID (IntPtr id);
[Preserve (Conditional = true)]
internal PMPrinter (NativeHandle handle, bool owns) : base (handle, owns) {}
static IntPtr Create ()

Просмотреть файл

@ -47,6 +47,7 @@ namespace SearchKit
public class SKSearch : NativeObject
{
[Preserve (Conditional = true)]
internal SKSearch (NativeHandle handle, bool owns)
: base (handle, owns)
{
@ -134,6 +135,7 @@ namespace SearchKit
{
}
[Preserve (Conditional = true)]
internal SKDocument (NativeHandle handle, bool owns)
: base (handle, owns)
{
@ -197,6 +199,7 @@ namespace SearchKit
[DllImport (Constants.SearchKitLibrary)]
extern static void SKIndexClose (IntPtr handle);
[Preserve (Conditional = true)]
SKIndex (NativeHandle handle, bool owns)
: base (handle, owns)
{
@ -490,6 +493,7 @@ namespace SearchKit
public class SKSummary : NativeObject
{
[Preserve (Conditional = true)]
internal SKSummary (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -154,6 +154,7 @@ namespace Security {
[DllImport (Constants.SecurityLibrary)]
extern static int /* OSStatus = int */ AuthorizationFree (IntPtr handle, AuthorizationFlags flags);
[Preserve (Conditional = true)]
internal Authorization (NativeHandle handle, bool owns)
: base (handle, owns)
{

Просмотреть файл

@ -106,6 +106,7 @@ namespace Security {
#endif
public partial class SecAccessControl : NativeObject {
#if !COREBUILD
[Preserve (Conditional = true)]
internal SecAccessControl (NativeHandle handle, bool owns)
: base (handle, owns)
{

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше