diff --git a/eng/ApiCompatExcludeAttributes.txt b/eng/ApiCompatExcludeAttributes.txt
index 83aa68c922346..325c9fa1f934a 100644
--- a/eng/ApiCompatExcludeAttributes.txt
+++ b/eng/ApiCompatExcludeAttributes.txt
@@ -1,3 +1,4 @@
T:System.Diagnostics.CodeAnalysis.MemberNotNullAttribute
T:System.Diagnostics.DebuggerGuidedStepThroughAttribute
T:System.Runtime.CompilerServices.EagerStaticClassConstructionAttribute
+T:System.Runtime.CompilerServices.NativeIntegerAttribute
diff --git a/eng/Versions.props b/eng/Versions.props
index e7db623f5862d..45b6ba1b75fb5 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -49,9 +49,9 @@
- 4.3.0-2.22261.3
+ 4.3.0-2.22270.2
- 2.0.0-alpha.1.21525.11
+ 2.0.0-preview.4.22252.4
7.0.0-beta.22255.2
7.0.0-beta.22255.2
diff --git a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CompatibilitySuppressions.xml b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..3b52b355d9329
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CompatibilitySuppressions.xml
@@ -0,0 +1,9 @@
+
+
+
+ CP0002
+ M:Microsoft.Extensions.Caching.Memory.PostEvictionDelegate.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/Microsoft.Extensions.Caching.Abstractions.dll
+ lib/net7.0/Microsoft.Extensions.Caching.Abstractions.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/CompatibilitySuppressions.xml b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..351221bb28d4a
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/CompatibilitySuppressions.xml
@@ -0,0 +1,9 @@
+
+
+
+ CP0002
+ M:Microsoft.Extensions.DependencyInjection.ObjectFactory.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll
+ lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection.Specification.Tests/src/CompatibilitySuppressions.xml b/src/libraries/Microsoft.Extensions.DependencyInjection.Specification.Tests/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..6b7b6bfd1c22a
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.DependencyInjection.Specification.Tests/src/CompatibilitySuppressions.xml
@@ -0,0 +1,9 @@
+
+
+
+ CP0002
+ M:Microsoft.Extensions.DependencyInjection.Specification.DependencyInjectionSpecificationTests.CreateInstanceFunc.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/Microsoft.Extensions.DependencyInjection.Specification.Tests.dll
+ lib/net7.0/Microsoft.Extensions.DependencyInjection.Specification.Tests.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/Microsoft.Win32.SystemEvents/src/CompatibilitySuppressions.xml b/src/libraries/Microsoft.Win32.SystemEvents/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..f41d235839d41
--- /dev/null
+++ b/src/libraries/Microsoft.Win32.SystemEvents/src/CompatibilitySuppressions.xml
@@ -0,0 +1,57 @@
+
+
+
+ CP0002
+ M:Microsoft.Win32.PowerModeChangedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/Microsoft.Win32.SystemEvents.dll
+ lib/net7.0/Microsoft.Win32.SystemEvents.dll
+
+
+ CP0002
+ M:Microsoft.Win32.SessionEndedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/Microsoft.Win32.SystemEvents.dll
+ lib/net7.0/Microsoft.Win32.SystemEvents.dll
+
+
+ CP0002
+ M:Microsoft.Win32.SessionEndingEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/Microsoft.Win32.SystemEvents.dll
+ lib/net7.0/Microsoft.Win32.SystemEvents.dll
+
+
+ CP0002
+ M:Microsoft.Win32.SessionSwitchEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/Microsoft.Win32.SystemEvents.dll
+ lib/net7.0/Microsoft.Win32.SystemEvents.dll
+
+
+ CP0002
+ M:Microsoft.Win32.SystemEvents.KillTimer(System.IntPtr)
+ lib/net6.0/Microsoft.Win32.SystemEvents.dll
+ lib/net7.0/Microsoft.Win32.SystemEvents.dll
+
+
+ CP0002
+ M:Microsoft.Win32.TimerElapsedEventArgs.#ctor(System.IntPtr)
+ lib/net6.0/Microsoft.Win32.SystemEvents.dll
+ lib/net7.0/Microsoft.Win32.SystemEvents.dll
+
+
+ CP0002
+ M:Microsoft.Win32.TimerElapsedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/Microsoft.Win32.SystemEvents.dll
+ lib/net7.0/Microsoft.Win32.SystemEvents.dll
+
+
+ CP0002
+ M:Microsoft.Win32.UserPreferenceChangedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/Microsoft.Win32.SystemEvents.dll
+ lib/net7.0/Microsoft.Win32.SystemEvents.dll
+
+
+ CP0002
+ M:Microsoft.Win32.UserPreferenceChangingEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/Microsoft.Win32.SystemEvents.dll
+ lib/net7.0/Microsoft.Win32.SystemEvents.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/System.CodeDom/src/CompatibilitySuppressions.xml b/src/libraries/System.CodeDom/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..b755bb33f2cdf
--- /dev/null
+++ b/src/libraries/System.CodeDom/src/CompatibilitySuppressions.xml
@@ -0,0 +1,15 @@
+
+
+
+ CP0002
+ M:System.CodeDom.Compiler.Executor.ExecWaitWithCapture(System.IntPtr,System.String,System.CodeDom.Compiler.TempFileCollection,System.String@,System.String@)
+ lib/net6.0/System.CodeDom.dll
+ lib/net7.0/System.CodeDom.dll
+
+
+ CP0002
+ M:System.CodeDom.Compiler.Executor.ExecWaitWithCapture(System.IntPtr,System.String,System.String,System.CodeDom.Compiler.TempFileCollection,System.String@,System.String@)
+ lib/net6.0/System.CodeDom.dll
+ lib/net7.0/System.CodeDom.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/System.Composition.Hosting/src/CompatibilitySuppressions.xml b/src/libraries/System.Composition.Hosting/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..e358a0e72439b
--- /dev/null
+++ b/src/libraries/System.Composition.Hosting/src/CompatibilitySuppressions.xml
@@ -0,0 +1,9 @@
+
+
+
+ CP0002
+ M:System.Composition.Hosting.Core.CompositeActivator.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Composition.Hosting.dll
+ lib/net7.0/System.Composition.Hosting.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/CompatibilitySuppressions.xml b/src/libraries/System.Configuration.ConfigurationManager/src/CompatibilitySuppressions.xml
index 8a07071730984..70889d28bf99a 100644
--- a/src/libraries/System.Configuration.ConfigurationManager/src/CompatibilitySuppressions.xml
+++ b/src/libraries/System.Configuration.ConfigurationManager/src/CompatibilitySuppressions.xml
@@ -36,4 +36,40 @@
lib/netstandard2.0/System.Configuration.ConfigurationManager.dll
lib/net462/System.Configuration.ConfigurationManager.dll
+
+ CP0002
+ M:System.Configuration.SettingChangingEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Configuration.ConfigurationManager.dll
+ lib/net7.0/System.Configuration.ConfigurationManager.dll
+
+
+ CP0002
+ M:System.Configuration.SettingsLoadedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Configuration.ConfigurationManager.dll
+ lib/net7.0/System.Configuration.ConfigurationManager.dll
+
+
+ CP0002
+ M:System.Configuration.SettingsSavingEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Configuration.ConfigurationManager.dll
+ lib/net7.0/System.Configuration.ConfigurationManager.dll
+
+
+ CP0002
+ M:System.Configuration.ValidatorCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Configuration.ConfigurationManager.dll
+ lib/net7.0/System.Configuration.ConfigurationManager.dll
+
+
+ CP0002
+ M:System.Configuration.Internal.InternalConfigEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Configuration.ConfigurationManager.dll
+ lib/net7.0/System.Configuration.ConfigurationManager.dll
+
+
+ CP0002
+ M:System.Configuration.Internal.StreamChangeCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Configuration.ConfigurationManager.dll
+ lib/net7.0/System.Configuration.ConfigurationManager.dll
+
\ No newline at end of file
diff --git a/src/libraries/System.Data.Odbc/src/CompatibilitySuppressions.xml b/src/libraries/System.Data.Odbc/src/CompatibilitySuppressions.xml
index 5971367836429..0c15b2d390f7c 100644
--- a/src/libraries/System.Data.Odbc/src/CompatibilitySuppressions.xml
+++ b/src/libraries/System.Data.Odbc/src/CompatibilitySuppressions.xml
@@ -347,4 +347,22 @@
lib/netstandard2.0/System.Data.Odbc.dll
true
+
+ CP0002
+ M:System.Data.Odbc.OdbcInfoMessageEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Data.Odbc.dll
+ lib/net7.0/System.Data.Odbc.dll
+
+
+ CP0002
+ M:System.Data.Odbc.OdbcRowUpdatedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Data.Odbc.dll
+ lib/net7.0/System.Data.Odbc.dll
+
+
+ CP0002
+ M:System.Data.Odbc.OdbcRowUpdatingEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Data.Odbc.dll
+ lib/net7.0/System.Data.Odbc.dll
+
\ No newline at end of file
diff --git a/src/libraries/System.Data.OleDb/src/CompatibilitySuppressions.xml b/src/libraries/System.Data.OleDb/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..19a4947b8f7be
--- /dev/null
+++ b/src/libraries/System.Data.OleDb/src/CompatibilitySuppressions.xml
@@ -0,0 +1,21 @@
+
+
+
+ CP0002
+ M:System.Data.OleDb.OleDbInfoMessageEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Data.OleDb.dll
+ lib/net7.0/System.Data.OleDb.dll
+
+
+ CP0002
+ M:System.Data.OleDb.OleDbRowUpdatedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Data.OleDb.dll
+ lib/net7.0/System.Data.OleDb.dll
+
+
+ CP0002
+ M:System.Data.OleDb.OleDbRowUpdatingEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Data.OleDb.dll
+ lib/net7.0/System.Data.OleDb.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/CompatibilitySuppressions.xml b/src/libraries/System.Diagnostics.DiagnosticSource/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..994ad65b2944d
--- /dev/null
+++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/CompatibilitySuppressions.xml
@@ -0,0 +1,27 @@
+
+
+
+ CP0002
+ M:System.Diagnostics.SampleActivity`1.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Diagnostics.DiagnosticSource.dll
+ lib/net7.0/System.Diagnostics.DiagnosticSource.dll
+
+
+ CP0002
+ M:System.Diagnostics.DistributedContextPropagator.PropagatorGetterCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Diagnostics.DiagnosticSource.dll
+ lib/net7.0/System.Diagnostics.DiagnosticSource.dll
+
+
+ CP0002
+ M:System.Diagnostics.DistributedContextPropagator.PropagatorSetterCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Diagnostics.DiagnosticSource.dll
+ lib/net7.0/System.Diagnostics.DiagnosticSource.dll
+
+
+ CP0002
+ M:System.Diagnostics.Metrics.MeasurementCallback`1.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Diagnostics.DiagnosticSource.dll
+ lib/net7.0/System.Diagnostics.DiagnosticSource.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/System.Diagnostics.EventLog/src/CompatibilitySuppressions.xml b/src/libraries/System.Diagnostics.EventLog/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..3c98c29c672ce
--- /dev/null
+++ b/src/libraries/System.Diagnostics.EventLog/src/CompatibilitySuppressions.xml
@@ -0,0 +1,9 @@
+
+
+
+ CP0002
+ M:System.Diagnostics.EntryWrittenEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Diagnostics.EventLog.dll
+ lib/net7.0/System.Diagnostics.EventLog.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/CompatibilitySuppressions.xml b/src/libraries/System.Diagnostics.PerformanceCounter/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..536f709eb9a6a
--- /dev/null
+++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/CompatibilitySuppressions.xml
@@ -0,0 +1,15 @@
+
+
+
+ CP0002
+ M:System.Diagnostics.ICollectData.CollectData(System.Int32,System.IntPtr,System.IntPtr,System.Int32,System.IntPtr@)
+ lib/net6.0/System.Diagnostics.PerformanceCounter.dll
+ lib/net7.0/System.Diagnostics.PerformanceCounter.dll
+
+
+ CP0006
+ M:System.Diagnostics.ICollectData.CollectData(System.Int32,System.IntPtr,System.IntPtr,System.Int32,System.IntPtr@)
+ lib/net6.0/System.Diagnostics.PerformanceCounter.dll
+ lib/net7.0/System.Diagnostics.PerformanceCounter.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml b/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..0eedfcc415e06
--- /dev/null
+++ b/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml
@@ -0,0 +1,33 @@
+
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.DereferenceConnectionCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.DirectoryServices.Protocols.dll
+ lib/net7.0/System.DirectoryServices.Protocols.dll
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.NotifyOfNewConnectionCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.DirectoryServices.Protocols.dll
+ lib/net7.0/System.DirectoryServices.Protocols.dll
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.QueryClientCertificateCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.DirectoryServices.Protocols.dll
+ lib/net7.0/System.DirectoryServices.Protocols.dll
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.QueryForConnectionCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.DirectoryServices.Protocols.dll
+ lib/net7.0/System.DirectoryServices.Protocols.dll
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.VerifyServerCertificateCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.DirectoryServices.Protocols.dll
+ lib/net7.0/System.DirectoryServices.Protocols.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/System.DirectoryServices/src/CompatibilitySuppressions.xml b/src/libraries/System.DirectoryServices/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..8f56bc5a74e02
--- /dev/null
+++ b/src/libraries/System.DirectoryServices/src/CompatibilitySuppressions.xml
@@ -0,0 +1,9 @@
+
+
+
+ CP0002
+ M:System.DirectoryServices.ActiveDirectory.SyncUpdateCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.DirectoryServices.dll
+ lib/net7.0/System.DirectoryServices.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/System.Drawing.Common/src/CompatibilitySuppressions.xml b/src/libraries/System.Drawing.Common/src/CompatibilitySuppressions.xml
index 4870097bdac77..e2ab49e117507 100644
--- a/src/libraries/System.Drawing.Common/src/CompatibilitySuppressions.xml
+++ b/src/libraries/System.Drawing.Common/src/CompatibilitySuppressions.xml
@@ -201,4 +201,640 @@
lib/netstandard2.0/System.Drawing.Common.dll
true
+
+ CP0002
+ M:System.Drawing.Bitmap.#ctor(System.Int32,System.Int32,System.Int32,System.Drawing.Imaging.PixelFormat,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Bitmap.FromHicon(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Bitmap.FromResource(System.IntPtr,System.String)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Brush.SetNativeBrush(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.BufferedGraphics.Render(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.BufferedGraphicsContext.Allocate(System.IntPtr,System.Drawing.Rectangle)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Font.FromHdc(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Font.FromHfont(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Font.FromLogFont(System.Object,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.DrawImageAbort.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.DrawImageAbort.Invoke(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.DrawImageAbort.BeginInvoke(System.IntPtr,System.AsyncCallback,System.Object)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafileProc.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafileProc.Invoke(System.Drawing.Imaging.EmfPlusRecordType,System.Int32,System.Int32,System.IntPtr,System.Drawing.Imaging.PlayRecordCallback)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafileProc.BeginInvoke(System.Drawing.Imaging.EmfPlusRecordType,System.Int32,System.Int32,System.IntPtr,System.Drawing.Imaging.PlayRecordCallback,System.AsyncCallback,System.Object)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.DrawImage(System.Drawing.Image,System.Drawing.Rectangle,System.Int32,System.Int32,System.Int32,System.Int32,System.Drawing.GraphicsUnit,System.Drawing.Imaging.ImageAttributes,System.Drawing.Graphics.DrawImageAbort,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.DrawImage(System.Drawing.Image,System.Drawing.Rectangle,System.Single,System.Single,System.Single,System.Single,System.Drawing.GraphicsUnit,System.Drawing.Imaging.ImageAttributes,System.Drawing.Graphics.DrawImageAbort,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.Point,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.Point,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr,System.Drawing.Imaging.ImageAttributes)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.Point,System.Drawing.Rectangle,System.Drawing.GraphicsUnit,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.Point,System.Drawing.Rectangle,System.Drawing.GraphicsUnit,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr,System.Drawing.Imaging.ImageAttributes)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.PointF,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.PointF,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr,System.Drawing.Imaging.ImageAttributes)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.PointF,System.Drawing.RectangleF,System.Drawing.GraphicsUnit,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.PointF,System.Drawing.RectangleF,System.Drawing.GraphicsUnit,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr,System.Drawing.Imaging.ImageAttributes)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.PointF[],System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.PointF[],System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr,System.Drawing.Imaging.ImageAttributes)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.PointF[],System.Drawing.RectangleF,System.Drawing.GraphicsUnit,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.PointF[],System.Drawing.RectangleF,System.Drawing.GraphicsUnit,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr,System.Drawing.Imaging.ImageAttributes)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.Point[],System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.Point[],System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr,System.Drawing.Imaging.ImageAttributes)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.Point[],System.Drawing.Rectangle,System.Drawing.GraphicsUnit,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.Point[],System.Drawing.Rectangle,System.Drawing.GraphicsUnit,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr,System.Drawing.Imaging.ImageAttributes)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.Rectangle,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.Rectangle,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr,System.Drawing.Imaging.ImageAttributes)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.Rectangle,System.Drawing.Rectangle,System.Drawing.GraphicsUnit,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.Rectangle,System.Drawing.Rectangle,System.Drawing.GraphicsUnit,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr,System.Drawing.Imaging.ImageAttributes)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.RectangleF,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.RectangleF,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr,System.Drawing.Imaging.ImageAttributes)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.RectangleF,System.Drawing.RectangleF,System.Drawing.GraphicsUnit,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.EnumerateMetafile(System.Drawing.Imaging.Metafile,System.Drawing.RectangleF,System.Drawing.RectangleF,System.Drawing.GraphicsUnit,System.Drawing.Graphics.EnumerateMetafileProc,System.IntPtr,System.Drawing.Imaging.ImageAttributes)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.FromHdc(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.FromHdc(System.IntPtr,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.FromHdcInternal(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.FromHwnd(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.FromHwndInternal(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.ReleaseHdc(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Graphics.ReleaseHdcInternal(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Icon.FromHandle(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Image.GetThumbnailImageAbort.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Image.FromHbitmap(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Image.FromHbitmap(System.IntPtr,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Image.GetThumbnailImage(System.Int32,System.Int32,System.Drawing.Image.GetThumbnailImageAbort,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Region.FromHrgn(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Region.ReleaseHrgn(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Text.PrivateFontCollection.AddMemoryFont(System.IntPtr,System.Int32)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Printing.PageSettings.CopyToHdevmode(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Printing.PageSettings.SetHdevmode(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Printing.PrinterSettings.SetHdevmode(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Printing.PrinterSettings.SetHdevnames(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Printing.PrintEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Printing.PrintPageEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Printing.QueryPageSettingsEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.EncoderParameter.#ctor(System.Drawing.Imaging.Encoder,System.Int32,System.Drawing.Imaging.EncoderParameterValueType,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Boolean)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Drawing.Imaging.EmfType)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Drawing.Imaging.EmfType,System.String)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Drawing.Imaging.WmfPlaceableFileHeader)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Drawing.Imaging.WmfPlaceableFileHeader,System.Boolean)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Drawing.Rectangle)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Drawing.Rectangle,System.Drawing.Imaging.MetafileFrameUnit)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Drawing.Rectangle,System.Drawing.Imaging.MetafileFrameUnit,System.Drawing.Imaging.EmfType)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Drawing.Rectangle,System.Drawing.Imaging.MetafileFrameUnit,System.Drawing.Imaging.EmfType,System.String)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Drawing.RectangleF)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Drawing.RectangleF,System.Drawing.Imaging.MetafileFrameUnit)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Drawing.RectangleF,System.Drawing.Imaging.MetafileFrameUnit,System.Drawing.Imaging.EmfType)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IntPtr,System.Drawing.RectangleF,System.Drawing.Imaging.MetafileFrameUnit,System.Drawing.Imaging.EmfType,System.String)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IO.Stream,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IO.Stream,System.IntPtr,System.Drawing.Imaging.EmfType)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IO.Stream,System.IntPtr,System.Drawing.Imaging.EmfType,System.String)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IO.Stream,System.IntPtr,System.Drawing.Rectangle)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IO.Stream,System.IntPtr,System.Drawing.Rectangle,System.Drawing.Imaging.MetafileFrameUnit)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IO.Stream,System.IntPtr,System.Drawing.Rectangle,System.Drawing.Imaging.MetafileFrameUnit,System.Drawing.Imaging.EmfType)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IO.Stream,System.IntPtr,System.Drawing.Rectangle,System.Drawing.Imaging.MetafileFrameUnit,System.Drawing.Imaging.EmfType,System.String)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IO.Stream,System.IntPtr,System.Drawing.RectangleF)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IO.Stream,System.IntPtr,System.Drawing.RectangleF,System.Drawing.Imaging.MetafileFrameUnit)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IO.Stream,System.IntPtr,System.Drawing.RectangleF,System.Drawing.Imaging.MetafileFrameUnit,System.Drawing.Imaging.EmfType)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.IO.Stream,System.IntPtr,System.Drawing.RectangleF,System.Drawing.Imaging.MetafileFrameUnit,System.Drawing.Imaging.EmfType,System.String)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr,System.Drawing.Imaging.EmfType)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr,System.Drawing.Imaging.EmfType,System.String)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr,System.Drawing.Rectangle)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr,System.Drawing.Rectangle,System.Drawing.Imaging.MetafileFrameUnit)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr,System.Drawing.Rectangle,System.Drawing.Imaging.MetafileFrameUnit,System.Drawing.Imaging.EmfType)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr,System.Drawing.Rectangle,System.Drawing.Imaging.MetafileFrameUnit,System.Drawing.Imaging.EmfType,System.String)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr,System.Drawing.Rectangle,System.Drawing.Imaging.MetafileFrameUnit,System.String)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr,System.Drawing.RectangleF)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr,System.Drawing.RectangleF,System.Drawing.Imaging.MetafileFrameUnit)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr,System.Drawing.RectangleF,System.Drawing.Imaging.MetafileFrameUnit,System.Drawing.Imaging.EmfType)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr,System.Drawing.RectangleF,System.Drawing.Imaging.MetafileFrameUnit,System.Drawing.Imaging.EmfType,System.String)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.#ctor(System.String,System.IntPtr,System.Drawing.RectangleF,System.Drawing.Imaging.MetafileFrameUnit,System.String)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.GetMetafileHeader(System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.Metafile.GetMetafileHeader(System.IntPtr,System.Drawing.Imaging.WmfPlaceableFileHeader)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.PlayRecordCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.PlayRecordCallback.Invoke(System.Drawing.Imaging.EmfPlusRecordType,System.Int32,System.Int32,System.IntPtr)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
+
+ CP0002
+ M:System.Drawing.Imaging.PlayRecordCallback.BeginInvoke(System.Drawing.Imaging.EmfPlusRecordType,System.Int32,System.Int32,System.IntPtr,System.AsyncCallback,System.Object)
+ lib/net6.0/System.Drawing.Common.dll
+ lib/net7.0/System.Drawing.Common.dll
+
\ No newline at end of file
diff --git a/src/libraries/System.IO.Ports/src/CompatibilitySuppressions.xml b/src/libraries/System.IO.Ports/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..63bae74d6ede3
--- /dev/null
+++ b/src/libraries/System.IO.Ports/src/CompatibilitySuppressions.xml
@@ -0,0 +1,21 @@
+
+
+
+ CP0002
+ M:System.IO.Ports.SerialDataReceivedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.IO.Ports.dll
+ lib/net7.0/System.IO.Ports.dll
+
+
+ CP0002
+ M:System.IO.Ports.SerialErrorReceivedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.IO.Ports.dll
+ lib/net7.0/System.IO.Ports.dll
+
+
+ CP0002
+ M:System.IO.Ports.SerialPinChangedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.IO.Ports.dll
+ lib/net7.0/System.IO.Ports.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/System.Management/src/CompatibilitySuppressions.xml b/src/libraries/System.Management/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..75f1cb64ce530
--- /dev/null
+++ b/src/libraries/System.Management/src/CompatibilitySuppressions.xml
@@ -0,0 +1,45 @@
+
+
+
+ CP0002
+ M:System.Management.CompletedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Management.dll
+ lib/net7.0/System.Management.dll
+
+
+ CP0002
+ M:System.Management.EventArrivedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Management.dll
+ lib/net7.0/System.Management.dll
+
+
+ CP0002
+ M:System.Management.ManagementBaseObject.op_Explicit(System.Management.ManagementBaseObject)~System.IntPtr
+ lib/net6.0/System.Management.dll
+ lib/net7.0/System.Management.dll
+
+
+ CP0002
+ M:System.Management.ObjectPutEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Management.dll
+ lib/net7.0/System.Management.dll
+
+
+ CP0002
+ M:System.Management.ObjectReadyEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Management.dll
+ lib/net7.0/System.Management.dll
+
+
+ CP0002
+ M:System.Management.ProgressEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Management.dll
+ lib/net7.0/System.Management.dll
+
+
+ CP0002
+ M:System.Management.StoppedEventHandler.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Management.dll
+ lib/net7.0/System.Management.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/System.Memory/tests/MemoryMarshal/CreateReadOnlySpanFromNullTerminated.cs b/src/libraries/System.Memory/tests/MemoryMarshal/CreateReadOnlySpanFromNullTerminated.cs
index 0b848524edd9d..d4f8d7977cba5 100644
--- a/src/libraries/System.Memory/tests/MemoryMarshal/CreateReadOnlySpanFromNullTerminated.cs
+++ b/src/libraries/System.Memory/tests/MemoryMarshal/CreateReadOnlySpanFromNullTerminated.cs
@@ -68,7 +68,7 @@ public static unsafe void CreateReadOnlySpanFromNullTerminated_Char_ExceedsMaxim
char* mem;
try
{
- mem = (char*)Marshal.AllocHGlobal((IntPtr)(sizeof(char) * (2L + int.MaxValue)));
+ mem = (char*)Marshal.AllocHGlobal(unchecked((nint)(sizeof(char) * (2L + int.MaxValue))));
}
catch (OutOfMemoryException)
{
@@ -96,7 +96,7 @@ public static unsafe void CreateReadOnlySpanFromNullTerminated_Byte_ExceedsMaxim
byte* mem;
try
{
- mem = (byte*)Marshal.AllocHGlobal((IntPtr)(2L + int.MaxValue));
+ mem = (byte*)Marshal.AllocHGlobal(unchecked((nint)(2L + int.MaxValue)));
}
catch (OutOfMemoryException)
{
diff --git a/src/libraries/System.Memory/tests/ReadOnlySpan/Overflow.cs b/src/libraries/System.Memory/tests/ReadOnlySpan/Overflow.cs
index d5c40ffbf62eb..0571c9d55299d 100644
--- a/src/libraries/System.Memory/tests/ReadOnlySpan/Overflow.cs
+++ b/src/libraries/System.Memory/tests/ReadOnlySpan/Overflow.cs
@@ -30,7 +30,7 @@ public static void IndexOverflow()
unsafe
{
- if (!AllocationHelper.TryAllocNative((IntPtr)ThreeGiB, out IntPtr memBlock))
+ if (!AllocationHelper.TryAllocNative(unchecked((nint)ThreeGiB), out IntPtr memBlock))
return; // It's not implausible to believe that a 3gb allocation will fail - if so, skip this test to avoid unnecessary test flakiness.
try
diff --git a/src/libraries/System.Memory/tests/Span/Clear.cs b/src/libraries/System.Memory/tests/Span/Clear.cs
index ee9a8ff469ac8..205ec76d5a483 100644
--- a/src/libraries/System.Memory/tests/Span/Clear.cs
+++ b/src/libraries/System.Memory/tests/Span/Clear.cs
@@ -263,7 +263,7 @@ static unsafe void ClearLongerThanUintMaxValueBytes()
if (sizeof(IntPtr) == sizeof(long))
{
// Arrange
- IntPtr bytes = (IntPtr)(((long)int.MaxValue) * sizeof(int));
+ nint bytes = unchecked((nint)(((long)int.MaxValue) * sizeof(int)));
int length = (int)(((long)bytes) / sizeof(int));
if (!AllocationHelper.TryAllocNative(bytes, out IntPtr memory))
diff --git a/src/libraries/System.Memory/tests/Span/Overflow.cs b/src/libraries/System.Memory/tests/Span/Overflow.cs
index aa9e6d4265d27..92ce3d11f0650 100644
--- a/src/libraries/System.Memory/tests/Span/Overflow.cs
+++ b/src/libraries/System.Memory/tests/Span/Overflow.cs
@@ -29,7 +29,7 @@ public static void IndexOverflow()
//
unsafe
{
- if (!AllocationHelper.TryAllocNative((IntPtr)ThreeGiB, out IntPtr memBlock))
+ if (!AllocationHelper.TryAllocNative(unchecked((nint)ThreeGiB), out IntPtr memBlock))
{
Console.WriteLine($"Span.Overflow test {nameof(IndexOverflow)} skipped (could not alloc memory).");
return; // It's not implausible to believe that a 3gb allocation will fail - if so, skip this test to avoid unnecessary test flakiness.
@@ -78,7 +78,7 @@ public static void SliceStartInt32Overflow()
{
unsafe
{
- if (!AllocationHelper.TryAllocNative((IntPtr)ThreeGiB, out IntPtr memory))
+ if (!AllocationHelper.TryAllocNative(unchecked((nint)ThreeGiB), out IntPtr memory))
{
Console.WriteLine($"Span.Overflow test {nameof(SliceStartInt32Overflow)} skipped (could not alloc memory).");
return;
@@ -122,7 +122,7 @@ public static void ReadOnlySliceStartInt32Overflow()
{
unsafe
{
- if (!AllocationHelper.TryAllocNative((IntPtr)ThreeGiB, out IntPtr memory))
+ if (!AllocationHelper.TryAllocNative(unchecked((nint)ThreeGiB), out IntPtr memory))
{
Console.WriteLine($"Span.Overflow test {nameof(ReadOnlySliceStartInt32Overflow)} skipped (could not alloc memory).");
return;
diff --git a/src/libraries/System.Private.CoreLib/src/System/IntPtr.cs b/src/libraries/System.Private.CoreLib/src/System/IntPtr.cs
index 6050df99b6fee..d777a0565aef2 100644
--- a/src/libraries/System.Private.CoreLib/src/System/IntPtr.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/IntPtr.cs
@@ -11,7 +11,6 @@
using System.Runtime.Versioning;
#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
-#pragma warning disable CA1066 // Implement IEquatable when overriding Object.Equals
#if TARGET_64BIT
using nint_t = System.Int64;
@@ -34,24 +33,24 @@ public readonly struct IntPtr
IMinMaxValue,
ISignedNumber
{
- private readonly unsafe void* _value; // Do not rename (binary serialization)
+ private readonly nint _value;
[Intrinsic]
- public static readonly IntPtr Zero;
+ public static readonly nint Zero;
[NonVersionable]
- public unsafe IntPtr(int value)
+ public IntPtr(int value)
{
- _value = (void*)value;
+ _value = value;
}
[NonVersionable]
- public unsafe IntPtr(long value)
+ public IntPtr(long value)
{
#if TARGET_64BIT
- _value = (void*)value;
+ _value = (nint)value;
#else
- _value = (void*)checked((int)value);
+ _value = checked((nint)value);
#endif
}
@@ -59,111 +58,100 @@ public unsafe IntPtr(long value)
[NonVersionable]
public unsafe IntPtr(void* value)
{
- _value = value;
+ _value = (nint)value;
}
- private unsafe IntPtr(SerializationInfo info, StreamingContext context)
+ private IntPtr(SerializationInfo info, StreamingContext context)
{
- long l = info.GetInt64("value");
+ long value = info.GetInt64("value");
- if (Size == 4 && (l > int.MaxValue || l < int.MinValue))
+#if TARGET_32BIT
+ if ((value > int.MaxValue) || (value < int.MinValue))
+ {
throw new ArgumentException(SR.Serialization_InvalidPtrValue);
+ }
+#endif
- _value = (void*)l;
+ _value = (nint)value;
}
- unsafe void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
+ void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
ArgumentNullException.ThrowIfNull(info);
- info.AddValue("value", ToInt64());
+ long value = _value;
+ info.AddValue("value", value);
}
- public override unsafe bool Equals([NotNullWhen(true)] object? obj) =>
- obj is IntPtr other &&
- _value == other._value;
+ public override bool Equals([NotNullWhen(true)] object? obj) => (obj is nint other) && Equals(other);
- public override unsafe int GetHashCode()
+ public override int GetHashCode()
{
#if TARGET_64BIT
- long l = (long)_value;
- return unchecked((int)l) ^ (int)(l >> 32);
+ long value = _value;
+ return value.GetHashCode();
#else
- return unchecked((int)_value);
+ return (int)_value;
#endif
}
[NonVersionable]
- public unsafe int ToInt32()
+ public int ToInt32()
{
#if TARGET_64BIT
- long l = (long)_value;
- return checked((int)l);
+ return checked((int)_value);
#else
return (int)_value;
#endif
}
[NonVersionable]
- public unsafe long ToInt64() =>
- (nint)_value;
+ public long ToInt64() => _value;
[NonVersionable]
- public static unsafe explicit operator IntPtr(int value) =>
- new IntPtr(value);
+ public static explicit operator nint(int value) => value;
[NonVersionable]
- public static unsafe explicit operator IntPtr(long value) =>
- new IntPtr(value);
+ public static explicit operator nint(long value) => checked((nint)value);
[CLSCompliant(false)]
[NonVersionable]
- public static unsafe explicit operator IntPtr(void* value) =>
- new IntPtr(value);
+ public static unsafe explicit operator nint(void* value) => (nint)value;
[CLSCompliant(false)]
[NonVersionable]
- public static unsafe explicit operator void*(IntPtr value) =>
- value._value;
+ public static unsafe explicit operator void*(nint value) => (void*)value;
[NonVersionable]
- public static unsafe explicit operator int(IntPtr value)
+ public static explicit operator int(nint value)
{
#if TARGET_64BIT
- long l = (long)value._value;
- return checked((int)l);
+ return checked((int)value);
#else
- return (int)value._value;
+ return (int)value;
#endif
}
[NonVersionable]
- public static unsafe explicit operator long(IntPtr value) =>
- (nint)value._value;
+ public static explicit operator long(nint value) => value;
[NonVersionable]
- public static unsafe bool operator ==(IntPtr value1, IntPtr value2) =>
- value1._value == value2._value;
+ public static bool operator ==(nint value1, nint value2) => value1 == value2;
[NonVersionable]
- public static unsafe bool operator !=(IntPtr value1, IntPtr value2) =>
- value1._value != value2._value;
+ public static bool operator !=(nint value1, nint value2) => value1 != value2;
[NonVersionable]
- public static IntPtr Add(IntPtr pointer, int offset) =>
- pointer + offset;
+ public static nint Add(nint pointer, int offset) => pointer + offset;
[NonVersionable]
- public static unsafe IntPtr operator +(IntPtr pointer, int offset) =>
- (nint)pointer._value + offset;
+ public static nint operator +(nint pointer, int offset) => pointer + offset;
[NonVersionable]
- public static IntPtr Subtract(IntPtr pointer, int offset) =>
- pointer - offset;
+ public static nint Subtract(nint pointer, int offset) => pointer - offset;
[NonVersionable]
- public static unsafe IntPtr operator -(IntPtr pointer, int offset) =>
- (nint)pointer._value - offset;
+ public static nint operator -(nint pointer, int offset) => pointer - offset;
public static int Size
{
@@ -173,93 +161,95 @@ public static int Size
[CLSCompliant(false)]
[NonVersionable]
- public unsafe void* ToPointer() => _value;
+ public unsafe void* ToPointer() => (void*)_value;
///
- public static IntPtr MaxValue
+ public static nint MaxValue
{
[NonVersionable]
- get => (IntPtr)nint_t.MaxValue;
+ get => unchecked((nint)nint_t.MaxValue);
}
///
- public static IntPtr MinValue
+ public static nint MinValue
{
[NonVersionable]
- get => (IntPtr)nint_t.MinValue;
+ get => unchecked((nint)nint_t.MinValue);
}
- // Don't just delegate to nint_t.CompareTo as it needs to throw when not IntPtr
- public unsafe int CompareTo(object? value)
+ public int CompareTo(object? value)
{
- if (value is null)
+ if (value is nint other)
{
- return 1;
+ return CompareTo(other);
}
- if (value is nint i)
+ else if (value is null)
{
- if ((nint)_value < i) return -1;
- if ((nint)_value > i) return 1;
- return 0;
+ return 1;
}
throw new ArgumentException(SR.Arg_MustBeIntPtr);
}
- public unsafe int CompareTo(IntPtr value) => ((nint_t)_value).CompareTo((nint_t)value);
+ public int CompareTo(nint value)
+ {
+ if (_value < value) return -1;
+ if (_value > value) return 1;
+ return 0;
+ }
[NonVersionable]
- public unsafe bool Equals(IntPtr other) => (nint_t)_value == (nint_t)other;
+ public bool Equals(nint other) => _value == other;
- public unsafe override string ToString() => ((nint_t)_value).ToString();
- public unsafe string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format) => ((nint_t)_value).ToString(format);
- public unsafe string ToString(IFormatProvider? provider) => ((nint_t)_value).ToString(provider);
- public unsafe string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format, IFormatProvider? provider) => ((nint_t)_value).ToString(format, provider);
+ public override string ToString() => ((nint_t)_value).ToString();
+ public string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format) => ((nint_t)_value).ToString(format);
+ public string ToString(IFormatProvider? provider) => ((nint_t)_value).ToString(provider);
+ public string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format, IFormatProvider? provider) => ((nint_t)_value).ToString(format, provider);
- public unsafe bool TryFormat(Span destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan format = default, IFormatProvider? provider = null) =>
+ public bool TryFormat(Span destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan format = default, IFormatProvider? provider = null) =>
((nint_t)_value).TryFormat(destination, out charsWritten, format, provider);
- public static IntPtr Parse(string s) => (IntPtr)nint_t.Parse(s);
- public static IntPtr Parse(string s, NumberStyles style) => (IntPtr)nint_t.Parse(s, style);
- public static IntPtr Parse(string s, IFormatProvider? provider) => (IntPtr)nint_t.Parse(s, provider);
- public static IntPtr Parse(string s, NumberStyles style, IFormatProvider? provider) => (IntPtr)nint_t.Parse(s, style, provider);
- public static IntPtr Parse(ReadOnlySpan s, IFormatProvider? provider) => (IntPtr)nint_t.Parse(s, provider);
- public static IntPtr Parse(ReadOnlySpan s, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null) => (IntPtr)nint_t.Parse(s, style, provider);
+ public static nint Parse(string s) => (nint)nint_t.Parse(s);
+ public static nint Parse(string s, NumberStyles style) => (nint)nint_t.Parse(s, style);
+ public static nint Parse(string s, IFormatProvider? provider) => (nint)nint_t.Parse(s, provider);
+ public static nint Parse(string s, NumberStyles style, IFormatProvider? provider) => (nint)nint_t.Parse(s, style, provider);
+ public static nint Parse(ReadOnlySpan s, IFormatProvider? provider) => (nint)nint_t.Parse(s, provider);
+ public static nint Parse(ReadOnlySpan s, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null) => (nint)nint_t.Parse(s, style, provider);
- public static bool TryParse([NotNullWhen(true)] string? s, out IntPtr result)
+ public static bool TryParse([NotNullWhen(true)] string? s, out nint result)
{
Unsafe.SkipInit(out result);
- return nint_t.TryParse(s, out Unsafe.As(ref result));
+ return nint_t.TryParse(s, out Unsafe.As(ref result));
}
- public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out IntPtr result)
+ public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out nint result)
{
Unsafe.SkipInit(out result);
- return nint_t.TryParse(s, provider, out Unsafe.As(ref result));
+ return nint_t.TryParse(s, provider, out Unsafe.As(ref result));
}
- public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out IntPtr result)
+ public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out nint result)
{
Unsafe.SkipInit(out result);
- return nint_t.TryParse(s, style, provider, out Unsafe.As(ref result));
+ return nint_t.TryParse(s, style, provider, out Unsafe.As(ref result));
}
- public static bool TryParse(ReadOnlySpan s, out IntPtr result)
+ public static bool TryParse(ReadOnlySpan s, out nint result)
{
Unsafe.SkipInit(out result);
- return nint_t.TryParse(s, out Unsafe.As(ref result));
+ return nint_t.TryParse(s, out Unsafe.As(ref result));
}
- public static bool TryParse(ReadOnlySpan s, IFormatProvider? provider, out IntPtr result)
+ public static bool TryParse(ReadOnlySpan s, IFormatProvider? provider, out nint result)
{
Unsafe.SkipInit(out result);
- return nint_t.TryParse(s, provider, out Unsafe.As(ref result));
+ return nint_t.TryParse(s, provider, out Unsafe.As(ref result));
}
- public static bool TryParse(ReadOnlySpan s, NumberStyles style, IFormatProvider? provider, out IntPtr result)
+ public static bool TryParse(ReadOnlySpan s, NumberStyles style, IFormatProvider? provider, out nint result)
{
Unsafe.SkipInit(out result);
- return nint_t.TryParse(s, style, provider, out Unsafe.As(ref result));
+ return nint_t.TryParse(s, style, provider, out Unsafe.As(ref result));
}
//
@@ -302,13 +292,13 @@ public static bool TryParse(ReadOnlySpan s, NumberStyles style, IFormatPro
public static nint TrailingZeroCount(nint value) => BitOperations.TrailingZeroCount(value);
///
- unsafe int IBinaryInteger.GetShortestBitLength()
+ int IBinaryInteger.GetShortestBitLength()
{
- nint value = (nint)(_value);
+ nint value = _value;
if (value >= 0)
{
- return (sizeof(nint_t) * 8) - BitOperations.LeadingZeroCount((nuint)(value));
+ return (sizeof(nint_t) * 8) - BitOperations.LeadingZeroCount((nuint)value);
}
else
{
@@ -320,11 +310,16 @@ unsafe int IBinaryInteger.GetShortestBitLength()
int IBinaryInteger.GetByteCount() => sizeof(nint_t);
///
- unsafe bool IBinaryInteger.TryWriteBigEndian(Span destination, out int bytesWritten)
+ bool IBinaryInteger.TryWriteBigEndian(Span destination, out int bytesWritten)
{
if (destination.Length >= sizeof(nint_t))
{
- nint_t value = BitConverter.IsLittleEndian ? BinaryPrimitives.ReverseEndianness((nint_t)(_value)) : (nint_t)(_value);
+ nint_t value = (nint_t)_value;
+
+ if (BitConverter.IsLittleEndian)
+ {
+ value = BinaryPrimitives.ReverseEndianness(value);
+ }
Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
bytesWritten = sizeof(nint_t);
@@ -338,11 +333,16 @@ unsafe bool IBinaryInteger.TryWriteBigEndian(Span destination, out i
}
///
- unsafe bool IBinaryInteger.TryWriteLittleEndian(Span destination, out int bytesWritten)
+ bool IBinaryInteger.TryWriteLittleEndian(Span destination, out int bytesWritten)
{
if (destination.Length >= sizeof(nint_t))
{
- nint_t value = BitConverter.IsLittleEndian ? (nint_t)(_value) : BinaryPrimitives.ReverseEndianness((nint_t)(_value));
+ nint_t value = (nint_t)_value;
+
+ if (!BitConverter.IsLittleEndian)
+ {
+ value = BinaryPrimitives.ReverseEndianness(value);
+ }
Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
bytesWritten = sizeof(nint_t);
diff --git a/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs b/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs
index 0554ef8b90815..a3e7404e73395 100644
--- a/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs
@@ -11,7 +11,6 @@
using System.Runtime.Versioning;
#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
-#pragma warning disable CA1066 // Implement IEquatable when overriding Object.Equals
#if TARGET_64BIT
using nuint_t = System.UInt64;
@@ -35,71 +34,69 @@ public readonly struct UIntPtr
IMinMaxValue,
IUnsignedNumber
{
- private readonly unsafe void* _value; // Do not rename (binary serialization)
+ private readonly nuint _value;
[Intrinsic]
- public static readonly UIntPtr Zero;
+ public static readonly nuint Zero;
[NonVersionable]
- public unsafe UIntPtr(uint value)
+ public UIntPtr(uint value)
{
- _value = (void*)value;
+ _value = value;
}
[NonVersionable]
- public unsafe UIntPtr(ulong value)
+ public UIntPtr(ulong value)
{
#if TARGET_64BIT
- _value = (void*)value;
+ _value = (nuint)value;
#else
- _value = (void*)checked((uint)value);
+ _value = checked((nuint)value);
#endif
}
[NonVersionable]
public unsafe UIntPtr(void* value)
{
- _value = value;
+ _value = (nuint)value;
}
- private unsafe UIntPtr(SerializationInfo info, StreamingContext context)
+ private UIntPtr(SerializationInfo info, StreamingContext context)
{
- ulong l = info.GetUInt64("value");
+ ulong value = info.GetUInt64("value");
- if (Size == 4 && l > uint.MaxValue)
+#if TARGET_32BIT
+ if (value > uint.MaxValue)
+ {
throw new ArgumentException(SR.Serialization_InvalidPtrValue);
+ }
+#endif
- _value = (void*)l;
+ _value = (nuint)value;
}
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
ArgumentNullException.ThrowIfNull(info);
- info.AddValue("value", ToUInt64());
+ ulong value = _value;
+ info.AddValue("value", value);
}
- public override unsafe bool Equals([NotNullWhen(true)] object? obj)
- {
- if (obj is UIntPtr)
- {
- return _value == ((UIntPtr)obj)._value;
- }
- return false;
- }
+ public override bool Equals([NotNullWhen(true)] object? obj) => (obj is nuint other) && Equals(other);
- public override unsafe int GetHashCode()
+ public override int GetHashCode()
{
#if TARGET_64BIT
- ulong l = (ulong)_value;
- return unchecked((int)l) ^ (int)(l >> 32);
+ ulong value = _value;
+ return value.GetHashCode();
#else
- return unchecked((int)_value);
+ return (int)_value;
#endif
}
[NonVersionable]
- public unsafe uint ToUInt32()
+ public uint ToUInt32()
{
#if TARGET_64BIT
return checked((uint)_value);
@@ -109,59 +106,50 @@ public unsafe uint ToUInt32()
}
[NonVersionable]
- public unsafe ulong ToUInt64() => (ulong)_value;
+ public ulong ToUInt64() => _value;
[NonVersionable]
- public static explicit operator UIntPtr(uint value) =>
- new UIntPtr(value);
+ public static explicit operator nuint(uint value) => value;
[NonVersionable]
- public static explicit operator UIntPtr(ulong value) =>
- new UIntPtr(value);
+ public static explicit operator nuint(ulong value) => checked((nuint)value);
[NonVersionable]
- public static unsafe explicit operator UIntPtr(void* value) =>
- new UIntPtr(value);
+ public static unsafe explicit operator nuint(void* value) => (nuint)value;
[NonVersionable]
- public static unsafe explicit operator void*(UIntPtr value) =>
- value._value;
+ public static unsafe explicit operator void*(nuint value) => (void*)value;
[NonVersionable]
- public static unsafe explicit operator uint(UIntPtr value) =>
+ public static explicit operator uint(nuint value)
+ {
#if TARGET_64BIT
- checked((uint)value._value);
+ return checked((uint)value);
#else
- (uint)value._value;
+ return (uint)value;
#endif
+ }
[NonVersionable]
- public static unsafe explicit operator ulong(UIntPtr value) =>
- (ulong)value._value;
+ public static explicit operator ulong(nuint value) => value;
[NonVersionable]
- public static unsafe bool operator ==(UIntPtr value1, UIntPtr value2) =>
- value1._value == value2._value;
+ public static bool operator ==(nuint value1, nuint value2) => value1 == value2;
[NonVersionable]
- public static unsafe bool operator !=(UIntPtr value1, UIntPtr value2) =>
- value1._value != value2._value;
+ public static bool operator !=(nuint value1, nuint value2) => value1 != value2;
[NonVersionable]
- public static UIntPtr Add(UIntPtr pointer, int offset) =>
- pointer + offset;
+ public static nuint Add(nuint pointer, int offset) => pointer + (nuint)offset;
[NonVersionable]
- public static unsafe UIntPtr operator +(UIntPtr pointer, int offset) =>
- (nuint)pointer._value + (nuint)offset;
+ public static nuint operator +(nuint pointer, int offset) => pointer + (nuint)offset;
[NonVersionable]
- public static UIntPtr Subtract(UIntPtr pointer, int offset) =>
- pointer - offset;
+ public static nuint Subtract(nuint pointer, int offset) => pointer - (nuint)offset;
[NonVersionable]
- public static unsafe UIntPtr operator -(UIntPtr pointer, int offset) =>
- (nuint)pointer._value - (nuint)offset;
+ public static nuint operator -(nuint pointer, int offset) => pointer - (nuint)offset;
public static int Size
{
@@ -170,92 +158,95 @@ public static int Size
}
[NonVersionable]
- public unsafe void* ToPointer() => _value;
+ public unsafe void* ToPointer() => (void*)_value;
///
- public static UIntPtr MaxValue
+ public static nuint MaxValue
{
[NonVersionable]
- get => (UIntPtr)nuint_t.MaxValue;
+ get => unchecked((nuint)nuint_t.MaxValue);
}
///
- public static UIntPtr MinValue
+ public static nuint MinValue
{
[NonVersionable]
- get => (UIntPtr)nuint_t.MinValue;
+ get => unchecked((nuint)nuint_t.MinValue);
}
- public unsafe int CompareTo(object? value)
+ public int CompareTo(object? value)
{
- if (value is null)
+ if (value is nuint other)
{
- return 1;
+ return CompareTo(other);
}
- if (value is nuint i)
+ else if (value is null)
{
- if ((nuint)_value < i) return -1;
- if ((nuint)_value > i) return 1;
- return 0;
+ return 1;
}
throw new ArgumentException(SR.Arg_MustBeUIntPtr);
}
- public unsafe int CompareTo(UIntPtr value) => ((nuint_t)_value).CompareTo((nuint_t)value);
+ public int CompareTo(nuint value)
+ {
+ if (_value < value) return -1;
+ if (_value > value) return 1;
+ return 0;
+ }
[NonVersionable]
- public unsafe bool Equals(UIntPtr other) => (nuint)_value == (nuint)other;
+ public bool Equals(nuint other) => _value == other;
- public unsafe override string ToString() => ((nuint_t)_value).ToString();
- public unsafe string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format) => ((nuint_t)_value).ToString(format);
- public unsafe string ToString(IFormatProvider? provider) => ((nuint_t)_value).ToString(provider);
- public unsafe string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format, IFormatProvider? provider) => ((nuint_t)_value).ToString(format, provider);
+ public override string ToString() => ((nuint_t)_value).ToString();
+ public string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format) => ((nuint_t)_value).ToString(format);
+ public string ToString(IFormatProvider? provider) => ((nuint_t)_value).ToString(provider);
+ public string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format, IFormatProvider? provider) => ((nuint_t)_value).ToString(format, provider);
- public unsafe bool TryFormat(Span destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan format = default, IFormatProvider? provider = null) =>
+ public bool TryFormat(Span destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan format = default, IFormatProvider? provider = null) =>
((nuint_t)_value).TryFormat(destination, out charsWritten, format, provider);
- public static UIntPtr Parse(string s) => (UIntPtr)nuint_t.Parse(s);
- public static UIntPtr Parse(string s, NumberStyles style) => (UIntPtr)nuint_t.Parse(s, style);
- public static UIntPtr Parse(string s, IFormatProvider? provider) => (UIntPtr)nuint_t.Parse(s, provider);
- public static UIntPtr Parse(string s, NumberStyles style, IFormatProvider? provider) => (UIntPtr)nuint_t.Parse(s, style, provider);
- public static UIntPtr Parse(ReadOnlySpan s, IFormatProvider? provider) => (UIntPtr)nuint_t.Parse(s, provider);
- public static UIntPtr Parse(ReadOnlySpan s, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null) => (UIntPtr)nuint_t.Parse(s, style, provider);
+ public static nuint Parse(string s) => (nuint)nuint_t.Parse(s);
+ public static nuint Parse(string s, NumberStyles style) => (nuint)nuint_t.Parse(s, style);
+ public static nuint Parse(string s, IFormatProvider? provider) => (nuint)nuint_t.Parse(s, provider);
+ public static nuint Parse(string s, NumberStyles style, IFormatProvider? provider) => (nuint)nuint_t.Parse(s, style, provider);
+ public static nuint Parse(ReadOnlySpan s, IFormatProvider? provider) => (nuint)nuint_t.Parse(s, provider);
+ public static nuint Parse(ReadOnlySpan s, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null) => (nuint)nuint_t.Parse(s, style, provider);
- public static bool TryParse([NotNullWhen(true)] string? s, out UIntPtr result)
+ public static bool TryParse([NotNullWhen(true)] string? s, out nuint result)
{
Unsafe.SkipInit(out result);
- return nuint_t.TryParse(s, out Unsafe.As(ref result));
+ return nuint_t.TryParse(s, out Unsafe.As(ref result));
}
- public static bool TryParse(ReadOnlySpan s, IFormatProvider? provider, out UIntPtr result)
+ public static bool TryParse(ReadOnlySpan s, IFormatProvider? provider, out nuint result)
{
Unsafe.SkipInit(out result);
- return nuint_t.TryParse(s, provider, out Unsafe.As(ref result));
+ return nuint_t.TryParse(s, provider, out Unsafe.As(ref result));
}
- public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out UIntPtr result)
+ public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out nuint result)
{
Unsafe.SkipInit(out result);
- return nuint_t.TryParse(s, style, provider, out Unsafe.As(ref result));
+ return nuint_t.TryParse(s, style, provider, out Unsafe.As(ref result));
}
- public static bool TryParse(ReadOnlySpan s, out UIntPtr result)
+ public static bool TryParse(ReadOnlySpan s, out nuint result)
{
Unsafe.SkipInit(out result);
- return nuint_t.TryParse(s, out Unsafe.As(ref result));
+ return nuint_t.TryParse(s, out Unsafe.As(ref result));
}
- public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out UIntPtr result)
+ public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out nuint result)
{
Unsafe.SkipInit(out result);
- return nuint_t.TryParse(s, provider, out Unsafe.As(ref result));
+ return nuint_t.TryParse(s, provider, out Unsafe.As(ref result));
}
- public static bool TryParse(ReadOnlySpan s, NumberStyles style, IFormatProvider? provider, out UIntPtr result)
+ public static bool TryParse(ReadOnlySpan s, NumberStyles style, IFormatProvider? provider, out nuint result)
{
Unsafe.SkipInit(out result);
- return nuint_t.TryParse(s, style, provider, out Unsafe.As(ref result));
+ return nuint_t.TryParse(s, style, provider, out Unsafe.As(ref result));
}
//
@@ -263,10 +254,10 @@ public static bool TryParse(ReadOnlySpan s, NumberStyles style, IFormatPro
//
///
- static nuint IAdditionOperators.operator +(nuint left, nuint right) => (nuint)(left + right);
+ static nuint IAdditionOperators.operator +(nuint left, nuint right) => left + right;
///
- static nuint IAdditionOperators.operator checked +(nuint left, nuint right) => checked((nuint)(left + right));
+ static nuint IAdditionOperators.operator checked +(nuint left, nuint right) => checked(left + right);
//
// IAdditiveIdentity
@@ -298,17 +289,22 @@ public static bool TryParse(ReadOnlySpan s, NumberStyles style, IFormatPro
public static nuint TrailingZeroCount(nuint value) => (nuint)BitOperations.TrailingZeroCount(value);
///
- unsafe int IBinaryInteger.GetShortestBitLength() => (sizeof(nuint_t) * 8) - BitOperations.LeadingZeroCount((nuint)(_value));
+ int IBinaryInteger.GetShortestBitLength() => (sizeof(nuint_t) * 8) - BitOperations.LeadingZeroCount(_value);
///
int IBinaryInteger.GetByteCount() => sizeof(nuint_t);
///
- unsafe bool IBinaryInteger.TryWriteBigEndian(Span destination, out int bytesWritten)
+ bool IBinaryInteger.TryWriteBigEndian(Span destination, out int bytesWritten)
{
if (destination.Length >= sizeof(nuint_t))
{
- nuint_t value = BitConverter.IsLittleEndian ? BinaryPrimitives.ReverseEndianness((nuint_t)(_value)) : (nuint_t)(_value);
+ nuint_t value = (nuint_t)_value;
+
+ if (BitConverter.IsLittleEndian)
+ {
+ value = BinaryPrimitives.ReverseEndianness(value);
+ }
Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
bytesWritten = sizeof(nuint_t);
@@ -322,11 +318,16 @@ unsafe bool IBinaryInteger.TryWriteBigEndian(Span destination, out
}
///
- unsafe bool IBinaryInteger.TryWriteLittleEndian(Span destination, out int bytesWritten)
+ bool IBinaryInteger.TryWriteLittleEndian(Span destination, out int bytesWritten)
{
if (destination.Length >= sizeof(nuint_t))
{
- nuint_t value = BitConverter.IsLittleEndian ? (nuint_t)(_value) : BinaryPrimitives.ReverseEndianness((nuint_t)(_value));
+ nuint_t value = (nuint_t)_value;
+
+ if (!BitConverter.IsLittleEndian)
+ {
+ value = BinaryPrimitives.ReverseEndianness(value);
+ }
Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
bytesWritten = sizeof(nuint_t);
diff --git a/src/libraries/System.Runtime.Caching/src/CompatibilitySuppressions.xml b/src/libraries/System.Runtime.Caching/src/CompatibilitySuppressions.xml
new file mode 100644
index 0000000000000..531ad4f0383c7
--- /dev/null
+++ b/src/libraries/System.Runtime.Caching/src/CompatibilitySuppressions.xml
@@ -0,0 +1,21 @@
+
+
+
+ CP0002
+ M:System.Runtime.Caching.CacheEntryRemovedCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Runtime.Caching.dll
+ lib/net7.0/System.Runtime.Caching.dll
+
+
+ CP0002
+ M:System.Runtime.Caching.CacheEntryUpdateCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Runtime.Caching.dll
+ lib/net7.0/System.Runtime.Caching.dll
+
+
+ CP0002
+ M:System.Runtime.Caching.OnChangedCallback.#ctor(System.Object,System.IntPtr)
+ lib/net6.0/System.Runtime.Caching.dll
+ lib/net7.0/System.Runtime.Caching.dll
+
+
\ No newline at end of file
diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs
index 63dcc1d0b5cb9..bcfaa53f8fa3f 100644
--- a/src/libraries/System.Runtime/ref/System.Runtime.cs
+++ b/src/libraries/System.Runtime/ref/System.Runtime.cs
@@ -3469,14 +3469,14 @@ public InsufficientMemoryException(string? message, System.Exception? innerExcep
}
public readonly partial struct IntPtr : System.IComparable, System.IComparable, System.IEquatable, System.IFormattable, System.IParsable, System.ISpanFormattable, System.ISpanParsable, System.Numerics.IAdditionOperators, System.Numerics.IAdditiveIdentity, System.Numerics.IBinaryInteger, System.Numerics.IBinaryNumber, System.Numerics.IBitwiseOperators, System.Numerics.IComparisonOperators, System.Numerics.IDecrementOperators, System.Numerics.IDivisionOperators, System.Numerics.IEqualityOperators, System.Numerics.IIncrementOperators, System.Numerics.IMinMaxValue, System.Numerics.IModulusOperators, System.Numerics.IMultiplicativeIdentity, System.Numerics.IMultiplyOperators, System.Numerics.INumber, System.Numerics.INumberBase, System.Numerics.IShiftOperators, System.Numerics.ISignedNumber, System.Numerics.ISubtractionOperators, System.Numerics.IUnaryNegationOperators, System.Numerics.IUnaryPlusOperators, System.Runtime.Serialization.ISerializable
{
- private readonly int _dummyPrimitive;
- public static readonly System.IntPtr Zero;
+ private readonly nint _dummyPrimitive;
+ public static readonly nint Zero;
public IntPtr(int value) { throw null; }
public IntPtr(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe IntPtr(void* value) { throw null; }
- public static System.IntPtr MaxValue { get { throw null; } }
- public static System.IntPtr MinValue { get { throw null; } }
+ public static nint MaxValue { get { throw null; } }
+ public static nint MinValue { get { throw null; } }
public static int Size { get { throw null; } }
static nint System.Numerics.IAdditiveIdentity.AdditiveIdentity { get { throw null; } }
static nint System.Numerics.IMinMaxValue.MaxValue { get { throw null; } }
@@ -3486,16 +3486,16 @@ public InsufficientMemoryException(string? message, System.Exception? innerExcep
static nint System.Numerics.INumberBase.Zero { get { throw null; } }
static nint System.Numerics.ISignedNumber.NegativeOne { get { throw null; } }
public static nint Abs(nint value) { throw null; }
- public static System.IntPtr Add(System.IntPtr pointer, int offset) { throw null; }
+ public static nint Add(nint pointer, int offset) { throw null; }
public static nint Clamp(nint value, nint min, nint max) { throw null; }
- public int CompareTo(System.IntPtr value) { throw null; }
+ public int CompareTo(nint value) { throw null; }
public int CompareTo(object? value) { throw null; }
public static nint CopySign(nint value, nint sign) { throw null; }
public static nint CreateChecked(TOther value) where TOther : System.Numerics.INumberBase { throw null; }
public static nint CreateSaturating(TOther value) where TOther : System.Numerics.INumberBase { throw null; }
public static nint CreateTruncating(TOther value) where TOther : System.Numerics.INumberBase { throw null; }
public static (nint Quotient, nint Remainder) DivRem(nint left, nint right) { throw null; }
- public bool Equals(System.IntPtr other) { throw null; }
+ public bool Equals(nint other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static bool IsNegative(nint value) { throw null; }
@@ -3506,29 +3506,29 @@ public InsufficientMemoryException(string? message, System.Exception? innerExcep
public static nint MaxMagnitude(nint x, nint y) { throw null; }
public static nint Min(nint x, nint y) { throw null; }
public static nint MinMagnitude(nint x, nint y) { throw null; }
- public static System.IntPtr operator +(System.IntPtr pointer, int offset) { throw null; }
- public static bool operator ==(System.IntPtr value1, System.IntPtr value2) { throw null; }
- public static explicit operator System.IntPtr (int value) { throw null; }
- public static explicit operator System.IntPtr (long value) { throw null; }
- public static explicit operator int (System.IntPtr value) { throw null; }
- public static explicit operator long (System.IntPtr value) { throw null; }
- [System.CLSCompliantAttribute(false)]
- public unsafe static explicit operator void* (System.IntPtr value) { throw null; }
- [System.CLSCompliantAttribute(false)]
- public unsafe static explicit operator System.IntPtr (void* value) { throw null; }
- public static bool operator !=(System.IntPtr value1, System.IntPtr value2) { throw null; }
- public static System.IntPtr operator -(System.IntPtr pointer, int offset) { throw null; }
- public static System.IntPtr Parse(System.ReadOnlySpan s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
- public static System.IntPtr Parse(System.ReadOnlySpan s, System.IFormatProvider? provider) { throw null; }
- public static System.IntPtr Parse(string s) { throw null; }
- public static System.IntPtr Parse(string s, System.Globalization.NumberStyles style) { throw null; }
- public static System.IntPtr Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
- public static System.IntPtr Parse(string s, System.IFormatProvider? provider) { throw null; }
+ public static nint operator +(nint pointer, int offset) { throw null; }
+ public static bool operator ==(nint value1, nint value2) { throw null; }
+ public static explicit operator nint (int value) { throw null; }
+ public static explicit operator nint (long value) { throw null; }
+ public static explicit operator int (nint value) { throw null; }
+ public static explicit operator long (nint value) { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public unsafe static explicit operator void* (nint value) { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public unsafe static explicit operator nint (void* value) { throw null; }
+ public static bool operator !=(nint value1, nint value2) { throw null; }
+ public static nint operator -(nint pointer, int offset) { throw null; }
+ public static nint Parse(System.ReadOnlySpan s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
+ public static nint Parse(System.ReadOnlySpan s, System.IFormatProvider? provider) { throw null; }
+ public static nint Parse(string s) { throw null; }
+ public static nint Parse(string s, System.Globalization.NumberStyles style) { throw null; }
+ public static nint Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
+ public static nint Parse(string s, System.IFormatProvider? provider) { throw null; }
public static nint PopCount(nint value) { throw null; }
public static nint RotateLeft(nint value, int rotateAmount) { throw null; }
public static nint RotateRight(nint value, int rotateAmount) { throw null; }
public static int Sign(nint value) { throw null; }
- public static System.IntPtr Subtract(System.IntPtr pointer, int offset) { throw null; }
+ public static nint Subtract(nint pointer, int offset) { throw null; }
static nint System.Numerics.IAdditionOperators.operator +(nint left, nint right) { throw null; }
static nint System.Numerics.IAdditionOperators.operator checked +(nint left, nint right) { throw null; }
int System.Numerics.IBinaryInteger.GetByteCount() { throw null; }
@@ -3583,12 +3583,12 @@ void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Ser
public static nint TrailingZeroCount(nint value) { throw null; }
public static bool TryCreate(TOther value, out nint result) where TOther : System.Numerics.INumberBase { throw null; }
public bool TryFormat(System.Span destination, out int charsWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] System.ReadOnlySpan format = default(System.ReadOnlySpan), System.IFormatProvider? provider = null) { throw null; }
- public static bool TryParse(System.ReadOnlySpan s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.IntPtr result) { throw null; }
- public static bool TryParse(System.ReadOnlySpan s, System.IFormatProvider? provider, out System.IntPtr result) { throw null; }
- public static bool TryParse(System.ReadOnlySpan s, out System.IntPtr result) { throw null; }
- public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.IntPtr result) { throw null; }
- public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.IntPtr result) { throw null; }
- public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.IntPtr result) { throw null; }
+ public static bool TryParse(System.ReadOnlySpan s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out nint result) { throw null; }
+ public static bool TryParse(System.ReadOnlySpan s, System.IFormatProvider? provider, out nint result) { throw null; }
+ public static bool TryParse(System.ReadOnlySpan s, out nint result) { throw null; }
+ public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out nint result) { throw null; }
+ public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out nint result) { throw null; }
+ public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out nint result) { throw null; }
}
public partial class InvalidCastException : System.SystemException
{
@@ -6374,13 +6374,13 @@ public TypeUnloadedException(string? message, System.Exception? innerException)
[System.CLSCompliantAttribute(false)]
public readonly partial struct UIntPtr : System.IComparable, System.IComparable, System.IEquatable, System.IFormattable, System.IParsable, System.ISpanFormattable, System.ISpanParsable, System.Numerics.IAdditionOperators, System.Numerics.IAdditiveIdentity, System.Numerics.IBinaryInteger, System.Numerics.IBinaryNumber, System.Numerics.IBitwiseOperators, System.Numerics.IComparisonOperators, System.Numerics.IDecrementOperators, System.Numerics.IDivisionOperators, System.Numerics.IEqualityOperators, System.Numerics.IIncrementOperators, System.Numerics.IMinMaxValue, System.Numerics.IModulusOperators, System.Numerics.IMultiplicativeIdentity, System.Numerics.IMultiplyOperators, System.Numerics.INumber, System.Numerics.INumberBase, System.Numerics.IShiftOperators, System.Numerics.ISubtractionOperators, System.Numerics.IUnaryNegationOperators, System.Numerics.IUnaryPlusOperators, System.Numerics.IUnsignedNumber, System.Runtime.Serialization.ISerializable
{
- private readonly int _dummyPrimitive;
- public static readonly System.UIntPtr Zero;
+ private readonly nuint _dummyPrimitive;
+ public static readonly nuint Zero;
public UIntPtr(uint value) { throw null; }
public UIntPtr(ulong value) { throw null; }
public unsafe UIntPtr(void* value) { throw null; }
- public static System.UIntPtr MaxValue { get { throw null; } }
- public static System.UIntPtr MinValue { get { throw null; } }
+ public static nuint MaxValue { get { throw null; } }
+ public static nuint MinValue { get { throw null; } }
public static int Size { get { throw null; } }
static nuint System.Numerics.IAdditiveIdentity.AdditiveIdentity { get { throw null; } }
static nuint System.Numerics.IMinMaxValue.MaxValue { get { throw null; } }
@@ -6388,43 +6388,43 @@ public TypeUnloadedException(string? message, System.Exception? innerException)
static nuint System.Numerics.IMultiplicativeIdentity.MultiplicativeIdentity { get { throw null; } }
static nuint System.Numerics.INumberBase.One { get { throw null; } }
static nuint System.Numerics.INumberBase.Zero { get { throw null; } }
- public static System.UIntPtr Add(System.UIntPtr pointer, int offset) { throw null; }
+ public static nuint Add(nuint pointer, int offset) { throw null; }
public static nuint Clamp(nuint value, nuint min, nuint max) { throw null; }
public int CompareTo(object? value) { throw null; }
- public int CompareTo(System.UIntPtr value) { throw null; }
+ public int CompareTo(nuint value) { throw null; }
public static nuint CreateChecked(TOther value) where TOther : System.Numerics.INumberBase { throw null; }
public static nuint CreateSaturating(TOther value) where TOther : System.Numerics.INumberBase { throw null; }
public static nuint CreateTruncating(TOther value) where TOther : System.Numerics.INumberBase { throw null; }
public static (nuint Quotient, nuint Remainder) DivRem(nuint left, nuint right) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
- public bool Equals(System.UIntPtr other) { throw null; }
+ public bool Equals(nuint other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool IsPow2(nuint value) { throw null; }
public static nuint LeadingZeroCount(nuint value) { throw null; }
public static nuint Log2(nuint value) { throw null; }
public static nuint Max(nuint x, nuint y) { throw null; }
public static nuint Min(nuint x, nuint y) { throw null; }
- public static System.UIntPtr operator +(System.UIntPtr pointer, int offset) { throw null; }
- public static bool operator ==(System.UIntPtr value1, System.UIntPtr value2) { throw null; }
- public static explicit operator System.UIntPtr (uint value) { throw null; }
- public static explicit operator System.UIntPtr (ulong value) { throw null; }
- public static explicit operator uint (System.UIntPtr value) { throw null; }
- public static explicit operator ulong (System.UIntPtr value) { throw null; }
- public unsafe static explicit operator void* (System.UIntPtr value) { throw null; }
- public unsafe static explicit operator System.UIntPtr (void* value) { throw null; }
- public static bool operator !=(System.UIntPtr value1, System.UIntPtr value2) { throw null; }
- public static System.UIntPtr operator -(System.UIntPtr pointer, int offset) { throw null; }
- public static System.UIntPtr Parse(System.ReadOnlySpan s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
- public static System.UIntPtr Parse(System.ReadOnlySpan s, System.IFormatProvider? provider) { throw null; }
- public static System.UIntPtr Parse(string s) { throw null; }
- public static System.UIntPtr Parse(string s, System.Globalization.NumberStyles style) { throw null; }
- public static System.UIntPtr Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
- public static System.UIntPtr Parse(string s, System.IFormatProvider? provider) { throw null; }
+ public static nuint operator +(nuint pointer, int offset) { throw null; }
+ public static bool operator ==(nuint value1, nuint value2) { throw null; }
+ public static explicit operator nuint (uint value) { throw null; }
+ public static explicit operator nuint (ulong value) { throw null; }
+ public static explicit operator uint (nuint value) { throw null; }
+ public static explicit operator ulong (nuint value) { throw null; }
+ public unsafe static explicit operator void* (nuint value) { throw null; }
+ public unsafe static explicit operator nuint (void* value) { throw null; }
+ public static bool operator !=(nuint value1, nuint value2) { throw null; }
+ public static nuint operator -(nuint pointer, int offset) { throw null; }
+ public static nuint Parse(System.ReadOnlySpan s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
+ public static nuint Parse(System.ReadOnlySpan s, System.IFormatProvider? provider) { throw null; }
+ public static nuint Parse(string s) { throw null; }
+ public static nuint Parse(string s, System.Globalization.NumberStyles style) { throw null; }
+ public static nuint Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
+ public static nuint Parse(string s, System.IFormatProvider? provider) { throw null; }
public static nuint PopCount(nuint value) { throw null; }
public static nuint RotateLeft(nuint value, int rotateAmount) { throw null; }
public static nuint RotateRight(nuint value, int rotateAmount) { throw null; }
public static int Sign(nuint value) { throw null; }
- public static System.UIntPtr Subtract(System.UIntPtr pointer, int offset) { throw null; }
+ public static nuint Subtract(nuint pointer, int offset) { throw null; }
static nuint System.Numerics.IAdditionOperators.operator +(nuint left, nuint right) { throw null; }
static nuint System.Numerics.IAdditionOperators.operator checked +(nuint left, nuint right) { throw null; }
int System.Numerics.IBinaryInteger.GetByteCount() { throw null; }
@@ -6483,12 +6483,12 @@ void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Ser
public static nuint TrailingZeroCount(nuint value) { throw null; }
public static bool TryCreate(TOther value, out nuint result) where TOther : System.Numerics.INumberBase { throw null; }
public bool TryFormat(System.Span destination, out int charsWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] System.ReadOnlySpan format = default(System.ReadOnlySpan), System.IFormatProvider? provider = null) { throw null; }
- public static bool TryParse(System.ReadOnlySpan s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UIntPtr result) { throw null; }
- public static bool TryParse(System.ReadOnlySpan s, System.IFormatProvider? provider, out System.UIntPtr result) { throw null; }
- public static bool TryParse(System.ReadOnlySpan s, out System.UIntPtr result) { throw null; }
- public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UIntPtr result) { throw null; }
- public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.UIntPtr result) { throw null; }
- public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.UIntPtr result) { throw null; }
+ public static bool TryParse(System.ReadOnlySpan s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out nuint result) { throw null; }
+ public static bool TryParse(System.ReadOnlySpan s, System.IFormatProvider? provider, out nuint result) { throw null; }
+ public static bool TryParse(System.ReadOnlySpan s, out nuint result) { throw null; }
+ public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out nuint result) { throw null; }
+ public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out nuint result) { throw null; }
+ public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out nuint result) { throw null; }
}
public partial class UnauthorizedAccessException : System.SystemException
{
diff --git a/src/libraries/System.Runtime/tests/System/IntPtrTests.cs b/src/libraries/System.Runtime/tests/System/IntPtrTests.cs
index 25ad67a3b20c8..79f6bc1ca7400 100644
--- a/src/libraries/System.Runtime/tests/System/IntPtrTests.cs
+++ b/src/libraries/System.Runtime/tests/System/IntPtrTests.cs
@@ -4,6 +4,8 @@
using System;
using System.Collections.Generic;
using System.Globalization;
+using System.Linq;
+using System.Reflection;
using Xunit;
namespace System.Tests
@@ -15,197 +17,215 @@ public static class IntPtrTests
[Fact]
public static void Zero()
{
- VerifyPointer(IntPtr.Zero, 0);
+ Verify(nint.Zero, 0);
}
[Fact]
public static void Ctor_Int()
{
int i = 42;
- VerifyPointer(new IntPtr(i), i);
- VerifyPointer((IntPtr)i, i);
+ Verify(new nint(i), i);
+ Verify(i, i);
i = -1;
- VerifyPointer(new IntPtr(i), i);
- VerifyPointer((IntPtr)i, i);
+ Verify(new nint(i), i);
+ Verify(i, i);
}
[ConditionalFact(nameof(Is64Bit))]
public static void Ctor_Long()
{
long l = 0x0fffffffffffffff;
- VerifyPointer(new IntPtr(l), l);
- VerifyPointer((IntPtr)l, l);
+ Verify(new nint(l), l);
+ Verify(checked((nint)l), l);
}
[ConditionalFact(nameof(Is64Bit))]
public static unsafe void Ctor_VoidPointer_ToPointer()
{
- void* pv = new IntPtr(42).ToPointer();
- VerifyPointer(new IntPtr(pv), 42);
- VerifyPointer((IntPtr)pv, 42);
+ void* pv = new nint(42).ToPointer();
+ Verify(new nint(pv), 42);
+ Verify((nint)pv, 42);
}
[ConditionalFact(nameof(Is64Bit))]
public static unsafe void Size()
{
- Assert.Equal(sizeof(void*), IntPtr.Size);
+ Assert.Equal(sizeof(void*), nint.Size);
}
public static IEnumerable