Rename `GeneratedDllImportAttribute` -> `LibraryImportAttribute` (#66307)
authorElinor Fung <elfung@microsoft.com>
Thu, 10 Mar 2022 02:07:52 +0000 (18:07 -0800)
committerGitHub <noreply@github.com>
Thu, 10 Mar 2022 02:07:52 +0000 (18:07 -0800)
992 files changed:
docs/coding-guidelines/interop-guidelines.md
docs/design/features/source-generator-com.md
docs/design/features/source-generator-pinvokes.md
docs/design/libraries/LibraryImportGenerator/Compatibility.md
docs/design/libraries/LibraryImportGenerator/Pipeline.md
docs/design/libraries/LibraryImportGenerator/SpanMarshallers.md
eng/generators.targets
src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/CLRConfig.cs
src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs
src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipe.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/NativeRuntimeEventSource.PortableThreadPool.NativeSinks.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Diagnostics/StackFrame.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Enum.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/GC.cs
src/coreclr/System.Private.CoreLib/src/System/IO/FileLoadException.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Reflection/Assembly.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs
src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs
src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs
src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs
src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs
src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs
src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeModule.cs
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs
src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs
src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.Unix.cs
src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Threading/ThreadPool.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/Threading/Timer.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/TypeLoadException.CoreCLR.cs
src/coreclr/System.Private.CoreLib/src/System/TypeNameParser.cs
src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/InternalCalls.cs
src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/RuntimeExports.cs
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs
src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs
src/libraries/Common/src/Interop/Android/Interop.JObjectLifetime.cs
src/libraries/Common/src/Interop/Android/Interop.Logcat.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Bignum.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Cipher.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Dsa.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.ImportExport.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcKey.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ecdh.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Err.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.DigestAlgs.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Hmac.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Initialization.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Random.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Rsa.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.ProtocolSupport.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509Chain.cs
src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509Store.cs
src/libraries/Common/src/Interop/BSD/System.Native/Interop.ProtocolStatistics.cs
src/libraries/Common/src/Interop/BSD/System.Native/Interop.Sysctl.cs
src/libraries/Common/src/Interop/BSD/System.Native/Interop.TcpConnectionInfo.cs
src/libraries/Common/src/Interop/Interop.Brotli.cs
src/libraries/Common/src/Interop/Interop.Calendar.cs
src/libraries/Common/src/Interop/Interop.Casing.cs
src/libraries/Common/src/Interop/Interop.Collation.cs
src/libraries/Common/src/Interop/Interop.HostPolicy.cs
src/libraries/Common/src/Interop/Interop.ICU.cs
src/libraries/Common/src/Interop/Interop.ICU.iOS.cs
src/libraries/Common/src/Interop/Interop.Idna.cs
src/libraries/Common/src/Interop/Interop.Locale.cs
src/libraries/Common/src/Interop/Interop.Normalization.cs
src/libraries/Common/src/Interop/Interop.Odbc.cs
src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs
src/libraries/Common/src/Interop/Interop.zlib.cs
src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ber.cs
src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ldap.cs
src/libraries/Common/src/Interop/Linux/System.Native/Interop.INotify.cs
src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFArray.cs
src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFData.cs
src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFDate.cs
src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFDictionary.cs
src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFError.cs
src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFNumber.cs
src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFProxy.cs
src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFString.cs
src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFUrl.cs
src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.cs
src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs
src/libraries/Common/src/Interop/OSX/Interop.RunLoop.cs
src/libraries/Common/src/Interop/OSX/Interop.SystemConfiguration.cs
src/libraries/Common/src/Interop/OSX/Interop.libc.cs
src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs
src/libraries/Common/src/Interop/OSX/Interop.libproc.GetProcessInfoById.cs
src/libraries/Common/src/Interop/OSX/Interop.libproc.cs
src/libraries/Common/src/Interop/OSX/System.Native/Interop.AutoreleasePool.cs
src/libraries/Common/src/Interop/OSX/System.Native/Interop.SearchPath.cs
src/libraries/Common/src/Interop/OSX/System.Native/Interop.SearchPath.iOS.cs
src/libraries/Common/src/Interop/OSX/System.Native/Interop.iOSSupportVersion.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ecc.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Hmac.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.KeyAgree.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.iOS.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.macOS.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Pbkdf2.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.RSA.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecErrMessage.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.macOS.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SignVerify.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Symmetric.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Trust.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.iOS.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.macOS.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509Chain.cs
src/libraries/Common/src/Interop/SunOS/procfs/Interop.ProcFsStat.TryReadProcessStatusInfo.cs
src/libraries/Common/src/Interop/Unix/Interop.Errors.cs
src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Serial.cs
src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Termios.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Abort.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Accept.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Access.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Bind.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChDir.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChMod.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Close.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.ConfigureTerminalForChildProcess.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Connect.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.CopyFile.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Disconnect.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Dup.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.DynamicLoad.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.EnumerateInterfaceAddresses.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.ErrNo.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Exit.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.FAllocate.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.FChMod.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.FLock.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.FSync.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.FTruncate.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.ForkAndExecProcess.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetBytesAvailable.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetControlCharacters.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCpuUtilization.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDefaultTimeZone.Android.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainName.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEUid.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnv.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetGroupList.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetHostName.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerID.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerName.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPeerUserName.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPid.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessPath.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPwUid.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetRandomBytes.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSetPriority.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSid.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockName.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockOpt.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSocketErrorOption.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSocketType.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSystemTimeAsTicks.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetTimestamp.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixName.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixRelease.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixVersion.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetWindowWidth.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.HostEntry.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.InitializeTerminalAndSignalHandling.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.InterfaceNameToIndex.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsATty.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsMemberOfGroup.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Kill.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.LSeek.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.LingerOption.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Link.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Listen.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Log.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.LowLevelMonitor.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MAdvise.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MMap.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MSync.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MUnmap.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemAlloc.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemSet.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MkDir.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MksTemps.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MountPoints.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MulticastOption.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.NetworkChange.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Open.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.PRead.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.PReadV.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWrite.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWriteV.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.PathConf.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Pipe.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Poll.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixFAdvise.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixSignal.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.Pipe.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.RealPath.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Receive.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReceiveMessage.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForSigChld.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Rename.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.ResourceLimits.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.RmDir.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SNPrintF.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SchedGetCpu.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SchedGetSetAffinity.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Send.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SendFile.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SendMessage.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetDelayedSigChildConsoleConfigurationHandler.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetEUid.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetReceiveTimeout.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSendTimeout.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSockOpt.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.ShmOpen.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Shutdown.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Socket.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketEvent.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.Pipe.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.Span.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.StdinReady.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SymLink.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysConf.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysLog.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Threading.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.UTimensat.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Unlink.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.WaitId.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.WaitPid.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.Pipe.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.cs
src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.IsNtlmInstalled.cs
src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.GetIntegerBytes.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.Nid.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.BIO.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Bignum.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.CheckX509Hostname_IntPtr.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Dsa.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ERR.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.DigestAlgs.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcKey.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Dsa.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.EcKey.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Ecdh.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Rsa.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Hmac.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LegacyAlgorithms.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LookupFriendlyNameByOid.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OCSP.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslAvailable.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslGetProtocolSupport.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslVersion.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs7.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SetProtocolOptions.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtx.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtxOptions.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Ext.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Name.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Stack.cs
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509StoreCtx.cs
src/libraries/Common/src/Interop/Unix/libc/Interop.GetParentPid.cs
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AdjustTokenPrivileges.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AllocateLocallyUniqueId.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ChangeServiceConfig2.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CheckTokenMembership.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ClearEventLog.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseEventLog.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseServiceHandle.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ControlService.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSdToStringSd.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSidToStringSid.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSdToSd.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSecurityDescriptorToSecurityDescriptor.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSidToSid.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CopySid.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateProcessWithLogon.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateService.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateWellKnownSid.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDecrypt.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDeriveKey.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyHash.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyKey.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptEncrypt.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptExportKey.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGenKey.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetHashParam.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetKeyParam.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetProvParam.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetUserKey.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptHashData.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptImportKey.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptReleaseContext.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSetKeyParam.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptSignHash.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeleteService.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeregisterEventSource.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx_SafeTokenHandle.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EncryptDecrypt.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumDependentServices.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumServicesStatusEx.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EqualDomainSid.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventActivityIdControl.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventTraceGuidsEx.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteTransfer.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetNumberOfEventLogRecords.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetOldestEventLogRecord.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByHandle.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByName.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceDisplayName.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceKeyName.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSidIdentifierAuthority.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_SafeLocalAllocHandle.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_void.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetWindowsAccountDomainSid.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateNamedPipeClient.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsEqualDomainSid.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsValidSid.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsWellKnownSid.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LogonUser.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountNameW.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountSid.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupPrivilegeValue.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaClose.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaFreeMemory.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupNames2.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupSids.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaNtStatusToWinError.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaOpenPolicy.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaQueryInformationPolicy.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.NotifyChangeEventLog.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenEventLog.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_SafeAccessTokenHandle.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenSCManager.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenService.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken_SafeTokenHandle.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceConfig.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceStatus.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReadEventLog.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegConnectRegistry.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCreateKeyEx.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteKeyEx.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteValue.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumKeyEx.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumValue.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegOpenKeyEx.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryInfoKey.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegSetValueEx.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterEventSource.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterServiceCtrlHandlerEx.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReportEvent.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RevertToSelf.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetSecurityInfoByHandle.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetSecurityInfoByName.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetServiceStatus.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetThreadToken.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartService.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartServiceCtrlDispatcher.cs
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.cs
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.cs
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCloseAlgorithmProvider.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCreateHash.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDeriveKeyPBKDF2.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDuplicateHash.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptEncryptDecrypt.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptExportKey.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptFinishHash.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenerateSymmetricKey.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGetProperty.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHashData.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptImportKey.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptKeyDerivation.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptOpenAlgorithmProvider.cs
src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateContextToStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore_CertStoreAddDisposition.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCloseStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateChainEngine.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateContext.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDeleteCertificateFromStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateChain.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContextWithKeyContainerDeletion.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_SafeCertStoreHandle.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindCertificateInStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindExtension.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChain.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChainEngine.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateContext.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateChain.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty_NO_NULLABLE.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetIntendedKeyUsage.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetNameString.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetPublicKeyLength.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetValidUsages.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameToStr.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore_ENUM.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSaveStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSerializeCertificateStoreElement.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_CRYPT_KEY_PROV_INFO.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_DATA_BLOB.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_SafeNCryptKeyHandle.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStrToName.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertVerifyTimeValidity.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey_SafeNCryptKeyHandle.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_string.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject_CertEncodingType.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject_CertEncodingType.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptFormatObject.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptHashPublicKeyInfo.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptImportPublicKeyInfoEx2.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgClose.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgControl.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToDecode.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgUpdate.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectData.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptQueryObject.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptQueryObject_IntPtr_out.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptUnprotectData.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.FindOidInfo.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.HashIdAlg.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXExportCertStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXImportCertStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.certificates.cs
src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.cs
src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.BitBlt.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CombineRgn.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateCompatibleDC.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateDC.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateFontIndirect.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateIC.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.CreateRectRgn.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteDC.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.DeleteObject.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetClipRgn.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetCurrentObject.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetDeviceCaps.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetObjectType.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetRgnBox.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetStockObject.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.OffsetViewportOrgEx.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.RestoreDC.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SaveDC.cs
src/libraries/Common/src/Interop/Windows/Gdi32/Interop.SelectClipRgn.cs
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.cs
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.cs
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.ICMP.cs
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.cs
src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.if_nametoindex.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Beep.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CancelIoEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CheckTokenMembershipEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommError.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CompletionPort.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConditionVariable.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConnectNamedPipe.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConsoleCursorInfo.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFileEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateDirectory.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipe.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateNamedPipeClient.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreatePipe_SafeFileHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreatePipe_SafePipeHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateProcess.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateSymbolicLink.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateToolhelp32Snapshot.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CriticalSection.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteFile.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteVolumeMountPoint.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeviceIoControl.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DisconnectNamedPipe.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeAccessTokenHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeFileHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafePipeHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeWaitHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DynamicLoad.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EnumProcessModules.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EnumProcesses.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExitProcess.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileScatterGather.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileTimeToSystemTime.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FillConsoleOutputAttribute.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FillConsoleOutputCharacter.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindFirstFileEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindNextFile.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushFileBuffers.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushViewOfFile.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage_SafeLibraryHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfoEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommModemStatus.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleScreenBufferInfo.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleTitle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentDirectory.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessorNumber.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThreadId.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetDiskFreeSpaceEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetDriveType.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentVariable.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetExitCodeProcess.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileAttributesEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFinalPathNameByHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFullPathNameW.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLargestConsoleWindowSize.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLongPathNameW.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleBaseName.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileName.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileNameEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleInformation.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNamedPipeHandleState.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNamedPipeInfo.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetOverlappedResult.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetPriorityClass.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcAddress.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessAffinityMask.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessId.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessName.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessPriorityBoost.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessWorkingSetSizeEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTimes.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempFileNameW.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempPathW.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriority.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadPriorityBoost.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetThreadTimes.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTickCount64.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetVolumeInformation.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalFree.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalLock.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Globalization.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.HandleInformation.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Heap.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsDebuggerPresent.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsWow64Process_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IsWow64Process_SafeProcessHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibrary.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LocalAlloc.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LockFile.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MapViewOfFile.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MoveFileEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MultiByteToWideChar.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Mutex.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenProcess.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenThread.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OutputDebugString.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PeekConsoleInput.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryUnbiasedInterruptTime.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RaiseFailFastException.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsole.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsoleInput.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadConsoleOutput.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadDirectoryChangesW.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RemoveDirectory.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReplaceFile.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResolveLocaleName.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Semaphore.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommTimeouts.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCP.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.Delegate.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCursorPosition.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleOutputCP.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleScreenBufferSize.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleTextAttribute.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleTitle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleWindowInfo.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCurrentDirectory.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetEnvironmentVariable.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileAttributes.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileCompletionNotificationModes.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileInformationByHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFilePointerEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetNamedPipeHandleState.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetPriorityClass.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessAffinityMask.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessPriorityBoost.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetProcessWorkingSetSizeEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadAffinityMask.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadIdealProcessor.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadPriority.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadPriorityBoost.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetVolumeLabel.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SystemTimeToFileTime.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TerminateProcess.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ThreadPool.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ThreadPoolIO.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Threading.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TimeZone.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Timer.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TzSpecificLocalTimeToSystemTime.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.UnmapViewOfFile.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerLanguageName.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerSetConditionMask.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerifyVersionExW.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc_Ptr.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualFree.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery_Ptr.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitForSingleObject.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitNamedPipe.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WideCharToMultiByte.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteConsole.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteConsoleOutput.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs
src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.cs
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.EncryptDecrypt.cs
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveSecretAgreement.cs
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.cs
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptOpenStorageProvider.cs
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs
src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.cs
src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.cs
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.cs
src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.cs
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.cs
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.cs
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationProcess.cs
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.cs
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.cs
src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.cs
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.cs
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.cs
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetApartmentType.cs
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.cs
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.cs
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.cs
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.cs
src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.cs
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.cs
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.cs
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.cs
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.cs
src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.cs
src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.cs
src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.cs
src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.cs
src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.cs
src/libraries/Common/src/Interop/Windows/Shell32/Interop.ShellExecuteExW.cs
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.cs
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.cs
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.cs
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.cs
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.cs
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.cs
src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs
src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetDC.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetMessage.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextLengthW.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowTextW.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.PostQuitMessage.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.ReleaseDC.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.SystemParametersInfo.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.WaitForInputIdle.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.WindowFromDC.cs
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoEx.cs
src/libraries/Common/src/Interop/Windows/Version/Interop.GetFileVersionInfoSizeEx.cs
src/libraries/Common/src/Interop/Windows/Version/Interop.VerQueryValue.cs
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketAbortHandle.cs
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.cs
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.cs
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCompleteAction.cs
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateClientHandle.cs
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketCreateServerHandle.cs
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.cs
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketEndServerHandshake.cs
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketGetAction.cs
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketReceive.cs
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.cs
src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoExW.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoW.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetNameInfoW.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.TransmitFile.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAConnect.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSADuplicateSocket.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAEventSelect.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAGetOverlappedResult.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAIoctl.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecv.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSARecvFrom.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASend.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASendTo.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASocketW.SafeCloseSocket.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSASocketW.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAStartup.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.bind.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.gethostname.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getpeername.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockname.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockopt.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.ioctlsocket.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.listen.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recv.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.recvfrom.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.select.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.send.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.sendto.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.setsockopt.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.shutdown.cs
src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.cs
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ber.cs
src/libraries/Common/src/Interop/Windows/Wldap32/Interop.Ldap.cs
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSRegisterSessionNotification.cs
src/libraries/Common/src/Interop/Windows/WtsApi32/Interop.WTSUnRegisterSessionNotification.cs
src/libraries/Common/src/System/Runtime/InteropServices/LibraryImportAttribute.cs [moved from src/libraries/Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs with 89% similarity]
src/libraries/Common/tests/TestUtilities/System/Buffers/BoundedMemory.Windows.cs
src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs
src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs
src/libraries/Common/tests/TestUtilities/System/WindowsIdentityFixture.cs
src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft/Diagnostics/Tracing/StubEnvironment.cs
src/libraries/Microsoft.Win32.Registry/tests/Helpers.cs
src/libraries/System.Console/tests/CancelKeyPress.Unix.cs
src/libraries/System.Console/tests/ConsoleEncoding.Windows.cs
src/libraries/System.Data.OleDb/src/SafeNativeMethods.cs
src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.cs
src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/UnsafeNativeMethods.cs
src/libraries/System.DirectoryServices/src/Interop/SafeNativeMethods.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/NativeMethods.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/UnsafeNativeMethods.cs
src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Comdlg32.cs
src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Gdi32.cs
src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Kernel32.cs
src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Shell32.cs
src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.User32.cs
src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Winspool.cs
src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs
src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Windows.cs
src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.COMWrappers.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.NoCOMWrappers.cs
src/libraries/System.Drawing.Common/src/System/Drawing/LibX11Functions.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Printing/LibcupsNative.cs
src/libraries/System.Drawing.Common/src/System/Drawing/macFunctions.cs
src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Unix.cs
src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.NotifyFilter.cs
src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.NotifyFilter.cs
src/libraries/System.IO.FileSystem/tests/FileSystemTest.Unix.cs
src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Unix.cs
src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Windows.cs
src/libraries/System.IO.MemoryMappedFiles/tests/SafeMemoryMappedViewHandleTests.cs
src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs
src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportAnalyzer.cs
src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Analyzers/ConvertToLibraryImportFixer.cs
src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.cs
src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/PInvokeStubCodeGenerator.cs
src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Resources.Designer.cs
src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/Resources.resx
src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshallingAttributeInfo.cs
src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Resources.Designer.cs
src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Resources.resx
src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeNames.cs
src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/Ancillary.Interop.csproj
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/ArrayTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/BlittableStructTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/BooleanTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CallingConventionTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CharacterTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CollectionTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CustomMarshallingTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/DelegateTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/EnumTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/FunctionPointerTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/PointerTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SafeHandleTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SetLastErrorTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/SpanTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/StringTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/AdditionalAttributesOnStub.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/AttributeForwarding.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CodeSnippets.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/CompileFails.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/Compiles.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportAnalyzerTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/ConvertToLibraryImportFixerTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/Diagnostics.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/IncrementalGenerationTests.cs
src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.UnitTests/TestUtils.cs
src/samples/LibraryImportGeneratorSample/Program.cs

index 90d4c16..6490cd7 100644 (file)
@@ -166,7 +166,7 @@ Using enums instead of partial, static classes can lead to needing lots of casts
 
 When defining the P/Invoke signatures and structs, we follow the guidelines in the [interop best practices documentation](https://docs.microsoft.com/en-us/dotnet/standard/native-interop/best-practices).
 
-The runtime repo makes use of [source-generated p/invokes](../design/features/source-generator-pinvokes.md) whenever possible (see [the compatibility doc](../design/libraries/LibraryImportGenerator/Compatibility.md) for unsupported scenarios). Methods should be marked `GeneratedDllImport` and be `static` and `partial`.
+The runtime repo makes use of [source-generated p/invokes](../design/features/source-generator-pinvokes.md) whenever possible (see [the compatibility doc](../design/libraries/LibraryImportGenerator/Compatibility.md) for unsupported scenarios). Methods should be marked `LibraryImport` and be `static` and `partial`.
 
 If implicit framework references are disabled (as is the case for most libraries projects), explicit references to the below are required for marshalling arrays:
   - `System.Memory`
index 45945f0..6af31c4 100644 (file)
@@ -106,7 +106,7 @@ We do not plan on supporting `IDispatch` integration with C# `dynamic`, at least
 
 ### Checkpoint 5: .NET 6-compatible output
 
-A very important component of source generators is determining how to trigger them. For the DllImportGenerator, we trigger on a new attribute type, `GeneratedDllImportAttribute`, that is applied in place of the previous `DllImportAttribute`. For the JSON source generator, the team decided to have developers define an empty `JsonSerializerContext`-derived class and add `JsonSerializableAttribute` attribute on that context type that each point to a type that the generated serialization context should support. Below are the potential API designs we considered. All options below would support the `GuidAttribute` attribute to specify an IID, the `InterfaceTypeAttribute` attribute with the `InterfaceIsIUnknown` member (and `InterfaceIsIDispatch` if Checkpoint 4 is achieved), and the `DispIdAttribute` for `IDispatch` scenarios. We selected Option 5 as it gives us the most flexibility to express the switches we want to express to the user without tying us down to legacy requirements or requiring additional metadata in basic scenarios.
+A very important component of source generators is determining how to trigger them. For the DllImportGenerator, we trigger on a new attribute type, `LibraryImportAttribute`, that is applied in place of the previous `DllImportAttribute`. For the JSON source generator, the team decided to have developers define an empty `JsonSerializerContext`-derived class and add `JsonSerializableAttribute` attribute on that context type that each point to a type that the generated serialization context should support. Below are the potential API designs we considered. All options below would support the `GuidAttribute` attribute to specify an IID, the `InterfaceTypeAttribute` attribute with the `InterfaceIsIUnknown` member (and `InterfaceIsIDispatch` if Checkpoint 4 is achieved), and the `DispIdAttribute` for `IDispatch` scenarios. We selected Option 5 as it gives us the most flexibility to express the switches we want to express to the user without tying us down to legacy requirements or requiring additional metadata in basic scenarios.
 
 #### Option 1: Annotated ComWrappers stub
 
@@ -362,7 +362,7 @@ partial class MyComWrappers : ComWrappers
 
 Pros:
 
-- Similar experience to the `GeneratedDllImportAttribute`, where it basically replaces its built-in equivalent as a drop-in.
+- Similar experience to the `LibraryImportAttribute`, where it basically replaces its built-in equivalent as a drop-in.
 - Very easy to automatically hook up generated marshalling and to provide an easy process for other source generators to duplicate to support side-by-side as the policy is very simple.
 - Since we only generate a single `ComWrappers`-derived type, we could also decide to make the `ComObject` type public for .NET 7+ scenarios and make it private for .NET 6 scenarios as we know there will only ever be one.
 - The `GeneratedComImportAttribute` and `GeneratedComVisibleAttribute` attributes mirror the existing `ComImportAttribute` and `ComVisibleAttribute`, which will help provide a more intuitive view of the types and how to hook in tools that process C# -> TLB or TLB -> C# into the generator's flow.
@@ -480,7 +480,7 @@ partial class MyComWrappers : ComWrappers
 
 Pros:
 
-- Similar experience to the `GeneratedDllImportAttribute`, where it basically replaces its built-in equivalent as a drop-in.
+- Similar experience to the `LibraryImportAttribute`, where it basically replaces its built-in equivalent as a drop-in.
 - The `GeneratedComImportAttribute` and `GeneratedComVisibleAttribute` attributes mirror the existing `ComImportAttribute` and `ComVisibleAttribute`, which will help provide a more intuitive view of the types and how to hook in tools that process C# -> TLB or TLB -> C# into the generator's flow.
 
 Cons:
index dc2128b..f3608e0 100644 (file)
@@ -80,7 +80,7 @@ An example of how the previous P/Invoke snippet could be transformed is below. T
 `Program.cs` (User written code)
 
 ``` CSharp
-/* A */ [GeneratedDllImportAttribute("Kernel32.dll")]
+/* A */ [LibraryImportAttribute("Kernel32.dll")]
 /* B */ partial static bool QueryPerformanceCounter(out long lpPerformanceCount);
 ...
 long count;
@@ -89,7 +89,7 @@ long count;
 
 Observe point (A), the new attribute. This attribute provides an indication to a Source Generator that the following declaration represents a native export that will be called via a generated stub.
 
-During the source generation process the metadata in the `GeneratedDllImportAttribute` (A) would be used to generate a stub and invoke the desired native export. Also note that the method declaration is marked `partial`. The Source Generator would then generate the source for this partial method. The invocation (C) remains unchanged to that of usage involving `DllImportAttribute`.
+During the source generation process the metadata in the `LibraryImportAttribute` (A) would be used to generate a stub and invoke the desired native export. Also note that the method declaration is marked `partial`. The Source Generator would then generate the source for this partial method. The invocation (C) remains unchanged to that of usage involving `DllImportAttribute`.
 
 `Stubs.g.cs` (Source Generator code)
 
@@ -117,11 +117,11 @@ In this system it is not defined how marshaling of specific types would be perfo
 
 In the current Source Generator design modification of any user written code is not permitted. This includes modification of any non-functional metadata (e.g. Attributes). The above design therefore introduces a new attribute and signature for consumption of a native export. In order to consume Source Generators, users would need to update their source and adoption could be stunted by this requirement.
 
-As a mitigation it would be possible to create a [Roslyn Analyzer and Code fix](https://github.com/dotnet/roslyn/blob/master/docs/wiki/Getting-Started-Writing-a-Custom-Analyzer-&-Code-Fix.md) to aid the developer in converting `DllImportAttribute` marked functions to use `GeneratedDllImportAttribute`. Additionally, the function signature would need to be updated to remove the `extern` keyword and add the `partial` keyword to the function and potentially the enclosing class.
+As a mitigation it would be possible to create a [Roslyn Analyzer and Code fix](https://github.com/dotnet/roslyn/blob/master/docs/wiki/Getting-Started-Writing-a-Custom-Analyzer-&-Code-Fix.md) to aid the developer in converting `DllImportAttribute` marked functions to use `LibraryImportAttribute`. Additionally, the function signature would need to be updated to remove the `extern` keyword and add the `partial` keyword to the function and potentially the enclosing class.
 
 ## Proposed API
 
-Given the Source Generator restrictions and potential confusion about overloaded attribute usage, the new `GeneratedDllImportAttribute` attribute mirrors the existing `DllImportAttribute`.
+Given the Source Generator restrictions and potential confusion about overloaded attribute usage, the new `LibraryImportAttribute` attribute mirrors the existing `DllImportAttribute`.
 
 ``` CSharp
 namespace System.Runtime.InteropServices
@@ -131,7 +131,7 @@ namespace System.Runtime.InteropServices
     /// arguments instead of relying on the CLR to generate an IL Stub at runtime.
     /// </summary>
     [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
-    public sealed class GeneratedDllImportAttribute : Attribute
+    public sealed class LibraryImportAttribute : Attribute
     {
         /// <summary>
         /// Enables or disables best-fit mapping behavior when converting Unicode characters
index 50bc3b5..8e4f850 100644 (file)
@@ -8,19 +8,19 @@ The focus of version 1 is to support `NetCoreApp`. This implies that anything no
 
 ### Fallback mechanism
 
-In the event a marshaller would generate code that has a specific target framework or version requirement that is not satisfied, the generator will instead produce a normal `DllImportAttribute` declaration. This fallback mechanism enables the use of `GeneratedDllImportAttribute` in most circumstances and permits the conversion from `DllImportAttribute` to `GeneratedDllImportAttribute` to be across most code bases. There are instances where the generator will not be able to handle signatures or configuration. For example, uses of `StringBuilder` are not supported in any form and consumers should retain uses of `DllImportAttribute`. Additionally, `GeneratedDllImportAttribute` cannot represent all settings available on `DllImportAttribute`&mdash;see below for details.
+In the event a marshaller would generate code that has a specific target framework or version requirement that is not satisfied, the generator will instead produce a normal `DllImportAttribute` declaration. This fallback mechanism enables the use of `LibraryImportAttribute` in most circumstances and permits the conversion from `DllImportAttribute` to `LibraryImportAttribute` to be across most code bases. There are instances where the generator will not be able to handle signatures or configuration. For example, uses of `StringBuilder` are not supported in any form and consumers should retain uses of `DllImportAttribute`. Additionally, `LibraryImportAttribute` cannot represent all settings available on `DllImportAttribute`&mdash;see below for details.
 
 ### Semantic changes compared to `DllImportAttribute`
 
 [`CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) has been replaced with a new `StringMarshalling` enumeration. `Ansi` and `Auto` are no longer supported as first-class options and `Utf8` has been added.
 
-With `DllImportAttribute`, the default value of [`CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) is runtime/language-defined. In the built-in system, the default value of the `CharSet` property is `CharSet.Ansi`. The P/Invoke source generator makes no assumptions about `StringMarshalling` if it is not explicitly set on `GeneratedDllImportAttribute`. Marshalling of `char` or `string` requires explicitly specifying marshalling information.
+With `DllImportAttribute`, the default value of [`CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) is runtime/language-defined. In the built-in system, the default value of the `CharSet` property is `CharSet.Ansi`. The P/Invoke source generator makes no assumptions about `StringMarshalling` if it is not explicitly set on `LibraryImportAttribute`. Marshalling of `char` or `string` requires explicitly specifying marshalling information.
 
-[`BestFitMapping`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.bestfitmapping) and [`ThrowOnUnmappableChar`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.throwonunmappablechar) will not be supported for `GeneratedDllImportAttribute`. These values only have meaning on Windows when marshalling string data (`char`, `string`, `StringBuilder`) as [ANSI](https://docs.microsoft.com/windows/win32/intl/code-pages). As the general recommendation - including from Windows - is to move away from ANSI, the P/Invoke source generator will not support these fields.
+[`BestFitMapping`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.bestfitmapping) and [`ThrowOnUnmappableChar`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.throwonunmappablechar) will not be supported for `LibraryImportAttribute`. These values only have meaning on Windows when marshalling string data (`char`, `string`, `StringBuilder`) as [ANSI](https://docs.microsoft.com/windows/win32/intl/code-pages). As the general recommendation - including from Windows - is to move away from ANSI, the P/Invoke source generator will not support these fields.
 
-[`CallingConvention`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.callingconvention) will not be supported for `GeneratedDllImportAttribute`. Users will be required to use the new `UnmanagedCallConvAttribute` attribute instead. This attribute provides support for extensible calling conventions and provides parity with the `UnmanagedCallersOnlyAttribute` attribute and C# function pointer syntax. We will enable our conversion code-fix to automatically convert explicit and known calling convention usage to use the `UnmanagedCallConvAttribute`.
+[`CallingConvention`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.callingconvention) will not be supported for `LibraryImportAttribute`. Users will be required to use the new `UnmanagedCallConvAttribute` attribute instead. This attribute provides support for extensible calling conventions and provides parity with the `UnmanagedCallersOnlyAttribute` attribute and C# function pointer syntax. We will enable our conversion code-fix to automatically convert explicit and known calling convention usage to use the `UnmanagedCallConvAttribute`.
 
-[`ExactSpelling`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.exactspelling) will not be supported for `GeneratedDllImportAttribute`. If `ExactSpelling` is used on an existing `DllImport`, the offered code-fix will provide users with additional options for using `A` or `W` suffixed variants depending on the provided `CharSet` so they can explicitly choose which spelling is correct for their scenario.
+[`ExactSpelling`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.exactspelling) will not be supported for `LibraryImportAttribute`. If `ExactSpelling` is used on an existing `DllImport`, the offered code-fix will provide users with additional options for using `A` or `W` suffixed variants depending on the provided `CharSet` so they can explicitly choose which spelling is correct for their scenario.
 
 ### Required references
 
@@ -36,7 +36,7 @@ These are all part of `NetCoreApp` and will be referenced by default unless [imp
 Marshalling of `char` will only be supported with `StringMarshalling.Utf16` or as `UnmanagedType.U2` or `UnmanagedType.I2`. It will not be supported when configured with any of the following:
   - [`UnmanagedType.U1` or `UnmanagedType.I1`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype)
   - `StringMarshalling.Utf8` will not be supported.
-  - No explicit marshalling information - either `GeneratedDllImportAttribute.StringMarshalling` or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute)
+  - No explicit marshalling information - either `LibraryImportAttribute.StringMarshalling` or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute)
 
 In the built-in system, marshalling with `CharSet.Ansi` and `CharSet.None` used the [system default Windows ANSI code page](https://docs.microsoft.com/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte) when on Windows and took the first byte of the UTF-8 encoding on non-Windows platforms. The above reasoning also applies to marshalling of a `char` as `UnmanagedType.U1` and `UnmanagedType.I1`. All approaches are fundamentally flawed and therefore not supported. If a single-byte character is expected to be marshalled it is left to the caller to convert a .NET `char` into a single `byte` prior to calling the native function.
 
@@ -46,7 +46,7 @@ For `CharSet.Auto`, the built-in system relied upon detection at runtime of the
 
 Marshalling of `string` will not be supported when configured with any of the following:
   - [`UnmanagedType.VBByRefStr`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype)
-  - No explicit marshalling information - either `GeneratedDllImportAttribute.StringMarshalling` or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute)
+  - No explicit marshalling information - either `LibraryImportAttribute.StringMarshalling` or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute)
 
 When converting from native to managed, the built-in system would throw a [`MarshalDirectiveException`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshaldirectiveexception) if the string's length is over 0x7ffffff0. The generated marshalling code will no longer perform this check.
 
@@ -86,7 +86,7 @@ For some types - blittable or Unicode `char` - passed by read-only reference via
 
 ### `LCIDConversion` support
 
-[`LCIDConversionAttribute`](`https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute`) will not be supported for methods marked with `GeneratedDllImportAttribute`.
+[`LCIDConversionAttribute`](`https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute`) will not be supported for methods marked with `LibraryImportAttribute`.
 
 ### `[In, Out]` Attributes
 
index c2b1844..7d0d7a5 100644 (file)
@@ -1,6 +1,6 @@
 # P/Invoke Generation Pipeline
 
-The P/Invoke source generator is responsible for finding all methods marked with `GeneratedDllImportAttribute` and generating code for their implementations (stubs) and corresponding P/Invokes that will be called by the stubs. For every method, the steps are:
+The P/Invoke source generator is responsible for finding all methods marked with `LibraryImportAttribute` and generating code for their implementations (stubs) and corresponding P/Invokes that will be called by the stubs. For every method, the steps are:
 
 1. [Process the symbols and metadata](#symbols-and-metadata-processing) for the method, its parameters, and its return type.
 1. [Determine the marshalling generators](#marshalling-generators) that will be responsible for generating the stub code for each parameter and return
@@ -12,7 +12,7 @@ The pipeline uses the Roslyn [Syntax APIs](https://docs.microsoft.com/dotnet/api
 
 ## Symbol and metadata processing
 
-The generator processes the method's `GeneratedDllImportAttribute` data, the method's parameter and return types, and the metadata on them (e.g. [`LCIDConversionAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute), [`MarshalAsAttribute`][MarshalAsAttribute], [struct marshalling attributes](StructMarshalling.md)). This information is used to determine the corresponding native type for each managed parameter/return type and how they will be marshalled.
+The generator processes the method's `LibraryImportAttribute` data, the method's parameter and return types, and the metadata on them (e.g. [`LCIDConversionAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute), [`MarshalAsAttribute`][MarshalAsAttribute], [struct marshalling attributes](StructMarshalling.md)). This information is used to determine the corresponding native type for each managed parameter/return type and how they will be marshalled.
 
 A [`TypePositionInfo`][src-TypePositionInfo] is created for each type that needs to be marshalled. For each parameter and return type, this captures the managed type, managed and native positions (return or index in parameter list), and marshalling information.
 
@@ -25,7 +25,7 @@ The processing step also includes handling any implicit parameter/return types t
 The below signature indicates that the native function returns an HRESULT, but has no other return value (out parameter).
 
 ```C#
-[GeneratedDllImport("Lib", PreserveSig = false)]
+[LibraryImport("Lib", PreserveSig = false)]
 static partial void Method();
 ```
 Processing the above signature would create a `TypePositionInfo` for the HRESULT return type for native call, with properties indicating that it is in the native return position and has no managed position. The actual P/Invoke would be:
@@ -38,7 +38,7 @@ static partial int Method__PInvoke__();
 The below signature indicates that the native function returns an HRESULT and also has an out parameter to be used as the managed return value.
 
 ```C#
-[GeneratedDllImport("Lib", PreserveSig = false)]
+[LibraryImport("Lib", PreserveSig = false)]
 [return: MarshalAs(UnmanagedType.U1)]
 static partial bool MethodWithReturn();
 ```
@@ -158,7 +158,7 @@ Clearing the system error (1) is necessary because the native method may not set
 
 The P/Invoke called by the stub is created based on the user's original declaration of the stub. The signature is generated using the syntax returned by `AsNativeType` and `AsParameter` of the marshalling generators for the return and parameters. Any marshalling attributes on the return and parameters of the managed method - [`MarshalAsAttribute`][MarshalAsAttribute], [`InAttribute`][InAttribute], [`OutAttribute`][OutAttribute] - are dropped.
 
-The fields of the [`DllImportAttribute`][DllImportAttribute] are set based on the fields of `GeneratedDllImportAttribute` as follows:
+The fields of the [`DllImportAttribute`][DllImportAttribute] are set based on the fields of `LibraryImportAttribute` as follows:
 
 | Field                                             | Behaviour |
 | ------------------------------------------------- | --------- |
@@ -177,7 +177,7 @@ Explicit `EntryPoint`:
 
 ```C#
 // Original declaration
-[GeneratedDllImport("Lib")]
+[LibraryImport("Lib")]
 static partial void Method(out int i);
 
 // Generated P/Invoke
@@ -189,7 +189,7 @@ Passed through:
 
 ```C#
 // Original declaration
-[GeneratedDllImport("Lib", EntryPoint = "EntryPoint", CharSet = CharSet.Unicode)]
+[LibraryImport("Lib", EntryPoint = "EntryPoint", CharSet = CharSet.Unicode)]
 static partial int Method(string s);
 
 // Generated P/Invoke
@@ -201,7 +201,7 @@ Handled by generated source (dropped from `DllImport`):
 
 ```C#
 // Original declaration
-[GeneratedDllImport("Lib", SetLastError = true)]
+[LibraryImport("Lib", SetLastError = true)]
 [return: [MarshalAs(UnmanagedType.U1)]
 static partial bool Method([In][MarshasAs(UnmanagedType.LPWStr)] string s);
 
index a1b3e74..eccefc6 100644 (file)
@@ -59,7 +59,7 @@ Introduce a new attribute named `GenericContiguousCollectionMarshallerAttribute`
 
 ```csharp
 namespace System.Runtime.InteropServices
-{ 
+{
     [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class)]
     public sealed class GenericContiguousCollectionMarshallerAttribute : Attribute
     {
@@ -99,7 +99,7 @@ public struct GenericContiguousCollectionMarshallerImpl<T, U, V,...>
     // these constructors are required if marshalling from managed to native is supported.
     public GenericContiguousCollectionMarshallerImpl(GenericCollection<T, U, V, ...> collection, int nativeSizeOfElement);
     public GenericContiguousCollectionMarshallerImpl(GenericCollection<T, U, V, ...> collection, Span<byte> stackSpace, int nativeSizeOfElement); // optional
-    
+
     public const int StackBufferSize = /* */; // required if the span-based constructor is supplied.
 
     /// <summary>
@@ -227,7 +227,7 @@ struct WrappedInt
   public int ToManaged() => value;
 }
 
-[GeneratedDllImport("Native")]
+[LibraryImport("Native")]
 [return:MarshalUsing(CountElementName = nameof(length))]
 public static partial Span<int> DuplicateValues([MarshalUsing(typeof(WrappedInt), ElementIndirectionLevel = 1)] Span<int> values, int length);
 
@@ -271,7 +271,7 @@ public struct GenericContiguousCollectionMarshallerImpl<T, U, V,...>
     // these constructors are required if marshalling from managed to native is supported.
     public GenericContiguousCollectionMarshallerImpl(GenericCollection<T, U, V, ...> collection, int nativeSizeOfElements);
     public GenericContiguousCollectionMarshallerImpl(GenericCollection<T, U, V, ...> collection, Span<byte> stackSpace, int nativeSizeOfElements); // optional
-    
+
     public const int StackBufferSize = /* */; // required if the span-based constructor is supplied.
 
 -    public Span<TCollectionElement> ManagedValues { get; }
index 7cd7b4c..9ca826c 100644 (file)
@@ -44,7 +44,7 @@
   <ItemGroup Condition="'@(EnabledGenerators)' != ''
                         and @(EnabledGenerators->AnyHaveMetadataValue('Identity', 'LibraryImportGenerator'))
                         and '$(IncludeLibraryImportGeneratorSources)' == 'true'">
-    <Compile Include="$(LibrariesProjectRoot)Common\src\System\Runtime\InteropServices\GeneratedDllImportAttribute.cs" />
+    <Compile Include="$(LibrariesProjectRoot)Common\src\System\Runtime\InteropServices\LibraryImportAttribute.cs" />
     <Compile Include="$(LibrariesProjectRoot)Common\src\System\Runtime\InteropServices\StringMarshalling.cs" />
 
     <!-- Only add the following files if we are on the latest TFM (that is, net7). -->
index 002937f..4131391 100644 (file)
@@ -20,7 +20,7 @@ namespace System
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_Clear")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_Clear")]
         private static unsafe partial void __ZeroMemory(void* b, nuint byteLength);
 
         // The maximum block size to for __BulkMoveWithWriteBarrier FCall. This is required to avoid GC starvation.
@@ -76,7 +76,7 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void __BulkMoveWithWriteBarrier(ref byte destination, ref byte source, nuint byteCount);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_MemMove")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Buffer_MemMove")]
         private static unsafe partial void __Memmove(byte* dest, byte* src, nuint len);
 
         // Used by ilmarshalers.cpp
index c94ddba..31d0d35 100644 (file)
@@ -15,7 +15,7 @@ namespace System
             return GetConfigBoolValue(switchName, out exist);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ClrConfig_GetConfigBoolValue", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ClrConfig_GetConfigBoolValue", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool GetConfigBoolValue(string configSwitchName, [MarshalAs(UnmanagedType.Bool)] out bool exist);
     }
index e5d1c40..9a51c47 100644 (file)
@@ -51,7 +51,7 @@ namespace System.Diagnostics
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "DebugDebugger_Launch")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "DebugDebugger_Launch")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool LaunchInternal();
 
@@ -78,7 +78,7 @@ namespace System.Diagnostics
         // report the message depending on its settings.
         public static void Log(int level, string? category, string? message) => LogInternal(level, category, message);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "DebugDebugger_Log", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "DebugDebugger_Log", StringMarshalling = StringMarshalling.Utf16)]
         private static partial void LogInternal(int level, string? category, string? message);
 
         // Checks to see if an attached debugger has logging enabled
index 3014425..8269557 100644 (file)
@@ -14,7 +14,7 @@ namespace System.Diagnostics.Tracing
         //
         // These PInvokes are used by the configuration APIs to interact with EventPipe.
         //
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Enable")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Enable")]
         private static unsafe partial ulong Enable(
             char* outputFile,
             EventPipeSerializationFormat format,
@@ -22,42 +22,42 @@ namespace System.Diagnostics.Tracing
             EventPipeProviderConfigurationNative* providers,
             uint numProviders);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Disable")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Disable")]
         internal static partial void Disable(ulong sessionID);
 
         //
         // These PInvokes are used by EventSource to interact with the EventPipe.
         //
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_CreateProvider", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_CreateProvider", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr CreateProvider(string providerName, Interop.Advapi32.EtwEnableCallback callbackFunc);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DefineEvent")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DefineEvent")]
         internal static unsafe partial IntPtr DefineEvent(IntPtr provHandle, uint eventID, long keywords, uint eventVersion, uint level, void *pMetadata, uint metadataLength);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetProvider", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetProvider", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr GetProvider(string providerName);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DeleteProvider")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DeleteProvider")]
         internal static partial void DeleteProvider(IntPtr provHandle);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_EventActivityIdControl")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_EventActivityIdControl")]
         internal static partial int EventActivityIdControl(uint controlCode, ref Guid activityId);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_WriteEventData")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_WriteEventData")]
         internal static unsafe partial void WriteEventData(IntPtr eventHandle, EventProvider.EventData* pEventData, uint dataCount, Guid* activityId, Guid* relatedActivityId);
 
         //
         // These PInvokes are used as part of the EventPipeEventDispatcher.
         //
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetSessionInfo")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetSessionInfo")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetSessionInfo(ulong sessionID, EventPipeSessionInfo* pSessionInfo);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetNextEvent")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetNextEvent")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetNextEvent(ulong sessionID, EventPipeEventInstanceData* pInstance);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetWaitHandle")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetWaitHandle")]
         internal static unsafe partial IntPtr GetWaitHandle(ulong sessionID);
     }
 }
index 6c555fd..a06aa79 100644 (file)
@@ -13,27 +13,27 @@ namespace System.Diagnostics.Tracing
     internal sealed partial class NativeRuntimeEventSource : EventSource
     {
         [NonEvent]
-        [GeneratedDllImport(RuntimeHelpers.QCall)]
+        [LibraryImport(RuntimeHelpers.QCall)]
         internal static partial void LogThreadPoolWorkerThreadStart(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID);
 
         [NonEvent]
-        [GeneratedDllImport(RuntimeHelpers.QCall)]
+        [LibraryImport(RuntimeHelpers.QCall)]
         internal static partial void LogThreadPoolWorkerThreadStop(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID);
 
         [NonEvent]
-        [GeneratedDllImport(RuntimeHelpers.QCall)]
+        [LibraryImport(RuntimeHelpers.QCall)]
         internal static partial void LogThreadPoolWorkerThreadWait(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID);
 
         [NonEvent]
-        [GeneratedDllImport(RuntimeHelpers.QCall)]
+        [LibraryImport(RuntimeHelpers.QCall)]
         internal static partial void LogThreadPoolWorkerThreadAdjustmentSample(double Throughput, ushort ClrInstanceID);
 
         [NonEvent]
-        [GeneratedDllImport(RuntimeHelpers.QCall)]
+        [LibraryImport(RuntimeHelpers.QCall)]
         internal static partial void LogThreadPoolWorkerThreadAdjustmentAdjustment(double AverageThroughput, uint NewWorkerThreadCount, NativeRuntimeEventSource.ThreadAdjustmentReasonMap Reason, ushort ClrInstanceID);
 
         [NonEvent]
-        [GeneratedDllImport(RuntimeHelpers.QCall)]
+        [LibraryImport(RuntimeHelpers.QCall)]
         internal static partial void LogThreadPoolWorkerThreadAdjustmentStats(
             double Duration,
             double Throughput,
@@ -48,7 +48,7 @@ namespace System.Diagnostics.Tracing
             ushort ClrInstanceID);
 
         [NonEvent]
-        [GeneratedDllImport(RuntimeHelpers.QCall)]
+        [LibraryImport(RuntimeHelpers.QCall)]
         internal static partial void LogThreadPoolIOEnqueue(
             IntPtr NativeOverlapped,
             IntPtr Overlapped,
@@ -56,14 +56,14 @@ namespace System.Diagnostics.Tracing
             ushort ClrInstanceID);
 
         [NonEvent]
-        [GeneratedDllImport(RuntimeHelpers.QCall)]
+        [LibraryImport(RuntimeHelpers.QCall)]
         internal static partial void LogThreadPoolIODequeue(
             IntPtr NativeOverlapped,
             IntPtr Overlapped,
             ushort ClrInstanceID);
 
         [NonEvent]
-        [GeneratedDllImport(RuntimeHelpers.QCall)]
+        [LibraryImport(RuntimeHelpers.QCall)]
         internal static partial void LogThreadPoolWorkingThreadCount(
             uint Count,
             ushort ClrInstanceID
index 4839781..76f445e 100644 (file)
@@ -56,7 +56,7 @@ namespace System.Diagnostics
         private static bool AppendStackFrameWithoutMethodBase(StringBuilder sb) => false;
 #pragma warning restore IDE0060
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "StackFrame_GetMethodDescFromNativeIP")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "StackFrame_GetMethodDescFromNativeIP")]
         private static partial RuntimeMethodHandleInternal GetMethodDescFromNativeIP(IntPtr ip);
 
         /// <summary>
index 8899b18..b8e41c0 100644 (file)
@@ -10,7 +10,7 @@ namespace System
 {
     public abstract partial class Enum
     {
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Enum_GetValuesAndNames")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Enum_GetValuesAndNames")]
         private static partial void GetEnumValuesAndNames(QCallTypeHandle enumType, ObjectHandleOnStack values, ObjectHandleOnStack names, Interop.BOOL getNames);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
index 531f51e..ce4ab04 100644 (file)
@@ -18,7 +18,7 @@ namespace System
         }
 
         // Terminates this process with the given exit code.
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Environment_Exit")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Environment_Exit")]
         [DoesNotReturn]
         private static partial void _Exit(int exitCode);
 
@@ -84,7 +84,7 @@ namespace System
                 GetCommandLineArgsNative();
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Environment_GetProcessorCount")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Environment_GetProcessorCount")]
         private static partial int GetProcessorCount();
 
         // Used by VM
index 145e1ff..82250b5 100644 (file)
@@ -248,7 +248,7 @@ namespace System
             return retMesg!;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_GetMessageFromNativeResources")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_GetMessageFromNativeResources")]
         private static partial void GetMessageFromNativeResources(ExceptionMessageKind kind, StringHandleOnStack retMesg);
 
         internal readonly struct DispatchState
index 91e5e7c..4f2fbd8 100644 (file)
@@ -77,10 +77,10 @@ namespace System
             return new GCMemoryInfo(data);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_StartNoGCRegion")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_StartNoGCRegion")]
         internal static partial int _StartNoGCRegion(long totalSize, [MarshalAs(UnmanagedType.Bool)] bool lohSizeKnown, long lohSize, [MarshalAs(UnmanagedType.Bool)] bool disallowFullBlockingGC);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_EndNoGCRegion")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_EndNoGCRegion")]
         internal static partial int _EndNoGCRegion();
 
         // keep in sync with GC_ALLOC_FLAGS in gcinterface.h
@@ -97,10 +97,10 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern int GetGenerationWR(IntPtr handle);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_GetTotalMemory")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_GetTotalMemory")]
         private static partial long GetTotalMemory();
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_Collect")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_Collect")]
         private static partial void _Collect(int generation, int mode);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
@@ -118,10 +118,10 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern ulong GetGenerationSize(int gen);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_AddMemoryPressure")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_AddMemoryPressure")]
         private static partial void _AddMemoryPressure(ulong bytesAllocated);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_RemoveMemoryPressure")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_RemoveMemoryPressure")]
         private static partial void _RemoveMemoryPressure(ulong bytesAllocated);
 
         public static void AddMemoryPressure(long bytesAllocated)
@@ -288,7 +288,7 @@ namespace System
         //
         public static int MaxGeneration => GetMaxGeneration();
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_WaitForPendingFinalizers")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_WaitForPendingFinalizers")]
         private static partial void _WaitForPendingFinalizers();
 
         public static void WaitForPendingFinalizers()
@@ -347,10 +347,10 @@ namespace System
             return newSize;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_RegisterFrozenSegment")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_RegisterFrozenSegment")]
         private static partial IntPtr _RegisterFrozenSegment(IntPtr sectionAddress, nint sectionSize);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_UnregisterFrozenSegment")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_UnregisterFrozenSegment")]
         private static partial void _UnregisterFrozenSegment(IntPtr segmentHandle);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
index b41e979..4933f91 100644 (file)
@@ -31,10 +31,10 @@ namespace System.IO
             return string.Format(format!, fileName, message);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall)]
+        [LibraryImport(RuntimeHelpers.QCall)]
         private static partial void GetFileLoadExceptionMessage(int hResult, StringHandleOnStack retString);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "FileLoadException_GetMessageForHR")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "FileLoadException_GetMessageForHR")]
         private static partial void GetMessageForHR(int hresult, StringHandleOnStack retString);
     }
 }
index 651c4ae..8f71f71 100644 (file)
@@ -48,7 +48,7 @@ namespace System.Reflection
             return RuntimeAssembly.InternalLoad(assemblyRef, ref stackMark, AssemblyLoadContext.CurrentContextualReflectionContext);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetExecutingAssembly")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetExecutingAssembly")]
         private static partial void GetExecutingAssemblyNative(StackCrawlMarkHandle stackMark, ObjectHandleOnStack retAssembly);
 
         internal static RuntimeAssembly GetExecutingAssembly(ref StackCrawlMark stackMark)
@@ -76,7 +76,7 @@ namespace System.Reflection
             return GetExecutingAssembly(ref stackMark);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetEntryAssembly")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetEntryAssembly")]
         private static partial void GetEntryAssemblyNative(ObjectHandleOnStack retAssembly);
 
         private static Assembly? GetEntryAssemblyInternal()
@@ -86,7 +86,7 @@ namespace System.Reflection
             return entryAssembly;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetAssemblyCount")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetAssemblyCount")]
         [SuppressGCTransition]
         internal static partial uint GetAssemblyCount();
     }
index ea1376d..880556d 100644 (file)
@@ -164,7 +164,7 @@ namespace System.Reflection.Emit
                                                  assemblyAttributes);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomain_CreateDynamicAssembly")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomain_CreateDynamicAssembly")]
         private static partial void CreateDynamicAssembly(ObjectHandleOnStack name,
                                                          int access,
                                                          ObjectHandleOnStack assemblyLoadContext,
index f1731f3..aae82ed 100644 (file)
@@ -93,10 +93,10 @@ namespace System.Reflection.Emit
             return SymbolType.FormCompoundType(strFormat, baseType, 0);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetTypeRef", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetTypeRef", StringMarshalling = StringMarshalling.Utf16)]
         private static partial int GetTypeRef(QCallModule module, string strFullName, QCallModule refedModule, string? strRefedModuleFileName, int tkResolution);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRef")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRef")]
         private static partial int GetMemberRef(QCallModule module, QCallModule refedModule, int tr, int defToken);
 
         private int GetMemberRef(Module? refedModule, int tr, int defToken)
@@ -107,7 +107,7 @@ namespace System.Reflection.Emit
             return GetMemberRef(new QCallModule(ref thisModule), new QCallModule(ref refedRuntimeModule), tr, defToken);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefFromSignature", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefFromSignature", StringMarshalling = StringMarshalling.Utf16)]
         private static partial int GetMemberRefFromSignature(QCallModule module, int tr, string methodName, byte[] signature, int length);
 
         private int GetMemberRefFromSignature(int tr, string methodName, byte[] signature, int length)
@@ -116,7 +116,7 @@ namespace System.Reflection.Emit
             return GetMemberRefFromSignature(new QCallModule(ref thisModule), tr, methodName, signature, length);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefOfMethodInfo")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefOfMethodInfo")]
         private static partial int GetMemberRefOfMethodInfo(QCallModule module, int tr, RuntimeMethodHandleInternal method);
 
         private int GetMemberRefOfMethodInfo(int tr, RuntimeMethodInfo method)
@@ -139,7 +139,7 @@ namespace System.Reflection.Emit
             return result;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefOfFieldInfo")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetMemberRefOfFieldInfo")]
         private static partial int GetMemberRefOfFieldInfo(QCallModule module, int tkType, QCallTypeHandle declaringType, int tkField);
 
         private int GetMemberRefOfFieldInfo(int tkType, RuntimeTypeHandle declaringType, RuntimeFieldInfo runtimeField)
@@ -150,7 +150,7 @@ namespace System.Reflection.Emit
             return GetMemberRefOfFieldInfo(new QCallModule(ref thisModule), tkType, new QCallTypeHandle(ref declaringType), runtimeField.MetadataToken);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetTokenFromTypeSpec")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetTokenFromTypeSpec")]
         private static partial int GetTokenFromTypeSpec(QCallModule pModule, byte[] signature, int length);
 
         private int GetTokenFromTypeSpec(byte[] signature, int length)
@@ -159,13 +159,13 @@ namespace System.Reflection.Emit
             return GetTokenFromTypeSpec(new QCallModule(ref thisModule), signature, length);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetArrayMethodToken", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetArrayMethodToken", StringMarshalling = StringMarshalling.Utf16)]
         private static partial int GetArrayMethodToken(QCallModule module, int tkTypeSpec, string methodName, byte[] signature, int sigLength);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetStringConstant", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_GetStringConstant", StringMarshalling = StringMarshalling.Utf16)]
         private static partial int GetStringConstant(QCallModule module, string str, int length);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_SetFieldRVAContent")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleBuilder_SetFieldRVAContent")]
         internal static partial void SetFieldRVAContent(QCallModule module, int fdToken, byte[]? data, int length);
 
         #endregion
index ae2c3d4..2f0bc41 100644 (file)
@@ -140,26 +140,26 @@ namespace System.Reflection.Emit
         #endregion
 
         #region Private Static FCalls
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetParentType")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetParentType")]
         private static partial void SetParentType(QCallModule module, int tdTypeDef, int tkParent);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_AddInterfaceImpl")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_AddInterfaceImpl")]
         private static partial void AddInterfaceImpl(QCallModule module, int tdTypeDef, int tkInterface);
         #endregion
 
         #region Internal Static FCalls
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethod", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethod", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DefineMethod(QCallModule module, int tkParent, string name, byte[] signature, int sigLength,
             MethodAttributes attributes);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodSpec")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodSpec")]
         internal static partial int DefineMethodSpec(QCallModule module, int tkParent, byte[] signature, int sigLength);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineField", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineField", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DefineField(QCallModule module, int tkParent, string name, byte[] signature, int sigLength,
             FieldAttributes attributes);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetMethodIL")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetMethodIL")]
         private static partial void SetMethodIL(QCallModule module, int tk, [MarshalAs(UnmanagedType.Bool)] bool isInitLocals,
             byte[]? body, int bodyLength,
             byte[] LocalSig, int sigLength,
@@ -167,7 +167,7 @@ namespace System.Reflection.Emit
             ExceptionHandler[]? exceptions, int numExceptions,
             int[]? tokenFixups, int numTokenFixups);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineCustomAttribute")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineCustomAttribute")]
         private static partial void DefineCustomAttribute(QCallModule module, int tkAssociate, int tkConstructor,
             byte[]? attr, int attrLength);
 
@@ -186,40 +186,40 @@ namespace System.Reflection.Emit
                 localAttr, (localAttr != null) ? localAttr.Length : 0);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineProperty", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineProperty", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DefineProperty(QCallModule module, int tkParent, string name, PropertyAttributes attributes,
             byte[] signature, int sigLength);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineEvent", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineEvent", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DefineEvent(QCallModule module, int tkParent, string name, EventAttributes attributes, int tkEventType);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodSemantics")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodSemantics")]
         internal static partial void DefineMethodSemantics(QCallModule module, int tkAssociation,
             MethodSemanticsAttributes semantics, int tkMethod);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodImpl")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineMethodImpl")]
         internal static partial void DefineMethodImpl(QCallModule module, int tkType, int tkBody, int tkDecl);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetMethodImpl")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetMethodImpl")]
         internal static partial void SetMethodImpl(QCallModule module, int tkMethod, MethodImplAttributes MethodImplAttributes);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetParamInfo", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetParamInfo", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int SetParamInfo(QCallModule module, int tkMethod, int iSequence,
             ParameterAttributes iParamAttributes, string? strParamName);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_GetTokenFromSig")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_GetTokenFromSig")]
         internal static partial int GetTokenFromSig(QCallModule module, byte[] signature, int sigLength);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetFieldLayoutOffset")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetFieldLayoutOffset")]
         internal static partial void SetFieldLayoutOffset(QCallModule module, int fdToken, int iOffset);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetClassLayout")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetClassLayout")]
         internal static partial void SetClassLayout(QCallModule module, int tk, PackingSize iPackingSize, int iTypeSize);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetConstantValue")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetConstantValue")]
         private static unsafe partial void SetConstantValue(QCallModule module, int tk, int corType, void* pValue);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetPInvokeData", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetPInvokeData", StringMarshalling = StringMarshalling.Utf16)]
         private static partial void SetPInvokeData(QCallModule module, string DllName, string name, int token, int linkFlags);
 
         #endregion
@@ -635,15 +635,15 @@ namespace System.Reflection.Emit
         #endregion
 
         #region FCalls
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineType", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineType", StringMarshalling = StringMarshalling.Utf16)]
         private static partial int DefineType(QCallModule module,
             string fullname, int tkParent, TypeAttributes attributes, int tkEnclosingType, int[] interfaceTokens);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineGenericParam", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_DefineGenericParam", StringMarshalling = StringMarshalling.Utf16)]
         private static partial int DefineGenericParam(QCallModule module,
             string name, int tkParent, GenericParameterAttributes attributes, int position, int[] constraints);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_TermCreateClass")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_TermCreateClass")]
         private static partial void TermCreateClass(QCallModule module, int tk, ObjectHandleOnStack type);
         #endregion
 
index 29fcfa3..08da273 100644 (file)
@@ -25,7 +25,7 @@ namespace System.Reflection
         // This field is set by the VM to atomically transfer the ownership to the managed loader allocator
         internal IntPtr m_nativeLoaderAllocator;
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "LoaderAllocator_Destroy")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "LoaderAllocator_Destroy")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool Destroy(IntPtr nativeLoaderAllocator);
 
index fa7385a..a5b243a 100644 (file)
@@ -8,7 +8,7 @@ namespace System.Reflection.Metadata
 {
     public static partial class AssemblyExtensions
     {
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalTryGetRawMetadata")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalTryGetRawMetadata")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static unsafe partial bool InternalTryGetRawMetadata(QCallAssembly assembly, ref byte* blob, ref int length);
 
index 50df55a..26ef9ed 100644 (file)
@@ -9,10 +9,10 @@ namespace System.Reflection.Metadata
 {
     public static partial class MetadataUpdater
     {
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_ApplyUpdate")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_ApplyUpdate")]
         private static unsafe partial void ApplyUpdate(QCallAssembly assembly, byte* metadataDelta, int metadataDeltaLength, byte* ilDelta, int ilDeltaLength, byte* pdbDelta, int pdbDeltaLength);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_IsApplyUpdateSupported")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_IsApplyUpdateSupported")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static unsafe partial bool IsApplyUpdateSupported();
 
index 93912e2..ef226f6 100644 (file)
@@ -68,7 +68,7 @@ namespace System.Reflection
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetCodeBase")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetCodeBase")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool GetCodeBase(QCallAssembly assembly,
                                                StringHandleOnStack retString);
@@ -137,7 +137,7 @@ namespace System.Reflection
             return an;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetFullName")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetFullName")]
         private static partial void GetFullName(QCallAssembly assembly, StringHandleOnStack retString);
 
         public override string? FullName
@@ -157,7 +157,7 @@ namespace System.Reflection
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetEntryPoint")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetEntryPoint")]
         private static partial void GetEntryPoint(QCallAssembly assembly, ObjectHandleOnStack retMethod);
 
         public override MethodInfo? EntryPoint
@@ -175,7 +175,7 @@ namespace System.Reflection
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetType", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetType", StringMarshalling = StringMarshalling.Utf16)]
         private static partial void GetType(QCallAssembly assembly,
                                             string name,
                                             [MarshalAs(UnmanagedType.Bool)] bool throwOnError,
@@ -206,7 +206,7 @@ namespace System.Reflection
             return type;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetExportedTypes")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetExportedTypes")]
         private static partial void GetExportedTypes(QCallAssembly assembly, ObjectHandleOnStack retTypes);
 
         [RequiresUnreferencedCode("Types might be removed")]
@@ -240,7 +240,7 @@ namespace System.Reflection
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetIsCollectible")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetIsCollectible")]
         internal static partial Interop.BOOL GetIsCollectible(QCallAssembly assembly);
 
         public override bool IsCollectible
@@ -253,7 +253,7 @@ namespace System.Reflection
         }
 
         // GetResource will return a pointer to the resources in memory.
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetResource", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetResource", StringMarshalling = StringMarshalling.Utf16)]
         private static unsafe partial byte* GetResource(QCallAssembly assembly,
                                                        string resourceName,
                                                        out uint length);
@@ -346,7 +346,7 @@ namespace System.Reflection
             return retAssembly!;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalLoad")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalLoad")]
         private static partial void InternalLoad(ObjectHandleOnStack assemblyName,
                                                 ObjectHandleOnStack requestingAssembly,
                                                 StackCrawlMarkHandle stackMark,
@@ -358,7 +358,7 @@ namespace System.Reflection
 
         // Returns the module in this assembly with name 'name'
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetModule", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetModule", StringMarshalling = StringMarshalling.Utf16)]
         private static partial void GetModule(QCallAssembly assembly, string name, ObjectHandleOnStack retModule);
 
         public override Module? GetModule(string name)
@@ -431,7 +431,7 @@ namespace System.Reflection
             return GetReferencedAssemblies(GetNativeHandle());
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetManifestResourceInfo", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetManifestResourceInfo", StringMarshalling = StringMarshalling.Utf16)]
         private static partial int GetManifestResourceInfo(QCallAssembly assembly,
                                                           string resourceName,
                                                           ObjectHandleOnStack assemblyRef,
@@ -453,7 +453,7 @@ namespace System.Reflection
                                                 (ResourceLocation)location);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLocation")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLocation")]
         private static partial void GetLocation(QCallAssembly assembly, StringHandleOnStack retString);
 
         public override string Location
@@ -469,7 +469,7 @@ namespace System.Reflection
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetImageRuntimeVersion")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetImageRuntimeVersion")]
         private static partial void GetImageRuntimeVersion(QCallAssembly assembly, StringHandleOnStack retString);
 
         public override string ImageRuntimeVersion
@@ -488,7 +488,7 @@ namespace System.Reflection
 
         public override long HostContext => 0;
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetVersion")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetVersion")]
         private static partial void GetVersion(QCallAssembly assembly,
                                               out int majVer,
                                               out int minVer,
@@ -502,7 +502,7 @@ namespace System.Reflection
             return new Version(majorVer, minorVer, build, revision);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLocale")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLocale")]
         private static partial void GetLocale(QCallAssembly assembly, StringHandleOnStack retString);
 
         internal CultureInfo GetLocale()
@@ -523,7 +523,7 @@ namespace System.Reflection
 
         public override bool IsDynamic => FCallIsDynamic(GetNativeHandle());
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetSimpleName")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetSimpleName")]
         private static partial void GetSimpleName(QCallAssembly assembly, StringHandleOnStack retSimpleName);
 
         internal string? GetSimpleName()
@@ -534,7 +534,7 @@ namespace System.Reflection
             return name;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetHashAlgorithm")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetHashAlgorithm")]
         private static partial AssemblyHashAlgorithm GetHashAlgorithm(QCallAssembly assembly);
 
         private AssemblyHashAlgorithm GetHashAlgorithm()
@@ -543,7 +543,7 @@ namespace System.Reflection
             return GetHashAlgorithm(new QCallAssembly(ref runtimeAssembly));
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetFlags")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetFlags")]
         private static partial AssemblyNameFlags GetFlags(QCallAssembly assembly);
 
         private AssemblyNameFlags GetFlags()
@@ -552,7 +552,7 @@ namespace System.Reflection
             return GetFlags(new QCallAssembly(ref runtimeAssembly));
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetPublicKey")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetPublicKey")]
         private static partial void GetPublicKey(QCallAssembly assembly, ObjectHandleOnStack retPublicKey);
 
         internal byte[]? GetPublicKey()
@@ -604,7 +604,7 @@ namespace System.Reflection
             return retAssembly;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetModules")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetModules")]
         private static partial void GetModules(QCallAssembly assembly,
                                               [MarshalAs(UnmanagedType.Bool)] bool loadIfNotFound,
                                               [MarshalAs(UnmanagedType.Bool)] bool getResourceModules,
@@ -709,7 +709,7 @@ namespace System.Reflection
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetForwardedType")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetForwardedType")]
         private static partial void GetForwardedType(QCallAssembly assembly, MetadataToken mdtExternalType, ObjectHandleOnStack type);
     }
 }
index 1376054..d0a74a2 100644 (file)
@@ -14,13 +14,13 @@ namespace System.Reflection
         internal RuntimeModule() { throw new NotSupportedException(); }
 
         #region FCalls
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetType", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetType", StringMarshalling = StringMarshalling.Utf16)]
         private static partial void GetType(QCallModule module, string className, [MarshalAs(UnmanagedType.Bool)] bool throwOnError, [MarshalAs(UnmanagedType.Bool)] bool ignoreCase, ObjectHandleOnStack type, ObjectHandleOnStack keepAlive);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetScopeName")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetScopeName")]
         private static partial void GetScopeName(QCallModule module, StringHandleOnStack retString);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetFullyQualifiedName")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetFullyQualifiedName")]
         private static partial void GetFullyQualifiedName(QCallModule module, StringHandleOnStack retString);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
index 0fa3632..6343289 100644 (file)
@@ -47,7 +47,7 @@ namespace System.Runtime.CompilerServices
         // This call will generate an exception if the specified class constructor threw an
         // exception when it ran.
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_RunClassConstructor")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_RunClassConstructor")]
         private static partial void RunClassConstructor(QCallTypeHandle type);
 
         [RequiresUnreferencedCode("Trimmer can't guarantee existence of class constructor")]
@@ -68,7 +68,7 @@ namespace System.Runtime.CompilerServices
         // This call will generate an exception if the specified module constructor threw an
         // exception when it ran.
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_RunModuleConstructor")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_RunModuleConstructor")]
         private static partial void RunModuleConstructor(QCallModule module);
 
         public static void RunModuleConstructor(ModuleHandle module)
@@ -80,10 +80,10 @@ namespace System.Runtime.CompilerServices
             RunModuleConstructor(new QCallModule(ref rm));
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_CompileMethod")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_CompileMethod")]
         internal static partial void CompileMethod(RuntimeMethodHandleInternal method);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_PrepareMethod")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_PrepareMethod")]
         private static unsafe partial void PrepareMethod(RuntimeMethodHandleInternal method, IntPtr* pInstantiation, int cInstantiation);
 
         public static void PrepareMethod(RuntimeMethodHandle method) => PrepareMethod(method, null);
@@ -168,7 +168,7 @@ namespace System.Runtime.CompilerServices
             return obj!;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionSerialization_GetUninitializedObject")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionSerialization_GetUninitializedObject")]
         private static partial void GetUninitializedObject(QCallTypeHandle type, ObjectHandleOnStack retObject);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
@@ -300,7 +300,7 @@ namespace System.Runtime.CompilerServices
             return AllocateTypeAssociatedMemory(new QCallTypeHandle(ref rt), (uint)size);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_AllocateTypeAssociatedMemory")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_AllocateTypeAssociatedMemory")]
         private static partial IntPtr AllocateTypeAssociatedMemory(QCallTypeHandle type, uint size);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
index 8e1fc00..28558fb 100644 (file)
@@ -99,7 +99,7 @@ namespace System.Runtime.InteropServices
             return TryGetOrCreateComInterfaceForObjectInternal(ObjectHandleOnStack.Create(ref impl), impl.id, ObjectHandleOnStack.Create(ref instance), flags, out retValue);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_TryGetOrCreateComInterfaceForObject")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_TryGetOrCreateComInterfaceForObject")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool TryGetOrCreateComInterfaceForObjectInternal(ObjectHandleOnStack comWrappersImpl, long wrapperId, ObjectHandleOnStack instance, CreateComInterfaceFlags flags, out IntPtr retValue);
 
@@ -244,7 +244,7 @@ namespace System.Runtime.InteropServices
             return TryGetOrCreateObjectForComInstanceInternal(ObjectHandleOnStack.Create(ref impl), impl.id, externalComObject, innerMaybe, flags, ObjectHandleOnStack.Create(ref wrapperMaybeLocal), ObjectHandleOnStack.Create(ref retValue));
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_TryGetOrCreateObjectForComInstance")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_TryGetOrCreateObjectForComInstance")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool TryGetOrCreateObjectForComInstanceInternal(ObjectHandleOnStack comWrappersImpl, long wrapperId, IntPtr externalComObject, IntPtr innerMaybe, CreateObjectFlags flags, ObjectHandleOnStack wrapper, ObjectHandleOnStack retValue);
 
@@ -274,7 +274,7 @@ namespace System.Runtime.InteropServices
         }
 
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_SetGlobalInstanceRegisteredForTrackerSupport")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_SetGlobalInstanceRegisteredForTrackerSupport")]
         [SuppressGCTransition]
         private static partial void SetGlobalInstanceRegisteredForTrackerSupport(long id);
 
@@ -305,7 +305,7 @@ namespace System.Runtime.InteropServices
             SetGlobalInstanceRegisteredForMarshalling(instance.id);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_SetGlobalInstanceRegisteredForMarshalling")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_SetGlobalInstanceRegisteredForMarshalling")]
         [SuppressGCTransition]
         private static partial void SetGlobalInstanceRegisteredForMarshalling(long id);
 
@@ -318,7 +318,7 @@ namespace System.Runtime.InteropServices
         protected static void GetIUnknownImpl(out IntPtr fpQueryInterface, out IntPtr fpAddRef, out IntPtr fpRelease)
             => GetIUnknownImplInternal(out fpQueryInterface, out fpAddRef, out fpRelease);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_GetIUnknownImpl")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_GetIUnknownImpl")]
         private static partial void GetIUnknownImplInternal(out IntPtr fpQueryInterface, out IntPtr fpAddRef, out IntPtr fpRelease);
 
         internal static int CallICustomQueryInterface(object customQueryInterfaceMaybe, ref Guid iid, out IntPtr ppObject)
index 5265779..f96ec93 100644 (file)
@@ -213,7 +213,7 @@ namespace System.Runtime.InteropServices
             GC.KeepAlive(rmi);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_Prelink")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_Prelink")]
         private static partial void InternalPrelink(RuntimeMethodHandleInternal m);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
@@ -255,7 +255,7 @@ namespace System.Runtime.InteropServices
 #if TARGET_WINDOWS
         internal static bool IsBuiltInComSupported { get; } = IsBuiltInComSupportedInternal();
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_IsBuiltInComSupported")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_IsBuiltInComSupported")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool IsBuiltInComSupportedInternal();
 
@@ -273,7 +273,7 @@ namespace System.Runtime.InteropServices
             return (IntPtr)(-1);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetHINSTANCE")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetHINSTANCE")]
         private static partial IntPtr GetHINSTANCE(QCallModule m);
 
 #endif // TARGET_WINDOWS
@@ -317,7 +317,7 @@ namespace System.Runtime.InteropServices
             return type;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetTypeFromCLSID", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetTypeFromCLSID", StringMarshalling = StringMarshalling.Utf16)]
         private static partial void GetTypeFromCLSID(in Guid clsid, string? server, ObjectHandleOnStack retType);
 
         /// <summary>
@@ -769,17 +769,17 @@ namespace System.Runtime.InteropServices
         // Revist after https://github.com/mono/linker/issues/1989 is fixed
         [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2050:UnrecognizedReflectionPattern",
             Justification = "The calling method is annotated with RequiresUnreferencedCode")]
-        [GeneratedDllImport(Interop.Libraries.Ole32)]
+        [LibraryImport(Interop.Libraries.Ole32)]
         private static partial int CreateBindCtx(uint reserved, out IntPtr ppbc);
 
         [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2050:UnrecognizedReflectionPattern",
             Justification = "The calling method is annotated with RequiresUnreferencedCode")]
-        [GeneratedDllImport(Interop.Libraries.Ole32)]
+        [LibraryImport(Interop.Libraries.Ole32)]
         private static partial int MkParseDisplayName(IntPtr pbc, [MarshalAs(UnmanagedType.LPWStr)] string szUserName, out uint pchEaten, out IntPtr ppmk);
 
         [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2050:UnrecognizedReflectionPattern",
             Justification = "The calling method is annotated with RequiresUnreferencedCode")]
-        [GeneratedDllImport(Interop.Libraries.Ole32)]
+        [LibraryImport(Interop.Libraries.Ole32)]
         private static partial int BindMoniker(IntPtr pmk, uint grfOpt, ref Guid iidResult, out IntPtr ppvResult);
 
         [SupportedOSPlatform("windows")]
@@ -794,7 +794,7 @@ namespace System.Runtime.InteropServices
         internal static extern IntPtr GetFunctionPointerForDelegateInternal(Delegate d);
 
 #if DEBUG // Used for testing in Checked or Debug
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetIsInCooperativeGCModeFunctionPointer")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetIsInCooperativeGCModeFunctionPointer")]
         internal static unsafe partial delegate* unmanaged<int> GetIsInCooperativeGCModeFunctionPointer();
 #endif
     }
index b3c660d..f407b36 100644 (file)
@@ -20,18 +20,18 @@ namespace System.Runtime.InteropServices
 
         /// External functions that implement the NativeLibrary interface
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_LoadFromPath", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_LoadFromPath", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr LoadFromPath(string libraryName, [MarshalAs(UnmanagedType.Bool)] bool throwOnError);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_LoadByName", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_LoadByName", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr LoadByName(string libraryName, QCallAssembly callingAssembly,
                                                  [MarshalAs(UnmanagedType.Bool)] bool hasDllImportSearchPathFlag, uint dllImportSearchPathFlag,
                                                  [MarshalAs(UnmanagedType.Bool)] bool throwOnError);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_FreeLib")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_FreeLib")]
         internal static partial void FreeLib(IntPtr handle);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_GetSymbol", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "NativeLibrary_GetSymbol", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr GetSymbol(IntPtr handle, string symbolName, [MarshalAs(UnmanagedType.Bool)] bool throwOnError);
     }
 }
index 8b6572f..f2435b9 100644 (file)
@@ -21,20 +21,20 @@ namespace System.Runtime.InteropServices.ObjectiveC
             System.StubHelpers.StubHelpers.SetPendingExceptionObject(exception);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_TrySetGlobalMessageSendCallback")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_TrySetGlobalMessageSendCallback")]
         [return:MarshalAs(UnmanagedType.Bool)]
         private static partial bool TrySetGlobalMessageSendCallback(
             MessageSendFunction msgSendFunction,
             IntPtr func);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_TryInitializeReferenceTracker")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_TryInitializeReferenceTracker")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static unsafe partial bool TryInitializeReferenceTracker(
             delegate* unmanaged<void> beginEndCallback,
             delegate* unmanaged<IntPtr, int> isReferencedCallback,
             delegate* unmanaged<IntPtr, void> trackedObjectEnteredFinalization);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_CreateReferenceTrackingHandle")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjCMarshal_CreateReferenceTrackingHandle")]
         private static partial IntPtr CreateReferenceTrackingHandleInternal(
             ObjectHandleOnStack obj,
             out int memInSizeT,
index 954b723..b5e011d 100644 (file)
@@ -8,7 +8,7 @@ namespace System.Runtime.Intrinsics.X86
 {
     public abstract partial class X86Base
     {
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "X86BaseCpuId")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "X86BaseCpuId")]
         private static unsafe partial void __cpuidex(int* cpuInfo, int functionId, int subFunctionId);
     }
 }
index 9e78990..735f788 100644 (file)
@@ -11,24 +11,24 @@ namespace System.Runtime.Loader
 {
     public partial class AssemblyLoadContext
     {
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InitializeAssemblyLoadContext")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InitializeAssemblyLoadContext")]
         private static partial IntPtr InitializeAssemblyLoadContext(IntPtr ptrAssemblyLoadContext, [MarshalAs(UnmanagedType.Bool)] bool fRepresentsTPALoadContext, [MarshalAs(UnmanagedType.Bool)] bool isCollectible);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_PrepareForAssemblyLoadContextRelease")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_PrepareForAssemblyLoadContextRelease")]
         private static partial void PrepareForAssemblyLoadContextRelease(IntPtr ptrNativeAssemblyBinder, IntPtr ptrAssemblyLoadContextStrong);
 
         [RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromStream")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromStream")]
         private static partial void LoadFromStream(IntPtr ptrNativeAssemblyBinder, IntPtr ptrAssemblyArray, int iAssemblyArrayLen, IntPtr ptrSymbols, int iSymbolArrayLen, ObjectHandleOnStack retAssembly);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MultiCoreJIT_InternalSetProfileRoot", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MultiCoreJIT_InternalSetProfileRoot", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial void InternalSetProfileRoot(string directoryPath);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MultiCoreJIT_InternalStartProfile", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MultiCoreJIT_InternalStartProfile", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial void InternalStartProfile(string? profile, IntPtr ptrNativeAssemblyBinder);
 
         [RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromPath", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromPath", StringMarshalling = StringMarshalling.Utf16)]
         private static partial void LoadFromPath(IntPtr ptrNativeAssemblyBinder, string? ilPath, string? niPath, ObjectHandleOnStack retAssembly);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
@@ -37,19 +37,19 @@ namespace System.Runtime.Loader
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern bool IsTracingEnabled();
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceResolvingHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceResolvingHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool TraceResolvingHandlerInvoked(string assemblyName, string handlerName, string? alcName, string? resultAssemblyName, string? resultAssemblyPath);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceAssemblyResolveHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceAssemblyResolveHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool TraceAssemblyResolveHandlerInvoked(string assemblyName, string handlerName, string? resultAssemblyName, string? resultAssemblyPath);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceAssemblyLoadFromResolveHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceAssemblyLoadFromResolveHandlerInvoked", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool TraceAssemblyLoadFromResolveHandlerInvoked(string assemblyName, [MarshalAs(UnmanagedType.Bool)] bool isTrackedAssembly, string requestingAssemblyPath, string? requestedAssemblyPath);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceSatelliteSubdirectoryPathProbed", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_TraceSatelliteSubdirectoryPathProbed", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool TraceSatelliteSubdirectoryPathProbed(string filePath, int hResult);
 
@@ -76,7 +76,7 @@ namespace System.Runtime.Loader
         }
 
 #if TARGET_WINDOWS
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromInMemoryModule")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_LoadFromInMemoryModule")]
         private static partial IntPtr LoadFromInMemoryModuleInternal(IntPtr ptrNativeAssemblyBinder, IntPtr hModule, ObjectHandleOnStack retAssembly);
 
 
@@ -136,7 +136,7 @@ namespace System.Runtime.Loader
             return context.ResolveUsingEvent(assemblyName);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLoadContextForAssembly")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetLoadContextForAssembly")]
         private static partial IntPtr GetLoadContextForAssembly(QCallAssembly assembly);
 
         // Returns the load context in which the specified assembly has been loaded
index 7725817..e82b631 100644 (file)
@@ -259,7 +259,7 @@ namespace System
             return instantiatedObject!;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_CreateInstanceForAnotherGenericParameter")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_CreateInstanceForAnotherGenericParameter")]
         private static partial void CreateInstanceForAnotherGenericParameter(
             QCallTypeHandle baseType,
             IntPtr* pTypeHandles,
@@ -296,7 +296,7 @@ namespace System
             ctorIsPublic = fCtorIsPublicTemp != Interop.BOOL.FALSE;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetActivationInfo")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetActivationInfo")]
         private static partial void GetActivationInfo(
             ObjectHandleOnStack pRuntimeType,
             delegate*<void*, object>* ppfnAllocator,
@@ -402,7 +402,7 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern Type[]? GetInterfaces(RuntimeType type);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetConstraints")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetConstraints")]
         private static partial void GetConstraints(QCallTypeHandle handle, ObjectHandleOnStack types);
 
         internal Type[] GetConstraints()
@@ -415,7 +415,7 @@ namespace System
             return types!;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "QCall_GetGCHandleForTypeHandle")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "QCall_GetGCHandleForTypeHandle")]
         private static partial IntPtr GetGCHandle(QCallTypeHandle handle, GCHandleType type);
 
         internal IntPtr GetGCHandle(GCHandleType type)
@@ -424,7 +424,7 @@ namespace System
             return GetGCHandle(new QCallTypeHandle(ref nativeHandle), type);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "QCall_FreeGCHandleForTypeHandle")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "QCall_FreeGCHandleForTypeHandle")]
         private static partial IntPtr FreeGCHandle(QCallTypeHandle typeHandle, IntPtr objHandle);
 
         internal IntPtr FreeGCHandle(IntPtr objHandle)
@@ -439,7 +439,7 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern int GetNumVirtualsAndStaticVirtuals(RuntimeType type);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_VerifyInterfaceIsImplemented")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_VerifyInterfaceIsImplemented")]
         private static partial void VerifyInterfaceIsImplemented(QCallTypeHandle handle, QCallTypeHandle interfaceHandle);
 
         internal void VerifyInterfaceIsImplemented(RuntimeTypeHandle interfaceHandle)
@@ -449,7 +449,7 @@ namespace System
             VerifyInterfaceIsImplemented(new QCallTypeHandle(ref nativeHandle), new QCallTypeHandle(ref nativeInterfaceHandle));
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInterfaceMethodImplementation")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInterfaceMethodImplementation")]
         private static partial RuntimeMethodHandleInternal GetInterfaceMethodImplementation(QCallTypeHandle handle, QCallTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle);
 
         internal RuntimeMethodHandleInternal GetInterfaceMethodImplementation(RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle)
@@ -478,7 +478,7 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern bool IsByRefLike(RuntimeType type);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_IsVisible")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_IsVisible")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool _IsVisible(QCallTypeHandle typeHandle);
 
@@ -490,7 +490,7 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern bool IsValueType(RuntimeType type);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_ConstructName")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_ConstructName")]
         private static partial void ConstructName(QCallTypeHandle handle, TypeNameFormatFlags formatFlags, StringHandleOnStack retString);
 
         internal string ConstructName(TypeNameFormatFlags formatFlags)
@@ -518,7 +518,7 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern IRuntimeMethodInfo GetDeclaringMethod(RuntimeType type);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetTypeByName", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetTypeByName", StringMarshalling = StringMarshalling.Utf16)]
         private static partial void GetTypeByName(string name, [MarshalAs(UnmanagedType.Bool)] bool throwOnError, [MarshalAs(UnmanagedType.Bool)] bool ignoreCase, StackCrawlMarkHandle stackMark,
             ObjectHandleOnStack assemblyLoadContext,
             ObjectHandleOnStack type, ObjectHandleOnStack keepalive);
@@ -552,7 +552,7 @@ namespace System
             return type;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetTypeByNameUsingCARules", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetTypeByNameUsingCARules", StringMarshalling = StringMarshalling.Utf16)]
         private static partial void GetTypeByNameUsingCARules(string name, QCallModule scope, ObjectHandleOnStack type);
 
         internal static RuntimeType GetTypeByNameUsingCARules(string name, RuntimeModule scope)
@@ -565,7 +565,7 @@ namespace System
             return type!;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInstantiation")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInstantiation")]
         internal static partial void GetInstantiation(QCallTypeHandle type, ObjectHandleOnStack types, Interop.BOOL fAsRuntimeTypeArray);
 
         internal RuntimeType[] GetInstantiationInternal()
@@ -584,7 +584,7 @@ namespace System
             return types!;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_Instantiate")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_Instantiate")]
         private static partial void Instantiate(QCallTypeHandle handle, IntPtr* pInst, int numGenericArgs, ObjectHandleOnStack type);
 
         internal RuntimeType Instantiate(RuntimeType inst)
@@ -612,7 +612,7 @@ namespace System
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeArray")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeArray")]
         private static partial void MakeArray(QCallTypeHandle handle, int rank, ObjectHandleOnStack type);
 
         internal RuntimeType MakeArray(int rank)
@@ -623,7 +623,7 @@ namespace System
             return type!;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeSZArray")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeSZArray")]
         private static partial void MakeSZArray(QCallTypeHandle handle, ObjectHandleOnStack type);
 
         internal RuntimeType MakeSZArray()
@@ -634,7 +634,7 @@ namespace System
             return type!;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeByRef")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeByRef")]
         private static partial void MakeByRef(QCallTypeHandle handle, ObjectHandleOnStack type);
 
         internal RuntimeType MakeByRef()
@@ -645,7 +645,7 @@ namespace System
             return type!;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakePointer")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakePointer")]
         private static partial void MakePointer(QCallTypeHandle handle, ObjectHandleOnStack type);
 
         internal RuntimeType MakePointer()
@@ -656,13 +656,13 @@ namespace System
             return type!;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_IsCollectible")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_IsCollectible")]
         internal static partial Interop.BOOL IsCollectible(QCallTypeHandle handle);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern bool HasInstantiation(RuntimeType type);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetGenericTypeDefinition")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetGenericTypeDefinition")]
         private static partial void GetGenericTypeDefinition(QCallTypeHandle type, ObjectHandleOnStack retType);
 
         internal static RuntimeType GetGenericTypeDefinition(RuntimeType type)
@@ -877,7 +877,7 @@ namespace System
             return m_value == null;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetFunctionPointer")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetFunctionPointer")]
         internal static partial IntPtr GetFunctionPointer(RuntimeMethodHandleInternal handle);
 
         public IntPtr GetFunctionPointer()
@@ -887,10 +887,10 @@ namespace System
             return ptr;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetIsCollectible")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetIsCollectible")]
         internal static partial Interop.BOOL GetIsCollectible(RuntimeMethodHandleInternal handle);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_IsCAVisibleFromDecoratedType")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_IsCAVisibleFromDecoratedType")]
         internal static partial Interop.BOOL IsCAVisibleFromDecoratedType(
             QCallTypeHandle attrTypeHandle,
             RuntimeMethodHandleInternal attrCtor,
@@ -917,7 +917,7 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern MethodImplAttributes GetImplAttributes(IRuntimeMethodInfo method);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_ConstructInstantiation")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_ConstructInstantiation")]
         private static partial void ConstructInstantiation(RuntimeMethodHandleInternal method, TypeNameFormatFlags format, StringHandleOnStack retString);
 
         internal static string ConstructInstantiation(IRuntimeMethodInfo method, TypeNameFormatFlags format)
@@ -980,7 +980,7 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern object? InvokeMethod(object? target, in Span<object?> arguments, Signature sig, bool constructor, bool wrapExceptions);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetMethodInstantiation")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetMethodInstantiation")]
         private static partial void GetMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack types, Interop.BOOL fAsRuntimeTypeArray);
 
         internal static RuntimeType[] GetMethodInstantiationInternal(IRuntimeMethodInfo method)
@@ -1035,7 +1035,7 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern bool IsTypicalMethodDefinition(IRuntimeMethodInfo method);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetTypicalMethodDefinition")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_GetTypicalMethodDefinition")]
         private static partial void GetTypicalMethodDefinition(RuntimeMethodHandleInternal method, ObjectHandleOnStack outMethod);
 
         internal static IRuntimeMethodInfo GetTypicalMethodDefinition(IRuntimeMethodInfo method)
@@ -1054,7 +1054,7 @@ namespace System
 
         internal static int GetGenericParameterCount(IRuntimeMethodInfo method) => GetGenericParameterCount(method.Value);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_StripMethodInstantiation")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_StripMethodInstantiation")]
         private static partial void StripMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack outMethod);
 
         internal static IRuntimeMethodInfo StripMethodInstantiation(IRuntimeMethodInfo method)
@@ -1070,7 +1070,7 @@ namespace System
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern bool IsDynamicMethod(RuntimeMethodHandleInternal method);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_Destroy")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_Destroy")]
         internal static partial void Destroy(RuntimeMethodHandleInternal method);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
@@ -1360,7 +1360,7 @@ namespace System
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveType")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveType")]
         private static partial void ResolveType(QCallModule module,
                                                             int typeToken,
                                                             IntPtr* typeInstArgs,
@@ -1412,7 +1412,7 @@ namespace System
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveMethod")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveMethod")]
         private static partial RuntimeMethodHandleInternal ResolveMethod(QCallModule module,
                                                         int methodToken,
                                                         IntPtr* typeInstArgs,
@@ -1468,7 +1468,7 @@ namespace System
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveField")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveField")]
         private static partial void ResolveField(QCallModule module,
                                                       int fieldToken,
                                                       IntPtr* typeInstArgs,
@@ -1477,7 +1477,7 @@ namespace System
                                                       int methodInstCount,
                                                       ObjectHandleOnStack retField);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetModuleType")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetModuleType")]
         internal static partial void GetModuleType(QCallModule handle, ObjectHandleOnStack type);
 
         internal static RuntimeType GetModuleType(RuntimeModule module)
@@ -1487,7 +1487,7 @@ namespace System
             return type!;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetPEKind")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetPEKind")]
         private static partial void GetPEKind(QCallModule handle, int* peKind, int* machine);
 
         // making this internal, used by Module.GetPEKind
index 0f0d115..56589cf 100644 (file)
@@ -3986,11 +3986,11 @@ namespace System
     #region Library
     internal readonly unsafe partial struct MdUtf8String
     {
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_EqualsCaseInsensitive")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_EqualsCaseInsensitive")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EqualsCaseInsensitive(void* szLhs, void* szRhs, int cSz);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_HashCaseInsensitive")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_HashCaseInsensitive")]
         private static partial uint HashCaseInsensitive(void* sz, int cSz);
 
         private readonly byte* m_pStringHeap;        // This is the raw UTF8 string.
index 21f352c..bf1ac24 100644 (file)
@@ -581,7 +581,7 @@ namespace System.StubHelpers
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern object ConvertToManaged(ref IntPtr ppUnk, IntPtr itfMT, IntPtr classMT, int flags);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "InterfaceMarshaler__ClearNative")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "InterfaceMarshaler__ClearNative")]
         internal static partial void ClearNative(IntPtr pUnk);
     }  // class InterfaceMarshaler
 #endif // FEATURE_COMINTEROP
index fb59a54..716c9c2 100644 (file)
@@ -225,7 +225,7 @@ namespace System.Threading
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern void ReadMemoryBarrier();
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "Interlocked_MemoryBarrierProcessWide")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Interlocked_MemoryBarrierProcessWide")]
         private static partial void _MemoryBarrierProcessWide();
 
         /// <summary>Provides a process-wide memory barrier that ensures that reads and writes from any CPU cannot move across the barrier.</summary>
index 8cc1abd..8bb4315 100644 (file)
@@ -31,7 +31,7 @@ namespace System.Threading
             return waitResult == WaitHandle.WaitSuccess;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "WaitHandle_CorWaitOnePrioritizedNative")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "WaitHandle_CorWaitOnePrioritizedNative")]
         private static partial int WaitNative(SafeWaitHandle handle, int timeoutMs);
 
         public void ReleaseCore(int count)
index c514d5c..c84f615 100644 (file)
@@ -184,7 +184,7 @@ namespace System.Threading
         /// </summary>
         public static long LockContentionCount => GetLockContentionCount();
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ObjectNative_GetMonitorLockContentionCount")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjectNative_GetMonitorLockContentionCount")]
         private static partial long GetLockContentionCount();
     }
 }
index 90f08b2..fda212f 100644 (file)
@@ -92,7 +92,7 @@ namespace System.Threading
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_Start")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_Start")]
         private static unsafe partial void StartInternal(ThreadHandle t, int stackSize, int priority, char* pThreadName);
 
         // Called from the runtime
@@ -119,7 +119,7 @@ namespace System.Threading
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void SleepInternal(int millisecondsTimeout);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_UninterruptibleSleep0")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_UninterruptibleSleep0")]
         internal static partial void UninterruptibleSleep0();
 
         /// <summary>
@@ -132,7 +132,7 @@ namespace System.Threading
 
         public static void SpinWait(int iterations) => SpinWaitInternal(iterations);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_YieldThread")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_YieldThread")]
         private static partial Interop.BOOL YieldInternal();
 
         public static bool Yield() => YieldInternal() != Interop.BOOL.FALSE;
@@ -157,7 +157,7 @@ namespace System.Threading
             InformThreadNameChange(GetNativeHandle(), value, value?.Length ?? 0);
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_InformThreadNameChange", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_InformThreadNameChange", StringMarshalling = StringMarshalling.Utf16)]
         private static partial void InformThreadNameChange(ThreadHandle t, string? name, int len);
 
         /// <summary>Returns true if the thread has been started and is not dead.</summary>
@@ -219,7 +219,7 @@ namespace System.Threading
         [MethodImpl(MethodImplOptions.InternalCall)]
         private extern void SetPriorityNative(int priority);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_GetCurrentOSThreadId")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_GetCurrentOSThreadId")]
         private static partial ulong GetCurrentOSThreadId();
 
         /// <summary>
index 86e37a4..4aff36f 100644 (file)
@@ -383,7 +383,7 @@ namespace System.Threading
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_GetCompletedWorkItemCount")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_GetCompletedWorkItemCount")]
         private static partial long GetCompletedWorkItemCount();
 
         private static long PendingUnmanagedWorkItemCount => UsePortableThreadPool ? 0 : GetPendingUnmanagedWorkItemCount();
@@ -437,7 +437,7 @@ namespace System.Threading
             RequestWorkerThreadNative();
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_RequestWorkerThread")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_RequestWorkerThread")]
         private static partial Interop.BOOL RequestWorkerThreadNative();
 
         // Entry point from unmanaged code
@@ -466,7 +466,7 @@ namespace System.Threading
             return PerformRuntimeSpecificGateActivitiesNative(cpuUtilization) != Interop.BOOL.FALSE;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_PerformGateActivities")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadPool_PerformGateActivities")]
         private static partial Interop.BOOL PerformRuntimeSpecificGateActivitiesNative(int cpuUtilization);
 
         // Entry point from unmanaged code
index 2d5172a..e91e896 100644 (file)
@@ -59,14 +59,14 @@ namespace System.Threading
             Instances[id].FireNextTimers();
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Create")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Create")]
         private static partial AppDomainTimerSafeHandle CreateAppDomainTimer(uint dueTime, int id);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Change")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Change")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool ChangeAppDomainTimer(AppDomainTimerSafeHandle handle, uint dueTime);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Delete")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomainTimer_Delete")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool DeleteAppDomainTimer(IntPtr handle);
 
index 7b109f0..e755ec0 100644 (file)
@@ -46,7 +46,7 @@ namespace System
             }
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall)]
+        [LibraryImport(RuntimeHelpers.QCall)]
         private static partial void GetTypeLoadExceptionMessage(int resourceId, StringHandleOnStack retString);
     }
 }
index fa922d8..318487d 100644 (file)
@@ -17,7 +17,7 @@ namespace System
     internal sealed partial class SafeTypeNameParserHandle : SafeHandleZeroOrMinusOneIsInvalid
     {
         #region QCalls
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_ReleaseTypeNameParser")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_ReleaseTypeNameParser")]
         private static partial void Release(IntPtr pTypeNameParser);
         #endregion
 
@@ -37,19 +37,19 @@ namespace System
     internal sealed partial class TypeNameParser : IDisposable
     {
         #region QCalls
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_CreateTypeNameParser", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_CreateTypeNameParser", StringMarshalling = StringMarshalling.Utf16)]
         private static partial void _CreateTypeNameParser(string typeName, ObjectHandleOnStack retHandle, [MarshalAs(UnmanagedType.Bool)] bool throwOnError);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetNames")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetNames")]
         private static partial void _GetNames(SafeTypeNameParserHandle pTypeNameParser, ObjectHandleOnStack retArray);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetTypeArguments")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetTypeArguments")]
         private static partial void _GetTypeArguments(SafeTypeNameParserHandle pTypeNameParser, ObjectHandleOnStack retArray);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetModifiers")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetModifiers")]
         private static partial void _GetModifiers(SafeTypeNameParserHandle pTypeNameParser, ObjectHandleOnStack retArray);
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetAssemblyName")]
+        [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeName_GetAssemblyName")]
         private static partial void _GetAssemblyName(SafeTypeNameParserHandle pTypeNameParser, StringHandleOnStack retString);
         #endregion
 
index 569846d..e8c53bf 100644 (file)
@@ -59,7 +59,7 @@ namespace System.Runtime
             RhpCollect(generation, mode);
         }
 
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         private static partial void RhpCollect(int generation, InternalGCCollectionMode mode);
 
@@ -69,7 +69,7 @@ namespace System.Runtime
             return RhpGetGcTotalMemory();
         }
 
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         private static partial long RhpGetGcTotalMemory();
 
@@ -286,48 +286,48 @@ namespace System.Runtime
 
         // Block the current thread until at least one object needs to be finalized (returns true) or
         // memory is low (returns false and the finalizer thread should initiate a garbage collection).
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial uint RhpWaitForFinalizerRequest();
 
         // Indicate that the current round of finalizations is complete.
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial void RhpSignalFinalizationComplete();
 
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial void RhpAcquireCastCacheLock();
 
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial void RhpReleaseCastCacheLock();
 
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial ulong RhpGetTickCount64();
 
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial void RhpAcquireThunkPoolLock();
 
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial void RhpReleaseThunkPoolLock();
 
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial IntPtr RhAllocateThunksMapping();
 
         // Enters a no GC region, possibly doing a blocking GC if there is not enough
         // memory available to satisfy the caller's request.
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial int RhpStartNoGCRegion(long totalSize, [MarshalAs(UnmanagedType.Bool)] bool hasLohSize, long lohSize, [MarshalAs(UnmanagedType.Bool)] bool disallowFullBlockingGC);
 
         // Exits a no GC region, possibly doing a GC to clean up the garbage that
         // the caller allocated.
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial int RhpEndNoGCRegion();
     }
index d92c8cc..c77d833 100644 (file)
@@ -300,7 +300,7 @@ namespace System.Runtime
                 return RhpGetCurrentThreadStackTrace(pOutputBuffer, (uint)((outputBuffer != null) ? outputBuffer.Length : 0), new UIntPtr(&pOutputBuffer));
         }
 
-        [GeneratedDllImport(Redhawk.BaseName)]
+        [LibraryImport(Redhawk.BaseName)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         private static unsafe partial int RhpGetCurrentThreadStackTrace(IntPtr* pOutputBuffer, uint outputBufferLength, UIntPtr addressInCurrentFrame);
 
index 1fede6e..b1666d1 100644 (file)
@@ -26,12 +26,12 @@ namespace System.Runtime
     {
         private const string RuntimeLibrary = "*";
 
-        [GeneratedDllImport(RuntimeLibrary)]
+        [LibraryImport(RuntimeLibrary)]
         [SuppressGCTransition]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial ulong RhpGetTickCount64();
 
-        [GeneratedDllImport(RuntimeLibrary)]
+        [LibraryImport(RuntimeLibrary)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial IntPtr RhpGetCurrentThread();
 
@@ -69,7 +69,7 @@ namespace System.Runtime
         private static extern bool _RhReRegisterForFinalize(object obj);
 
         // Wait for all pending finalizers. This must be a p/invoke to avoid starving the GC.
-        [GeneratedDllImport(RuntimeLibrary)]
+        [LibraryImport(RuntimeLibrary)]
         private static partial void RhWaitForPendingFinalizers(int allowReentrantWait);
 
         // Temporary workaround to unblock shareable assembly bring-up - without shared interop,
@@ -82,7 +82,7 @@ namespace System.Runtime
             RhWaitForPendingFinalizers(allowReentrantWait ? 1 : 0);
         }
 
-        [GeneratedDllImport(RuntimeLibrary)]
+        [LibraryImport(RuntimeLibrary)]
         internal static partial void RhInitializeFinalizerThread();
 
         // Get maximum GC generation number.
@@ -187,7 +187,7 @@ namespace System.Runtime
         [RuntimeImport(RuntimeLibrary, "RhGetTotalAllocatedBytes")]
         internal static extern long RhGetTotalAllocatedBytes();
 
-        [GeneratedDllImport(RuntimeLibrary)]
+        [LibraryImport(RuntimeLibrary)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial long RhGetTotalAllocatedBytesPrecise();
 
@@ -195,10 +195,10 @@ namespace System.Runtime
         [RuntimeImport(RuntimeLibrary, "RhGetMemoryInfo")]
         internal static extern void RhGetMemoryInfo(ref byte info, GCKind kind);
 
-        [GeneratedDllImport(RuntimeLibrary)]
+        [LibraryImport(RuntimeLibrary)]
         internal static unsafe partial void RhAllocateNewArray(IntPtr pArrayEEType, uint numElements, uint flags, void* pResult);
 
-        [GeneratedDllImport(RuntimeLibrary)]
+        [LibraryImport(RuntimeLibrary)]
         internal static unsafe partial void RhAllocateNewObject(IntPtr pEEType, uint flags, void* pResult);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
@@ -368,25 +368,25 @@ namespace System.Runtime
         internal static extern object RhMemberwiseClone(object obj);
 
         // Busy spin for the given number of iterations.
-        [GeneratedDllImport(RuntimeLibrary, EntryPoint = "RhSpinWait")]
+        [LibraryImport(RuntimeLibrary, EntryPoint = "RhSpinWait")]
         [SuppressGCTransition]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial void RhSpinWait(int iterations);
 
         // Yield the cpu to another thread ready to process, if one is available.
-        [GeneratedDllImport(RuntimeLibrary, EntryPoint = "RhYield")]
+        [LibraryImport(RuntimeLibrary, EntryPoint = "RhYield")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         private static partial int _RhYield();
         internal static bool RhYield() { return (_RhYield() != 0); }
 
-        [GeneratedDllImport(RuntimeLibrary, EntryPoint = "RhFlushProcessWriteBuffers")]
+        [LibraryImport(RuntimeLibrary, EntryPoint = "RhFlushProcessWriteBuffers")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial void RhFlushProcessWriteBuffers();
 
 #if !TARGET_UNIX
         // Wait for any object to be signalled, in a way that's compatible with the CLR's behavior in an STA.
         // ExactSpelling = 'true' to force MCG to resolve it to default
-        [GeneratedDllImport(RuntimeLibrary)]
+        [LibraryImport(RuntimeLibrary)]
         private static unsafe partial int RhCompatibleReentrantWaitAny(int alertable, int timeout, int count, IntPtr* handles);
 
         // Temporary workaround to unblock shareable assembly bring-up - without shared interop,
@@ -617,7 +617,7 @@ namespace System.Runtime
         internal static extern void RhCallDescrWorker(IntPtr callDescr);
 
         // For Managed to Native calls
-        [GeneratedDllImport(RuntimeLibrary, EntryPoint = "RhCallDescrWorker")]
+        [LibraryImport(RuntimeLibrary, EntryPoint = "RhCallDescrWorker")]
         internal static partial void RhCallDescrWorkerNative(IntPtr callDescr);
 
         // Moves memory from smem to dmem. Size must be a positive value.
@@ -935,14 +935,14 @@ namespace System.Runtime
         [RuntimeImport(RuntimeLibrary, "modff")]
         internal static extern unsafe float modff(float x, float* intptr);
 
-        [GeneratedDllImport(RuntimeImports.RuntimeLibrary)]
+        [LibraryImport(RuntimeImports.RuntimeLibrary)]
         internal static unsafe partial void* memmove(byte* dmem, byte* smem, nuint size);
 
-        [GeneratedDllImport(RuntimeImports.RuntimeLibrary)]
+        [LibraryImport(RuntimeImports.RuntimeLibrary)]
         internal static unsafe partial void* memset(byte* mem, int value, nuint size);
 
 #if TARGET_X86 || TARGET_AMD64
-        [GeneratedDllImport(RuntimeLibrary)]
+        [LibraryImport(RuntimeLibrary)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static unsafe partial void RhCpuIdEx(int* cpuInfo, int functionId, int subFunctionId);
 #endif
index c0f0dd1..015151e 100644 (file)
@@ -85,7 +85,7 @@ namespace System.Runtime
         internal static unsafe Array RhNewArray(EETypePtr pEEType, int length)
             => RhNewArray(pEEType.ToPointer(), length);
 
-        [GeneratedDllImport(RuntimeLibrary)]
+        [LibraryImport(RuntimeLibrary)]
         internal static unsafe partial void RhAllocateNewObject(IntPtr pEEType, uint flags, void* pResult);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
index 6dc8dee..ff83cf7 100644 (file)
@@ -10,10 +10,10 @@ internal static partial class Interop
 {
     internal static partial class JObjectLifetime
     {
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_NewGlobalReference")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_NewGlobalReference")]
         internal static partial IntPtr NewGlobalReference(IntPtr obj);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DeleteGlobalReference")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DeleteGlobalReference")]
         internal static partial void DeleteGlobalReference(IntPtr obj);
 
         internal class SafeJObjectHandle : SafeHandle
index 27dd92a..a8fd8d2 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Logcat
     {
-        [GeneratedDllImport(Libraries.Liblog, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.Liblog, StringMarshalling = StringMarshalling.Utf8)]
         private static partial void __android_log_print(LogLevel level, string? tag, string format, string args, IntPtr ptr);
 
         internal static void AndroidLogPrint(LogLevel level, string? tag, string message) =>
index 3bbc00a..9cf78a9 100644 (file)
@@ -10,10 +10,10 @@ internal static partial class Interop
     // TODO: [AndroidCrypto] Rename class to AndroidCrypto once all consumers are split in Android vs. Unix
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_BigNumToBinary")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_BigNumToBinary")]
         private static unsafe partial int BigNumToBinary(SafeBignumHandle a, byte* to);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetBigNumBytes")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetBigNumBytes")]
         private static partial int GetBigNumBytes(SafeBignumHandle a);
 
         internal static unsafe byte[]? ExtractBignum(SafeBignumHandle? bignum, int targetSize)
index 8de978a..8b987ce 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreate")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreate")]
         internal static partial SafeEvpCipherCtxHandle EvpCipherCreate(
             IntPtr cipher,
             ref byte key,
@@ -18,11 +18,11 @@ internal static partial class Interop
             ref byte iv,
             int enc);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreatePartial")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreatePartial")]
         internal static partial SafeEvpCipherCtxHandle EvpCipherCreatePartial(
             IntPtr cipher);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetKeyAndIV")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetKeyAndIV")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EvpCipherSetKeyAndIV(
             SafeEvpCipherCtxHandle ctx,
@@ -46,7 +46,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetNonceLength")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetNonceLength")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool AndroidCryptoNative_CipherSetNonceLength(
             SafeEvpCipherCtxHandle ctx, int nonceLength);
@@ -59,10 +59,10 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherDestroy")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherDestroy")]
         internal static partial void EvpCipherDestroy(IntPtr ctx);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherReset")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherReset")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static unsafe partial bool EvpCipherReset(SafeEvpCipherCtxHandle ctx, byte* pIv, int cIv);
 
@@ -74,11 +74,11 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCtxSetPadding")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCtxSetPadding")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvpCipherCtxSetPadding(SafeEvpCipherCtxHandle x, int padding);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdate")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdate")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EvpCipherUpdate(
             SafeEvpCipherCtxHandle ctx,
@@ -101,7 +101,7 @@ internal static partial class Interop
                 input.Length);
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdateAAD")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdateAAD")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool CipherUpdateAAD(
             SafeEvpCipherCtxHandle ctx,
@@ -121,7 +121,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherFinalEx")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherFinalEx")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EvpCipherFinalEx(
             SafeEvpCipherCtxHandle ctx,
@@ -136,98 +136,98 @@ internal static partial class Interop
             return EvpCipherFinalEx(ctx, ref MemoryMarshal.GetReference(output), out bytesWritten);
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetTagLength")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetTagLength")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CipherSetTagLength(
             SafeEvpCipherCtxHandle ctx,
             int tagLength);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherIsSupported")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherIsSupported")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CipherIsSupported(IntPtr cipher);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ecb")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ecb")]
         internal static partial IntPtr EvpAes128Ecb();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cbc")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cbc")]
         internal static partial IntPtr EvpAes128Cbc();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Gcm")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Gcm")]
         internal static partial IntPtr EvpAes128Gcm();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb8")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb8")]
         internal static partial IntPtr EvpAes128Cfb8();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb128")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb128")]
         internal static partial IntPtr EvpAes128Cfb128();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ccm")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ccm")]
         internal static partial IntPtr EvpAes128Ccm();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ecb")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ecb")]
         internal static partial IntPtr EvpAes192Ecb();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cbc")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cbc")]
         internal static partial IntPtr EvpAes192Cbc();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Gcm")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Gcm")]
         internal static partial IntPtr EvpAes192Gcm();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb8")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb8")]
         internal static partial IntPtr EvpAes192Cfb8();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb128")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb128")]
         internal static partial IntPtr EvpAes192Cfb128();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ccm")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ccm")]
         internal static partial IntPtr EvpAes192Ccm();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ecb")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ecb")]
         internal static partial IntPtr EvpAes256Ecb();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cbc")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cbc")]
         internal static partial IntPtr EvpAes256Cbc();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Gcm")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Gcm")]
         internal static partial IntPtr EvpAes256Gcm();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb128")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb128")]
         internal static partial IntPtr EvpAes256Cfb128();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb8")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb8")]
         internal static partial IntPtr EvpAes256Cfb8();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ccm")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ccm")]
         internal static partial IntPtr EvpAes256Ccm();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCbc")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCbc")]
         internal static partial IntPtr EvpDesCbc();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesEcb")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesEcb")]
         internal static partial IntPtr EvpDesEcb();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCfb8")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCfb8")]
         internal static partial IntPtr EvpDesCfb8();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cbc")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cbc")]
         internal static partial IntPtr EvpDes3Cbc();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Ecb")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Ecb")]
         internal static partial IntPtr EvpDes3Ecb();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb8")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb8")]
         internal static partial IntPtr EvpDes3Cfb8();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb64")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb64")]
         internal static partial IntPtr EvpDes3Cfb64();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Cbc")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Cbc")]
         internal static partial IntPtr EvpRC2Cbc();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Ecb")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Ecb")]
         internal static partial IntPtr EvpRC2Ecb();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_ChaCha20Poly1305")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_ChaCha20Poly1305")]
         internal static partial IntPtr EvpChaCha20Poly1305();
 
         internal enum EvpCipherDirection : int
index 623b697..e5fa30c 100644 (file)
@@ -11,11 +11,11 @@ internal static partial class Interop
 {
     internal static partial class AndroidCrypto
     {
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaGenerateKey")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaGenerateKey")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DsaGenerateKey(out SafeDsaHandle dsa, int bits);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeSignature")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeSignature")]
         private static partial int DsaSizeSignature(SafeDsaHandle dsa);
 
         /// <summary>
@@ -27,7 +27,7 @@ internal static partial class Interop
             return size;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSignatureFieldSize")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSignatureFieldSize")]
         private static partial int AndroidCryptoNative_DsaSignatureFieldSize(SafeDsaHandle dsa);
 
         /// <summary>
@@ -41,7 +41,7 @@ internal static partial class Interop
             return size;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeP")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeP")]
         private static partial int DsaSizeP(SafeDsaHandle dsa);
 
         /// <summary>
@@ -59,7 +59,7 @@ internal static partial class Interop
         internal static bool DsaSign(SafeDsaHandle dsa, ReadOnlySpan<byte> hash, Span<byte> refSignature, out int outSignatureLength) =>
             DsaSign(dsa, ref MemoryMarshal.GetReference(hash), hash.Length, ref MemoryMarshal.GetReference(refSignature), out outSignatureLength);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSign")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSign")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool DsaSign(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte refSignature, out int outSignatureLength);
 
@@ -80,7 +80,7 @@ internal static partial class Interop
             return ret == 1;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaVerify")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaVerify")]
         private static partial int DsaVerify(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte signature, int signatureLength);
 
         internal static DSAParameters ExportDsaParameters(SafeDsaHandle key, bool includePrivateParameters)
@@ -141,7 +141,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetDsaParameters")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetDsaParameters")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool GetDsaParameters(
             SafeDsaHandle key,
@@ -151,7 +151,7 @@ internal static partial class Interop
             out SafeBignumHandle y, out int y_cb,
             out SafeBignumHandle x, out int x_cb);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaKeyCreateByExplicitParameters")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaKeyCreateByExplicitParameters")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DsaKeyCreateByExplicitParameters(
             out SafeDsaHandle dsa,
index 9db42ff..369bdae 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class AndroidCrypto
     {
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByKeyParameters", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByKeyParameters", StringMarshalling = StringMarshalling.Utf8)]
         private static partial int EcKeyCreateByKeyParameters(
             out SafeEcKeyHandle key,
             string oid,
@@ -35,7 +35,7 @@ internal static partial class Interop
             return key;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByExplicitParameters")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByExplicitParameters")]
         internal static partial SafeEcKeyHandle EcKeyCreateByExplicitParameters(
             ECCurve.ECCurveType curveType,
             byte[]? qx, int qxLength,
@@ -91,7 +91,7 @@ internal static partial class Interop
         }
 
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+        [LibraryImport(Libraries.AndroidCryptoNative)]
         private static partial int AndroidCryptoNative_GetECKeyParameters(
             SafeEcKeyHandle key,
             [MarshalAs(UnmanagedType.Bool)] bool includePrivate,
@@ -149,7 +149,7 @@ internal static partial class Interop
             return parameters;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+        [LibraryImport(Libraries.AndroidCryptoNative)]
         private static partial int AndroidCryptoNative_GetECCurveParameters(
             SafeEcKeyHandle key,
             [MarshalAs(UnmanagedType.Bool)] bool includePrivate,
index e81681e..1c34713 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         internal static bool EcDsaSign(ReadOnlySpan<byte> dgst, Span<byte> sig, out int siglen, SafeEcKeyHandle ecKey) =>
             EcDsaSign(ref MemoryMarshal.GetReference(dgst), dgst.Length, ref MemoryMarshal.GetReference(sig), out siglen, ecKey);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSign")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSign")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EcDsaSign(ref byte dgst, int dlen, ref byte sig, out int siglen, SafeEcKeyHandle ecKey);
 
@@ -34,11 +34,11 @@ internal static partial class Interop
          *      0: incorrect signature
          *     -1: error
          */
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaVerify")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaVerify")]
         private static partial int EcDsaVerify(ref byte dgst, int dgst_len, ref byte sigbuf, int sig_len, SafeEcKeyHandle ecKey);
 
         // returns the maximum length of a DER encoded ECDSA signature created with this key.
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSize")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSize")]
         private static partial int AndroidCryptoNative_EcDsaSize(SafeEcKeyHandle ecKey);
 
         internal static int EcDsaSize(SafeEcKeyHandle ecKey)
index 178610b..ada1831 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class AndroidCrypto
     {
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByOid", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByOid", StringMarshalling = StringMarshalling.Utf8)]
         private static partial SafeEcKeyHandle AndroidCryptoNative_EcKeyCreateByOid(string oid);
         internal static SafeEcKeyHandle? EcKeyCreateByOid(string oid)
         {
@@ -19,14 +19,14 @@ internal static partial class Interop
             return handle;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyDestroy")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyDestroy")]
         internal static partial void EcKeyDestroy(IntPtr a);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyUpRef")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyUpRef")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EcKeyUpRef(IntPtr r);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+        [LibraryImport(Libraries.AndroidCryptoNative)]
         private static partial int AndroidCryptoNative_EcKeyGetSize(SafeEcKeyHandle ecKey, out int keySize);
         internal static int EcKeyGetSize(SafeEcKeyHandle key)
         {
@@ -39,7 +39,7 @@ internal static partial class Interop
             throw new CryptographicException();
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyGetCurveName")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyGetCurveName")]
         private static partial int AndroidCryptoNative_EcKeyGetCurveName(SafeEcKeyHandle ecKey, out IntPtr curveName);
 
         internal static string? EcKeyGetCurveName(SafeEcKeyHandle key)
index c5bbd4c..20ecb72 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         internal static bool EcdhDeriveKey(SafeEcKeyHandle ourKey, SafeEcKeyHandle peerKey, Span<byte> buffer, out int usedBuffer) =>
             EcdhDeriveKey(ourKey, peerKey, ref MemoryMarshal.GetReference(buffer), buffer.Length, out usedBuffer);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcdhDeriveKey")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcdhDeriveKey")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EcdhDeriveKey(SafeEcKeyHandle ourKey, SafeEcKeyHandle peerKey, ref byte buffer, int bufferLength, out int usedBuffer);
     }
index 96d983b..4207132 100644 (file)
@@ -10,22 +10,22 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrClearError")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrClearError")]
         internal static partial ulong ErrClearError();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrGetErrorAlloc")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrGetErrorAlloc")]
         private static partial ulong ErrGetErrorAlloc([MarshalAs(UnmanagedType.Bool)] out bool isAllocFailure);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekError")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekError")]
         internal static partial ulong ErrPeekError();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")]
         internal static partial ulong ErrPeekLastError();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")]
         internal static partial IntPtr ErrReasonErrorString(ulong error);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")]
         private static unsafe partial void ErrErrorStringN(ulong e, byte* buf, int len);
 
         private static unsafe string ErrErrorStringN(ulong error)
index b233af7..8ba0658 100644 (file)
@@ -15,31 +15,31 @@ internal static partial class Interop
         private static volatile IntPtr s_evpSha384;
         private static volatile IntPtr s_evpSha512;
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+        [LibraryImport(Libraries.AndroidCryptoNative)]
         private static partial IntPtr CryptoNative_EvpMd5();
 
         internal static IntPtr EvpMd5() =>
             s_evpMd5 != IntPtr.Zero ? s_evpMd5 : (s_evpMd5 = CryptoNative_EvpMd5());
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+        [LibraryImport(Libraries.AndroidCryptoNative)]
         internal static partial IntPtr CryptoNative_EvpSha1();
 
         internal static IntPtr EvpSha1() =>
             s_evpSha1 != IntPtr.Zero ? s_evpSha1 : (s_evpSha1 = CryptoNative_EvpSha1());
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+        [LibraryImport(Libraries.AndroidCryptoNative)]
         internal static partial IntPtr CryptoNative_EvpSha256();
 
         internal static IntPtr EvpSha256() =>
             s_evpSha256 != IntPtr.Zero ? s_evpSha256 : (s_evpSha256 = CryptoNative_EvpSha256());
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+        [LibraryImport(Libraries.AndroidCryptoNative)]
         internal static partial IntPtr CryptoNative_EvpSha384();
 
         internal static IntPtr EvpSha384() =>
             s_evpSha384 != IntPtr.Zero ? s_evpSha384 : (s_evpSha384 = CryptoNative_EvpSha384());
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+        [LibraryImport(Libraries.AndroidCryptoNative)]
         internal static partial IntPtr CryptoNative_EvpSha512();
 
         internal static IntPtr EvpSha512() =>
index 251f5bf..e3bea19 100644 (file)
@@ -10,37 +10,37 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")]
         internal static partial SafeEvpMdCtxHandle EvpMdCtxCreate(IntPtr type);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")]
         internal static partial void EvpMdCtxDestroy(IntPtr ctx);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")]
         internal static partial int EvpDigestReset(SafeEvpMdCtxHandle ctx, IntPtr type);
 
         internal static int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ReadOnlySpan<byte> d, int cnt) =>
             EvpDigestUpdate(ctx, ref MemoryMarshal.GetReference(d), cnt);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")]
         private static partial int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ref byte d, int cnt);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")]
         internal static partial int EvpDigestFinalEx(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")]
         internal static partial int EvpDigestCurrent(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")]
         internal static unsafe partial int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, uint* mdSize);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdSize")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdSize")]
         internal static partial int EvpMdSize(IntPtr md);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")]
         private static partial int GetMaxMdSize();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_Pbkdf2")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_Pbkdf2")]
         private static unsafe partial int Pbkdf2(
             byte* pPassword,
             int passwordLength,
index 6f9cfef..f2bec40 100644 (file)
@@ -10,28 +10,28 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCreate")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCreate")]
         internal static partial SafeHmacCtxHandle HmacCreate(ref byte key, int keyLen, IntPtr md);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacDestroy")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacDestroy")]
         internal static partial void HmacDestroy(IntPtr ctx);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacReset")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacReset")]
         internal static partial int HmacReset(SafeHmacCtxHandle ctx);
 
         internal static int HmacUpdate(SafeHmacCtxHandle ctx, ReadOnlySpan<byte> data, int len) =>
             HmacUpdate(ctx, ref MemoryMarshal.GetReference(data), len);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacUpdate")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacUpdate")]
         private static partial int HmacUpdate(SafeHmacCtxHandle ctx, ref byte data, int len);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacFinal")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacFinal")]
         internal static partial int HmacFinal(SafeHmacCtxHandle ctx, ref byte data, ref int len);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCurrent")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCurrent")]
         internal static partial int HmacCurrent(SafeHmacCtxHandle ctx, ref byte data, ref int len);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacOneShot")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacOneShot")]
         private static unsafe partial int HmacOneShot(IntPtr type, byte* key, int keySize, byte* source, int sourceSize, byte* md, ref int mdSize);
 
         internal static unsafe int HmacOneShot(IntPtr type, ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination)
index 9585baf..9116ab5 100644 (file)
@@ -48,7 +48,7 @@ internal static partial class Interop
             // No-op that exists to provide a hook for other static constructors.
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")]
         private static partial int EnsureOpenSslInitialized();
     }
 }
index fa8e5ff..c058213 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             return CryptoNative_GetRandomBytes(pbBuffer, count);
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative)]
+        [LibraryImport(Libraries.AndroidCryptoNative)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static unsafe partial bool CryptoNative_GetRandomBytes(byte* buf, int num);
     }
index 2623cbc..9aef7f7 100644 (file)
@@ -11,20 +11,20 @@ internal static partial class Interop
 {
     internal static partial class AndroidCrypto
     {
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaCreate")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaCreate")]
         internal static partial SafeRsaHandle RsaCreate();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaUpRef")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaUpRef")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool RsaUpRef(IntPtr rsa);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaDestroy")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaDestroy")]
         internal static partial void RsaDestroy(IntPtr rsa);
 
         internal static SafeRsaHandle DecodeRsaSubjectPublicKeyInfo(ReadOnlySpan<byte> buf) =>
             DecodeRsaSubjectPublicKeyInfo(ref MemoryMarshal.GetReference(buf), buf.Length);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo")]
         private static partial SafeRsaHandle DecodeRsaSubjectPublicKeyInfo(ref byte buf, int len);
 
         internal static int RsaPublicEncrypt(
@@ -35,7 +35,7 @@ internal static partial class Interop
             RsaPadding padding) =>
             RsaPublicEncrypt(flen, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa, padding);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPublicEncrypt")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPublicEncrypt")]
         private static partial int RsaPublicEncrypt(
             int flen,
             ref byte from,
@@ -51,7 +51,7 @@ internal static partial class Interop
             RsaPadding padding) =>
             RsaPrivateDecrypt(flen, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa, padding);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPrivateDecrypt")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPrivateDecrypt")]
         private static partial int RsaPrivateDecrypt(
             int flen,
             ref byte from,
@@ -65,7 +65,7 @@ internal static partial class Interop
             SafeRsaHandle rsa) =>
             RsaSignPrimitive(from.Length, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSignPrimitive")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSignPrimitive")]
         private static partial int RsaSignPrimitive(
             int flen,
             ref byte from,
@@ -78,17 +78,17 @@ internal static partial class Interop
             SafeRsaHandle rsa) =>
             RsaVerificationPrimitive(from.Length, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaVerificationPrimitive")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaVerificationPrimitive")]
         private static partial int RsaVerificationPrimitive(
             int flen,
             ref byte from,
             ref byte to,
             SafeRsaHandle rsa);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSize")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSize")]
         internal static partial int RsaSize(SafeRsaHandle rsa);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaGenerateKeyEx")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaGenerateKeyEx")]
         internal static partial int RsaGenerateKeyEx(SafeRsaHandle rsa, int bits);
 
         internal static RSAParameters ExportRsaParameters(SafeRsaHandle key, bool includePrivateParameters)
@@ -159,7 +159,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetRsaParameters")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetRsaParameters")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool GetRsaParameters(
             SafeRsaHandle key,
@@ -172,7 +172,7 @@ internal static partial class Interop
             out SafeBignumHandle dmq1,
             out SafeBignumHandle iqmp);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SetRsaParameters")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SetRsaParameters")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetRsaParameters(
             SafeRsaHandle key,
index f0f7356..5fd3828 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal static partial class AndroidCrypto
     {
-        [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLGetSupportedProtocols")]
+        [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLGetSupportedProtocols")]
         internal static partial SslProtocols SSLGetSupportedProtocols();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration")]
         [return:MarshalAs(UnmanagedType.U1)]
         internal static partial bool SSLSupportsApplicationProtocolsConfiguration();
     }
index 9ae8823..56acba0 100644 (file)
@@ -31,10 +31,10 @@ internal static partial class Interop
             Closed = 4,
         };
 
-        [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreate")]
+        [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreate")]
         internal static partial SafeSslHandle SSLStreamCreate();
 
-        [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreateWithCertificates")]
+        [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreateWithCertificates")]
         private static partial SafeSslHandle SSLStreamCreateWithCertificates(
             ref byte pkcs8PrivateKey,
             int pkcs8PrivateKeyLen,
@@ -51,7 +51,7 @@ internal static partial class Interop
                 certificates.Length);
         }
 
-        [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamInitialize")]
+        [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamInitialize")]
         private static partial int SSLStreamInitializeImpl(
             SafeSslHandle sslHandle,
             [MarshalAs(UnmanagedType.U1)] bool isServer,
@@ -70,7 +70,7 @@ internal static partial class Interop
                 throw new SslException();
         }
 
-        [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetTargetHost")]
+        [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetTargetHost")]
         private static partial int SSLStreamSetTargetHostImpl(
             SafeSslHandle sslHandle,
             [MarshalAs(UnmanagedType.LPUTF8Str)] string targetHost);
@@ -85,7 +85,7 @@ internal static partial class Interop
                 throw new SslException();
         }
 
-        [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRequestClientAuthentication")]
+        [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRequestClientAuthentication")]
         internal static partial void SSLStreamRequestClientAuthentication(SafeSslHandle sslHandle);
 
         [StructLayout(LayoutKind.Sequential)]
@@ -95,7 +95,7 @@ internal static partial class Interop
             public int Length;
         }
 
-        [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetApplicationProtocols")]
+        [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetApplicationProtocols")]
         private static unsafe partial int SSLStreamSetApplicationProtocols(SafeSslHandle sslHandle, ApplicationProtocolData[] protocolData, int count);
         internal static unsafe void SSLStreamSetApplicationProtocols(SafeSslHandle sslHandle, List<SslApplicationProtocol> protocols)
         {
@@ -129,7 +129,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetEnabledProtocols")]
+        [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetEnabledProtocols")]
         private static partial int SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ref SslProtocols protocols, int length);
         internal static void SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ReadOnlySpan<SslProtocols> protocols)
         {
@@ -138,10 +138,10 @@ internal static partial class Interop
                 throw new SslException();
         }
 
-        [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamHandshake")]
+        [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamHandshake")]
         internal static partial PAL_SSLStreamStatus SSLStreamHandshake(SafeSslHandle sslHandle);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetApplicationProtocol")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetApplicationProtocol")]
         private static partial int SSLStreamGetApplicationProtocol(SafeSslHandle ssl, byte[]? buf, ref int len);
         internal static byte[]? SSLStreamGetApplicationProtocol(SafeSslHandle ssl)
         {
@@ -158,7 +158,7 @@ internal static partial class Interop
             return bytes;
         }
 
-        [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRead")]
+        [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRead")]
         private static unsafe partial PAL_SSLStreamStatus SSLStreamRead(
             SafeSslHandle sslHandle,
             byte* buffer,
@@ -175,7 +175,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamWrite")]
+        [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamWrite")]
         private static unsafe partial PAL_SSLStreamStatus SSLStreamWrite(
             SafeSslHandle sslHandle,
             byte* buffer,
@@ -190,7 +190,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRelease")]
+        [LibraryImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRelease")]
         internal static partial void SSLStreamRelease(IntPtr ptr);
 
         internal sealed class SslException : Exception
@@ -205,7 +205,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetProtocol")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetProtocol")]
         private static partial int SSLStreamGetProtocol(SafeSslHandle ssl, out IntPtr protocol);
         internal static string SSLStreamGetProtocol(SafeSslHandle ssl)
         {
@@ -222,10 +222,10 @@ internal static partial class Interop
             return protocol;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificate")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificate")]
         internal static partial SafeX509Handle SSLStreamGetPeerCertificate(SafeSslHandle ssl);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificates")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificates")]
         private static partial void SSLStreamGetPeerCertificates(
             SafeSslHandle ssl,
             [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] out IntPtr[] certs,
@@ -237,7 +237,7 @@ internal static partial class Interop
             return ptrs;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetCipherSuite")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetCipherSuite")]
         private static partial int SSLStreamGetCipherSuite(SafeSslHandle ssl, out IntPtr cipherSuite);
         internal static string SSLStreamGetCipherSuite(SafeSslHandle ssl)
         {
@@ -254,11 +254,11 @@ internal static partial class Interop
             return cipherSuite;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamShutdown")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamShutdown")]
         [return: MarshalAs(UnmanagedType.U1)]
         internal static partial bool SSLStreamShutdown(SafeSslHandle ssl);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamVerifyHostname")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamVerifyHostname")]
         [return: MarshalAs(UnmanagedType.U1)]
         internal static partial bool SSLStreamVerifyHostname(
             SafeSslHandle ssl,
index ee0bf3c..cc3733f 100644 (file)
@@ -13,10 +13,10 @@ internal static partial class Interop
         private const int INSUFFICIENT_BUFFER = -1;
         private const int SUCCESS = 1;
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Decode")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Decode")]
         internal static partial SafeX509Handle X509Decode(ref byte buf, int len);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Encode")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Encode")]
         private static partial int X509Encode(SafeX509Handle x, byte[]? buf, ref int len);
         internal static byte[] X509Encode(SafeX509Handle x)
         {
@@ -33,7 +33,7 @@ internal static partial class Interop
             return encoded;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509DecodeCollection")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509DecodeCollection")]
         private static partial int X509DecodeCollection(ref byte buf, int bufLen, IntPtr[]? ptrs, ref int handlesLen);
         internal static SafeX509Handle[] X509DecodeCollection(ReadOnlySpan<byte> data)
         {
@@ -60,7 +60,7 @@ internal static partial class Interop
             return handles;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ExportPkcs7")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ExportPkcs7")]
         private static partial int X509ExportPkcs7(IntPtr[] certs, int certsLen, byte[]? buf, ref int len);
         internal static byte[] X509ExportPkcs7(IntPtr[] certHandles)
         {
@@ -77,7 +77,7 @@ internal static partial class Interop
             return encoded;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509GetContentType")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509GetContentType")]
         private static partial X509ContentType X509GetContentType(ref byte buf, int len);
         internal static X509ContentType X509GetContentType(ReadOnlySpan<byte> data)
         {
@@ -92,7 +92,7 @@ internal static partial class Interop
             UnknownAlgorithm = -1,
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509PublicKey")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509PublicKey")]
         internal static partial IntPtr X509GetPublicKey(SafeX509Handle x, PAL_KeyAlgorithm algorithm);
     }
 }
index c19c68f..996b0de 100644 (file)
@@ -12,25 +12,25 @@ internal static partial class Interop
 {
     internal static partial class AndroidCrypto
     {
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainCreateContext")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainCreateContext")]
         internal static partial SafeX509ChainContextHandle X509ChainCreateContext(
             SafeX509Handle cert,
             IntPtr[] extraStore,
             int extraStoreLen);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainDestroyContext")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainDestroyContext")]
         internal static partial void X509ChainDestroyContext(IntPtr ctx);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainBuild")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainBuild")]
         [return: MarshalAs(UnmanagedType.U1)]
         internal static partial bool X509ChainBuild(
             SafeX509ChainContextHandle ctx,
             long timeInMsFromUnixEpoch);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetCertificateCount")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetCertificateCount")]
         private static partial int X509ChainGetCertificateCount(SafeX509ChainContextHandle ctx);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetCertificates")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetCertificates")]
         private static partial int X509ChainGetCertificates(
             SafeX509ChainContextHandle ctx,
             IntPtr[] certs,
@@ -69,10 +69,10 @@ internal static partial class Interop
             public int Status;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetErrorCount")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetErrorCount")]
         private static partial int X509ChainGetErrorCount(SafeX509ChainContextHandle ctx);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetErrors")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainGetErrors")]
         private static unsafe partial int X509ChainGetErrors(
             SafeX509ChainContextHandle ctx,
             ValidationError[] errors,
@@ -92,17 +92,17 @@ internal static partial class Interop
             return errors;
         }
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainSetCustomTrustStore")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainSetCustomTrustStore")]
         internal static partial int X509ChainSetCustomTrustStore(
             SafeX509ChainContextHandle ctx,
             IntPtr[] customTrustStore,
             int customTrustStoreLen);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainSupportsRevocationOptions")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainSupportsRevocationOptions")]
         [return:MarshalAs(UnmanagedType.U1)]
         internal static partial bool X509ChainSupportsRevocationOptions();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainValidate")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ChainValidate")]
         internal static partial int X509ChainValidate(
             SafeX509ChainContextHandle ctx,
             X509RevocationMode revocationMode,
index 2dcbd16..ec5861b 100644 (file)
@@ -11,14 +11,14 @@ internal static partial class Interop
 {
     internal static partial class AndroidCrypto
     {
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreAddCertificate", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreAddCertificate", StringMarshalling = StringMarshalling.Utf8)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool X509StoreAddCertificate(
             SafeX509StoreHandle store,
             SafeX509Handle cert,
             string hashString);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", StringMarshalling = StringMarshalling.Utf8)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool X509StoreAddCertificateWithPrivateKey(
             SafeX509StoreHandle store,
@@ -27,31 +27,31 @@ internal static partial class Interop
             PAL_KeyAlgorithm algorithm,
             string hashString);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreContainsCertificate", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreContainsCertificate", StringMarshalling = StringMarshalling.Utf8)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool X509StoreContainsCertificate(
             SafeX509StoreHandle store,
             SafeX509Handle cert,
             string hashString);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreEnumerateCertificates")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreEnumerateCertificates")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool X509StoreEnumerateCertificates(
             SafeX509StoreHandle storeHandle,
             delegate* unmanaged<void*, void*, Interop.AndroidCrypto.PAL_KeyAlgorithm, void*, void> callback,
             void *callbackContext);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool X509StoreEnumerateTrustedCertificates(
             byte systemOnly,
             delegate* unmanaged<void*, void*, void> callback,
             void *callbackContext);
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreOpenDefault")]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreOpenDefault")]
         internal static unsafe partial SafeX509StoreHandle X509StoreOpenDefault();
 
-        [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreRemoveCertificate", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509StoreRemoveCertificate", StringMarshalling = StringMarshalling.Utf8)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool X509StoreRemoveCertificate(
             SafeX509StoreHandle store,
index 12554a3..87c060b 100644 (file)
@@ -33,7 +33,7 @@ internal static partial class Interop
             private readonly int __padding;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTcpGlobalStatistics")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTcpGlobalStatistics")]
         public static unsafe partial int GetTcpGlobalStatistics(TcpGlobalStatistics* statistics);
 
         [StructLayoutAttribute(LayoutKind.Sequential)]
@@ -55,7 +55,7 @@ internal static partial class Interop
             public readonly int Forwarding;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4GlobalStatistics")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4GlobalStatistics")]
         public static unsafe partial int GetIPv4GlobalStatistics(IPv4GlobalStatistics* statistics);
 
         [StructLayoutAttribute(LayoutKind.Sequential)]
@@ -68,7 +68,7 @@ internal static partial class Interop
             public readonly ulong UdpListeners;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUdpGlobalStatistics")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUdpGlobalStatistics")]
         public static unsafe partial int GetUdpGlobalStatistics(UdpGlobalStatistics* statistics);
 
         [StructLayoutAttribute(LayoutKind.Sequential)]
@@ -98,7 +98,7 @@ internal static partial class Interop
             public readonly ulong TimestampRequestsSent;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv4GlobalStatistics")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv4GlobalStatistics")]
         public static unsafe partial int GetIcmpv4GlobalStatistics(Icmpv4GlobalStatistics* statistics);
 
         [StructLayoutAttribute(LayoutKind.Sequential)]
@@ -134,7 +134,7 @@ internal static partial class Interop
             public readonly ulong TimeExceededMessagesSent;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv6GlobalStatistics")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv6GlobalStatistics")]
         public static unsafe partial int GetIcmpv6GlobalStatistics(Icmpv6GlobalStatistics* statistics);
 
         public readonly struct NativeIPInterfaceStatistics
@@ -155,10 +155,10 @@ internal static partial class Interop
             public readonly ulong Flags;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNativeIPInterfaceStatistics", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNativeIPInterfaceStatistics", StringMarshalling = StringMarshalling.Utf8)]
         public static partial int GetNativeIPInterfaceStatistics(string name, out NativeIPInterfaceStatistics stats);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNumRoutes")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNumRoutes")]
         public static partial int GetNumRoutes();
     }
 }
index 3c98d2d..9205bd0 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sysctl", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sysctl", SetLastError = true)]
         private static unsafe partial int Sysctl(int* name, int namelen, void* value, size_t* len);
 
         // This is 'raw' sysctl call, only wrapped to allocate memory if needed
index 35a6b9d..520d4d1 100644 (file)
@@ -25,16 +25,16 @@ internal static partial class Interop
             public TcpState State;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedTcpConnectionCount")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedTcpConnectionCount")]
         public static partial int GetEstimatedTcpConnectionCount();
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveTcpConnectionInfos")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveTcpConnectionInfos")]
         public static unsafe partial int GetActiveTcpConnectionInfos(NativeTcpConnectionInformation* infos, int* infoCount);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedUdpListenerCount")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedUdpListenerCount")]
         public static partial int GetEstimatedUdpListenerCount();
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveUdpListeners")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveUdpListeners")]
         public static unsafe partial int GetActiveUdpListeners(IPEndPointInfo* infos, int* infoCount);
     }
 }
index 0ebede8..919240e 100644 (file)
@@ -10,41 +10,41 @@ internal static partial class Interop
 {
     internal static partial class Brotli
     {
-        [GeneratedDllImport(Libraries.CompressionNative)]
+        [LibraryImport(Libraries.CompressionNative)]
         internal static partial SafeBrotliDecoderHandle BrotliDecoderCreateInstance(IntPtr allocFunc, IntPtr freeFunc, IntPtr opaque);
 
-        [GeneratedDllImport(Libraries.CompressionNative)]
+        [LibraryImport(Libraries.CompressionNative)]
         internal static unsafe partial int BrotliDecoderDecompressStream(
             SafeBrotliDecoderHandle state, ref nuint availableIn, byte** nextIn,
             ref nuint availableOut, byte** nextOut, out nuint totalOut);
 
-        [GeneratedDllImport(Libraries.CompressionNative)]
+        [LibraryImport(Libraries.CompressionNative)]
         internal static unsafe partial BOOL BrotliDecoderDecompress(nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes);
 
-        [GeneratedDllImport(Libraries.CompressionNative)]
+        [LibraryImport(Libraries.CompressionNative)]
         internal static partial void BrotliDecoderDestroyInstance(IntPtr state);
 
-        [GeneratedDllImport(Libraries.CompressionNative)]
+        [LibraryImport(Libraries.CompressionNative)]
         internal static partial BOOL BrotliDecoderIsFinished(SafeBrotliDecoderHandle state);
 
-        [GeneratedDllImport(Libraries.CompressionNative)]
+        [LibraryImport(Libraries.CompressionNative)]
         internal static partial SafeBrotliEncoderHandle BrotliEncoderCreateInstance(IntPtr allocFunc, IntPtr freeFunc, IntPtr opaque);
 
-        [GeneratedDllImport(Libraries.CompressionNative)]
+        [LibraryImport(Libraries.CompressionNative)]
         internal static partial BOOL BrotliEncoderSetParameter(SafeBrotliEncoderHandle state, BrotliEncoderParameter parameter, uint value);
 
-        [GeneratedDllImport(Libraries.CompressionNative)]
+        [LibraryImport(Libraries.CompressionNative)]
         internal static unsafe partial BOOL BrotliEncoderCompressStream(
             SafeBrotliEncoderHandle state, BrotliEncoderOperation op, ref nuint availableIn,
             byte** nextIn, ref nuint availableOut, byte** nextOut, out nuint totalOut);
 
-        [GeneratedDllImport(Libraries.CompressionNative)]
+        [LibraryImport(Libraries.CompressionNative)]
         internal static partial BOOL BrotliEncoderHasMoreOutput(SafeBrotliEncoderHandle state);
 
-        [GeneratedDllImport(Libraries.CompressionNative)]
+        [LibraryImport(Libraries.CompressionNative)]
         internal static partial void BrotliEncoderDestroyInstance(IntPtr state);
 
-        [GeneratedDllImport(Libraries.CompressionNative)]
+        [LibraryImport(Libraries.CompressionNative)]
         internal static unsafe partial BOOL BrotliEncoderCompress(int quality, int window, int v, nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes);
     }
 }
index 5efe983..622ecc6 100644 (file)
@@ -9,10 +9,10 @@ internal static partial class Interop
 {
     internal static partial class Globalization
     {
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendars", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendars", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int GetCalendars(string localeName, CalendarId[] calendars, int calendarsCapacity);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendarInfo", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendarInfo", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial ResultCode GetCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType calendarDataType, char* result, int resultCapacity);
 
         internal static unsafe bool EnumCalendarInfo(delegate* unmanaged<char*, IntPtr, void> callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context)
@@ -20,16 +20,16 @@ internal static partial class Interop
             return EnumCalendarInfo((IntPtr)callback, localeName, calendarId, calendarDataType, context);
         }
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EnumCalendarInfo", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EnumCalendarInfo", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         // We skip the following DllImport because of 'Parsing function pointer types in signatures is not supported.' for some targeted
         // platforms (for example, WASM build).
         private static unsafe partial bool EnumCalendarInfo(IntPtr callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEra")]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEra")]
         internal static partial int GetLatestJapaneseEra();
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetJapaneseEraStartDate")]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetJapaneseEraStartDate")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetJapaneseEraStartDate(int era, out int startYear, out int startMonth, out int startDay);
     }
index 4664826..62743b2 100644 (file)
@@ -7,19 +7,19 @@ internal static partial class Interop
 {
     internal static partial class Globalization
     {
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCase", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCase", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial void ChangeCase(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, [MarshalAs(UnmanagedType.Bool)] bool bToUpper);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseInvariant", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseInvariant", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial void ChangeCaseInvariant(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, [MarshalAs(UnmanagedType.Bool)] bool bToUpper);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseTurkish", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseTurkish", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial void ChangeCaseTurkish(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, [MarshalAs(UnmanagedType.Bool)] bool bToUpper);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitOrdinalCasingPage", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitOrdinalCasingPage", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial void InitOrdinalCasingPage(int pageNumber, char* pTarget);
     }
 }
index cb43ca1..11fa2de 100644 (file)
@@ -10,43 +10,43 @@ internal static partial class Interop
 {
     internal static partial class Globalization
     {
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortHandle", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortHandle", StringMarshalling = StringMarshalling.Utf8)]
         internal static unsafe partial ResultCode GetSortHandle(string localeName, out IntPtr sortHandle);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CloseSortHandle")]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CloseSortHandle")]
         internal static partial void CloseSortHandle(IntPtr handle);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CompareString", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CompareString", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int CompareString(IntPtr sortHandle, char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len, CompareOptions options);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IndexOf", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IndexOf", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int IndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LastIndexOf", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LastIndexOf", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int LastIndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", StringMarshalling = StringMarshalling.Utf16)]
         [MethodImpl(MethodImplOptions.NoInlining)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool StartsWith(IntPtr sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options, int* matchedLength);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", StringMarshalling = StringMarshalling.Utf16)]
         [MethodImpl(MethodImplOptions.NoInlining)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool EndsWith(IntPtr sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options, int* matchedLength);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool StartsWith(IntPtr sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EndsWith(IntPtr sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortKey", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortKey", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int GetSortKey(IntPtr sortHandle, char* str, int strLength, byte* sortKey, int sortKeyLength, CompareOptions options);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortVersion")]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortVersion")]
         internal static partial int GetSortVersion(IntPtr sortHandle);
     }
 }
index f41a18d..60ca3b9 100644 (file)
@@ -17,15 +17,15 @@ internal static partial class Interop
 
 #pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant
 #if TARGET_WINDOWS
-        [GeneratedDllImport(Libraries.HostPolicy, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.HostPolicy, StringMarshalling = StringMarshalling.Utf16)]
 #else
-        [GeneratedDllImport(Libraries.HostPolicy, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.HostPolicy, StringMarshalling = StringMarshalling.Utf8)]
 #endif
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial int corehost_resolve_component_dependencies(string componentMainAssemblyPath,
             corehost_resolve_component_dependencies_result_fn result);
 
-        [GeneratedDllImport(Libraries.HostPolicy)]
+        [LibraryImport(Libraries.HostPolicy)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial IntPtr corehost_set_error_writer(IntPtr errorWriter);
 #pragma warning restore CS3016 // Arrays as attribute arguments is not CLS-compliant
index de80c0a..99fcbe0 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Globalization
     {
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICU")]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICU")]
         internal static partial int LoadICU();
 
         internal static void InitICUFunctions(IntPtr icuuc, IntPtr icuin, ReadOnlySpan<char> version, ReadOnlySpan<char> suffix)
@@ -20,10 +20,10 @@ internal static partial class Interop
             InitICUFunctions(icuuc, icuin, version.ToString(), suffix.Length > 0 ? suffix.ToString() : null);
         }
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitICUFunctions", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitICUFunctions", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial void InitICUFunctions(IntPtr icuuc, IntPtr icuin, string version, string? suffix);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetICUVersion")]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetICUVersion")]
         internal static partial int GetICUVersion();
     }
 }
index 496e5db..42df7e7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Globalization
     {
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICUData", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICUData", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial int LoadICUData(string path);
     }
 }
index 1c720ab..f5a8e90 100644 (file)
@@ -10,10 +10,10 @@ internal static partial class Interop
         internal const int AllowUnassigned = 0x1;
         internal const int UseStd3AsciiRules = 0x2;
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToAscii", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToAscii", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int ToAscii(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToUnicode", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToUnicode", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int ToUnicode(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity);
     }
 }
index 6788335..051f276 100644 (file)
@@ -7,35 +7,35 @@ internal static partial class Interop
 {
     internal static partial class Globalization
     {
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleName", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleName", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetLocaleName(string localeName, char* value, int valueLength);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoString", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoString", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetLocaleInfoString(string localeName, uint localeStringData, char* value, int valueLength, string? uiLocaleName = null);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetDefaultLocaleName", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetDefaultLocaleName", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetDefaultLocaleName(char* value, int valueLength);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsPredefinedLocale", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsPredefinedLocale", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool IsPredefinedLocale(string localeName);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleTimeFormat", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleTimeFormat", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetLocaleTimeFormat(string localeName, [MarshalAs(UnmanagedType.Bool)] bool shortFormat, char* value, int valueLength);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoInt", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoInt", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetLocaleInfoInt(string localeName, uint localeNumberData, ref int value);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoGroupingSizes", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoGroupingSizes", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetLocaleInfoGroupingSizes(string localeName, uint localeGroupingData, ref int primaryGroupSize, ref int secondaryGroupSize);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocales", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocales", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int GetLocales([Out] char[]? value, int valueLength);
     }
 }
index 287bc02..633f272 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal static partial class Globalization
     {
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsNormalized", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsNormalized", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int IsNormalized(NormalizationForm normalizationForm, char* src, int srcLen);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_NormalizeString", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_NormalizeString", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int NormalizeString(NormalizationForm normalizationForm, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity);
     }
 }
index 8e2a09f..7e20cba 100644 (file)
@@ -20,19 +20,19 @@ internal static partial class Interop
         //
         // ODBC32
         //
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLAllocHandle(
             /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
             /*SQLHANDLE*/IntPtr InputHandle,
             /*SQLHANDLE* */out IntPtr OutputHandle);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLAllocHandle(
             /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
             /*SQLHANDLE*/OdbcHandle InputHandle,
             /*SQLHANDLE* */out IntPtr OutputHandle);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial /*SQLRETURN*/ODBC32.SQLRETURN SQLBindCol(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLUSMALLINT*/ushort ColumnNumber,
@@ -45,7 +45,7 @@ internal static partial class Interop
             /*SQLLEN*/IntPtr BufferLength,
             /*SQLLEN* */IntPtr StrLen_or_Ind);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLBindCol(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLUSMALLINT*/ushort ColumnNumber,
@@ -54,7 +54,7 @@ internal static partial class Interop
             /*SQLLEN*/IntPtr BufferLength,
             /*SQLLEN* */IntPtr StrLen_or_Ind);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial /*SQLRETURN*/ODBC32.SQLRETURN SQLBindParameter(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLUSMALLINT*/ushort ParameterNumber,
@@ -75,15 +75,15 @@ internal static partial class Interop
 #endif
             HandleRef StrLen_or_Ind);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLCancel(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLCloseCursor(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLColAttributeW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLUSMALLINT*/short ColumnNumber,
@@ -108,7 +108,7 @@ internal static partial class Interop
         //            SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute);
         // #endif
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLColumnsW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLCHAR* */string CatalogName,
@@ -120,11 +120,11 @@ internal static partial class Interop
             /*SQLCHAR* */string ColumnName,
             /*SQLSMALLINT*/short NameLen4);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLDisconnect(
             /*SQLHDBC*/IntPtr ConnectionHandle);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLDriverConnectW(
             /*SQLHDBC*/OdbcConnectionHandle hdbc,
             /*SQLHWND*/IntPtr hwnd,
@@ -135,37 +135,37 @@ internal static partial class Interop
             /*SQLSMALLINT* */out short cbConnectionstringout,
             /*SQLUSMALLINT*/short fDriverCompletion);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLEndTran(
             /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
             /*SQLHANDLE*/IntPtr Handle,
             /*SQLSMALLINT*/short CompletionType);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLExecDirectW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLCHAR* */string StatementText,
             /*SQLINTEGER*/int TextLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLExecute(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLFetch(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLFreeHandle(
             /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
             /*SQLHSTMT*/IntPtr StatementHandle);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLFreeStmt(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLUSMALLINT*/ODBC32.STMT Option);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLGetConnectAttrW(
             /*SQLHBDC*/OdbcConnectionHandle ConnectionHandle,
             /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
@@ -173,7 +173,7 @@ internal static partial class Interop
             /*SQLINTEGER*/int BufferLength,
             /*SQLINTEGER* */out int StringLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLGetData(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLUSMALLINT*/ushort ColumnNumber,
@@ -182,7 +182,7 @@ internal static partial class Interop
             /*SQLLEN*/IntPtr BufferLength, // sql.h differs from MSDN
             /*SQLLEN* */out IntPtr StrLen_or_Ind);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLGetDescFieldW(
             /*SQLHSTMT*/OdbcDescriptorHandle StatementHandle,
             /*SQLUSMALLINT*/short RecNumber,
@@ -191,7 +191,7 @@ internal static partial class Interop
             /*SQLINTEGER*/int BufferLength,
             /*SQLINTEGER* */out int StringLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLGetDiagRecW(
             /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
             /*SQLHANDLE*/OdbcHandle Handle,
@@ -202,7 +202,7 @@ internal static partial class Interop
             /*SQLSMALLINT*/short BufferLength,
             /*SQLSMALLINT* */out short TextLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLGetDiagFieldW(
            /*SQLSMALLINT*/ ODBC32.SQL_HANDLE HandleType,
            /*SQLHANDLE*/   OdbcHandle Handle,
@@ -212,13 +212,13 @@ internal static partial class Interop
            /*SQLSMALLINT*/ short BufferLength,
            /*SQLSMALLINT* */ out short StringLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLGetFunctions(
             /*SQLHBDC*/OdbcConnectionHandle hdbc,
             /*SQLUSMALLINT*/ODBC32.SQL_API fFunction,
             /*SQLUSMALLINT* */out short pfExists);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLGetInfoW(
             /*SQLHBDC*/OdbcConnectionHandle hdbc,
             /*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType,
@@ -226,7 +226,7 @@ internal static partial class Interop
             /*SQLSMALLINT*/short cbInfoValueMax,
             /*SQLSMALLINT* */out short pcbInfoValue);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLGetInfoW(
             /*SQLHBDC*/OdbcConnectionHandle hdbc,
             /*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType,
@@ -234,7 +234,7 @@ internal static partial class Interop
             /*SQLSMALLINT*/short cbInfoValueMax,
             /*SQLSMALLINT* */IntPtr pcbInfoValue);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLGetStmtAttrW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
@@ -242,27 +242,27 @@ internal static partial class Interop
             /*SQLINTEGER*/int BufferLength,
             /*SQLINTEGER*/out int StringLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLGetTypeInfo(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLSMALLINT*/short fSqlType);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLMoreResults(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLNumResultCols(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLSMALLINT* */out short ColumnCount);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLPrepareW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLCHAR* */string StatementText,
             /*SQLINTEGER*/int TextLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLPrimaryKeysW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLCHAR* */string? CatalogName,
@@ -272,7 +272,7 @@ internal static partial class Interop
             /*SQLCHAR* */string TableName,
             /*SQLSMALLINT*/short NameLen3);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLProcedureColumnsW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLCHAR* */ string? CatalogName,
@@ -284,7 +284,7 @@ internal static partial class Interop
             /*SQLCHAR* */ string? ColumnName,
             /*SQLSMALLINT*/short NameLen4);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLProceduresW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLCHAR* */ string CatalogName,
@@ -294,33 +294,33 @@ internal static partial class Interop
             /*SQLCHAR* */ string ProcName,
             /*SQLSMALLINT*/short NameLen3);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLRowCount(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLLEN* */out IntPtr RowCount);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW(
             /*SQLHBDC*/OdbcConnectionHandle ConnectionHandle,
             /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
             /*SQLPOINTER*/string Value,
             /*SQLINTEGER*/int StringLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW(
             /*SQLHBDC*/OdbcConnectionHandle ConnectionHandle,
             /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
             /*SQLPOINTER*/IntPtr Value,
             /*SQLINTEGER*/int StringLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW( // used only for AutoCommitOn
             /*SQLHBDC*/IntPtr ConnectionHandle,
             /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
             /*SQLPOINTER*/IntPtr Value,
             /*SQLINTEGER*/int StringLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial /*SQLRETURN*/ODBC32.SQLRETURN SQLSetDescFieldW(
             /*SQLHSTMT*/OdbcDescriptorHandle StatementHandle,
             /*SQLSMALLINT*/short ColumnNumber,
@@ -332,7 +332,7 @@ internal static partial class Interop
             HandleRef CharacterAttribute,
             /*SQLINTEGER*/int BufferLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLSetDescFieldW(
             /*SQLHSTMT*/OdbcDescriptorHandle StatementHandle,
             /*SQLSMALLINT*/short ColumnNumber,
@@ -340,7 +340,7 @@ internal static partial class Interop
             /*SQLPOINTER*/IntPtr CharacterAttribute,
             /*SQLINTEGER*/int BufferLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         // user can set SQL_ATTR_CONNECTION_POOLING attribute with envHandle = null, this attribute is process-level attribute
         internal static partial ODBC32.SQLRETURN SQLSetEnvAttr(
             /*SQLHENV*/OdbcEnvironmentHandle EnvironmentHandle,
@@ -348,14 +348,14 @@ internal static partial class Interop
             /*SQLPOINTER*/IntPtr Value,
             /*SQLINTEGER*/ODBC32.SQL_IS StringLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32)]
+        [LibraryImport(Interop.Libraries.Odbc32)]
         internal static partial ODBC32.SQLRETURN SQLSetStmtAttrW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLINTEGER*/int Attribute,
             /*SQLPOINTER*/IntPtr Value,
             /*SQLINTEGER*/int StringLength);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLSpecialColumnsW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLUSMALLINT*/ODBC32.SQL_SPECIALCOLS IdentifierType,
@@ -368,7 +368,7 @@ internal static partial class Interop
             /*SQLUSMALLINT*/ODBC32.SQL_SCOPE Scope,
             /*SQLUSMALLINT*/ ODBC32.SQL_NULLABILITY Nullable);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLStatisticsW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLCHAR* */string? CatalogName,
@@ -380,7 +380,7 @@ internal static partial class Interop
             /*SQLUSMALLINT*/short Unique,
             /*SQLUSMALLINT*/short Reserved);
 
-        [GeneratedDllImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Odbc32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ODBC32.SQLRETURN SQLTablesW(
             /*SQLHSTMT*/OdbcStatementHandle StatementHandle,
             /*SQLCHAR* */string CatalogName,
index 3163a21..7dc5100 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Globalization
     {
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayName", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayName", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial ResultCode GetTimeZoneDisplayName(
             string localeName,
             string timeZoneId,
@@ -16,10 +16,10 @@ internal static partial class Interop
             char* result,
             int resultLength);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_WindowsIdToIanaId", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_WindowsIdToIanaId", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int WindowsIdToIanaId(string windowsId, IntPtr region, char* ianaId, int ianaIdLength);
 
-        [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IanaIdToWindowsId", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IanaIdToWindowsId", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int IanaIdToWindowsId(string ianaId, char* windowsId, int windowsIdLength);
     }
 }
index d764bf8..ba4326d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class ZLib
     {
-        [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateInit2_")]
+        [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateInit2_")]
         internal static unsafe partial ZLibNative.ErrorCode DeflateInit2_(
             ZLibNative.ZStream* stream,
             ZLibNative.CompressionLevel level,
@@ -17,28 +17,28 @@ internal static partial class Interop
             int memLevel,
             ZLibNative.CompressionStrategy strategy);
 
-        [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Deflate")]
+        [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Deflate")]
         internal static unsafe partial ZLibNative.ErrorCode Deflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush);
 
-        [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateReset")]
+        [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateReset")]
         internal static unsafe partial ZLibNative.ErrorCode DeflateReset(ZLibNative.ZStream* stream);
 
-        [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateEnd")]
+        [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateEnd")]
         internal static unsafe partial ZLibNative.ErrorCode DeflateEnd(ZLibNative.ZStream* stream);
 
-        [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateInit2_")]
+        [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateInit2_")]
         internal static unsafe partial ZLibNative.ErrorCode InflateInit2_(ZLibNative.ZStream* stream, int windowBits);
 
-        [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Inflate")]
+        [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Inflate")]
         internal static unsafe partial ZLibNative.ErrorCode Inflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush);
 
-        [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateReset")]
+        [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateReset")]
         internal static unsafe partial ZLibNative.ErrorCode InflateReset(ZLibNative.ZStream* stream);
 
-        [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateEnd")]
+        [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateEnd")]
         internal static unsafe partial ZLibNative.ErrorCode InflateEnd(ZLibNative.ZStream* stream);
 
-        [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Crc32")]
+        [LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Crc32")]
         internal static unsafe partial uint crc32(uint crc, byte* buffer, int len);
     }
 }
index 32ce0da..20c2f5b 100644 (file)
@@ -12,13 +12,13 @@ internal static partial class Interop
     {
         public const int ber_default_successful_return_code = 0;
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_alloc_t")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_alloc_t")]
         public static partial IntPtr ber_alloc(int option);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_init")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_init")]
         public static partial IntPtr ber_init(BerVal value);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_free")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_free")]
         public static partial IntPtr ber_free(IntPtr berelement, int option);
 
         public static int ber_printf_emptyarg(SafeBerHandle berElement, string format, nuint tag)
@@ -46,19 +46,19 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_start_seq")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_start_seq")]
         public static partial int ber_start_seq(SafeBerHandle berElement, nuint tag);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_start_set")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_start_set")]
         public static partial int ber_start_set(SafeBerHandle berElement, nuint tag);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_seq")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_seq")]
         public static partial int ber_put_seq(SafeBerHandle berElement, nuint tag);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_set")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_set")]
         public static partial int ber_put_set(SafeBerHandle berElement, nuint tag);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_null")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_null")]
         public static partial int ber_put_null(SafeBerHandle berElement, nuint tag);
 
         public static int ber_printf_int(SafeBerHandle berElement, string format, int value, nuint tag)
@@ -78,13 +78,13 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_int")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_int")]
         public static partial int ber_put_int(SafeBerHandle berElement, int value, nuint tag);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_enum")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_enum")]
         public static partial int ber_put_enum(SafeBerHandle berElement, int value, nuint tag);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_boolean")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_boolean")]
         public static partial int ber_put_boolean(SafeBerHandle berElement, int value, nuint tag);
 
         public static int ber_printf_bytearray(SafeBerHandle berElement, string format, HGlobalMemHandle value, nuint length, nuint tag)
@@ -104,22 +104,22 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_ostring")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_ostring")]
         private static partial int ber_put_ostring(SafeBerHandle berElement, HGlobalMemHandle value, nuint length, nuint tag);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_string")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_string")]
         private static partial int ber_put_string(SafeBerHandle berElement, HGlobalMemHandle value, nuint tag);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_put_bitstring")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_put_bitstring")]
         private static partial int ber_put_bitstring(SafeBerHandle berElement, HGlobalMemHandle value, nuint length, nuint tag);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_flatten")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_flatten")]
         public static partial int ber_flatten(SafeBerHandle berElement, ref IntPtr value);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_bvfree")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_bvfree")]
         public static partial int ber_bvfree(IntPtr value);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_bvecfree")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_bvecfree")]
         public static partial int ber_bvecfree(IntPtr value);
 
         public static int ber_scanf_emptyarg(SafeBerHandle berElement, string format)
@@ -141,10 +141,10 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_skip_tag")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_skip_tag")]
         private static partial int ber_skip_tag(SafeBerHandle berElement, ref nuint len);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_null")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_null")]
         private static partial int ber_get_null(SafeBerHandle berElement);
 
         public static int ber_scanf_int(SafeBerHandle berElement, string format, ref int value)
@@ -164,13 +164,13 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_int")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_int")]
         private static partial int ber_get_int(SafeBerHandle berElement, ref int value);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_enum")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_enum")]
         private static partial int ber_get_enum(SafeBerHandle berElement, ref int value);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_boolean")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_boolean")]
         private static partial int ber_get_boolean(SafeBerHandle berElement, ref int value);
 
         public static int ber_scanf_bitstring(SafeBerHandle berElement, string format, ref IntPtr value, ref uint bitLength)
@@ -182,7 +182,7 @@ internal static partial class Interop
             return res;
         }
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_stringb")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_stringb")]
         private static partial int ber_get_stringb(SafeBerHandle berElement, ref IntPtr value, ref nuint bitLength);
 
         public static int ber_scanf_ptr(SafeBerHandle berElement, string format, ref IntPtr value)
@@ -191,7 +191,7 @@ internal static partial class Interop
             return ber_get_stringal(berElement, ref value);
         }
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ber_get_stringal")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ber_get_stringal")]
         private static partial int ber_get_stringal(SafeBerHandle berElement, ref IntPtr value);
 
         public static int ber_printf_berarray(SafeBerHandle berElement, string format, IntPtr value, nuint tag)
index 74f423f..faf4378 100644 (file)
@@ -76,43 +76,43 @@ internal static partial class Interop
             ldap_get_option_int(IntPtr.Zero, LdapOption.LDAP_OPT_DEBUG_LEVEL, ref unused);
         }
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_initialize", SetLastError = true)]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_initialize", SetLastError = true)]
         public static partial int ldap_initialize(out IntPtr ld,  [MarshalAs(UnmanagedType.LPUTF8Str)] string uri);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_unbind_ext_s")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_unbind_ext_s")]
         public static partial int ldap_unbind_ext_s(IntPtr ld, ref IntPtr serverctrls, ref IntPtr clientctrls);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_dn")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_dn")]
         public static partial IntPtr ldap_get_dn(ConnectionHandle ldapHandle, IntPtr result);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
         public static partial int ldap_get_option_bool(ConnectionHandle ldapHandle, LdapOption option, [MarshalAs(UnmanagedType.Bool)] ref bool outValue);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
         public static unsafe partial int ldap_get_option_secInfo(ConnectionHandle ldapHandle, LdapOption option, void* outValue);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
         public static partial int ldap_get_option_sechandle(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
         private static partial int ldap_get_option_int(IntPtr ldapHandle, LdapOption option, ref int outValue);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
         public static partial int ldap_get_option_int(ConnectionHandle ldapHandle, LdapOption option, ref int outValue);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_option")]
         public static partial int ldap_get_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr outValue);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_get_values_len")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_get_values_len")]
         public static partial IntPtr ldap_get_values_len(ConnectionHandle ldapHandle, IntPtr result, [MarshalAs(UnmanagedType.LPUTF8Str)] string name);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_result", SetLastError = true)]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_result", SetLastError = true)]
         public static partial int ldap_result(ConnectionHandle ldapHandle, int messageId, int all, in LDAP_TIMEVAL timeout, ref IntPtr Mesage);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_result2error")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_result2error")]
         public static partial int ldap_result2error(ConnectionHandle ldapHandle, IntPtr result, int freeIt);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_search_ext")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_search_ext")]
         public static partial int ldap_search(
             ConnectionHandle ldapHandle,
             [MarshalAs(UnmanagedType.LPUTF8Str)] string dn,
@@ -126,44 +126,44 @@ internal static partial class Interop
             int sizelimit,
             ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option", SetLastError = true)]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option", SetLastError = true)]
         public static partial int ldap_set_option_bool(ConnectionHandle ld, LdapOption option, [MarshalAs(UnmanagedType.Bool)] bool value);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
         public static partial int ldap_set_option_clientcert(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
         public static partial int ldap_set_option_servercert(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option", SetLastError = true)]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option", SetLastError = true)]
         public static partial int ldap_set_option_int(ConnectionHandle ld, LdapOption option, ref int inValue);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
         public static partial int ldap_set_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
         public static partial int ldap_set_option_string(ConnectionHandle ldapHandle, LdapOption option, [MarshalAs(UnmanagedType.LPUTF8Str)] string inValue);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_set_option")]
         public static partial int ldap_set_option_referral(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue);
 
         // Note that ldap_start_tls_s has a different signature across Windows LDAP and OpenLDAP
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_start_tls_s")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_start_tls_s")]
         public static partial int ldap_start_tls(ConnectionHandle ldapHandle, IntPtr serverControls, IntPtr clientControls);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_result")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_result")]
         public static partial int ldap_parse_result(ConnectionHandle ldapHandle, IntPtr result, ref int serverError, ref IntPtr dn, ref IntPtr message, ref IntPtr referral, ref IntPtr control, byte freeIt);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_result")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_result")]
         public static partial int ldap_parse_result_referral(ConnectionHandle ldapHandle, IntPtr result, IntPtr serverError, IntPtr dn, IntPtr message, ref IntPtr referral, IntPtr control, byte freeIt);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_extended_result")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_extended_result")]
         public static partial int ldap_parse_extended_result(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr oid, ref IntPtr data, byte freeIt);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_reference")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_parse_reference")]
         public static partial int ldap_parse_reference(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr referrals, IntPtr ServerControls, byte freeIt);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_sasl_bind_s")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_sasl_bind_s")]
         internal static partial int ldap_sasl_bind(
             ConnectionHandle ld,
             [MarshalAs(UnmanagedType.LPUTF8Str)] string dn,
@@ -173,7 +173,7 @@ internal static partial class Interop
             IntPtr clientctrls,
             IntPtr servercredp);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_sasl_interactive_bind_s")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_sasl_interactive_bind_s")]
         internal static partial int ldap_sasl_interactive_bind(
             ConnectionHandle ld,
             [MarshalAs(UnmanagedType.LPUTF8Str)] string dn,
@@ -184,64 +184,64 @@ internal static partial class Interop
             LDAP_SASL_INTERACT_PROC proc,
             IntPtr defaults);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_err2string")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_err2string")]
         public static partial IntPtr ldap_err2string(int err);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_extended_operation")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_extended_operation")]
         public static partial int ldap_extended_operation(ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string oid, BerVal data, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_first_attribute")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_first_attribute")]
         public static partial IntPtr ldap_first_attribute(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr address);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_first_entry")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_first_entry")]
         public static partial IntPtr ldap_first_entry(ConnectionHandle ldapHandle, IntPtr result);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_first_reference")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_first_reference")]
         public static partial IntPtr ldap_first_reference(ConnectionHandle ldapHandle, IntPtr result);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_create_sort_control")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_create_sort_control")]
         public static partial int ldap_create_sort_control(ConnectionHandle handle, IntPtr keys, byte critical, ref IntPtr control);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_control_free")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_control_free")]
         public static partial int ldap_control_free(IntPtr control);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_controls_free")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_controls_free")]
         public static partial int ldap_controls_free(IntPtr value);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_value_free")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_value_free")]
         public static partial int ldap_value_free(IntPtr value);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_value_free_len")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_value_free_len")]
         public static partial IntPtr ldap_value_free_len(IntPtr berelement);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_memfree")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_memfree")]
         public static partial void ldap_memfree(IntPtr value);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_msgfree")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_msgfree")]
         public static partial void ldap_msgfree(IntPtr value);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_modify_ext")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_modify_ext")]
         public static partial int ldap_modify(ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_next_attribute")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_next_attribute")]
         public static partial IntPtr ldap_next_attribute(ConnectionHandle ldapHandle, IntPtr result, IntPtr address);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_next_entry")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_next_entry")]
         public static partial IntPtr ldap_next_entry(ConnectionHandle ldapHandle, IntPtr result);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_next_reference")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_next_reference")]
         public static partial IntPtr ldap_next_reference(ConnectionHandle ldapHandle, IntPtr result);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_abandon")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_abandon")]
         public static partial int ldap_abandon(ConnectionHandle ldapHandle, int messagId);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_add_ext")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_add_ext")]
         public static partial int ldap_add(ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_delete_ext")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_delete_ext")]
         public static partial int ldap_delete_ext(ConnectionHandle ldapHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string dn, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_rename")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_rename")]
         public static partial int ldap_rename(
             ConnectionHandle ldapHandle,
             [MarshalAs(UnmanagedType.LPUTF8Str)] string dn,
@@ -252,7 +252,7 @@ internal static partial class Interop
             IntPtr clientcontrol,
             ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.OpenLdap, EntryPoint = "ldap_compare_ext")]
+        [LibraryImport(Libraries.OpenLdap, EntryPoint = "ldap_compare_ext")]
         public static partial int ldap_compare(
             ConnectionHandle ldapHandle,
             [MarshalAs(UnmanagedType.LPUTF8Str)] string dn,
index 8f0936b..446bdb4 100644 (file)
@@ -10,13 +10,13 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyInit", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyInit", SetLastError = true)]
         internal static partial SafeFileHandle INotifyInit();
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyAddWatch", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyAddWatch", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int INotifyAddWatch(SafeFileHandle fd, string pathName, uint mask);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyRemoveWatch", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_INotifyRemoveWatch", SetLastError = true)]
         private static partial int INotifyRemoveWatch_private(SafeFileHandle fd, int wd);
 
         internal static int INotifyRemoveWatch(SafeFileHandle fd, int wd)
index aeba90d..cb91cde 100644 (file)
@@ -13,12 +13,12 @@ internal static partial class Interop
 {
     internal static partial class CoreFoundation
     {
-        [GeneratedDllImport(Libraries.CoreFoundationLibrary, EntryPoint = "CFArrayGetCount")]
+        [LibraryImport(Libraries.CoreFoundationLibrary, EntryPoint = "CFArrayGetCount")]
         private static partial CFIndex _CFArrayGetCount(SafeCFArrayHandle cfArray);
 
         // Follows the "Get" version of the "Create" rule, so needs to return an IntPtr to
         // prevent CFRelease from being called on the SafeHandle close.
-        [GeneratedDllImport(Libraries.CoreFoundationLibrary, EntryPoint = "CFArrayGetValueAtIndex")]
+        [LibraryImport(Libraries.CoreFoundationLibrary, EntryPoint = "CFArrayGetValueAtIndex")]
         private static partial IntPtr CFArrayGetValueAtIndex(SafeCFArrayHandle cfArray, CFIndex index);
 
         internal static long CFArrayGetCount(SafeCFArrayHandle cfArray)
index f0775d7..482686b 100644 (file)
@@ -13,10 +13,10 @@ internal static partial class Interop
 {
     internal static partial class CoreFoundation
     {
-        [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Libraries.CoreFoundationLibrary)]
         private static unsafe partial byte* CFDataGetBytePtr(SafeCFDataHandle cfData);
 
-        [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Libraries.CoreFoundationLibrary)]
         private static partial CFIndex CFDataGetLength(SafeCFDataHandle cfData);
 
         internal static unsafe Span<byte> CFDataDangerousGetSpan(SafeCFDataHandle cfData)
index e43e20d..b1100a0 100644 (file)
@@ -17,7 +17,7 @@ internal static partial class Interop
         // https://developer.apple.com/reference/corefoundation/cfabsolutetime
         private static readonly DateTime s_cfDateEpoch = new DateTime(2001, 1, 1, 0, 0, 0, DateTimeKind.Utc);
 
-        [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Libraries.CoreFoundationLibrary)]
         private static partial SafeCFDateHandle CFDateCreate(IntPtr zero, CFAbsoluteTime at);
 
         internal static SafeCFDateHandle CFDateCreate(DateTime date)
index 466bd58..e8a319e 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class CoreFoundation
     {
-        [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Libraries.CoreFoundationLibrary)]
         internal static partial IntPtr CFDictionaryGetValue(SafeCFDictionaryHandle handle, IntPtr key);
     }
 }
index 056628a..2e83d9d 100644 (file)
@@ -14,10 +14,10 @@ internal static partial class Interop
 {
     internal static partial class CoreFoundation
     {
-        [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Libraries.CoreFoundationLibrary)]
         private static partial CFIndex CFErrorGetCode(SafeCFErrorHandle cfError);
 
-        [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Libraries.CoreFoundationLibrary)]
         private static partial SafeCFStringHandle CFErrorCopyDescription(SafeCFErrorHandle cfError);
 
         internal static int GetErrorCode(SafeCFErrorHandle cfError)
index 631aa86..22d51bd 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
             kCFNumberIntType = 9,
         }
 
-        [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Libraries.CoreFoundationLibrary)]
         private static unsafe partial int CFNumberGetValue(IntPtr handle, CFNumberType type, int* value);
     }
 }
index f315041..1c0c8eb 100644 (file)
@@ -13,22 +13,22 @@ internal static partial class Interop
 {
     internal static partial class CoreFoundation
     {
-        [GeneratedDllImport(Libraries.CFNetworkLibrary)]
+        [LibraryImport(Libraries.CFNetworkLibrary)]
         internal static partial SafeCFDictionaryHandle CFNetworkCopySystemProxySettings();
 
-        [GeneratedDllImport(Libraries.CFNetworkLibrary)]
+        [LibraryImport(Libraries.CFNetworkLibrary)]
         internal static partial SafeCFArrayHandle CFNetworkCopyProxiesForURL(SafeCreateHandle url, SafeCFDictionaryHandle proxySettings);
 
         internal delegate void CFProxyAutoConfigurationResultCallback(IntPtr client, IntPtr proxyList, IntPtr error);
 
-        [GeneratedDllImport(Libraries.CFNetworkLibrary)]
+        [LibraryImport(Libraries.CFNetworkLibrary)]
         internal static partial CFRunLoopSourceRef CFNetworkExecuteProxyAutoConfigurationURL(
             IntPtr proxyAutoConfigURL,
             SafeCreateHandle targetURL,
             CFProxyAutoConfigurationResultCallback cb,
             ref CFStreamClientContext clientContext);
 
-        [GeneratedDllImport(Libraries.CFNetworkLibrary)]
+        [LibraryImport(Libraries.CFNetworkLibrary)]
         internal static partial CFRunLoopSourceRef CFNetworkExecuteProxyAutoConfigurationScript(
             IntPtr proxyAutoConfigurationScript,
             SafeCreateHandle targetURL,
index 1527416..5350aaa 100644 (file)
@@ -15,12 +15,12 @@ internal static partial class Interop
         /// Returns the interior pointer of the cfString if it has the specified encoding.
         /// If it has the wrong encoding, or if the interior pointer isn't being shared for some reason, returns NULL
         /// </summary>
-        [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Libraries.CoreFoundationLibrary)]
         private static partial IntPtr CFStringGetCStringPtr(
             SafeCFStringHandle cfString,
             CFStringBuiltInEncodings encoding);
 
-        [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Libraries.CoreFoundationLibrary)]
         private static partial SafeCFDataHandle CFStringCreateExternalRepresentation(
             IntPtr alloc,
             SafeCFStringHandle theString,
index 9663244..390799c 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class CoreFoundation
     {
-        [GeneratedDllImport(Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Libraries.CoreFoundationLibrary)]
         private static partial SafeCreateHandle CFURLCreateWithString(
             IntPtr allocator,
             SafeCreateHandle str,
index ea555a8..efd8c3c 100644 (file)
@@ -47,7 +47,7 @@ internal static partial class Interop
         /// <param name="encoding">The encoding type.</param>
         /// <param name="isExternalRepresentation">Whether or not a BOM is present.</param>
         /// <returns>A CFStringRef on success, otherwise a SafeCreateHandle(IntPtr.Zero).</returns>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
         private static partial SafeCreateHandle CFStringCreateWithBytes(
             IntPtr alloc,
             IntPtr bytes,
@@ -63,7 +63,7 @@ internal static partial class Interop
         /// <param name="encoding">The encoding of the str variable. This should be UTF 8 for OS X</param>
         /// <returns>Returns a pointer to a CFString on success; otherwise, returns IntPtr.Zero</returns>
         /// <remarks>For *nix systems, the CLR maps ANSI to UTF-8, so be explicit about that</remarks>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)]
         private static partial SafeCreateHandle CFStringCreateWithCString(
             IntPtr allocator,
             string str,
@@ -77,7 +77,7 @@ internal static partial class Interop
         /// <param name="encoding">The encoding of the str variable. This should be UTF 8 for OS X</param>
         /// <returns>Returns a pointer to a CFString on success; otherwise, returns IntPtr.Zero</returns>
         /// <remarks>For *nix systems, the CLR maps ANSI to UTF-8, so be explicit about that</remarks>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)]
         private static partial SafeCreateHandle CFStringCreateWithCString(
             IntPtr allocator,
             IntPtr str,
@@ -130,7 +130,7 @@ internal static partial class Interop
         /// <param name="numValues">The number of values in the array</param>
         /// <param name="callbacks">Should be IntPtr.Zero</param>
         /// <returns>Returns a pointer to a CFArray on success; otherwise, returns IntPtr.Zero</returns>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
         private static unsafe partial SafeCreateHandle CFArrayCreate(
             IntPtr allocator,
             IntPtr* values,
@@ -171,14 +171,14 @@ internal static partial class Interop
         /// </summary>
         /// <param name="ptr">The CFType object to retain. This value must not be NULL</param>
         /// <returns>The input value</returns>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
         internal static partial IntPtr CFRetain(IntPtr ptr);
 
         /// <summary>
         /// Decrements the reference count on the specified object and, if the ref count hits 0, cleans up the object.
         /// </summary>
         /// <param name="ptr">The pointer on which to decrement the reference count.</param>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
         internal static partial void CFRelease(IntPtr ptr);
     }
 }
index 2edb5c4..96fbdea 100644 (file)
@@ -99,7 +99,7 @@ internal static partial class Interop
         /// <param name="flags">Flags to say what kind of events should be sent through this stream.</param>
         /// <returns>On success, returns a pointer to an FSEventStream object; otherwise, returns IntPtr.Zero</returns>
         /// <remarks>For *nix systems, the CLR maps ANSI to UTF-8, so be explicit about that</remarks>
-        [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Interop.Libraries.CoreServicesLibrary, StringMarshalling = StringMarshalling.Utf8)]
         internal static unsafe partial SafeEventStreamHandle FSEventStreamCreate(
             IntPtr                      allocator,
             delegate* unmanaged<FSEventStreamRef, IntPtr, size_t, byte**, FSEventStreamEventFlags*, FSEventStreamEventId*, void> callback,
@@ -115,7 +115,7 @@ internal static partial class Interop
         /// <param name="streamRef">The stream to attach to the RunLoop</param>
         /// <param name="runLoop">The RunLoop to attach the stream to</param>
         /// <param name="runLoopMode">The mode of the RunLoop; this should usually be kCFRunLoopDefaultMode. See the documentation for RunLoops for more info.</param>
-        [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+        [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
         internal static partial void FSEventStreamScheduleWithRunLoop(
             SafeEventStreamHandle   streamRef,
             CFRunLoopRef            runLoop,
@@ -126,7 +126,7 @@ internal static partial class Interop
         /// </summary>
         /// <param name="streamRef">The stream to receive events on.</param>
         /// <returns>Returns true if the stream was started; otherwise, returns false and no events will be received.</returns>
-        [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+        [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool FSEventStreamStart(SafeEventStreamHandle streamRef);
 
@@ -134,14 +134,14 @@ internal static partial class Interop
         /// Stops receiving events on the specified stream. The stream can be restarted and not miss any events.
         /// </summary>
         /// <param name="streamRef">The stream to stop receiving events on.</param>
-        [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+        [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
         internal static partial void FSEventStreamStop(SafeEventStreamHandle streamRef);
 
         /// <summary>
         /// Stops receiving events on the specified stream. The stream can be restarted and not miss any events.
         /// </summary>
         /// <param name="streamRef">The stream to stop receiving events on.</param>
-        [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+        [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
         internal static partial void FSEventStreamStop(IntPtr streamRef);
 
         /// <summary>
@@ -149,7 +149,7 @@ internal static partial class Interop
         /// </summary>
         /// <param name="streamRef">The FSEventStream to invalidate</param>
         /// <remarks>This can only be called after FSEventStreamScheduleWithRunLoop has be called</remarks>
-        [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+        [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
         internal static partial void FSEventStreamInvalidate(IntPtr streamRef);
 
         /// <summary>
@@ -158,7 +158,7 @@ internal static partial class Interop
         /// <param name="streamRef">The stream to remove from the RunLoop</param>
         /// <param name="runLoop">The RunLoop to remove the stream from.</param>
         /// <param name="runLoopMode">The mode of the RunLoop; this should usually be kCFRunLoopDefaultMode. See the documentation for RunLoops for more info.</param>
-        [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+        [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
         internal static partial void FSEventStreamUnscheduleFromRunLoop(
             SafeEventStreamHandle   streamRef,
             CFRunLoopRef            runLoop,
@@ -168,7 +168,7 @@ internal static partial class Interop
         /// Releases a reference count on the specified EventStream and, if necessary, cleans the stream up.
         /// </summary>
         /// <param name="streamRef">The stream on which to decrement the reference count.</param>
-        [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)]
+        [LibraryImport(Interop.Libraries.CoreServicesLibrary)]
         internal static partial void FSEventStreamRelease(IntPtr streamRef);
     }
 }
index ac88129..d27539e 100644 (file)
@@ -30,21 +30,21 @@ internal static partial class Interop
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
         internal static extern void CFRunLoopRun();
 #else
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
         internal static partial void CFRunLoopRun();
 #endif
 
         /// <summary>
         /// Runs the current thread's CFRunLoop object in a particular mode.
         /// </summary>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
         internal static partial int CFRunLoopRunInMode(CFStringRef mode, double seconds, int returnAfterSourceHandled);
 
         /// <summary>
         /// Notifies a RunLoop to stop and return control to the execution context that called CFRunLoopRun
         /// </summary>
         /// <param name="rl">The RunLoop to notify to stop</param>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
         internal static partial void CFRunLoopStop(CFRunLoopRef rl);
 
         /// <summary>
@@ -52,7 +52,7 @@ internal static partial class Interop
         /// Follows the "Get Rule" where you do not own the object unless you CFRetain it; in which case, you must also CFRelease it as well.
         /// </summary>
         /// <returns>Returns a pointer to a CFRunLoop on success; otherwise, returns IntPtr.Zero</returns>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
         internal static partial CFRunLoopRef CFRunLoopGetCurrent();
 
         /// <summary>
@@ -61,7 +61,7 @@ internal static partial class Interop
         /// <param name="rl">The run loop to modify.</param>
         /// <param name="source">The run loop source to add. The source is retained by the run loop.</param>
         /// <param name="mode">The run loop mode to which to add source.</param>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
         internal static partial void CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
 
         /// <summary>
@@ -70,14 +70,14 @@ internal static partial class Interop
         /// <param name="rl">The run loop to modify.</param>
         /// <param name="source">The run loop source to remove.</param>
         /// <param name="mode">The run loop mode of rl from which to remove source.</param>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
         internal static partial void CFRunLoopRemoveSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode);
 
         /// <summary>
         /// Invalidates a CFRunLoopSource object, stopping it from ever firing again.
         /// </summary>
         /// <param name="source">The run loop source to invalidate.</param>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
         internal static partial void CFRunLoopSourceInvalidate(CFRunLoopSourceRef source);
 
         /// <summary>
@@ -88,7 +88,7 @@ internal static partial class Interop
         /// waiting for a source or timer to become ready to fire;
         /// false if rl either is not running or is currently processing
         /// a source, timer, or observer.</returns>
-        [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)]
+        [LibraryImport(Interop.Libraries.CoreFoundationLibrary)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CFRunLoopIsWaiting(CFRunLoopRef rl);
     }
index 594666d..693d58b 100644 (file)
@@ -34,7 +34,7 @@ internal static partial class Interop
         /// Pass null if no callouts are desired.</param>
         /// <param name="context">The context associated with the callout.</param>
         /// <returns>A reference to the new dynamic store session.</returns>
-        [GeneratedDllImport(Libraries.SystemConfigurationLibrary)]
+        [LibraryImport(Libraries.SystemConfigurationLibrary)]
         private static unsafe partial SafeCreateHandle SCDynamicStoreCreate(
             IntPtr allocator,
             CFStringRef name,
@@ -67,7 +67,7 @@ internal static partial class Interop
         /// <param name="serviceID">The service ID or a regular expression pattern.</param>
         /// <param name="entity">The specific global entity, such as IPv4 or DNS.</param>
         /// <returns>A string containing the formatted key.</returns>
-        [GeneratedDllImport(Libraries.SystemConfigurationLibrary)]
+        [LibraryImport(Libraries.SystemConfigurationLibrary)]
         private static partial SafeCreateHandle SCDynamicStoreKeyCreateNetworkServiceEntity(
             IntPtr allocator,
             CFStringRef domain,
@@ -99,7 +99,7 @@ internal static partial class Interop
         /// <param name="order">The order in which the sources that are ready to be processed are handled,
         /// on platforms that support it and for source versions that support it.</param>
         /// <returns>The new run loop source object.</returns>
-        [GeneratedDllImport(Libraries.SystemConfigurationLibrary)]
+        [LibraryImport(Libraries.SystemConfigurationLibrary)]
         private static partial SafeCreateHandle SCDynamicStoreCreateRunLoopSource(
             IntPtr allocator,
             SCDynamicStoreRef store,
@@ -126,7 +126,7 @@ internal static partial class Interop
         /// <param name="patterns">An array of POSIX regex pattern strings used to match keys to be monitored,
         /// or IntPtr.Zero if no key patterns are to be monitored.</param>
         /// <returns>Non-zero if the set of notification keys and patterns was successfully updated; zero otherwise.</returns>
-        [GeneratedDllImport(Libraries.SystemConfigurationLibrary)]
+        [LibraryImport(Libraries.SystemConfigurationLibrary)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SCDynamicStoreSetNotificationKeys(SCDynamicStoreRef store, CFArrayRef keys, CFArrayRef patterns);
     }
index 5e9f0e9..9b65332 100644 (file)
@@ -23,7 +23,7 @@ internal static partial class Interop
             public const uint ATTR_CMN_CRTIME = 0x00000200;
         }
 
-        [GeneratedDllImport(Libraries.libc, EntryPoint = "setattrlist", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.libc, EntryPoint = "setattrlist", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static unsafe partial int setattrlist(string path, AttrList* attrList, void* attrBuf, nint attrBufSize, CULong options);
 
         internal const uint FSOPT_NOFOLLOW = 0x00000001;
index 6dbd15a..7274cb5 100644 (file)
@@ -16,11 +16,11 @@ internal static partial class Interop
             public nint patchVersion;
         }
 
-        [GeneratedDllImport(Libraries.libobjc, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.libobjc, StringMarshalling = StringMarshalling.Utf8)]
         private static partial IntPtr objc_getClass(string className);
-        [GeneratedDllImport(Libraries.libobjc, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.libobjc, StringMarshalling = StringMarshalling.Utf8)]
         private static partial IntPtr sel_getUid(string selector);
-        [GeneratedDllImport(Libraries.libobjc, EntryPoint = "objc_msgSend")]
+        [LibraryImport(Libraries.libobjc, EntryPoint = "objc_msgSend")]
         private static partial IntPtr intptr_objc_msgSend(IntPtr basePtr, IntPtr selector);
 
         internal static Version GetOperatingSystemVersion()
@@ -58,10 +58,10 @@ internal static partial class Interop
             return new Version(major, minor, patch);
         }
 
-        [GeneratedDllImport(Libraries.libobjc, EntryPoint = "objc_msgSend")]
+        [LibraryImport(Libraries.libobjc, EntryPoint = "objc_msgSend")]
         private static partial NSOperatingSystemVersion NSOperatingSystemVersion_objc_msgSend(IntPtr basePtr, IntPtr selector);
 
-        [GeneratedDllImport(Libraries.libobjc, EntryPoint = "objc_msgSend_stret")]
+        [LibraryImport(Libraries.libobjc, EntryPoint = "objc_msgSend_stret")]
         private static partial void NSOperatingSystemVersion_objc_msgSend_stret(out NSOperatingSystemVersion osVersion, IntPtr basePtr, IntPtr selector);
     }
 }
index ccac9c9..f337eb4 100644 (file)
@@ -89,7 +89,7 @@ internal static partial class Interop
         /// the data is valid. If the sizes do not match then the data is invalid, most likely due
         /// to not having enough permissions to query for the data of that specific process
         /// </returns>
-        [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
         private static unsafe partial int proc_pidinfo(
             int pid,
             int flavor,
index 929eb9a..dbb7fcc 100644 (file)
@@ -110,7 +110,7 @@ internal static partial class Interop
         /// <param name="pBuffer">A pointer to the memory block where the PID array will start</param>
         /// <param name="buffersize">The length of the block of memory allocated for the PID array</param>
         /// <returns>Returns the number of elements (PIDs) in the buffer</returns>
-        [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
         private static unsafe partial int proc_listallpids(
             int*    pBuffer,
             int     buffersize);
@@ -176,7 +176,7 @@ internal static partial class Interop
         /// the data is valid. If the sizes do not match then the data is invalid, most likely due
         /// to not having enough permissions to query for the data of that specific process
         /// </returns>
-        [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
         private static unsafe partial int proc_pidinfo(
             int pid,
             int flavor,
@@ -197,7 +197,7 @@ internal static partial class Interop
         /// the data is valid. If the sizes do not match then the data is invalid, most likely due
         /// to not having enough permissions to query for the data of that specific process
         /// </returns>
-        [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
         private static unsafe partial int proc_pidinfo(
             int pid,
             int flavor,
@@ -218,7 +218,7 @@ internal static partial class Interop
         /// the data is valid. If the sizes do not match then the data is invalid, most likely due
         /// to not having enough permissions to query for the data of that specific process
         /// </returns>
-        [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
         private static unsafe partial int proc_pidinfo(
             int pid,
             int flavor,
@@ -317,7 +317,7 @@ internal static partial class Interop
         /// <param name="buffer">A pointer to an allocated block of memory that will be filled with the process path</param>
         /// <param name="bufferSize">The size of the buffer, should be PROC_PIDPATHINFO_MAXSIZE</param>
         /// <returns>Returns the length of the path returned on success</returns>
-        [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
         private static unsafe partial int proc_pidpath(
             int pid,
             byte* buffer,
@@ -356,7 +356,7 @@ internal static partial class Interop
         /// <param name="flavor">Specifies the type of struct that is passed in to <paramref>buffer</paramref>. Should be RUSAGE_INFO_V3 to specify a rusage_info_v3 struct.</param>
         /// <param name="buffer">A buffer to be filled with rusage_info data</param>
         /// <returns>Returns 0 on success; on fail, -1 and errno is set with the error code</returns>
-        [GeneratedDllImport(Interop.Libraries.libproc, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.libproc, SetLastError = true)]
         private static unsafe partial int proc_pid_rusage(
             int pid,
             int flavor,
index c0e78cb..68cf5d6 100644 (file)
@@ -10,10 +10,10 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateAutoreleasePool")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateAutoreleasePool")]
         internal static partial IntPtr CreateAutoreleasePool();
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_DrainAutoreleasePool")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_DrainAutoreleasePool")]
         internal static partial void DrainAutoreleasePool(IntPtr ptr);
     }
 }
index 580111c..89681a6 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SearchPath", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SearchPath", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial string? SearchPath(NSSearchPathDirectory folderId);
 
         internal enum NSSearchPathDirectory
index f4afa27..9a7cb5b 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SearchPath_TempDirectory", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SearchPath_TempDirectory", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial string SearchPathTempDirectory();
     }
 }
index d429c27..6624fb1 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_iOSSupportVersion", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_iOSSupportVersion", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial string iOSSupportVersion();
     }
 }
index 5834de1..5798d5e 100644 (file)
@@ -9,34 +9,34 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFree")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFree")]
         internal static partial void DigestFree(IntPtr handle);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCreate")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCreate")]
         internal static partial SafeDigestCtxHandle DigestCreate(PAL_HashAlgorithm algorithm, out int cbDigest);
 
         internal static int DigestUpdate(SafeDigestCtxHandle ctx, ReadOnlySpan<byte> data) =>
             DigestUpdate(ctx, ref MemoryMarshal.GetReference(data), data.Length);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestUpdate")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestUpdate")]
         private static partial int DigestUpdate(SafeDigestCtxHandle ctx, ref byte pbData, int cbData);
 
         internal static int DigestFinal(SafeDigestCtxHandle ctx, Span<byte> output) =>
             DigestFinal(ctx, ref MemoryMarshal.GetReference(output), output.Length);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFinal")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFinal")]
         private static partial int DigestFinal(SafeDigestCtxHandle ctx, ref byte pbOutput, int cbOutput);
 
         internal static int DigestCurrent(SafeDigestCtxHandle ctx, Span<byte> output) =>
             DigestCurrent(ctx, ref MemoryMarshal.GetReference(output), output.Length);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCurrent")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCurrent")]
         private static partial int DigestCurrent(SafeDigestCtxHandle ctx, ref byte pbOutput, int cbOutput);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestOneShot")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestOneShot")]
         internal static unsafe partial int DigestOneShot(PAL_HashAlgorithm algorithm, byte* pbData, int cbData, byte* pbOutput, int cbOutput, int* cbDigest);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestReset")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestReset")]
         internal static partial int DigestReset(SafeDigestCtxHandle ctx);
     }
 }
index d1a27c7..3676fd0 100644 (file)
@@ -11,14 +11,14 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_EccGenerateKey(
             int keySizeInBits,
             out SafeSecKeyRefHandle pPublicKey,
             out SafeSecKeyRefHandle pPrivateKey,
             out SafeCFErrorHandle pErrorOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_EccGetKeySizeInBits")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_EccGetKeySizeInBits")]
         internal static partial long EccGetKeySizeInBits(SafeSecKeyRefHandle publicKey);
 
         internal static void EccGenerateKey(
index 993d6d4..1f7a33b 100644 (file)
@@ -9,13 +9,13 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFree")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFree")]
         internal static partial void HmacFree(IntPtr handle);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCreate")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCreate")]
         internal static partial SafeHmacHandle HmacCreate(PAL_HashAlgorithm algorithm, ref int cbDigest);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacInit")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacInit")]
         private static unsafe partial int HmacInit(SafeHmacHandle ctx, byte* pbKey, int cbKey);
 
         internal static unsafe int HmacInit(SafeHmacHandle ctx, ReadOnlySpan<byte> key)
@@ -29,22 +29,22 @@ internal static partial class Interop
         internal static int HmacUpdate(SafeHmacHandle ctx, ReadOnlySpan<byte> data) =>
             HmacUpdate(ctx, ref MemoryMarshal.GetReference(data), data.Length);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacUpdate")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacUpdate")]
         private static partial int HmacUpdate(SafeHmacHandle ctx, ref byte pbData, int cbData);
 
         internal static int HmacFinal(SafeHmacHandle ctx, ReadOnlySpan<byte> output) =>
             HmacFinal(ctx, ref MemoryMarshal.GetReference(output), output.Length);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFinal")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFinal")]
         private static partial int HmacFinal(SafeHmacHandle ctx, ref byte pbOutput, int cbOutput);
 
         internal static int HmacCurrent(SafeHmacHandle ctx, ReadOnlySpan<byte> output) =>
             HmacCurrent(ctx, ref MemoryMarshal.GetReference(output), output.Length);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCurrent")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCurrent")]
         private static partial int HmacCurrent(SafeHmacHandle ctx, ref byte pbOutput, int cbOutput);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacOneShot")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacOneShot")]
         internal static unsafe partial int HmacOneShot(
             PAL_HashAlgorithm algorithm,
             byte* pKey,
index 703f72b..0623b5e 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_EcdhKeyAgree(
             SafeSecKeyRefHandle privateKey,
             SafeSecKeyRefHandle publicKey,
index 3122d1a..2c6a372 100644 (file)
@@ -15,19 +15,19 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SecKeychainEnumerateCerts(
             out SafeCFArrayHandle matches);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SecKeychainEnumerateIdentities(
             out SafeCFArrayHandle matches);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509StoreAddCertificate(
             SafeHandle certOrIdentity);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509StoreRemoveCertificate(
             SafeHandle certOrIdentity,
             [MarshalAs(UnmanagedType.Bool)] bool isReadOnlyMode);
index bdacabd..14cfbb9 100644 (file)
@@ -15,64 +15,64 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SecKeychainItemCopyKeychain(
             IntPtr item,
             out SafeKeychainHandle keychain);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SecKeychainCreate", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SecKeychainCreate", StringMarshalling = StringMarshalling.Utf8)]
         private static unsafe partial int AppleCryptoNative_SecKeychainCreateTemporary(
             string path,
             int utf8PassphraseLength,
             byte* utf8Passphrase,
             out SafeTemporaryKeychainHandle keychain);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)]
         private static partial int AppleCryptoNative_SecKeychainCreate(
             string path,
             int utf8PassphraseLength,
             byte[] utf8Passphrase,
             out SafeKeychainHandle keychain);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SecKeychainDelete(IntPtr keychain);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SecKeychainCopyDefault(out SafeKeychainHandle keychain);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)]
         private static partial int AppleCryptoNative_SecKeychainOpen(
             string keychainPath,
             out SafeKeychainHandle keychain);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SecKeychainUnlock(
             SafeKeychainHandle keychain,
             int utf8PassphraseLength,
             byte[] utf8Passphrase);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SetKeychainNeverLock(SafeKeychainHandle keychain);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SecKeychainEnumerateCerts(
             SafeKeychainHandle keychain,
             out SafeCFArrayHandle matches,
             out int pOSStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SecKeychainEnumerateIdentities(
             SafeKeychainHandle keychain,
             out SafeCFArrayHandle matches,
             out int pOSStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509StoreAddCertificate(
             SafeKeychainItemHandle cert,
             SafeKeychainHandle keychain,
             out int pOSStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509StoreRemoveCertificate(
             SafeKeychainItemHandle cert,
             SafeKeychainHandle keychain,
index dac63e6..fc78845 100644 (file)
@@ -48,7 +48,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static unsafe partial int AppleCryptoNative_Pbkdf2(
             PAL_HashAlgorithm prfAlgorithm,
             byte* password,
index e3c68be..3e27e01 100644 (file)
@@ -12,14 +12,14 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_RsaGenerateKey(
             int keySizeInBits,
             out SafeSecKeyRefHandle pPublicKey,
             out SafeSecKeyRefHandle pPrivateKey,
             out SafeCFErrorHandle pErrorOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_RsaSignaturePrimitive(
             SafeSecKeyRefHandle privateKey,
             ref byte pbData,
@@ -27,7 +27,7 @@ internal static partial class Interop
             out SafeCFDataHandle pDataOut,
             out SafeCFErrorHandle pErrorOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_RsaVerificationPrimitive(
             SafeSecKeyRefHandle publicKey,
             ref byte pbData,
@@ -35,7 +35,7 @@ internal static partial class Interop
             out SafeCFDataHandle pDataOut,
             out SafeCFErrorHandle pErrorOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_RsaEncryptionPrimitive(
             SafeSecKeyRefHandle publicKey,
             ref byte pbData,
@@ -52,7 +52,7 @@ internal static partial class Interop
             out SafeCFErrorHandle pErrorOut) =>
             RsaEncryptOaep(publicKey, ref MemoryMarshal.GetReference(pbData), cbData, mgfAlgorithm, out pEncryptedOut, out pErrorOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaEncryptOaep")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaEncryptOaep")]
         private static partial int RsaEncryptOaep(
             SafeSecKeyRefHandle publicKey,
             ref byte pbData,
@@ -69,7 +69,7 @@ internal static partial class Interop
             out SafeCFErrorHandle pErrorOut) =>
             RsaEncryptPkcs(publicKey, ref MemoryMarshal.GetReference(pbData), cbData, out pEncryptedOut, out pErrorOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaEncryptPkcs")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaEncryptPkcs")]
         private static partial int RsaEncryptPkcs(
             SafeSecKeyRefHandle publicKey,
             ref byte pbData,
@@ -86,7 +86,7 @@ internal static partial class Interop
             out SafeCFErrorHandle pErrorOut) =>
             RsaDecryptOaep(publicKey, ref MemoryMarshal.GetReference(pbData), cbData, mgfAlgorithm, out pEncryptedOut, out pErrorOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaDecryptOaep")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaDecryptOaep")]
         private static partial int RsaDecryptOaep(
             SafeSecKeyRefHandle publicKey,
             ref byte pbData,
@@ -103,7 +103,7 @@ internal static partial class Interop
             out SafeCFErrorHandle pErrorOut) =>
             RsaDecryptPkcs(publicKey, ref MemoryMarshal.GetReference(pbData), cbData, out pEncryptedOut, out pErrorOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaDecryptPkcs")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_RsaDecryptPkcs")]
         private static partial int RsaDecryptPkcs(
             SafeSecKeyRefHandle publicKey,
             ref byte pbData,
index 2832aa3..93f1e8d 100644 (file)
@@ -27,7 +27,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static unsafe partial int AppleCryptoNative_GetRandomBytes(byte* buf, int num, int* errorCode);
     }
 }
index f353c50..8487457 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial SafeCFStringHandle AppleCryptoNative_SecCopyErrorMessageString(int osStatus);
 
         internal static string? GetSecErrorString(int osStatus)
index a37ecbf..ad5a345 100644 (file)
@@ -23,7 +23,7 @@ internal static partial class Interop
             RSA = 2,
         }
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial ulong AppleCryptoNative_SecKeyGetSimpleKeySizeInBytes(SafeSecKeyRefHandle publicKey);
 
         private delegate int SecKeyTransform(ReadOnlySpan<byte> source, out SafeCFDataHandle outputHandle, out SafeCFErrorHandle errorHandle);
@@ -154,7 +154,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static unsafe partial int AppleCryptoNative_SecKeyCreateWithData(
             byte* pKey,
             int cbKey,
@@ -163,13 +163,13 @@ internal static partial class Interop
             out SafeSecKeyRefHandle pDataKey,
             out SafeCFErrorHandle pErrorOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static unsafe partial int AppleCryptoNative_SecKeyCopyExternalRepresentation(
             SafeSecKeyRefHandle key,
             out SafeCFDataHandle pDataOut,
             out SafeCFErrorHandle pErrorOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SecKeyCopyPublicKey")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SecKeyCopyPublicKey")]
         internal static unsafe partial SafeSecKeyRefHandle CopyPublicKey(SafeSecKeyRefHandle privateKey);
     }
 }
index 789415a..b6c1aba 100644 (file)
@@ -26,7 +26,7 @@ internal static partial class Interop
                 out ppKeyOut,
                 out pOSStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SecKeyImportEphemeral(
             ref byte pbKeyBlob,
             int cbKeyBlob,
@@ -61,7 +61,7 @@ internal static partial class Interop
             throw new CryptographicException();
         }
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SecKeyExport(
             SafeSecKeyRefHandle? key,
             int exportPrivate,
index a612ce0..62df5c0 100644 (file)
@@ -47,7 +47,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static unsafe partial int AppleCryptoNative_SecKeyVerifySignature(
             SafeSecKeyRefHandle publicKey,
             byte* pbDataHash,
@@ -79,7 +79,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static unsafe partial int AppleCryptoNative_SecKeyCreateSignature(
             SafeSecKeyRefHandle privateKey,
             byte* pbDataHash,
index c1cdd4b..0433080 100644 (file)
@@ -58,110 +58,110 @@ internal static partial class Interop
             Renegotiate,
         }
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslCreateContext")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslCreateContext")]
         internal static partial System.Net.SafeSslHandle SslCreateContext(int isServer);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetConnection")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetConnection")]
         internal static partial int SslSetConnection(
             SafeSslHandle sslHandle,
             IntPtr sslConnection);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SslSetMinProtocolVersion(
             SafeSslHandle sslHandle,
             SslProtocols minProtocolId);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SslSetMaxProtocolVersion(
             SafeSslHandle sslHandle,
             SslProtocols maxProtocolId);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SslCopyCertChain(
             SafeSslHandle sslHandle,
             out SafeX509ChainHandle pTrustOut,
             out int pOSStatus);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SslCopyCADistinguishedNames(
             SafeSslHandle sslHandle,
             out SafeCFArrayHandle pArrayOut,
             out int pOSStatus);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SslSetBreakOnServerAuth(
             SafeSslHandle sslHandle,
             int setBreak,
             out int pOSStatus);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SslSetBreakOnClientAuth(
             SafeSslHandle sslHandle,
             int setBreak,
             out int pOSStatus);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SslSetBreakOnCertRequested(
             SafeSslHandle sslHandle,
             int setBreak,
             out int pOSStatus);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SslSetCertificate(
             SafeSslHandle sslHandle,
             SafeCreateHandle cfCertRefs);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, StringMarshalling = StringMarshalling.Utf8)]
         private static partial int AppleCryptoNative_SslSetTargetName(
             SafeSslHandle sslHandle,
             string targetName,
             int cbTargetName,
             out int osStatus);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SSLSetALPNProtocols")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SSLSetALPNProtocols")]
         internal static partial int SSLSetALPNProtocols(SafeSslHandle ctx, SafeCreateHandle cfProtocolsRefs, out int osStatus);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetAlpnSelected")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetAlpnSelected")]
         internal static partial int SslGetAlpnSelected(SafeSslHandle ssl, out SafeCFDataHandle protocol);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslHandshake")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslHandshake")]
         internal static partial PAL_TlsHandshakeState SslHandshake(SafeSslHandle sslHandle);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SslSetAcceptClientCert(SafeSslHandle sslHandle);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetIoCallbacks")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetIoCallbacks")]
         internal static unsafe partial int SslSetIoCallbacks(
             SafeSslHandle sslHandle,
             delegate* unmanaged<IntPtr, byte*, void**, int> readCallback,
             delegate* unmanaged<IntPtr, byte*, void**, int> writeCallback);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslWrite")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslWrite")]
         internal static unsafe partial PAL_TlsIo SslWrite(SafeSslHandle sslHandle, byte* writeFrom, int count, out int bytesWritten);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslRead")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslRead")]
         internal static unsafe partial PAL_TlsIo SslRead(SafeSslHandle sslHandle, byte* writeFrom, int count, out int bytesWritten);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_SslIsHostnameMatch(
             SafeSslHandle handle,
             SafeCreateHandle cfHostname,
             SafeCFDateHandle cfValidTime,
             out int pOSStatus);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslShutdown")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslShutdown")]
         internal static partial int SslShutdown(SafeSslHandle sslHandle);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetCipherSuite")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetCipherSuite")]
         internal static partial int SslGetCipherSuite(SafeSslHandle sslHandle, out TlsCipherSuite cipherSuite);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetProtocolVersion")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslGetProtocolVersion")]
         internal static partial int SslGetProtocolVersion(SafeSslHandle sslHandle, out SslProtocols protocol);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetEnabledCipherSuites")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetEnabledCipherSuites")]
         internal static unsafe partial int SslSetEnabledCipherSuites(SafeSslHandle sslHandle, uint* cipherSuites, int numCipherSuites);
 
-        [GeneratedDllImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetCertificateAuthorities")]
+        [LibraryImport(Interop.Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_SslSetCertificateAuthorities")]
         internal static partial int SslSetCertificateAuthorities(SafeSslHandle sslHandle, SafeCreateHandle certificateOrArray, int replaceExisting);
 
         internal static unsafe void SslSetCertificateAuthorities(SafeSslHandle sslHandle, Span<IntPtr> certificates, bool replaceExisting)
index 9e6d56e..3ba3936 100644 (file)
@@ -42,10 +42,10 @@ internal static partial class Interop
             None = 0,
         }
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFree")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFree")]
         internal static partial void CryptorFree(IntPtr handle);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorCreate")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorCreate")]
         internal static unsafe partial int CryptorCreate(
             PAL_SymmetricOperation operation,
             PAL_SymmetricAlgorithm algorithm,
@@ -58,7 +58,7 @@ internal static partial class Interop
             out SafeAppleCryptorHandle cryptor,
             out int ccStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorUpdate")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorUpdate")]
         internal static unsafe partial int CryptorUpdate(
             SafeAppleCryptorHandle cryptor,
             byte* pbData,
@@ -68,7 +68,7 @@ internal static partial class Interop
             out int cbWritten,
             out int ccStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFinal")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFinal")]
         internal static unsafe partial int CryptorFinal(
             SafeAppleCryptorHandle cryptor,
             byte* pbOutput,
@@ -76,7 +76,7 @@ internal static partial class Interop
             out int cbWritten,
             out int ccStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorReset")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorReset")]
         internal static unsafe partial int CryptorReset(SafeAppleCryptorHandle cryptor, byte* pbIv, out int ccStatus);
     }
 }
index 9a59dd0..4a66436 100644 (file)
@@ -11,22 +11,22 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_StoreEnumerateUserRoot(
             out SafeCFArrayHandle pCertsOut,
             out int pOSStatusOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_StoreEnumerateMachineRoot(
             out SafeCFArrayHandle pCertsOut,
             out int pOSStatusOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_StoreEnumerateUserDisallowed(
             out SafeCFArrayHandle pCertsOut,
             out int pOSStatusOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_StoreEnumerateMachineDisallowed(
             out SafeCFArrayHandle pCertsOut,
             out int pOSStatusOut);
index efb189b..f741d33 100644 (file)
@@ -14,37 +14,37 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509GetRawData(
             SafeSecCertificateHandle cert,
             out SafeCFDataHandle cfDataOut,
             out int pOSStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509GetSubjectSummary(
             SafeSecCertificateHandle cert,
             out SafeCFStringHandle cfSubjectSummaryOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509GetPublicKey(SafeSecCertificateHandle cert, out SafeSecKeyRefHandle publicKey, out int pOSStatus);
 
         internal static X509ContentType X509GetContentType(ReadOnlySpan<byte> data)
             => X509GetContentType(ref MemoryMarshal.GetReference(data), data.Length);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509GetContentType")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509GetContentType")]
         private static partial X509ContentType X509GetContentType(ref byte pbData, int cbData);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509CopyCertFromIdentity(
             SafeSecIdentityHandle identity,
             out SafeSecCertificateHandle cert);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509CopyPrivateKeyFromIdentity(
             SafeSecIdentityHandle identity,
             out SafeSecKeyRefHandle key);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509DemuxAndRetainHandle(
             IntPtr handle,
             out SafeSecCertificateHandle certHandle,
index c79a9de..63fbcac 100644 (file)
@@ -33,7 +33,7 @@ internal static partial class Interop
                 out pPrivateKeyOut);
         }
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509ImportCertificate(
             ref byte pbKeyBlob,
             int cbKeyBlob,
@@ -42,7 +42,7 @@ internal static partial class Interop
             out SafeSecCertificateHandle pCertOut,
             out SafeSecIdentityHandle pPrivateKeyOut);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509ImportCollection(
             ref byte pbKeyBlob,
             int cbKeyBlob,
index 785f9e6..8245a87 100644 (file)
@@ -39,7 +39,7 @@ internal static partial class Interop
                 out pOSStatus);
         }
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509ImportCertificate(
             ref byte pbKeyBlob,
             int cbKeyBlob,
@@ -51,7 +51,7 @@ internal static partial class Interop
             out SafeSecIdentityHandle pPrivateKeyOut,
             out int pOSStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509ImportCollection(
             ref byte pbKeyBlob,
             int cbKeyBlob,
@@ -62,7 +62,7 @@ internal static partial class Interop
             out SafeCFArrayHandle pCollectionOut,
             out int pOSStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509ExportData(
             SafeCreateHandle data,
             X509ContentType type,
@@ -70,7 +70,7 @@ internal static partial class Interop
             out SafeCFDataHandle pExportOut,
             out int pOSStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509CopyWithPrivateKey(
             SafeSecCertificateHandle certHandle,
             SafeSecKeyRefHandle privateKeyHandle,
@@ -78,7 +78,7 @@ internal static partial class Interop
             out SafeSecIdentityHandle pIdentityHandleOut,
             out int pOSStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         private static partial int AppleCryptoNative_X509MoveToKeychain(
             SafeSecCertificateHandle certHandle,
             SafeKeychainHandle targetKeychain,
index c6779b4..713d724 100644 (file)
@@ -11,42 +11,42 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainCreateDefaultPolicy")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainCreateDefaultPolicy")]
         internal static partial SafeCreateHandle X509ChainCreateDefaultPolicy();
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainCreateRevocationPolicy")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainCreateRevocationPolicy")]
         internal static partial SafeCreateHandle X509ChainCreateRevocationPolicy();
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         internal static partial int AppleCryptoNative_X509ChainCreate(
             SafeCreateHandle certs,
             SafeCreateHandle policies,
             out SafeX509ChainHandle pTrustOut,
             out int pOSStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative)]
+        [LibraryImport(Libraries.AppleCryptoNative)]
         internal static partial int AppleCryptoNative_X509ChainEvaluate(
             SafeX509ChainHandle chain,
             SafeCFDateHandle cfEvaluationTime,
             [MarshalAs(UnmanagedType.Bool)] bool allowNetwork,
             out int pOSStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetChainSize")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetChainSize")]
         internal static partial long X509ChainGetChainSize(SafeX509ChainHandle chain);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetCertificateAtIndex")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetCertificateAtIndex")]
         internal static partial IntPtr X509ChainGetCertificateAtIndex(SafeX509ChainHandle chain, long index);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetTrustResults")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetTrustResults")]
         internal static partial SafeCreateHandle X509ChainGetTrustResults(SafeX509ChainHandle chain);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetStatusAtIndex")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetStatusAtIndex")]
         internal static partial int X509ChainGetStatusAtIndex(SafeCreateHandle trustResults, long index, out int pdwStatus);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_GetOSStatusForChainStatus")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_GetOSStatusForChainStatus")]
         internal static partial int GetOSStatusForChainStatus(X509ChainStatusFlags flag);
 
-        [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainSetTrustAnchorCertificates")]
+        [LibraryImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainSetTrustAnchorCertificates")]
         internal static partial int X509ChainSetTrustAnchorCertificates(SafeX509ChainHandle chain, SafeCreateHandle anchorCertificates);
     }
 }
index 2a71db0..82f763d 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         /// <returns>
         /// true if the process status was read; otherwise, false.
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadProcessStatusInfo", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadProcessStatusInfo", SetLastError = true)]
         private static unsafe partial bool TryReadProcessStatusInfo(int pid, ProcessStatusInfo* processStatus);
 
         internal struct ProcessStatusInfo
index 88af774..75971cc 100644 (file)
@@ -183,24 +183,24 @@ internal static partial class Interop
         }
 
 #if SERIAL_PORTS
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPlatformToPal")]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPlatformToPal")]
         internal static partial Error ConvertErrorPlatformToPal(int platformErrno);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPalToPlatform")]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPalToPlatform")]
         internal static partial int ConvertErrorPalToPlatform(Error error);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_StrErrorR")]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_StrErrorR")]
         private static unsafe partial byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize);
 #else
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPlatformToPal")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPlatformToPal")]
         [SuppressGCTransition]
         internal static partial Error ConvertErrorPlatformToPal(int platformErrno);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPalToPlatform")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPalToPlatform")]
         [SuppressGCTransition]
         internal static partial int ConvertErrorPalToPlatform(Error error);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")]
         private static unsafe partial byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize);
 #endif
     }
index e7aa1b1..8f79130 100644 (file)
@@ -10,13 +10,13 @@ internal static partial class Interop
 {
     internal static partial class Serial
     {
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortOpen", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortOpen", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial SafeSerialDeviceHandle SerialPortOpen(string name);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortClose", SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortClose", SetLastError = true)]
         internal static partial int SerialPortClose(IntPtr handle);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Shutdown")]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Shutdown")]
         internal static partial Error Shutdown(IntPtr socket, SocketShutdown how);
 
         /// <summary>
@@ -29,7 +29,7 @@ internal static partial class Interop
         /// Returns the number of bytes read on success; otherwise, -1 is returned
         /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info
         /// </returns>
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Read", SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Read", SetLastError = true)]
         internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count);
 
         /// <summary>
@@ -41,7 +41,7 @@ internal static partial class Interop
         /// <returns>
         /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno
         /// </returns>
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Write", SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Write", SetLastError = true)]
         internal static unsafe partial int Write(SafeHandle fd, byte* buffer, int bufferSize);
 
         /// <summary>
@@ -52,7 +52,7 @@ internal static partial class Interop
         /// <param name="timeout">The amount of time to wait; -1 for infinite, 0 for immediate return, and a positive number is the number of milliseconds</param>
         /// <param name="triggered">The number of events triggered (i.e. the number of entries in pollEvents with a non-zero TriggeredEvents). May be zero in the event of a timeout.</param>
         /// <returns>An error or Error.SUCCESS.</returns>
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Poll")]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Poll")]
         private static unsafe partial Error Poll(PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered);
 
         /// <summary>
index ce98ffa..73f9c51 100644 (file)
@@ -29,34 +29,34 @@ internal static partial class Interop
             SendQueue = 2,
         }
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosReset", SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosReset", SetLastError = true)]
         internal static partial int TermiosReset(SafeSerialDeviceHandle handle, int speed, int data, StopBits stop, Parity parity, Handshake flow);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSignal", SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSignal", SetLastError = true)]
         internal static partial int TermiosGetSignal(SafeSerialDeviceHandle handle, Signals signal);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSignal", SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSignal", SetLastError = true)]
         internal static partial int TermiosGetSignal(SafeSerialDeviceHandle handle, Signals signal, int set);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetAllSignals")]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetAllSignals")]
         internal static partial Signals TermiosGetAllSignals(SafeSerialDeviceHandle handle);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSpeed", SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSpeed", SetLastError = true)]
         internal static partial int TermiosSetSpeed(SafeSerialDeviceHandle handle, int speed);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSpeed", SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSpeed", SetLastError = true)]
         internal static partial int TermiosGetSpeed(SafeSerialDeviceHandle handle);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosAvailableBytes", SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosAvailableBytes", SetLastError = true)]
         internal static partial int TermiosGetAvailableBytes(SafeSerialDeviceHandle handle, [MarshalAs(UnmanagedType.Bool)]bool fromReadBuffer);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDiscard", SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDiscard", SetLastError = true)]
         internal static partial int TermiosDiscard(SafeSerialDeviceHandle handle, Queue input);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDrain", SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDrain", SetLastError = true)]
         internal static partial int TermiosDrain(SafeSerialDeviceHandle handle);
 
-        [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSendBreak", SetLastError = true)]
+        [LibraryImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSendBreak", SetLastError = true)]
         internal static partial int TermiosSendBreak(SafeSerialDeviceHandle handle, int duration);
     }
 }
index c8abb85..568899d 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
     internal unsafe partial class Sys
     {
         [DoesNotReturn]
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Abort")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Abort")]
         internal static partial void Abort();
     }
 }
index 2385cf9..69d3752 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Accept")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Accept")]
         internal static unsafe partial Error Accept(SafeHandle socket, byte* socketAddress, int* socketAddressLen, IntPtr* acceptedFd);
     }
 }
index 82c32b0..5f466b0 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             R_OK = 4,   /* Check for read */
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Access", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Access", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int Access(string path, AccessMode mode);
     }
 }
index 41dac6f..f279f45 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Bind")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Bind")]
         internal static unsafe partial Error Bind(SafeHandle socket, ProtocolType socketProtocolType, byte* socketAddress, int socketAddressLen);
     }
 }
index 2184935..784f8c6 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int ChDir(string path);
     }
 }
index 423aa45..940058d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChMod", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChMod", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int ChMod(string path, int mode);
     }
 }
index dcf65c4..4c438db 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Close", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Close", SetLastError = true)]
         internal static partial int Close(IntPtr fd);
     }
 }
index 92a7bf2..8a1f408 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConfigureTerminalForChildProcess")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConfigureTerminalForChildProcess")]
         internal static partial void ConfigureTerminalForChildProcess([MarshalAs(UnmanagedType.Bool)] bool childUsesTerminal);
     }
 }
index 5149052..11d4e8d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Connect")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Connect")]
         internal static unsafe partial Error Connect(SafeHandle socket, byte* socketAddress, int socketAddressLen);
     }
 }
index 3bdbcf8..154eac7 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CopyFile", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CopyFile", SetLastError = true)]
         internal static partial int CopyFile(SafeFileHandle source, SafeFileHandle destination, long sourceLength);
     }
 }
index 55c7988..446f22d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Disconnect")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Disconnect")]
         internal static partial Error Disconnect(IntPtr socket);
     }
 }
index d61ab47..2638c25 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Dup", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Dup", SetLastError = true)]
         internal static partial SafeFileHandle Dup(SafeFileHandle oldfd);
     }
 }
index 33f36ac..1bcc468 100644 (file)
@@ -8,16 +8,16 @@ internal static partial class Interop
 {
     internal unsafe partial class Sys
     {
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_LoadLibrary", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_LoadLibrary", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial IntPtr LoadLibrary(string filename);
 
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress")]
         internal static partial IntPtr GetProcAddress(IntPtr handle, byte* symbol);
 
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetProcAddress", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial IntPtr GetProcAddress(IntPtr handle, string symbol);
 
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeLibrary")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeLibrary")]
         internal static partial void FreeLibrary(IntPtr handle);
     }
 }
index b4896fc..52b3653 100644 (file)
@@ -42,17 +42,17 @@ internal static partial class Interop
             private fixed byte __padding[3];
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateInterfaceAddresses")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateInterfaceAddresses")]
         public static unsafe partial int EnumerateInterfaceAddresses(
             void* context,
             delegate* unmanaged<void*, byte*, IpAddressInfo*, void> ipv4Found,
             delegate* unmanaged<void*, byte*, IpAddressInfo*, uint*, void> ipv6Found,
             delegate* unmanaged<void*, byte*, LinkLayerAddressInfo*, void> linkLayerFound);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateGatewayAddressesForInterface")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateGatewayAddressesForInterface")]
         public static unsafe partial int EnumerateGatewayAddressesForInterface(void* context, uint interfaceIndex, delegate* unmanaged<void*, IpAddressInfo*, void> onGatewayFound);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNetworkInterfaces")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNetworkInterfaces")]
         public static unsafe partial int GetNetworkInterfaces(int* count, NetworkInterfaceInfo** addrs, int* addressCount, IpAddressInfo** aa);
 
     }
index b6c4c21..197bdd7 100644 (file)
@@ -8,11 +8,11 @@ internal static partial class Interop
 {
     internal unsafe partial class Sys
     {
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetErrNo")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetErrNo")]
         [SuppressGCTransition]
         internal static partial int GetErrNo();
 
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SetErrNo")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SetErrNo")]
         [SuppressGCTransition]
         internal static partial void SetErrNo(int errorCode);
     }
index 69d5711..41b97b4 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
     internal unsafe partial class Sys
     {
         [DoesNotReturn]
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Exit")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Exit")]
         internal static partial void Exit(int exitCode);
     }
 }
index 8c3508e..27f8029 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
         /// <summary>
         /// Returns -1 on error, 0 on success.
         /// </summary>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FAllocate", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FAllocate", SetLastError = true)]
         internal static partial int FAllocate(SafeFileHandle fd, long offset, long length);
     }
 }
index 57a278c..b2efd51 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FChMod", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FChMod", SetLastError = true)]
         internal static partial int FChMod(SafeFileHandle fd, int mode);
     }
 }
index a2a89fe..0ed3518 100644 (file)
@@ -17,14 +17,14 @@ internal static partial class Interop
             LOCK_UN = 8,    /* unlock */
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)]
         internal static partial int FLock(SafeFileHandle fd, LockOperations operation);
 
         /// <summary>
         /// Exposing this for SafeFileHandle.ReleaseHandle() to call.
         /// Normal callers should use FLock(SafeFileHandle fd).
         /// </summary>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)]
         internal static partial int FLock(IntPtr fd, LockOperations operation);
     }
 }
index 531ceb5..4c902e0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FSync", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FSync", SetLastError = true)]
         internal static partial int FSync(SafeFileHandle fd);
     }
 }
index b836726..33e87ce 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FTruncate", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FTruncate", SetLastError = true)]
         internal static partial int FTruncate(SafeFileHandle fd, long length);
     }
 }
index c44493f..c8b65c5 100644 (file)
@@ -13,13 +13,13 @@ internal static partial class Interop
         {
             internal static readonly bool CanGetSetPipeSz = (FcntlCanGetSetPipeSz() != 0);
 
-            [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetPipeSz", SetLastError=true)]
+            [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetPipeSz", SetLastError=true)]
             internal static partial int GetPipeSz(SafePipeHandle fd);
 
-            [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetPipeSz", SetLastError=true)]
+            [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetPipeSz", SetLastError=true)]
             internal static partial int SetPipeSz(SafePipeHandle fd, int size);
 
-            [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlCanGetSetPipeSz")]
+            [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlCanGetSetPipeSz")]
             [SuppressGCTransition]
             private static partial int FcntlCanGetSetPipeSz();
         }
index 72290a1..d35b40b 100644 (file)
@@ -10,22 +10,22 @@ internal static partial class Interop
     {
         internal static partial class Fcntl
         {
-            [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError = true)]
+            [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError = true)]
             internal static partial int DangerousSetIsNonBlocking(IntPtr fd, int isNonBlocking);
 
-            [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError=true)]
+            [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetIsNonBlocking", SetLastError=true)]
             internal static partial int SetIsNonBlocking(SafeHandle fd, int isNonBlocking);
 
-            [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetIsNonBlocking", SetLastError = true)]
+            [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetIsNonBlocking", SetLastError = true)]
             internal static partial int GetIsNonBlocking(SafeHandle fd, [MarshalAs(UnmanagedType.Bool)] out bool isNonBlocking);
 
-            [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetFD", SetLastError=true)]
+            [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetFD", SetLastError=true)]
             internal static partial int SetFD(SafeHandle fd, int flags);
 
-            [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError=true)]
+            [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError=true)]
             internal static partial int GetFD(SafeHandle fd);
 
-            [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError=true)]
+            [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlGetFD", SetLastError=true)]
             internal static partial int GetFD(IntPtr fd);
         }
     }
index 9454d42..a09d81a 100644 (file)
@@ -40,7 +40,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ForkAndExecProcess", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ForkAndExecProcess", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         private static unsafe partial int ForkAndExecProcess(
             string filename, byte** argv, byte** envp, string? cwd,
             int redirectStdin, int redirectStdout, int redirectStderr,
index 96b5791..153518f 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetBytesAvailable")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetBytesAvailable")]
         internal static unsafe partial Error GetBytesAvailable(SafeHandle socket, int* available);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAtOutOfBandMark")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAtOutOfBandMark")]
         internal static unsafe partial Error GetAtOutOfBandMark(SafeHandle socket, int* atMark);
     }
 }
index be1316a..c9d86da 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlCharacters")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlCharacters")]
         internal static partial void GetControlCharacters(
             ControlCharacterNames[] controlCharacterNames, byte[] controlCharacterValues, int controlCharacterLength,
             out byte posixDisableValue);
index 6598dbd..da8fca2 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             internal ulong lastRecordedUserTime;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCpuUtilization")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCpuUtilization")]
         internal static partial int GetCpuUtilization(ref ProcessCpuInformation previousCpuInfo);
     }
 }
index 22fb18f..1831128 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCwd", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCwd", SetLastError = true)]
         private static unsafe partial byte* GetCwd(byte* buffer, int bufferLength);
 
         internal static unsafe string GetCwd()
index 1029cff..2edaca1 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetDefaultTimeZone", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetDefaultTimeZone", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial string? GetDefaultTimeZone();
     }
 }
index 7494679..b2357ea 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainName")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainName")]
         private static unsafe partial int GetDomainName(byte* name, int len);
 
         internal static unsafe string GetDomainName()
index 3526397..26dabc8 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainSocketSizes")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainSocketSizes")]
         [SuppressGCTransition]
         internal static unsafe partial void GetDomainSocketSizes(int* pathOffset, int* pathSize, int* addressSize);
     }
index f11d4ef..228bab3 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEUid")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEUid")]
         internal static partial uint GetEUid();
     }
 }
index 583288b..18b3b6d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal unsafe partial class Sys
     {
-        [GeneratedDllImport(Interop.Libraries.SystemNative, StringMarshalling = StringMarshalling.Utf8, EntryPoint = "SystemNative_GetEnv")]
+        [LibraryImport(Interop.Libraries.SystemNative, StringMarshalling = StringMarshalling.Utf8, EntryPoint = "SystemNative_GetEnv")]
         internal static unsafe partial IntPtr GetEnv(string name);
     }
 }
index deefc74..3e26d42 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal unsafe partial class Sys
     {
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetEnviron")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetEnviron")]
         internal static unsafe partial IntPtr GetEnviron();
 
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeEnviron")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeEnviron")]
         internal static unsafe partial void FreeEnviron(IntPtr environ);
     }
 }
index 973a704..28b474c 100644 (file)
@@ -43,7 +43,7 @@ internal static partial class Interop
             } while (true);
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroupList", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroupList", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         private static unsafe partial int GetGroupList(string name, uint group, uint* groups, int* ngroups);
     }
 }
index 72710dc..4a99113 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostName", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostName", SetLastError = true)]
         private static unsafe partial int GetHostName(byte* name, int nameLength);
 
         internal static unsafe string GetHostName()
index 6ad3e4e..6bccdb2 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetMaximumAddressSize")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetMaximumAddressSize")]
         [SuppressGCTransition]
         internal static partial int GetMaximumAddressSize();
     }
index e962dbd..65e5cdf 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             NI_NUMERICHOST  = 0x2,
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNameInfo")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNameInfo")]
         internal static unsafe partial int GetNameInfo(
             byte* address,
             uint addressLength,
index 50bf35c..023a4c8 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
     internal static partial class Sys
     {
         [SuppressGCTransition]
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetOSArchitecture")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetOSArchitecture")]
         internal static partial int GetOSArchitecture();
     }
 }
index 23a338a..bb1aed9 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerID", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerID", SetLastError = true)]
         internal static partial int GetPeerID(SafeHandle socket, out uint euid);
     }
 }
index a66bcfe..1ed8fd7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerName")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerName")]
         internal static unsafe partial Error GetPeerName(SafeHandle socket, byte* socketAddress, int* socketAddressLen);
     }
 }
index b24072f..e20a12b 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerUserName", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPeerUserName", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial string GetPeerUserName(SafeHandle socket);
     }
 }
index 6b26b60..016c854 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPid")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPid")]
         internal static partial int GetPid();
     }
 }
index 52fc19f..3577765 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
         /// <summary>
         /// Returns the full path to the executable for the current process, resolving symbolic links.
         /// </summary>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetProcessPath", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetProcessPath", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial string? GetProcessPath();
     }
 }
index f30235d..79b3b4f 100644 (file)
@@ -20,10 +20,10 @@ internal static partial class Interop
             internal byte* Shell;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPwUidR", SetLastError = false)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPwUidR", SetLastError = false)]
         internal static unsafe partial int GetPwUidR(uint uid, out Passwd pwd, byte* buf, int bufLen);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPwNamR", StringMarshalling = StringMarshalling.Utf8, SetLastError = false)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPwNamR", StringMarshalling = StringMarshalling.Utf8, SetLastError = false)]
         internal static unsafe partial int GetPwNamR(string name, out Passwd pwd, byte* buf, int bufLen);
     }
 }
index 76c1323..9d80ea4 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetNonCryptographicallySecureRandomBytes")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetNonCryptographicallySecureRandomBytes")]
         internal static unsafe partial void GetNonCryptographicallySecureRandomBytes(byte* buffer, int length);
 
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetCryptographicallySecureRandomBytes")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetCryptographicallySecureRandomBytes")]
         internal static unsafe partial int GetCryptographicallySecureRandomBytes(byte* buffer, int length);
     }
 
index 4677fd8..3c4ab6f 100644 (file)
@@ -16,10 +16,10 @@ internal static partial class Interop
             PRIO_USER       = 2,
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPriority", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPriority", SetLastError = true)]
         private static partial int GetPriority(PriorityWhich which, int who);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPriority", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPriority", SetLastError = true)]
         internal static partial int SetPriority(PriorityWhich which, int who, int nice);
 
         /// <summary>
index 5b20a86..1684298 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSid")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSid")]
         internal static partial int GetSid(int pid);
     }
 }
index a0a44f2..fa347dc 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockName")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockName")]
         internal static unsafe partial Error GetSockName(SafeHandle socket, byte* socketAddress, int* socketAddressLen);
     }
 }
index 49d4b0d..fb8ade9 100644 (file)
@@ -9,13 +9,13 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")]
         internal static unsafe partial Error GetSockOpt(SafeHandle socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int* optionLen);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")]
         internal static unsafe partial Error GetSockOpt(IntPtr socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int* optionLen);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRawSockOpt")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRawSockOpt")]
         internal static unsafe partial Error GetRawSockOpt(SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int* optionLen);
     }
 }
index a77fb31..3313c20 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSocketErrorOption")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSocketErrorOption")]
         internal static unsafe partial Error GetSocketErrorOption(SafeHandle socket, Error* socketError);
     }
 }
index 1aab445..29c2937 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSocketType")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSocketType")]
         internal static partial Error GetSocketType(SafeSocketHandle socket, out AddressFamily addressFamily, out SocketType socketType, out ProtocolType protocolType, [MarshalAs(UnmanagedType.Bool)] out bool isListening);
     }
 }
index ca5c01c..2fa2d4d 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetSystemTimeAsTicks")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetSystemTimeAsTicks")]
         [SuppressGCTransition]
         internal static partial long GetSystemTimeAsTicks();
     }
index 6e0e24a..00c9678 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestamp")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestamp")]
         [SuppressGCTransition]
         internal static partial ulong GetTimestamp();
     }
index 276f112..6ee0e2e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixName")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixName")]
         private static partial IntPtr GetUnixNamePrivate();
 
         internal static string GetUnixName()
index 994e4dc..14e1fff 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixRelease", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixRelease", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         public static partial string GetUnixRelease();
     }
 }
index 35503c1..c58b3be 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixVersion", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixVersion", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         private static partial int GetUnixVersion(byte[] version, ref int capacity);
 
         internal static string GetUnixVersion()
index 8341048..ea3ef66 100644 (file)
@@ -17,7 +17,7 @@ internal static partial class Interop
             internal ushort YPixel;
         };
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetWindowSize", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetWindowSize", SetLastError = true)]
         internal static partial int GetWindowSize(out WinSize winSize);
     }
 }
index 531c5ce..b8bc385 100644 (file)
@@ -32,10 +32,10 @@ internal static partial class Interop
             internal int IPAddressCount;       // Number of IP addresses in the list
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostEntryForName", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostEntryForName", StringMarshalling = StringMarshalling.Utf8)]
         internal static unsafe partial int GetHostEntryForName(string address, AddressFamily family, HostEntry* entry);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeHostEntry")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeHostEntry")]
         internal static unsafe partial void FreeHostEntry(HostEntry* entry);
     }
 }
index d253cb2..f165c92 100644 (file)
@@ -16,11 +16,11 @@ internal static partial class Interop
             private int _padding;       // Pad out to 8-byte alignment
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlMessageBufferSize")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlMessageBufferSize")]
         [SuppressGCTransition]
         internal static partial int GetControlMessageBufferSize(int isIPv4, int isIPv6);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryGetIPPacketInformation")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryGetIPPacketInformation")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool TryGetIPPacketInformation(MessageHeader* messageHeader, [MarshalAs(UnmanagedType.Bool)] bool isIPv4, IPPacketInformation* packetInfo);
     }
index e3a50f6..81ebf2d 100644 (file)
@@ -7,11 +7,11 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeTerminalAndSignalHandling", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeTerminalAndSignalHandling", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool InitializeTerminalAndSignalHandling();
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetKeypadXmit", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetKeypadXmit", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial void SetKeypadXmit(string terminfoString);
     }
 }
index 7a6af16..6dd5bf2 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InterfaceNameToIndex", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_InterfaceNameToIndex", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         public static partial uint InterfaceNameToIndex(string name);
     }
 }
index 9ed5b29..da47ef8 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_IsATty", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_IsATty", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool IsATty(SafeFileHandle fd);
     }
index c302dbe..76302e8 100644 (file)
@@ -49,10 +49,10 @@ internal static partial class Interop
             while (true);
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEGid")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEGid")]
         private static partial uint GetEGid();
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroups", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroups", SetLastError = true)]
         private static unsafe partial int GetGroups(int ngroups, uint* groups);
     }
 }
index 1fb42ef..d1cec81 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             SIGSTOP = 19
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Kill", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Kill", SetLastError = true)]
         internal static partial int Kill(int pid, Signals signal);
     }
 }
index 04e18dc..9412275 100644 (file)
@@ -14,18 +14,18 @@ internal static partial class Interop
             UF_HIDDEN = 0x8000
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflags", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflags", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int LChflags(string path, uint flags);
 
         internal static readonly bool CanSetHiddenFlag = (LChflagsCanSetHiddenFlag() != 0);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflagsCanSetHiddenFlag")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflagsCanSetHiddenFlag")]
         [SuppressGCTransition]
         private static partial int LChflagsCanSetHiddenFlag();
 
         internal static readonly bool SupportsHiddenFlag = (CanGetHiddenFlag() != 0);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CanGetHiddenFlag")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CanGetHiddenFlag")]
         [SuppressGCTransition]
         private static partial int CanGetHiddenFlag();
     }
index c76231b..26381e6 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             SEEK_END = 2
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LSeek", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LSeek", SetLastError = true)]
         internal static partial long LSeek(SafeFileHandle fd, long offset, SeekWhence whence);
     }
 }
index ecaae2b..76244cf 100644 (file)
@@ -15,13 +15,13 @@ internal static partial class Interop
             public int Seconds; // Number of seconds to linger for
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetLingerOption")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetLingerOption")]
         internal static unsafe partial Error GetLingerOption(SafeHandle socket, LingerOption* option);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")]
         internal static unsafe partial Error SetLingerOption(SafeHandle socket, LingerOption* option);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")]
         internal static unsafe partial Error SetLingerOption(IntPtr socket, LingerOption* option);
     }
 }
index c09c4e2..35fdb5f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Link", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Link", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int Link(string source, string link);
     }
 }
index f630563..b5918bb 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Listen")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Listen")]
         internal static partial Error Listen(SafeHandle socket, int backlog);
     }
 }
index 0692aa4..8a2bd9d 100644 (file)
@@ -14,7 +14,7 @@ internal static partial class Interop
             F_UNLCK = 2     // unlock
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LockFileRegion", SetLastError =true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LockFileRegion", SetLastError =true)]
         internal static partial int LockFileRegion(SafeHandle fd, long offset, long length, LockType lockType);
     }
 }
index 474429e..ea550a5 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Log")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Log")]
         internal static unsafe partial void Log(byte* buffer, int count);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LogError")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LogError")]
         internal static unsafe partial void LogError(byte* buffer, int count);
     }
 }
index 76d6437..cab01ab 100644 (file)
@@ -8,26 +8,26 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Create")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Create")]
         internal static partial IntPtr LowLevelMonitor_Create();
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Destroy")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Destroy")]
         internal static partial void LowLevelMonitor_Destroy(IntPtr monitor);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Acquire")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Acquire")]
         internal static partial void LowLevelMonitor_Acquire(IntPtr monitor);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Release")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Release")]
         internal static partial void LowLevelMonitor_Release(IntPtr monitor);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Wait")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Wait")]
         internal static partial void LowLevelMonitor_Wait(IntPtr monitor);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_TimedWait")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_TimedWait")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool LowLevelMonitor_TimedWait(IntPtr monitor, int timeoutMilliseconds);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Signal_Release")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Signal_Release")]
         internal static partial void LowLevelMonitor_Signal_Release(IntPtr monitor);
     }
 }
index 5ac7aa1..0ee855f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MAdvise", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MAdvise", SetLastError = true)]
         internal static partial int MAdvise(IntPtr addr, ulong length, MemoryAdvice advice);
 
         internal enum MemoryAdvice
index 5789ee7..8797980 100644 (file)
@@ -28,7 +28,7 @@ internal static partial class Interop
         }
 
         // NOTE: Shim returns null pointer on failure, not non-null MAP_FAILED sentinel.
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MMap", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MMap", SetLastError = true)]
         internal static partial IntPtr MMap(
             IntPtr addr, ulong len,
             MemoryMappedProtections prot, MemoryMappedFlags flags,
index 78263cb..b147f24 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
             MS_INVALIDATE = 0x10,
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MSync", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MSync", SetLastError = true)]
         internal static partial int MSync(IntPtr addr, ulong len, MemoryMappedSyncFlags flags);
     }
 }
index a0ed692..60bd0bd 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MUnmap", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MUnmap", SetLastError = true)]
         internal static partial int MUnmap(IntPtr addr, ulong len);
     }
 }
index 3d689c5..323fcff 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MapTcpState")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MapTcpState")]
         [SuppressGCTransition]
         internal static partial TcpState MapTcpState(int nativeState);
     }
index 9a0a90c..23fb244 100644 (file)
@@ -8,25 +8,25 @@ internal static partial class Interop
 {
     internal static unsafe partial class Sys
     {
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedAlloc")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedAlloc")]
         internal static partial void* AlignedAlloc(nuint alignment, nuint size);
 
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedFree")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedFree")]
         internal static partial void AlignedFree(void* ptr);
 
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedRealloc")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedRealloc")]
         internal static partial void* AlignedRealloc(void* ptr, nuint alignment, nuint new_size);
 
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Calloc")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Calloc")]
         internal static partial void* Calloc(nuint num, nuint size);
 
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Free")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Free")]
         internal static partial void Free(void* ptr);
 
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Malloc")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Malloc")]
         internal static partial void* Malloc(nuint size);
 
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Realloc")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Realloc")]
         internal static partial void* Realloc(void* ptr, nuint new_size);
     }
 }
index a71c014..5fb7165 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MemSet")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MemSet")]
         internal static extern unsafe void* MemSet(void *s, int c, UIntPtr n);
     }
 }
index 09a4ae1..a6bb1dc 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MkDir", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MkDir", SetLastError = true)]
         private static partial int MkDir(ref byte path, int mode);
 
         internal static int MkDir(ReadOnlySpan<char> path, int mode)
index f697cd9..95250e6 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MksTemps", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_MksTemps", SetLastError = true)]
         internal static partial IntPtr MksTemps(
             byte[] template,
             int suffixlen);
index 3a38edc..ad31d40 100644 (file)
@@ -30,10 +30,10 @@ internal static partial class Interop
             internal ulong TotalSize;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSpaceInfoForMountPoint", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSpaceInfoForMountPoint", SetLastError = true)]
         internal static partial int GetSpaceInfoForMountPoint([MarshalAs(UnmanagedType.LPStr)]string name, out MountPointInformation mpi);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFormatInfoForMountPoint", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFormatInfoForMountPoint", SetLastError = true)]
         private static unsafe partial int GetFormatInfoForMountPoint(
             [MarshalAs(UnmanagedType.LPStr)]string name,
             byte* formatNameBuffer,
index 1f54797..6f031a0 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         private unsafe delegate void MountPointFound(byte* name);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAllMountPoints", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAllMountPoints", SetLastError = true)]
         private static partial int GetAllMountPoints(MountPointFound mpf);
 
         internal static string[] GetAllMountPoints()
index f874683..5de715f 100644 (file)
@@ -31,16 +31,16 @@ internal static partial class Interop
             private int _padding;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4MulticastOption")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4MulticastOption")]
         internal static unsafe partial Error GetIPv4MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv4MulticastOption* option);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4MulticastOption")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4MulticastOption")]
         internal static unsafe partial Error SetIPv4MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv4MulticastOption* option);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6MulticastOption")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6MulticastOption")]
         internal static unsafe partial Error GetIPv6MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv6MulticastOption* option);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6MulticastOption")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6MulticastOption")]
         internal static unsafe partial Error SetIPv6MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv6MulticastOption* option);
     }
 }
index 5f04ee0..d4dd7ee 100644 (file)
@@ -16,10 +16,10 @@ internal static partial class Interop
             AvailabilityChanged = 2
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateNetworkChangeListenerSocket")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateNetworkChangeListenerSocket")]
         public static unsafe partial Error CreateNetworkChangeListenerSocket(IntPtr* socket);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadEvents")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadEvents")]
         public static unsafe partial Error ReadEvents(SafeHandle socket, delegate* unmanaged<IntPtr, NetworkChangeKind, void> onNetworkChange);
     }
 }
index 3daa76c..627296c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Open", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Open", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial SafeFileHandle Open(string filename, OpenFlags flags, int mode);
     }
 }
index b48dff0..aa41a2f 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PRead", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PRead", SetLastError = true)]
         internal static unsafe partial int PRead(SafeHandle fd, byte* buffer, int bufferSize, long fileOffset);
     }
 }
index de0f311..a47036c 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PReadV", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PReadV", SetLastError = true)]
         internal static unsafe partial long PReadV(SafeHandle fd, IOVector* vectors, int vectorCount, long fileOffset);
     }
 }
index d658f4b..742de1b 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWrite", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWrite", SetLastError = true)]
         internal static unsafe partial int PWrite(SafeHandle fd, byte* buffer, int bufferSize, long fileOffset);
     }
 }
index baba793..63c6b27 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWriteV", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWriteV", SetLastError = true)]
         internal static unsafe partial long PWriteV(SafeHandle fd, IOVector* vectors, int vectorCount, long fileOffset);
     }
 }
index 6485745..3b02546 100644 (file)
@@ -20,7 +20,7 @@ internal static partial class Interop
             PC_VDISABLE         = 9,
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PathConf", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PathConf", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         private static partial int PathConf(string path, PathConfName name);
     }
 }
index 92587f2..3574339 100644 (file)
@@ -24,7 +24,7 @@ internal static partial class Interop
         /// </summary>
         internal const int WriteEndOfPipe = 1;
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Pipe", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Pipe", SetLastError = true)]
         internal static unsafe partial int Pipe(int* pipefd, PipeFlags flags = 0); // pipefd is an array of two ints
     }
 }
index 550aaff..d250c29 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PlatformSupportsDualModeIPv4PacketInfo")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PlatformSupportsDualModeIPv4PacketInfo")]
         [SuppressGCTransition]
         internal static partial int PlatformSupportsDualModeIPv4PacketInfo();
     }
index 65d9b71..08b6915 100644 (file)
@@ -17,7 +17,7 @@ internal static partial class Interop
         /// <param name="timeout">The amount of time to wait; -1 for infinite, 0 for immediate return, and a positive number is the number of milliseconds</param>
         /// <param name="triggered">The number of events triggered (i.e. the number of entries in pollEvents with a non-zero TriggeredEvents). May be zero in the event of a timeout.</param>
         /// <returns>An error or Error.SUCCESS.</returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Poll")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Poll")]
         internal static unsafe partial Error Poll(PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered);
 
         /// <summary>
index e2e96df..42653ac 100644 (file)
@@ -29,7 +29,7 @@ internal static partial class Interop
         /// <returns>
         /// Returns 0 on success; otherwise, the error code is returned
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PosixFAdvise", SetLastError = false /* this is explicitly called out in the man page */)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_PosixFAdvise", SetLastError = false /* this is explicitly called out in the man page */)]
         internal static partial int PosixFAdvise(SafeFileHandle fd, long offset, long length, FileAdvice advice);
     }
 }
index 680bead..e3025f9 100644 (file)
@@ -7,21 +7,21 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPosixSignalHandler")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPosixSignalHandler")]
         [SuppressGCTransition]
         internal static unsafe partial void SetPosixSignalHandler(delegate* unmanaged<int, PosixSignal, int> handler);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnablePosixSignalHandling", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnablePosixSignalHandling", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EnablePosixSignalHandling(int signal);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_DisablePosixSignalHandling")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_DisablePosixSignalHandling")]
         internal static partial void DisablePosixSignalHandling(int signal);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_HandleNonCanceledPosixSignal")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_HandleNonCanceledPosixSignal")]
         internal static partial void HandleNonCanceledPosixSignal(int signal);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPlatformSignalNumber")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPlatformSignalNumber")]
         [SuppressGCTransition]
         internal static partial int GetPlatformSignalNumber(PosixSignal signal);
     }
index c2ecd36..ef2c39d 100644 (file)
@@ -18,7 +18,7 @@ internal static partial class Interop
         /// Returns the number of bytes read on success; otherwise, -1 is returned
         /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)]
         internal static unsafe partial int Read(SafePipeHandle fd, byte* buffer, int count);
     }
 }
index 7d9988d..76f21fc 100644 (file)
@@ -17,7 +17,7 @@ internal static partial class Interop
         /// Returns the number of bytes read on success; otherwise, -1 is returned
         /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)]
         internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count);
     }
 }
index 9bac51a..9362a84 100644 (file)
@@ -53,17 +53,17 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_OpenDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_OpenDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial IntPtr OpenDir(string path);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetReadDirRBufferSize", SetLastError = false)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetReadDirRBufferSize", SetLastError = false)]
         [SuppressGCTransition]
         internal static partial int GetReadDirRBufferSize();
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadDirR")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadDirR")]
         internal static unsafe partial int ReadDirR(IntPtr dir, byte* buffer, int bufferSize, DirectoryEntry* outputEntry);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseDir", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseDir", SetLastError = true)]
         internal static partial int CloseDir(IntPtr dir);
     }
 }
index ce3b064..ae0fc4d 100644 (file)
@@ -20,7 +20,7 @@ internal static partial class Interop
         /// <returns>
         /// Returns the number of bytes placed into the buffer on success; bufferSize if the buffer is too small; and -1 on error.
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadLink", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadLink", SetLastError = true)]
         private static partial int ReadLink(ref byte path, byte[] buffer, int bufferSize);
 
         /// <summary>
index c751528..844e669 100644 (file)
@@ -8,13 +8,13 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadStdin", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadStdin", SetLastError = true)]
         internal static unsafe partial int ReadStdin(byte* buffer, int bufferSize);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeConsoleBeforeRead")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeConsoleBeforeRead")]
         internal static partial void InitializeConsoleBeforeRead(byte minChars = 1, byte decisecondsTimeout = 0);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UninitializeConsoleAfterRead")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_UninitializeConsoleAfterRead")]
         internal static partial void UninitializeConsoleAfterRead();
     }
 }
index fc4c934..963e707 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         /// </summary>
         /// <param name="path">The path to the file system object</param>
         /// <returns>Returns the result string on success and null on failure</returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RealPath", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_RealPath", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial string RealPath(string path);
     }
 }
index a23bdad..8c14c0e 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Receive")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Receive")]
         internal static unsafe partial Error Receive(SafeHandle socket, byte* buffer, int bufferLen, SocketFlags flags, int* received);
     }
 }
index 5757d46..d6e5ab1 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReceiveMessage")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReceiveMessage")]
         internal static unsafe partial Error ReceiveMessage(SafeHandle socket, MessageHeader* messageHeader, SocketFlags flags, long* received);
     }
 }
index 2bbac8a..c54f349 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RegisterForSigChld")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_RegisterForSigChld")]
         internal static unsafe partial void RegisterForSigChld(delegate* unmanaged<int, int, int> handler);
     }
 }
index 9d58817..ccdbbfd 100644 (file)
@@ -17,10 +17,10 @@ internal static partial class Interop
         /// <returns>
         /// Returns 0 on success; otherwise, returns -1
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Rename", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Rename", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int Rename(string oldPath, string newPath);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Rename", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Rename", SetLastError = true)]
         internal static partial int Rename(ref byte oldPath, ref byte newPath);
 
         internal static int Rename(ReadOnlySpan<char> oldPath, ReadOnlySpan<char> newPath)
index 1d25b5c..935ccc9 100644 (file)
@@ -30,10 +30,10 @@ internal static partial class Interop
             internal ulong MaximumLimit;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRLimit", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRLimit", SetLastError = true)]
         internal static partial int GetRLimit(RlimitResources resourceType, out RLimit limits);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRLimit", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRLimit", SetLastError = true)]
         internal static partial int SetRLimit(RlimitResources resourceType, ref RLimit limits);
     }
 }
index 2fce1f1..3536ff0 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         /// <returns>
         /// Returns 0 on success; otherwise, returns -1
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RmDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_RmDir", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int RmDir(string path);
     }
 }
index 41e403e..fada562 100644 (file)
@@ -26,7 +26,7 @@ internal static partial class Interop
         /// success; if the return value is equal to the size then the result may have been truncated.
         /// On failure, returns a negative value.
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static unsafe partial int SNPrintF(byte* str, int size, string format, string arg1);
 
         /// <summary>
@@ -47,7 +47,7 @@ internal static partial class Interop
         /// success; if the return value is equal to the size then the result may have been truncated.
         /// On failure, returns a negative value.
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SNPrintF", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static unsafe partial int SNPrintF(byte* str, int size, string format, int arg1);
     }
 }
index 464dc33..4f3de7c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal unsafe partial class Sys
     {
-        [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetCpu")]
+        [LibraryImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetCpu")]
         internal static partial int SchedGetCpu();
     }
 }
index e304cc2..955b0fc 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SchedSetAffinity", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SchedSetAffinity", SetLastError = true)]
         internal static partial int SchedSetAffinity(int pid, ref IntPtr mask);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetAffinity", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SchedGetAffinity", SetLastError = true)]
         internal static partial int SchedGetAffinity(int pid, out IntPtr mask);
     }
 }
index c65b452..650afa4 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Send")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Send")]
         internal static unsafe partial Error Send(SafeHandle socket, byte* buffer, int bufferLen, SocketFlags flags, int* sent);
     }
 }
index b731010..f0a0cc5 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SendFile", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SendFile", SetLastError = true)]
         internal static partial Error SendFile(SafeHandle out_fd, SafeHandle in_fd, long offset, long count, out long sent);
     }
 }
index d091c9d..9d60674 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SendMessage")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SendMessage")]
         internal static unsafe partial Error SendMessage(SafeHandle socket, MessageHeader* messageHeader, SocketFlags flags, long* sent);
     }
 }
index f9c6b2b..eed788d 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetDelayedSigChildConsoleConfigurationHandler")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetDelayedSigChildConsoleConfigurationHandler")]
         [SuppressGCTransition]
         internal static unsafe partial void SetDelayedSigChildConsoleConfigurationHandler(delegate* unmanaged<void> callback);
     }
index 2a52122..615e140 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetEUid")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetEUid")]
         internal static partial int SetEUid(uint euid);
     }
 }
index 5eae239..e4eb9fc 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetReceiveTimeout")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetReceiveTimeout")]
         internal static partial Error SetReceiveTimeout(SafeHandle socket, int millisecondsTimeout);
     }
 }
index 7e2fe7c..18333fb 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSendTimeout")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSendTimeout")]
         internal static partial Error SetSendTimeout(SafeHandle socket, int millisecondsTimeout);
     }
 }
index 8a504d7..a235e8e 100644 (file)
@@ -7,11 +7,11 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSignalForBreak")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSignalForBreak")]
         [SuppressGCTransition]
         internal static partial int GetSignalForBreak();
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSignalForBreak")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSignalForBreak")]
         internal static partial int SetSignalForBreak(int signalForBreak);
     }
 }
index 66048b3..1d57e7f 100644 (file)
@@ -9,13 +9,13 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")]
         internal static unsafe partial Error SetSockOpt(SafeHandle socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int optionLen);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")]
         internal static unsafe partial Error SetSockOpt(IntPtr socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int optionLen);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRawSockOpt")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRawSockOpt")]
         internal static unsafe partial Error SetRawSockOpt(SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int optionLen);
     }
 }
index 7661463..c4b420c 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetTerminalInvalidationHandler")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetTerminalInvalidationHandler")]
         internal static unsafe partial void SetTerminalInvalidationHandler(delegate* unmanaged<void> handler);
     }
 }
index f7f100c..c01bbe6 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ShmOpen", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ShmOpen", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial SafeFileHandle ShmOpen(string name, OpenFlags flags, int mode);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ShmUnlink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_ShmUnlink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int ShmUnlink(string name);
     }
 }
index 6a04ca8..9a87ee5 100644 (file)
@@ -9,10 +9,10 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")]
         internal static partial Error Shutdown(SafeHandle socket, SocketShutdown how);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")]
         internal static partial Error Shutdown(IntPtr socket, SocketShutdown how);
     }
 }
index bce4224..56d00cc 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Socket")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Socket")]
         internal static unsafe partial Error Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, IntPtr* socket);
     }
 }
index a0c217a..4c03a64 100644 (file)
@@ -9,38 +9,38 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPSocketAddressSizes")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPSocketAddressSizes")]
         [SuppressGCTransition]
         internal static unsafe partial Error GetIPSocketAddressSizes(int* ipv4SocketAddressSize, int* ipv6SocketAddressSize);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAddressFamily")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAddressFamily")]
         [SuppressGCTransition]
         internal static unsafe partial Error GetAddressFamily(byte* socketAddress, int socketAddressLen, int* addressFamily);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetAddressFamily")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetAddressFamily")]
         [SuppressGCTransition]
         internal static unsafe partial Error SetAddressFamily(byte* socketAddress, int socketAddressLen, int addressFamily);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPort")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPort")]
         [SuppressGCTransition]
         internal static unsafe partial Error GetPort(byte* socketAddress, int socketAddressLen, ushort* port);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPort")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPort")]
         [SuppressGCTransition]
         internal static unsafe partial Error SetPort(byte* socketAddress, int socketAddressLen, ushort port);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4Address")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4Address")]
         [SuppressGCTransition]
         internal static unsafe partial Error GetIPv4Address(byte* socketAddress, int socketAddressLen, uint* address);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4Address")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4Address")]
         [SuppressGCTransition]
         internal static unsafe partial Error SetIPv4Address(byte* socketAddress, int socketAddressLen, uint address);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6Address")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6Address")]
         internal static unsafe partial Error GetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint* scopeId);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6Address")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6Address")]
         internal static unsafe partial Error SetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint scopeId);
     }
 }
index 45eb915..ef14ce8 100644 (file)
@@ -27,25 +27,25 @@ internal static partial class Interop
             private int _padding;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventPort")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventPort")]
         internal static unsafe partial Error CreateSocketEventPort(IntPtr* port);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseSocketEventPort")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseSocketEventPort")]
         internal static partial Error CloseSocketEventPort(IntPtr port);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventBuffer")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventBuffer")]
         internal static unsafe partial Error CreateSocketEventBuffer(int count, SocketEvent** buffer);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeSocketEventBuffer")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeSocketEventBuffer")]
         internal static unsafe partial Error FreeSocketEventBuffer(SocketEvent* buffer);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")]
         internal static partial Error TryChangeSocketEventRegistration(IntPtr port, SafeHandle socket, SocketEvents currentEvents, SocketEvents newEvents, IntPtr data);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")]
         internal static partial Error TryChangeSocketEventRegistration(IntPtr port, IntPtr socket, SocketEvents currentEvents, SocketEvents newEvents, IntPtr data);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitForSocketEvents")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitForSocketEvents")]
         internal static unsafe partial Error WaitForSocketEvents(IntPtr port, SocketEvent* buffer, int* count);
     }
 }
index ccf6a41..3fbae1b 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)]
         internal static partial int FStat(SafePipeHandle fd, out FileStatus output);
     }
 }
index 094fa66..15f42cd 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", SetLastError = true)]
         internal static partial int Stat(ref byte path, out FileStatus output);
 
         internal static int Stat(ReadOnlySpan<char> path, out FileStatus output)
@@ -20,7 +20,7 @@ internal static partial class Interop
             return result;
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", SetLastError = true)]
         internal static partial int LStat(ref byte path, out FileStatus output);
 
         internal static int LStat(ReadOnlySpan<char> path, out FileStatus output)
index 3da48e8..395c99d 100644 (file)
@@ -53,13 +53,13 @@ internal static partial class Interop
             HasBirthTime = 1,
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)]
         internal static partial int FStat(SafeHandle fd, out FileStatus output);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int Stat(string path, out FileStatus output);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int LStat(string path, out FileStatus output);
     }
 }
index 7a4a697..ea191c8 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StdinReady")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_StdinReady")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool StdinReady();
     }
index 9e97fd8..02325f2 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SymLink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SymLink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int SymLink(string target, string linkPath);
     }
 }
index 3b2246f..0ee8d16 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
         /// <summary>
         /// Forces a write of all modified I/O buffers to their storage mediums.
         /// </summary>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sync")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sync")]
         internal static partial void Sync();
     }
 }
index 5790ad5..a8ea57a 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
             _SC_PAGESIZE = 2
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysConf", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysConf", SetLastError = true)]
         internal static partial long SysConf(SysConfName name);
     }
 }
index 4757674..c733309 100644 (file)
@@ -29,7 +29,7 @@ internal static partial class Interop
         /// </param>
         /// <param name="message">The message to put in the log entry</param>
         /// <param name="arg1">Like printf, the argument is passed to the variadic part of the C++ function to wildcards in the message</param>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysLog", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysLog", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial void SysLog(SysLogPriority priority, string message, string arg1);
     }
 }
index 252ae16..9fe84d2 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal unsafe partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateThread")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateThread")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CreateThread(IntPtr stackSize, delegate* unmanaged<IntPtr, IntPtr> startAddress, IntPtr parameter);
     }
index d1788ee..87359ff 100644 (file)
@@ -22,7 +22,7 @@ internal static partial class Interop
         /// <returns>
         /// Returns 0 on success; otherwise, returns -1
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UTimensat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_UTimensat", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static unsafe partial int UTimensat(string path, TimeSpec* times);
     }
 }
index 5e4d7a6..984ca44 100644 (file)
@@ -145,7 +145,7 @@ internal static partial class Interop
             zfs = 0x2FC12FC1,
         }
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFileSystemType")]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFileSystemType")]
         private static partial long GetFileSystemType(SafeFileHandle fd);
 
         internal static bool TryGetFileSystemType(SafeFileHandle fd, out UnixFileSystemTypes fileSystemType)
index ec2c544..8e22880 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Unlink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Unlink", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         internal static partial int Unlink(string pathname);
     }
 }
index 4701e47..a191e49 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
         /// 2) if no children are terminated, 0 is returned
         /// 3) on error, -1 is returned
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitIdAnyExitedNoHangNoWait", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitIdAnyExitedNoHangNoWait", SetLastError = true)]
         internal static partial int WaitIdAnyExitedNoHangNoWait();
     }
 }
index 129ea86..2f4eae4 100644 (file)
@@ -17,7 +17,7 @@ internal static partial class Interop
         /// 3) if the child has not yet terminated, 0 is returned
         /// 4) on error, -1 is returned.
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitPidExitedNoHang", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitPidExitedNoHang", SetLastError = true)]
         internal static partial int WaitPidExitedNoHang(int pid, out int exitCode);
     }
 }
index b71b9c5..bd192c2 100644 (file)
@@ -17,7 +17,7 @@ internal static partial class Interop
         /// <returns>
         /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
         internal static unsafe partial int Write(SafePipeHandle fd, byte* buffer, int bufferSize);
     }
 }
index 2783467..749b34b 100644 (file)
@@ -17,10 +17,10 @@ internal static partial class Interop
         /// <returns>
         /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno
         /// </returns>
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
         internal static unsafe partial int Write(SafeHandle fd, byte* buffer, int bufferSize);
 
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
+        [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)]
         internal static unsafe partial int Write(IntPtr fd, byte* buffer, int bufferSize);
     }
 }
index 3607e3f..c6a0ecf 100644 (file)
@@ -8,11 +8,11 @@ internal static partial class Interop
 {
     internal static partial class NetSecurityNative
     {
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_IsNtlmInstalled")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_IsNtlmInstalled")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool IsNtlmInstalled();
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")]
         private static partial int EnsureGssInitialized();
 
         static NetSecurityNative()
index f835484..292523f 100644 (file)
@@ -11,54 +11,54 @@ internal static partial class Interop
 {
     internal static partial class NetSecurityNative
     {
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseGssBuffer")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseGssBuffer")]
         internal static partial void ReleaseGssBuffer(
             IntPtr bufferPtr,
             ulong length);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMinorStatus")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMinorStatus")]
         internal static partial Status DisplayMinorStatus(
             out Status minorStatus,
             Status statusValue,
             ref GssBuffer buffer);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMajorStatus")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DisplayMajorStatus")]
         internal static partial Status DisplayMajorStatus(
             out Status minorStatus,
             Status statusValue,
             ref GssBuffer buffer);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ImportUserName")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ImportUserName")]
         internal static partial Status ImportUserName(
             out Status minorStatus,
             [MarshalAs(UnmanagedType.LPUTF8Str)] string inputName,
             int inputNameByteCount,
             out SafeGssNameHandle outputName);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ImportPrincipalName")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ImportPrincipalName")]
         internal static partial Status ImportPrincipalName(
             out Status minorStatus,
             [MarshalAs(UnmanagedType.LPUTF8Str)] string inputName,
             int inputNameByteCount,
             out SafeGssNameHandle outputName);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseName")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseName")]
         internal static partial Status ReleaseName(
             out Status minorStatus,
             ref IntPtr inputName);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcquireAcceptorCred")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcquireAcceptorCred")]
         internal static partial Status AcquireAcceptorCred(
             out Status minorStatus,
             out SafeGssCredHandle outputCredHandle);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitiateCredSpNego")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitiateCredSpNego")]
         internal static partial Status InitiateCredSpNego(
             out Status minorStatus,
             SafeGssNameHandle desiredName,
             out SafeGssCredHandle outputCredHandle);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitiateCredWithPassword", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitiateCredWithPassword", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial Status InitiateCredWithPassword(
             out Status minorStatus,
             [MarshalAs(UnmanagedType.Bool)] bool isNtlm,
@@ -67,12 +67,12 @@ internal static partial class Interop
             int passwordLen,
             out SafeGssCredHandle outputCredHandle);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseCred")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseCred")]
         internal static partial Status ReleaseCred(
             out Status minorStatus,
             ref IntPtr credHandle);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContext")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContext")]
         internal static partial Status InitSecContext(
             out Status minorStatus,
             SafeGssCredHandle initiatorCredHandle,
@@ -86,7 +86,7 @@ internal static partial class Interop
             out uint retFlags,
             [MarshalAs(UnmanagedType.Bool)] out bool isNtlmUsed);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContextEx")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContextEx")]
         internal static partial Status InitSecContext(
             out Status minorStatus,
             SafeGssCredHandle initiatorCredHandle,
@@ -102,7 +102,7 @@ internal static partial class Interop
             out uint retFlags,
             [MarshalAs(UnmanagedType.Bool)] out bool isNtlmUsed);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcceptSecContext")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcceptSecContext")]
         internal static partial Status AcceptSecContext(
             out Status minorStatus,
             SafeGssCredHandle acceptorCredHandle,
@@ -113,18 +113,18 @@ internal static partial class Interop
             out uint retFlags,
             [MarshalAs(UnmanagedType.Bool)] out bool isNtlmUsed);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DeleteSecContext")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DeleteSecContext")]
         internal static partial Status DeleteSecContext(
             out Status minorStatus,
             ref IntPtr contextHandle);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_GetUser")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_GetUser")]
         internal static partial Status GetUser(
             out Status minorStatus,
             SafeGssContextHandle? acceptContextHandle,
             ref GssBuffer token);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_Wrap")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_Wrap")]
         private static unsafe partial Status Wrap(
             out Status minorStatus,
             SafeGssContextHandle? contextHandle,
@@ -133,7 +133,7 @@ internal static partial class Interop
             int count,
             ref GssBuffer outBuffer);
 
-        [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_Unwrap")]
+        [LibraryImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_Unwrap")]
         private static partial Status Unwrap(
             out Status minorStatus,
             SafeGssContextHandle? contextHandle,
index e9a7884..a5af06c 100644 (file)
@@ -11,10 +11,10 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetAsn1IntegerDerSize")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetAsn1IntegerDerSize")]
         private static partial int GetAsn1IntegerDerSize(SafeSharedAsn1IntegerHandle i);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeAsn1Integer")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeAsn1Integer")]
         private static partial int EncodeAsn1Integer(SafeSharedAsn1IntegerHandle i, byte[] buf);
 
         internal static byte[] GetAsn1IntegerBytes(SafeSharedAsn1IntegerHandle asn1Integer)
index 4d48646..3de8f89 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
 
         internal const int NID_undef = 0;
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Nid", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Nid", StringMarshalling = StringMarshalling.Utf8)]
         private static partial int ObjTxt2Nid(string oid);
 
         internal static int ResolveRequiredNid(string oid)
index efbca47..51a007e 100644 (file)
@@ -12,13 +12,13 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Obj", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Obj", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial SafeAsn1ObjectHandle ObjTxt2Obj(string s);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjObj2Txt")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjObj2Txt")]
         private static unsafe partial int ObjObj2Txt(byte* buf, int buf_len, IntPtr a);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetObjectDefinitionByName", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetObjectDefinitionByName", StringMarshalling = StringMarshalling.Utf8)]
         private static partial IntPtr CryptoNative_GetObjectDefinitionByName(string friendlyName);
         internal static IntPtr GetObjectDefinitionByName(string friendlyName)
         {
@@ -32,26 +32,26 @@ internal static partial class Interop
         }
 
         // Returns shared pointers, should not be tracked as a SafeHandle.
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjNid2Obj")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjNid2Obj")]
         internal static partial IntPtr ObjNid2Obj(int nid);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1ObjectFree")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1ObjectFree")]
         internal static partial void Asn1ObjectFree(IntPtr o);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeAsn1BitString")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeAsn1BitString")]
         internal static partial SafeAsn1BitStringHandle DecodeAsn1BitString(byte[] buf, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1BitStringFree")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1BitStringFree")]
         internal static partial void Asn1BitStringFree(IntPtr o);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringNew")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringNew")]
         internal static partial SafeAsn1OctetStringHandle Asn1OctetStringNew();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringSet")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringSet")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool Asn1OctetStringSet(SafeAsn1OctetStringHandle o, byte[] d, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringFree")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringFree")]
         internal static partial void Asn1OctetStringFree(IntPtr o);
 
         internal static unsafe string GetOidValue(IntPtr asn1ObjectPtr)
index 159a6ef..d007f57 100644 (file)
@@ -9,35 +9,35 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CreateMemoryBio")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CreateMemoryBio")]
         internal static partial SafeBioHandle CreateMemoryBio();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioNewFile", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioNewFile", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial SafeBioHandle BioNewFile(string filename, string mode);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioDestroy")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool BioDestroy(IntPtr a);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioGets")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioGets")]
         internal static partial int BioGets(SafeBioHandle b, byte[] buf, int size);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioRead")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioRead")]
         internal static partial int BioRead(SafeBioHandle b, byte[] data, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
         internal static partial int BioWrite(SafeBioHandle b, byte[] data, int len);
 
         internal static int BioWrite(SafeBioHandle b, ReadOnlySpan<byte> data) =>
             BioWrite(b, ref MemoryMarshal.GetReference(data), data.Length);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
         private static partial int BioWrite(SafeBioHandle b, ref byte data, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMemoryBioSize")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMemoryBioSize")]
         internal static partial int GetMemoryBioSize(SafeBioHandle bio);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioCtrlPending")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioCtrlPending")]
         internal static partial int BioCtrlPending(SafeBioHandle bio);
     }
 }
index a4ab395..2c2d923 100644 (file)
@@ -10,16 +10,16 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumDestroy")]
         internal static partial void BigNumDestroy(IntPtr a);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumFromBinary")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumFromBinary")]
         private static unsafe partial IntPtr BigNumFromBinary(byte* s, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumToBinary")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumToBinary")]
         private static unsafe partial int BigNumToBinary(SafeBignumHandle a, byte* to);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetBigNumBytes")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetBigNumBytes")]
         private static partial int GetBigNumBytes(SafeBignumHandle a);
 
         private static unsafe IntPtr CreateBignumPtr(ReadOnlySpan<byte> bigEndianValue)
index b139a44..fc40429 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509Hostname", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509Hostname", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial int CheckX509Hostname(
             IntPtr x509,
             string hostname,
index 0196000..50dc4c2 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
     {
         internal delegate int NegativeSizeReadMethod<in THandle>(THandle handle, byte[]? buf, int cBuf);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioTell")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioTell")]
         internal static partial int CryptoNative_BioTell(SafeBioHandle bio);
 
         internal static int BioTell(SafeBioHandle bio)
@@ -27,44 +27,44 @@ internal static partial class Interop
             return ret;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioSeek")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioSeek")]
         internal static partial int BioSeek(SafeBioHandle bio, int pos);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509Thumbprint")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509Thumbprint")]
         private static partial int GetX509Thumbprint(SafeX509Handle x509, byte[]? buf, int cBuf);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameRawBytes")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameRawBytes")]
         private static partial int GetX509NameRawBytes(IntPtr x509Name, byte[]? buf, int cBuf);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ReadX509AsDerFromBio")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ReadX509AsDerFromBio")]
         internal static partial SafeX509Handle ReadX509AsDerFromBio(SafeBioHandle bio);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509CrlNextUpdate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509CrlNextUpdate")]
         internal static partial IntPtr GetX509CrlNextUpdate(SafeX509CrlHandle crl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509Version")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509Version")]
         internal static partial int GetX509Version(SafeX509Handle x509);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyParameterBytes")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyParameterBytes")]
         private static partial int GetX509PublicKeyParameterBytes(SafeX509Handle x509, byte[]? buf, int cBuf);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EkuFieldCount")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EkuFieldCount")]
         internal static partial int GetX509EkuFieldCount(SafeEkuExtensionHandle eku);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EkuField")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EkuField")]
         internal static partial IntPtr GetX509EkuField(SafeEkuExtensionHandle eku, int loc);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameInfo")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameInfo")]
         internal static partial SafeBioHandle GetX509NameInfo(SafeX509Handle x509, int nameType, [MarshalAs(UnmanagedType.Bool)] bool forIssuer);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetAsn1StringBytes")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetAsn1StringBytes")]
         private static partial int GetAsn1StringBytes(IntPtr asn1, byte[]? buf, int cBuf);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PushX509StackField")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PushX509StackField")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool PushX509StackField(SafeX509StackHandle stack, SafeX509Handle x509);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PushX509StackField")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PushX509StackField")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool PushX509StackField(SafeSharedX509StackHandle stack, SafeX509Handle x509);
 
@@ -82,13 +82,13 @@ internal static partial class Interop
             return Marshal.PtrToStringAnsi(GetX509RootStoreFile_private(&unused));
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStorePath")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStorePath")]
         private static unsafe partial IntPtr GetX509RootStorePath_private(byte* defaultPath);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStoreFile")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStoreFile")]
         private static unsafe partial IntPtr GetX509RootStoreFile_private(byte* defaultPath);
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_X509StoreSetVerifyTime(
             SafeX509StoreHandle ctx,
             int year,
@@ -99,10 +99,10 @@ internal static partial class Interop
             int second,
             [MarshalAs(UnmanagedType.Bool)] bool isDst);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509IpAddress", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509IpAddress", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial int CheckX509IpAddress(SafeX509Handle x509, byte[] addressBytes, int addressLen, string hostname, int cchHostname);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509Hostname", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_CheckX509Hostname", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial int CheckX509Hostname(SafeX509Handle x509, string hostname, int cchHostname);
 
         internal static byte[] GetAsn1StringBytes(IntPtr asn1)
index ebce6ab..923930f 100644 (file)
@@ -11,18 +11,18 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaUpRef")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaUpRef")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DsaUpRef(IntPtr dsa);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaDestroy")]
         internal static partial void DsaDestroy(IntPtr dsa);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaGenerateKey")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaGenerateKey")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DsaGenerateKey(out SafeDsaHandle dsa, int bits);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeSignature")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeSignature")]
         private static partial int DsaSizeSignature(SafeDsaHandle dsa);
 
         /// <summary>
@@ -34,7 +34,7 @@ internal static partial class Interop
             return size;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeQ")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeQ")]
         private static partial int DsaSizeQ(SafeDsaHandle dsa);
 
         /// <summary>
@@ -47,7 +47,7 @@ internal static partial class Interop
             return size;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeP")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSizeP")]
         private static partial int DsaSizeP(SafeDsaHandle dsa);
 
         /// <summary>
@@ -65,7 +65,7 @@ internal static partial class Interop
         internal static bool DsaSign(SafeDsaHandle dsa, ReadOnlySpan<byte> hash, Span<byte> refSignature, out int outSignatureLength) =>
             DsaSign(dsa, ref MemoryMarshal.GetReference(hash), hash.Length, ref MemoryMarshal.GetReference(refSignature), out outSignatureLength);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSign")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaSign")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool DsaSign(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte refSignature, out int outSignatureLength);
 
@@ -83,7 +83,7 @@ internal static partial class Interop
             return ret;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaVerify")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaVerify")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool DsaVerify(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte signature, int signatureLength);
 
@@ -144,7 +144,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetDsaParameters")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetDsaParameters")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool GetDsaParameters(
             SafeDsaHandle key,
@@ -154,7 +154,7 @@ internal static partial class Interop
             out IntPtr y, out int y_cb,
             out IntPtr x, out int x_cb);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaKeyCreateByExplicitParameters")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaKeyCreateByExplicitParameters")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DsaKeyCreateByExplicitParameters(
             out SafeDsaHandle dsa,
index 66b465b..ff307db 100644 (file)
@@ -11,22 +11,22 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrClearError")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrClearError")]
         internal static partial ulong ErrClearError();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrGetExceptionError")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrGetExceptionError")]
         private static partial ulong ErrGetExceptionError([MarshalAs(UnmanagedType.Bool)] out bool isAllocFailure);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekError")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekError")]
         internal static partial ulong ErrPeekError();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")]
         internal static partial ulong ErrPeekLastError();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")]
         internal static partial IntPtr ErrReasonErrorString(ulong error);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")]
         private static unsafe partial void ErrErrorStringN(ulong e, byte* buf, int len);
 
         private static unsafe string ErrErrorStringN(ulong error)
index b949698..f47bf5d 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCreate2")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCreate2")]
         internal static partial SafeEvpCipherCtxHandle EvpCipherCreate(
             IntPtr cipher,
             ref byte key,
@@ -17,11 +17,11 @@ internal static partial class Interop
             ref byte iv,
             int enc);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCreatePartial")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCreatePartial")]
         internal static partial SafeEvpCipherCtxHandle EvpCipherCreatePartial(
             IntPtr cipher);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetKeyAndIV")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetKeyAndIV")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EvpCipherSetKeyAndIV(
             SafeEvpCipherCtxHandle ctx,
@@ -45,7 +45,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetGcmNonceLength")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetGcmNonceLength")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool CryptoNative_EvpCipherSetGcmNonceLength(
             SafeEvpCipherCtxHandle ctx, int nonceLength);
@@ -58,7 +58,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetCcmNonceLength")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetCcmNonceLength")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool CryptoNative_EvpCipherSetCcmNonceLength(
             SafeEvpCipherCtxHandle ctx, int nonceLength);
@@ -71,10 +71,10 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherDestroy")]
         internal static partial void EvpCipherDestroy(IntPtr ctx);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherReset")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherReset")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static unsafe partial bool EvpCipherReset(SafeEvpCipherCtxHandle ctx, byte* pIv, int cIv);
 
@@ -86,11 +86,11 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCtxSetPadding")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherCtxSetPadding")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvpCipherCtxSetPadding(SafeEvpCipherCtxHandle x, int padding);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherUpdate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherUpdate")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EvpCipherUpdate(
             SafeEvpCipherCtxHandle ctx,
@@ -122,7 +122,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherFinalEx")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherFinalEx")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EvpCipherFinalEx(
             SafeEvpCipherCtxHandle ctx,
@@ -137,7 +137,7 @@ internal static partial class Interop
             return EvpCipherFinalEx(ctx, ref MemoryMarshal.GetReference(output), out bytesWritten);
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetGcmTag")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetGcmTag")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EvpCipherGetGcmTag(
             SafeEvpCipherCtxHandle ctx,
@@ -152,7 +152,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetAeadTag")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetAeadTag")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EvpCipherGetAeadTag(
             SafeEvpCipherCtxHandle ctx,
@@ -167,7 +167,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetGcmTag")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetGcmTag")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EvpCipherSetGcmTag(
             SafeEvpCipherCtxHandle ctx,
@@ -182,7 +182,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetAeadTag")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetAeadTag")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EvpCipherSetAeadTag(
             SafeEvpCipherCtxHandle ctx,
@@ -197,7 +197,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetCcmTag")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherGetCcmTag")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EvpCipherGetCcmTag(
             SafeEvpCipherCtxHandle ctx,
@@ -212,7 +212,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetCcmTag")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherSetCcmTag")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EvpCipherSetCcmTag(
             SafeEvpCipherCtxHandle ctx,
@@ -236,88 +236,88 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ecb")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ecb")]
         internal static partial IntPtr EvpAes128Ecb();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cbc")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cbc")]
         internal static partial IntPtr EvpAes128Cbc();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Gcm")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Gcm")]
         internal static partial IntPtr EvpAes128Gcm();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb8")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb8")]
         internal static partial IntPtr EvpAes128Cfb8();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb128")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb128")]
         internal static partial IntPtr EvpAes128Cfb128();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ccm")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ccm")]
         internal static partial IntPtr EvpAes128Ccm();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ecb")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ecb")]
         internal static partial IntPtr EvpAes192Ecb();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cbc")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cbc")]
         internal static partial IntPtr EvpAes192Cbc();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Gcm")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Gcm")]
         internal static partial IntPtr EvpAes192Gcm();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb8")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb8")]
         internal static partial IntPtr EvpAes192Cfb8();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb128")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb128")]
         internal static partial IntPtr EvpAes192Cfb128();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ccm")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ccm")]
         internal static partial IntPtr EvpAes192Ccm();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ecb")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ecb")]
         internal static partial IntPtr EvpAes256Ecb();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cbc")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cbc")]
         internal static partial IntPtr EvpAes256Cbc();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Gcm")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Gcm")]
         internal static partial IntPtr EvpAes256Gcm();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb128")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb128")]
         internal static partial IntPtr EvpAes256Cfb128();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb8")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb8")]
         internal static partial IntPtr EvpAes256Cfb8();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ccm")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ccm")]
         internal static partial IntPtr EvpAes256Ccm();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCbc")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCbc")]
         internal static partial IntPtr EvpDesCbc();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesEcb")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesEcb")]
         internal static partial IntPtr EvpDesEcb();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCfb8")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCfb8")]
         internal static partial IntPtr EvpDesCfb8();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cbc")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cbc")]
         internal static partial IntPtr EvpDes3Cbc();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Ecb")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Ecb")]
         internal static partial IntPtr EvpDes3Ecb();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb8")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb8")]
         internal static partial IntPtr EvpDes3Cfb8();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb64")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb64")]
         internal static partial IntPtr EvpDes3Cfb64();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Cbc")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Cbc")]
         internal static partial IntPtr EvpRC2Cbc();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Ecb")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Ecb")]
         internal static partial IntPtr EvpRC2Ecb();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpChaCha20Poly1305")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpChaCha20Poly1305")]
         internal static partial IntPtr EvpChaCha20Poly1305();
 
         internal enum EvpCipherDirection : int
index 465d67c..abaefab 100644 (file)
@@ -15,31 +15,31 @@ internal static partial class Interop
         private static volatile IntPtr s_evpSha384;
         private static volatile IntPtr s_evpSha512;
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial IntPtr CryptoNative_EvpMd5();
 
         internal static IntPtr EvpMd5() =>
             s_evpMd5 != IntPtr.Zero ? s_evpMd5 : (s_evpMd5 = CryptoNative_EvpMd5());
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         internal static partial IntPtr CryptoNative_EvpSha1();
 
         internal static IntPtr EvpSha1() =>
             s_evpSha1 != IntPtr.Zero ? s_evpSha1 : (s_evpSha1 = CryptoNative_EvpSha1());
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         internal static partial IntPtr CryptoNative_EvpSha256();
 
         internal static IntPtr EvpSha256() =>
             s_evpSha256 != IntPtr.Zero ? s_evpSha256 : (s_evpSha256 = CryptoNative_EvpSha256());
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         internal static partial IntPtr CryptoNative_EvpSha384();
 
         internal static IntPtr EvpSha384() =>
             s_evpSha384 != IntPtr.Zero ? s_evpSha384 : (s_evpSha384 = CryptoNative_EvpSha384());
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         internal static partial IntPtr CryptoNative_EvpSha512();
 
         internal static IntPtr EvpSha512() =>
index 42adb07..d729d9b 100644 (file)
@@ -10,37 +10,37 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")]
         internal static partial SafeEvpMdCtxHandle EvpMdCtxCreate(IntPtr type);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")]
         internal static partial void EvpMdCtxDestroy(IntPtr ctx);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")]
         internal static partial int EvpDigestReset(SafeEvpMdCtxHandle ctx, IntPtr type);
 
         internal static int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ReadOnlySpan<byte> d, int cnt) =>
             EvpDigestUpdate(ctx, ref MemoryMarshal.GetReference(d), cnt);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")]
         private static partial int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ref byte d, int cnt);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")]
         internal static partial int EvpDigestFinalEx(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")]
         internal static partial int EvpDigestCurrent(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")]
         internal static unsafe partial int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, uint* mdSize);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdSize")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdSize")]
         internal static partial int EvpMdSize(IntPtr md);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")]
         private static partial int GetMaxMdSize();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pbkdf2")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pbkdf2")]
         private static unsafe partial int Pbkdf2(
             byte* pPassword,
             int passwordLength,
index bbcbcd2..b70935b 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByKeyParameters", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByKeyParameters", StringMarshalling = StringMarshalling.Utf8)]
         private static partial int EcKeyCreateByKeyParameters(
             out SafeEcKeyHandle key,
             string oid,
@@ -37,7 +37,7 @@ internal static partial class Interop
             return key;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByExplicitParameters")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByExplicitParameters")]
         internal static partial SafeEcKeyHandle EcKeyCreateByExplicitParameters(
             ECCurve.ECCurveType curveType,
             byte[]? qx, int qxLength,
@@ -97,7 +97,7 @@ internal static partial class Interop
         }
 
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_GetECKeyParameters(
             SafeEcKeyHandle key,
             [MarshalAs(UnmanagedType.Bool)] bool includePrivate,
@@ -166,7 +166,7 @@ internal static partial class Interop
             return parameters;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_GetECCurveParameters(
             SafeEcKeyHandle key,
             [MarshalAs(UnmanagedType.Bool)] bool includePrivate,
index 77d7f78..7d994d9 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         internal static bool EcDsaSign(ReadOnlySpan<byte> dgst, Span<byte> sig, out int siglen, SafeEcKeyHandle ecKey) =>
             EcDsaSign(ref MemoryMarshal.GetReference(dgst), dgst.Length, ref MemoryMarshal.GetReference(sig), out siglen, ecKey);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaSign")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaSign")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EcDsaSign(ref byte dgst, int dlen, ref byte sig, out int siglen, SafeEcKeyHandle ecKey);
 
@@ -39,11 +39,11 @@ internal static partial class Interop
          *      0: incorrect signature
          *     -1: error
          */
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaVerify")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaVerify")]
         private static partial int EcDsaVerify(ref byte dgst, int dgst_len, ref byte sigbuf, int sig_len, SafeEcKeyHandle ecKey);
 
         // returns the maximum length of a DER encoded ECDSA signature created with this key.
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaSize")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcDsaSize")]
         private static partial int CryptoNative_EcDsaSize(SafeEcKeyHandle ecKey);
 
         internal static int EcDsaSize(SafeEcKeyHandle ecKey)
index 7ad6d52..c62dfc0 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByOid", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyCreateByOid", StringMarshalling = StringMarshalling.Utf8)]
         private static partial SafeEcKeyHandle CryptoNative_EcKeyCreateByOid(string oid);
         internal static SafeEcKeyHandle? EcKeyCreateByOid(string oid)
         {
@@ -23,18 +23,18 @@ internal static partial class Interop
             return handle;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyDestroy")]
         internal static partial void EcKeyDestroy(IntPtr a);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGenerateKey")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGenerateKey")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EcKeyGenerateKey(SafeEcKeyHandle eckey);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyUpRef")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyUpRef")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EcKeyUpRef(IntPtr r);
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_EcKeyGetSize(SafeEcKeyHandle ecKey, out int keySize);
         internal static int EcKeyGetSize(SafeEcKeyHandle key)
         {
@@ -47,7 +47,7 @@ internal static partial class Interop
             throw Interop.Crypto.CreateOpenSslCryptographicException();
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGetCurveName2")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGetCurveName2")]
         private static partial int CryptoNative_EcKeyGetCurveName(SafeEcKeyHandle ecKey, out int nid);
 
         internal static string EcKeyGetCurveName(SafeEcKeyHandle key)
index cd25db9..407d9b2 100644 (file)
@@ -9,10 +9,10 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyGetDsa")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyGetDsa")]
         internal static partial SafeDsaHandle EvpPkeyGetDsa(SafeEvpPKeyHandle pkey);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeySetDsa")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeySetDsa")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvpPkeySetDsa(SafeEvpPKeyHandle pkey, SafeDsaHandle key);
     }
index 2d61d8b..6ef629c 100644 (file)
@@ -9,10 +9,10 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyGetEcKey")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyGetEcKey")]
         internal static partial SafeEcKeyHandle EvpPkeyGetEcKey(SafeEvpPKeyHandle pkey);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeySetEcKey")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeySetEcKey")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvpPkeySetEcKey(SafeEvpPKeyHandle pkey, SafeEcKeyHandle key);
     }
index 01e12ff..5308043 100644 (file)
@@ -11,16 +11,16 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxCreate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxCreate")]
         internal static partial SafeEvpPKeyCtxHandle EvpPKeyCtxCreate(SafeEvpPKeyHandle pkey, SafeEvpPKeyHandle peerkey, out uint secretLength);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyDeriveSecretAgreement")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyDeriveSecretAgreement")]
         private static partial int EvpPKeyDeriveSecretAgreement(
             ref byte secret,
             uint secretLength,
             SafeEvpPKeyCtxHandle ctx);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxDestroy")]
         internal static partial void EvpPKeyCtxDestroy(IntPtr ctx);
 
         internal static void EvpPKeyDeriveSecretAgreement(SafeEvpPKeyCtxHandle ctx, Span<byte> destination)
index 523d3f3..9fe32f2 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial SafeEvpPKeyHandle CryptoNative_EvpPKeyCreateRsa(IntPtr rsa);
 
         internal static SafeEvpPKeyHandle EvpPKeyCreateRsa(IntPtr rsa)
@@ -29,7 +29,7 @@ internal static partial class Interop
             return pkey;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial SafeEvpPKeyHandle CryptoNative_RsaGenerateKey(int keySize);
 
         internal static SafeEvpPKeyHandle RsaGenerateKey(int keySize)
@@ -45,7 +45,7 @@ internal static partial class Interop
             return pkey;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_RsaDecrypt(
             SafeEvpPKeyHandle pkey,
             ref byte source,
@@ -80,7 +80,7 @@ internal static partial class Interop
             return written;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_RsaEncrypt(
             SafeEvpPKeyHandle pkey,
             ref byte source,
@@ -115,7 +115,7 @@ internal static partial class Interop
             return written;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_RsaSignHash(
             SafeEvpPKeyHandle pkey,
             RSASignaturePaddingMode paddingMode,
@@ -150,7 +150,7 @@ internal static partial class Interop
             return written;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_RsaVerifyHash(
             SafeEvpPKeyHandle pkey,
             RSASignaturePaddingMode paddingMode,
index 95e9ab8..bbb7a67 100644 (file)
@@ -10,10 +10,10 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyCreate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyCreate")]
         internal static partial SafeEvpPKeyHandle EvpPkeyCreate();
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial SafeEvpPKeyHandle CryptoNative_EvpPKeyDuplicate(
             SafeEvpPKeyHandle currentKey,
             EvpAlgorithmId algorithmId);
@@ -37,22 +37,22 @@ internal static partial class Interop
             return pkey;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyDestroy")]
         internal static partial void EvpPkeyDestroy(IntPtr pkey);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeySize")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeySize")]
         internal static partial int EvpPKeySize(SafeEvpPKeyHandle pkey);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_UpRefEvpPkey")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_UpRefEvpPkey")]
         internal static partial int UpRefEvpPkey(SafeEvpPKeyHandle handle);
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static unsafe partial SafeEvpPKeyHandle CryptoNative_DecodeSubjectPublicKeyInfo(
             byte* buf,
             int len,
             int algId);
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static unsafe partial SafeEvpPKeyHandle CryptoNative_DecodePkcs8PrivateKey(
             byte* buf,
             int len,
@@ -104,7 +104,7 @@ internal static partial class Interop
             return handle;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_GetPkcs8PrivateKeySize(IntPtr pkey, out int p8size);
 
         private static int GetPkcs8PrivateKeySize(IntPtr pkey)
@@ -129,7 +129,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static unsafe partial int CryptoNative_EncodePkcs8PrivateKey(IntPtr pkey, byte* buf);
 
         internal static ArraySegment<byte> RentEncodePkcs8PrivateKey(SafeEvpPKeyHandle pkey)
@@ -165,7 +165,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_GetSubjectPublicKeyInfoSize(IntPtr pkey);
 
         private static int GetSubjectPublicKeyInfoSize(IntPtr pkey)
@@ -180,7 +180,7 @@ internal static partial class Interop
             return ret;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static unsafe partial int CryptoNative_EncodeSubjectPublicKeyInfo(IntPtr pkey, byte* buf);
 
         internal static ArraySegment<byte> RentEncodeSubjectPublicKeyInfo(SafeEvpPKeyHandle pkey)
index 88cae2d..496324f 100644 (file)
@@ -10,28 +10,28 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCreate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCreate")]
         internal static partial SafeHmacCtxHandle HmacCreate(ref byte key, int keyLen, IntPtr md);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacDestroy")]
         internal static partial void HmacDestroy(IntPtr ctx);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacReset")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacReset")]
         internal static partial int HmacReset(SafeHmacCtxHandle ctx);
 
         internal static int HmacUpdate(SafeHmacCtxHandle ctx, ReadOnlySpan<byte> data, int len) =>
             HmacUpdate(ctx, ref MemoryMarshal.GetReference(data), len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacUpdate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacUpdate")]
         private static partial int HmacUpdate(SafeHmacCtxHandle ctx, ref byte data, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacFinal")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacFinal")]
         internal static partial int HmacFinal(SafeHmacCtxHandle ctx, ref byte data, ref int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCurrent")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCurrent")]
         internal static partial int HmacCurrent(SafeHmacCtxHandle ctx, ref byte data, ref int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacOneShot")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacOneShot")]
         private static unsafe partial int HmacOneShot(IntPtr type, byte* key, int keySize, byte* source, int sourceSize, byte* md, int* mdSize);
 
         internal static unsafe int HmacOneShot(IntPtr type, ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination)
index e7afaa1..9dabafd 100644 (file)
@@ -48,7 +48,7 @@ internal static partial class Interop
             // No-op that exists to provide a hook for other static constructors.
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")]
         private static partial int EnsureOpenSslInitialized();
     }
 }
index d3fada1..f30c816 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
         private static volatile bool s_loadedLegacy;
         private static readonly object s_legacyLoadLock = new object();
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial void CryptoNative_RegisterLegacyAlgorithms();
 
         internal static void EnsureLegacyAlgorithmsRegistered()
index 8d82c6c..118ee48 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_LookupFriendlyNameByOid", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_LookupFriendlyNameByOid", StringMarshalling = StringMarshalling.Utf8)]
         internal static partial int LookupFriendlyNameByOid(string oidValue, ref IntPtr friendlyNamePtr);
     }
 }
index 81f12a4..a4cb879 100644 (file)
@@ -12,16 +12,16 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspRequestDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspRequestDestroy")]
         internal static partial void OcspRequestDestroy(IntPtr ocspReq);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOcspRequestDerSize")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOcspRequestDerSize")]
         internal static partial int GetOcspRequestDerSize(SafeOcspRequestHandle req);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeOcspRequest")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeOcspRequest")]
         internal static partial int EncodeOcspRequest(SafeOcspRequestHandle req, byte[] buf);
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial SafeOcspResponseHandle CryptoNative_DecodeOcspResponse(ref byte buf, int len);
 
         internal static SafeOcspResponseHandle DecodeOcspResponse(ReadOnlySpan<byte> buf)
@@ -31,10 +31,10 @@ internal static partial class Interop
                 buf.Length);
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspResponseDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspResponseDestroy")]
         internal static partial void OcspResponseDestroy(IntPtr ocspReq);
 
-        [GeneratedDllImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)]
         private static partial int CryptoNative_X509ChainGetCachedOcspStatus(
             SafeX509StoreCtxHandle ctx,
             string cachePath,
@@ -53,7 +53,7 @@ internal static partial class Interop
             return response;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)]
         private static partial int CryptoNative_X509ChainVerifyOcsp(
             SafeX509StoreCtxHandle ctx,
             SafeOcspRequestHandle req,
@@ -79,7 +79,7 @@ internal static partial class Interop
             return response;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial SafeOcspRequestHandle CryptoNative_X509ChainBuildOcspRequest(
             SafeX509StoreCtxHandle storeCtx,
             int chainDepth);
index 696efb3..e27f5be 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class OpenSslNoInit
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslAvailable")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslAvailable")]
         private static partial int OpenSslAvailable();
 
         private static readonly Lazy<bool> s_openSslAvailable =
index a4efc28..4695539 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class OpenSsl
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslGetProtocolSupport")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslGetProtocolSupport")]
         internal static partial int OpenSslGetProtocolSupport(int protocol);
     }
 }
index c7b4c22..034ca71 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class OpenSsl
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslVersionNumber")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslVersionNumber")]
         internal static partial long OpenSslVersionNumber();
     }
 }
index a1d5568..bf922ca 100644 (file)
@@ -9,31 +9,31 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadBioPkcs7")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadBioPkcs7")]
         internal static partial SafePkcs7Handle PemReadBioPkcs7(SafeBioHandle bp);
 
         internal static SafePkcs7Handle DecodePkcs7(ReadOnlySpan<byte> buf) =>
             DecodePkcs7(ref MemoryMarshal.GetReference(buf), buf.Length);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodePkcs7")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodePkcs7")]
         private static partial SafePkcs7Handle DecodePkcs7(ref byte buf, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_D2IPkcs7Bio")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_D2IPkcs7Bio")]
         internal static partial SafePkcs7Handle D2IPkcs7Bio(SafeBioHandle bp);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7CreateCertificateCollection")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7CreateCertificateCollection")]
         internal static partial SafePkcs7Handle Pkcs7CreateCertificateCollection(SafeX509StackHandle certs);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7Destroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7Destroy")]
         internal static partial void Pkcs7Destroy(IntPtr p7);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7Certificates")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7Certificates")]
         private static partial int GetPkcs7Certificates(SafePkcs7Handle p7, out SafeSharedX509StackHandle certs);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7DerSize")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7DerSize")]
         internal static partial int GetPkcs7DerSize(SafePkcs7Handle p7);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodePkcs7")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodePkcs7")]
         internal static partial int EncodePkcs7(SafePkcs7Handle p7, byte[] buf);
 
         internal static SafeSharedX509StackHandle GetPkcs7Certificates(SafePkcs7Handle p7)
index 10e501f..99373d6 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             return CryptoNative_GetRandomBytes(pbBuffer, count) != 0;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static unsafe partial int CryptoNative_GetRandomBytes(byte* buf, int num);
     }
 }
index 66431af..b671bde 100644 (file)
@@ -10,10 +10,10 @@ internal static partial class Interop
 {
     internal static partial class Ssl
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")]
         internal static partial void SslCtxSetProtocolOptions(IntPtr ctx, SslProtocols protocols);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")]
         internal static partial void SslCtxSetProtocolOptions(SafeSslContextHandle ctx, SslProtocols protocols);
     }
 }
index e06ec39..605a85d 100644 (file)
@@ -20,44 +20,44 @@ internal static partial class Interop
         internal const int SSL_TLSEXT_ERR_ALERT_FATAL = 2;
         internal const int SSL_TLSEXT_ERR_NOACK = 3;
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureLibSslInitialized")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureLibSslInitialized")]
         internal static partial void EnsureLibSslInitialized();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslV2_3Method")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslV2_3Method")]
         internal static partial IntPtr SslV2_3Method();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCreate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCreate")]
         internal static partial SafeSslHandle SslCreate(SafeSslContextHandle ctx);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")]
         internal static partial SslErrorCode SslGetError(SafeSslHandle ssl, int ret);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")]
         internal static partial SslErrorCode SslGetError(IntPtr ssl, int ret);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetQuietShutdown")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetQuietShutdown")]
         internal static partial void SslSetQuietShutdown(SafeSslHandle ssl, int mode);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDestroy")]
         internal static partial void SslDestroy(IntPtr ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetConnectState")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetConnectState")]
         internal static partial void SslSetConnectState(SafeSslHandle ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetAcceptState")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetAcceptState")]
         internal static partial void SslSetAcceptState(SafeSslHandle ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetAlpnProtos")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetAlpnProtos")]
         internal static unsafe partial int SslSetAlpnProtos(SafeSslHandle ssl, byte* protos, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetVersion")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetVersion")]
         internal static partial IntPtr SslGetVersion(SafeSslHandle ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetTlsExtHostName", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetTlsExtHostName", StringMarshalling = StringMarshalling.Utf8)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SslSetTlsExtHostName(SafeSslHandle ssl, string host);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGet0AlpnSelected")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGet0AlpnSelected")]
         internal static partial void SslGetAlpnSelected(SafeSslHandle ssl, out IntPtr protocol, out int len);
 
         internal static byte[]? SslGetAlpnSelected(SafeSslHandle ssl)
@@ -74,97 +74,97 @@ internal static partial class Interop
             return result;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslWrite", SetLastError = true)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslWrite", SetLastError = true)]
         internal static partial int SslWrite(SafeSslHandle ssl, ref byte buf, int num, out SslErrorCode error);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRead", SetLastError = true)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRead", SetLastError = true)]
         internal static partial int SslRead(SafeSslHandle ssl, ref byte buf, int num, out SslErrorCode error);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRenegotiate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslRenegotiate")]
         internal static partial int SslRenegotiate(SafeSslHandle ssl, out SslErrorCode error);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_IsSslRenegotiatePending")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_IsSslRenegotiatePending")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool IsSslRenegotiatePending(SafeSslHandle ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")]
         internal static partial int SslShutdown(IntPtr ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")]
         internal static partial int SslShutdown(SafeSslHandle ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetBio")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetBio")]
         internal static partial void SslSetBio(SafeSslHandle ssl, SafeBioHandle rbio, SafeBioHandle wbio);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDoHandshake", SetLastError = true)]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDoHandshake", SetLastError = true)]
         internal static partial int SslDoHandshake(SafeSslHandle ssl, out SslErrorCode error);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_IsSslStateOK")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_IsSslStateOK")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool IsSslStateOK(SafeSslHandle ssl);
 
         // NOTE: this is just an (unsafe) overload to the BioWrite method from Interop.Bio.cs.
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
         internal static unsafe partial int BioWrite(SafeBioHandle b, byte* data, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BioWrite")]
         internal static partial int BioWrite(SafeBioHandle b, ref byte data, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertificate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertificate")]
         internal static partial SafeX509Handle SslGetPeerCertificate(SafeSslHandle ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertChain")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerCertChain")]
         internal static partial SafeSharedX509StackHandle SslGetPeerCertChain(SafeSslHandle ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerFinished")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetPeerFinished")]
         internal static partial int SslGetPeerFinished(SafeSslHandle ssl, IntPtr buf, int count);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetFinished")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetFinished")]
         internal static partial int SslGetFinished(SafeSslHandle ssl, IntPtr buf, int count);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSessionReused")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSessionReused")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SslSessionReused(SafeSslHandle ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetClientCAList")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetClientCAList")]
         private static partial SafeSharedX509NameStackHandle SslGetClientCAList_private(SafeSslHandle ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetCurrentCipherId")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetCurrentCipherId")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SslGetCurrentCipherId(SafeSslHandle ssl, out int cipherId);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOpenSslCipherSuiteName")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOpenSslCipherSuiteName")]
         private static partial IntPtr GetOpenSslCipherSuiteName(SafeSslHandle ssl, int cipherSuite, out int isTls12OrLower);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SetCiphers")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SetCiphers")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool SslSetCiphers(SafeSslHandle ssl, byte* cipherList, byte* cipherSuites);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetVerifyPeer")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetVerifyPeer")]
         internal static partial void SslSetVerifyPeer(SafeSslHandle ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetData")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetData")]
         internal static partial IntPtr SslGetData(IntPtr ssl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")]
         internal static partial int SslSetData(SafeSslHandle ssl, IntPtr data);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")]
         internal static partial int SslSetData(IntPtr ssl, IntPtr data);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUseCertificate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUseCertificate")]
         internal static partial int SslUseCertificate(SafeSslHandle ssl, SafeX509Handle certPtr);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUsePrivateKey")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUsePrivateKey")]
         internal static partial int SslUsePrivateKey(SafeSslHandle ssl, SafeEvpPKeyHandle keyPtr);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetClientCertCallback")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetClientCertCallback")]
         internal static unsafe partial void SslSetClientCertCallback(SafeSslHandle ssl, int set);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetPostHandshakeAuth")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetPostHandshakeAuth")]
         internal static partial void SslSetPostHandshakeAuth(SafeSslHandle ssl, int value);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Tls13Supported")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Tls13Supported")]
         private static partial int Tls13SupportedImpl();
 
         internal static class Capabilities
@@ -219,11 +219,11 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslAddExtraChainCert")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslAddExtraChainCert")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SslAddExtraChainCert(SafeSslHandle ssl, SafeX509Handle x509);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslAddClientCAs")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslAddClientCAs")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static unsafe partial bool SslAddClientCAs(SafeSslHandle ssl, IntPtr* x509s, int count);
 
index 7401389..e735e68 100644 (file)
@@ -13,16 +13,16 @@ internal static partial class Interop
 {
     internal static partial class Ssl
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxCreate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxCreate")]
         internal static partial SafeSslContextHandle SslCtxCreate(IntPtr method);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxDestroy")]
         internal static partial void SslCtxDestroy(IntPtr ctx);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetAlpnSelectCb")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetAlpnSelectCb")]
         internal static unsafe partial void SslCtxSetAlpnSelectCb(SafeSslContextHandle ctx, delegate* unmanaged<IntPtr, byte**, byte*, byte*, uint, IntPtr, int> callback, IntPtr arg);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCaching")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCaching")]
         internal static unsafe partial void SslCtxSetCaching(SafeSslContextHandle ctx, int mode);
 
         internal static bool AddExtraChainCertificates(SafeSslContextHandle ctx, X509Certificate2[] chain)
index e52164a..f3412d6 100644 (file)
@@ -11,27 +11,27 @@ internal static partial class Interop
 {
     internal static partial class Ssl
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxAddExtraChainCert")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxAddExtraChainCert")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SslCtxAddExtraChainCert(SafeSslContextHandle ctx, SafeX509Handle x509);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxUseCertificate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxUseCertificate")]
         internal static partial int SslCtxUseCertificate(SafeSslContextHandle ctx, SafeX509Handle certPtr);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxUsePrivateKey")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxUsePrivateKey")]
         internal static partial int SslCtxUsePrivateKey(SafeSslContextHandle ctx, SafeEvpPKeyHandle keyPtr);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxCheckPrivateKey")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxCheckPrivateKey")]
         internal static partial int SslCtxCheckPrivateKey(SafeSslContextHandle ctx);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetQuietShutdown")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetQuietShutdown")]
         internal static partial void SslCtxSetQuietShutdown(SafeSslContextHandle ctx);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCiphers")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCiphers")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool SslCtxSetCiphers(SafeSslContextHandle ctx, byte* cipherList, byte* cipherSuites);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetEncryptionPolicy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetEncryptionPolicy")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetEncryptionPolicy(SafeSslContextHandle ctx, EncryptionPolicy policy);
     }
index deddc37..ede2291 100644 (file)
@@ -14,75 +14,75 @@ internal static partial class Interop
     {
         internal delegate int X509StoreVerifyCallback(int ok, IntPtr ctx);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NotBefore")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NotBefore")]
         internal static partial IntPtr GetX509NotBefore(SafeX509Handle x509);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NotAfter")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NotAfter")]
         internal static partial IntPtr GetX509NotAfter(SafeX509Handle x509);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509SignatureAlgorithm")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509SignatureAlgorithm")]
         internal static partial IntPtr GetX509SignatureAlgorithm(SafeX509Handle x509);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyAlgorithm")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyAlgorithm")]
         internal static partial IntPtr GetX509PublicKeyAlgorithm(SafeX509Handle x509);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyBytes")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509PublicKeyBytes")]
         internal static partial IntPtr GetX509PublicKeyBytes(SafeX509Handle x509);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EvpPublicKey")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509EvpPublicKey")]
         internal static partial SafeEvpPKeyHandle GetX509EvpPublicKey(SafeX509Handle x509);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509Crl")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509Crl")]
         internal static partial SafeX509CrlHandle DecodeX509Crl(byte[] buf, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509")]
         internal static partial SafeX509Handle DecodeX509(ref byte buf, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509")]
         internal static partial SafeX509Handle DecodeX509(IntPtr buf, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509DerSize")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509DerSize")]
         internal static partial int GetX509DerSize(SafeX509Handle x);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509")]
         internal static partial int EncodeX509(SafeX509Handle x, byte[] buf);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Destroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Destroy")]
         internal static partial void X509Destroy(IntPtr a);
 
         /// <summary>
         /// Clone the input certificate into a new object.
         /// </summary>
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")]
         internal static partial SafeX509Handle X509Duplicate(IntPtr handle);
 
         /// <summary>
         /// Clone the input certificate into a new object.
         /// </summary>
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Duplicate")]
         internal static partial SafeX509Handle X509Duplicate(SafeX509Handle handle);
 
         /// <summary>
         /// Increment the native reference count of the certificate to protect against
         /// a free from another pointer-holder.
         /// </summary>
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")]
         internal static partial SafeX509Handle X509UpRef(IntPtr handle);
 
         /// <summary>
         /// Increment the native reference count of the certificate to protect against
         /// a free from another pointer-holder.
         /// </summary>
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509UpRef")]
         internal static partial SafeX509Handle X509UpRef(SafeX509Handle handle);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadX509FromBio")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadX509FromBio")]
         internal static partial SafeX509Handle PemReadX509FromBio(SafeBioHandle bio);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadX509FromBioAux")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadX509FromBioAux")]
         internal static partial SafeX509Handle PemReadX509FromBioAux(SafeBioHandle bio);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetSerialNumber")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetSerialNumber")]
         private static partial SafeSharedAsn1IntegerHandle X509GetSerialNumber_private(SafeX509Handle x);
 
         internal static SafeSharedAsn1IntegerHandle X509GetSerialNumber(SafeX509Handle x)
@@ -94,20 +94,20 @@ internal static partial class Interop
                 x);
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetIssuerName")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetIssuerName")]
         internal static partial IntPtr X509GetIssuerName(SafeX509Handle x);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetSubjectName")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetSubjectName")]
         internal static partial IntPtr X509GetSubjectName(SafeX509Handle x);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CheckPurpose")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CheckPurpose")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool X509CheckPurpose(SafeX509Handle x, int id, int ca);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509IssuerNameHash")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509IssuerNameHash")]
         internal static partial ulong X509IssuerNameHash(SafeX509Handle x);
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial SafeSharedAsn1OctetStringHandle CryptoNative_X509FindExtensionData(
             SafeX509Handle x,
             int extensionNid);
@@ -122,27 +122,27 @@ internal static partial class Interop
                 extensionNid);
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetExtCount")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetExtCount")]
         internal static partial int X509GetExtCount(SafeX509Handle x);
 
         // Returns a pointer already being tracked by the SafeX509Handle, shouldn't be SafeHandle tracked/freed.
         // Bounds checking is in place for "loc", IntPtr.Zero is returned on violations.
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetExt")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509GetExt")]
         internal static partial IntPtr X509GetExt(SafeX509Handle x, int loc);
 
         // Returns a pointer already being tracked by a SafeX509Handle, shouldn't be SafeHandle tracked/freed.
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetOid")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetOid")]
         internal static partial IntPtr X509ExtensionGetOid(IntPtr ex);
 
         // Returns a pointer already being tracked by a SafeX509Handle, shouldn't be SafeHandle tracked/freed.
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetData")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetData")]
         internal static partial IntPtr X509ExtensionGetData(IntPtr ex);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetCritical")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetCritical")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool X509ExtensionGetCritical(IntPtr ex);
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial SafeX509StoreHandle CryptoNative_X509ChainNew(SafeX509StackHandle systemTrust, SafeX509StackHandle userTrust);
 
         internal static SafeX509StoreHandle X509ChainNew(SafeX509StackHandle systemTrust, SafeX509StackHandle userTrust)
@@ -157,14 +157,14 @@ internal static partial class Interop
             return store;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreDestory")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreDestory")]
         internal static partial void X509StoreDestory(IntPtr v);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreAddCrl")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreAddCrl")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool X509StoreAddCrl(SafeX509StoreHandle ctx, SafeX509CrlHandle x);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreSetRevocationFlag")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreSetRevocationFlag")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool CryptoNative_X509StoreSetRevocationFlag(SafeX509StoreHandle ctx, X509RevocationFlag revocationFlag);
 
@@ -176,7 +176,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxInit")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxInit")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool X509StoreCtxInit(
             SafeX509StoreCtxHandle ctx,
@@ -184,7 +184,7 @@ internal static partial class Interop
             SafeX509Handle x509,
             SafeX509StackHandle extraCerts);
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_X509VerifyCert(SafeX509StoreCtxHandle ctx);
 
         internal static bool X509VerifyCert(SafeX509StoreCtxHandle ctx)
@@ -199,7 +199,7 @@ internal static partial class Interop
             return result != 0;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         internal static partial int CryptoNative_X509StoreCtxGetError(SafeX509StoreCtxHandle ctx);
 
         internal static X509VerifyStatusCode X509StoreCtxGetError(SafeX509StoreCtxHandle ctx)
@@ -207,7 +207,7 @@ internal static partial class Interop
             return (X509VerifyStatusCode)CryptoNative_X509StoreCtxGetError(ctx);
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_X509StoreCtxReset(SafeX509StoreCtxHandle ctx);
 
         internal static void X509StoreCtxReset(SafeX509StoreCtxHandle ctx)
@@ -218,7 +218,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_X509StoreCtxRebuildChain(SafeX509StoreCtxHandle ctx);
 
         internal static bool X509StoreCtxRebuildChain(SafeX509StoreCtxHandle ctx)
@@ -233,10 +233,10 @@ internal static partial class Interop
             return result != 0;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetErrorDepth")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetErrorDepth")]
         internal static partial int X509StoreCtxGetErrorDepth(SafeX509StoreCtxHandle ctx);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxSetVerifyCallback")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxSetVerifyCallback")]
         internal static partial void X509StoreCtxSetVerifyCallback(SafeX509StoreCtxHandle ctx, X509StoreVerifyCallback callback);
 
         internal static string GetX509VerifyCertErrorString(int n)
@@ -244,22 +244,22 @@ internal static partial class Interop
             return Marshal.PtrToStringAnsi(X509VerifyCertErrorString(n))!;
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509VerifyCertErrorString")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509VerifyCertErrorString")]
         private static partial IntPtr X509VerifyCertErrorString(int n);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CrlDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CrlDestroy")]
         internal static partial void X509CrlDestroy(IntPtr a);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemWriteBioX509Crl")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemWriteBioX509Crl")]
         internal static partial int PemWriteBioX509Crl(SafeBioHandle bio, SafeX509CrlHandle crl);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadBioX509Crl")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemReadBioX509Crl")]
         internal static partial SafeX509CrlHandle PemReadBioX509Crl(SafeBioHandle bio);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509SubjectPublicKeyInfoDerSize")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509SubjectPublicKeyInfoDerSize")]
         internal static partial int GetX509SubjectPublicKeyInfoDerSize(SafeX509Handle x509);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509SubjectPublicKeyInfo")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509SubjectPublicKeyInfo")]
         internal static partial int EncodeX509SubjectPublicKeyInfo(SafeX509Handle x509, byte[] buf);
 
         internal enum X509VerifyStatusCodeUniversal
index 1d3d385..b52e9a5 100644 (file)
@@ -9,20 +9,20 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionCreateByObj")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionCreateByObj")]
         internal static partial SafeX509ExtensionHandle X509ExtensionCreateByObj(
             SafeAsn1ObjectHandle oid,
             [MarshalAs(UnmanagedType.Bool)] bool isCritical,
             SafeAsn1OctetStringHandle data);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionDestroy")]
         internal static partial int X509ExtensionDestroy(IntPtr x);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509V3ExtPrint")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509V3ExtPrint")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool X509V3ExtPrint(SafeBioHandle buf, SafeX509ExtensionHandle ext);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509BasicConstraints2Extension")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeX509BasicConstraints2Extension")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DecodeX509BasicConstraints2Extension(
             byte[] encoded,
@@ -31,10 +31,10 @@ internal static partial class Interop
             [MarshalAs(UnmanagedType.Bool)] out bool hasPathLengthConstraint,
             out int pathLengthConstraint);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeExtendedKeyUsage")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeExtendedKeyUsage")]
         internal static partial SafeEkuExtensionHandle DecodeExtendedKeyUsage(byte[] buf, int len);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ExtendedKeyUsageDestory")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ExtendedKeyUsageDestory")]
         internal static partial void ExtendedKeyUsageDestory(IntPtr a);
     }
 }
index 17aeb15..0bc5e5a 100644 (file)
@@ -10,14 +10,14 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameStackFieldCount")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameStackFieldCount")]
         internal static partial int GetX509NameStackFieldCount(SafeSharedX509NameStackHandle sk);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameStackField")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameStackField")]
         private static partial SafeSharedX509NameHandle GetX509NameStackField_private(SafeSharedX509NameStackHandle sk,
             int loc);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameRawBytes")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509NameRawBytes")]
         private static partial int GetX509NameRawBytes(SafeSharedX509NameHandle x509Name, byte[]? buf, int cBuf);
 
         internal static X500DistinguishedName LoadX500Name(SafeSharedX509NameHandle namePtr)
index 7a75fb4..a322b1b 100644 (file)
@@ -9,33 +9,33 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_NewX509Stack")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_NewX509Stack")]
         internal static partial SafeX509StackHandle NewX509Stack();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_RecursiveFreeX509Stack")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_RecursiveFreeX509Stack")]
         internal static partial void RecursiveFreeX509Stack(IntPtr stack);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")]
         internal static partial int GetX509StackFieldCount(SafeX509StackHandle stack);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")]
         internal static partial int GetX509StackFieldCount(SafeSharedX509StackHandle stack);
 
         /// <summary>
         /// Gets a pointer to a certificate within a STACK_OF(X509). This pointer will later
         /// be freed, so it should be cloned via new X509Certificate2(IntPtr)
         /// </summary>
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")]
         internal static partial IntPtr GetX509StackField(SafeX509StackHandle stack, int loc);
 
         /// <summary>
         /// Gets a pointer to a certificate within a STACK_OF(X509). This pointer will later
         /// be freed, so it should be cloned via new X509Certificate2(IntPtr)
         /// </summary>
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackField")]
         internal static partial IntPtr GetX509StackField(SafeSharedX509StackHandle stack, int loc);
 
-        [GeneratedDllImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(Libraries.CryptoNative, StringMarshalling = StringMarshalling.Utf8)]
         private static partial int CryptoNative_X509StackAddDirectoryStore(SafeX509StackHandle stack, string storePath);
 
         internal static void X509StackAddDirectoryStore(SafeX509StackHandle stack, string storePath)
@@ -46,7 +46,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_X509StackAddMultiple(SafeX509StackHandle dest, SafeX509StackHandle src);
 
         internal static void X509StackAddMultiple(SafeX509StackHandle dest, SafeX509StackHandle src)
index 6ff3dba..08cf5b4 100644 (file)
@@ -9,19 +9,19 @@ internal static partial class Interop
 {
     internal static partial class Crypto
     {
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxCreate")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxCreate")]
         internal static partial SafeX509StoreCtxHandle X509StoreCtxCreate();
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxDestroy")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxDestroy")]
         internal static partial void X509StoreCtxDestroy(IntPtr v);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetChain")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetChain")]
         internal static partial SafeX509StackHandle X509StoreCtxGetChain(SafeX509StoreCtxHandle ctx);
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetCurrentCert")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetCurrentCert")]
         internal static partial SafeX509Handle X509StoreCtxGetCurrentCert(SafeX509StoreCtxHandle ctx);
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_X509StoreCtxCommitToChain(SafeX509StoreCtxHandle ctx);
 
         internal static void X509StoreCtxCommitToChain(SafeX509StoreCtxHandle ctx)
@@ -32,7 +32,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative)]
+        [LibraryImport(Libraries.CryptoNative)]
         private static partial int CryptoNative_X509StoreCtxResetForSignatureError(
             SafeX509StoreCtxHandle ctx,
             out SafeX509StoreHandle newStore);
@@ -55,7 +55,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetSharedUntrusted")]
+        [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetSharedUntrusted")]
         private static partial SafeSharedX509StackHandle X509StoreCtxGetSharedUntrusted_private(SafeX509StoreCtxHandle ctx);
 
         internal static SafeSharedX509StackHandle X509StoreCtxGetSharedUntrusted(SafeX509StoreCtxHandle ctx)
index f43f81f..83a338b 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class @libc
     {
-        [GeneratedDllImport(Libraries.libc, EntryPoint = "getppid")]
+        [LibraryImport(Libraries.libc, EntryPoint = "getppid")]
         internal static partial int GetParentPid();
     }
 }
index 6b99600..97a275a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Activeds
     {
-        [GeneratedDllImport(Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int ADsOpenObject(string path, string? userName, string? password, int flags, ref Guid iid, out IntPtr ppObject);
     }
 }
index 86f22a1..14bb849 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool AdjustTokenPrivileges(
             SafeTokenHandle TokenHandle,
index a1866c3..3fc64c6 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool AllocateLocallyUniqueId(LUID* Luid);
     }
index e67bc5b..90b3d8a 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ChangeServiceConfig2W", SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "ChangeServiceConfig2W", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool ChangeServiceConfig2(SafeServiceHandle serviceHandle, uint infoLevel, ref SERVICE_DESCRIPTION serviceDesc);
     }
index ae3b324..b10c2ef 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CheckTokenMembership(
             SafeAccessTokenHandle TokenHandle,
index d1880f4..d7b80aa 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ClearEventLogW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "ClearEventLogW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool ClearEventLog(SafeEventLogReadHandle hEventLog, string lpBackupFileName);
     }
index 2874cf1..674ebbe 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CloseEventLog(IntPtr hEventLog);
     }
index 9796226..7c5196c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CloseServiceHandle(IntPtr handle);
     }
index 3fb3fdd..7b22197 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool ControlService(SafeServiceHandle serviceHandle, int control, SERVICE_STATUS* pStatus);
 
index 8e3cdb6..0a7508a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertSecurityDescriptorToStringSecurityDescriptorW",
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertSecurityDescriptorToStringSecurityDescriptorW",
             SetLastError = true)]
             [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ConvertSdToStringSd(
index ece6aad..257e709 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ConvertSidToStringSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "ConvertSidToStringSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial BOOL ConvertSidToStringSid(IntPtr sid, out string stringSid);
     }
 }
index 014e88a..9bb721d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW",
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW",
             SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ConvertStringSdToSd(
index 1d65cc7..120fc0e 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ConvertStringSecurityDescriptorToSecurityDescriptor(
             string StringSecurityDescriptor,
index f5bba0b..fe1fd2c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial BOOL ConvertStringSidToSid(
             string stringSid,
             out IntPtr ByteArray);
index c34de91..4a8c468 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CopySid(int destinationLength, IntPtr pSidDestination, IntPtr pSidSource);
     }
index c1b97ca..d772679 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CreateProcessWithLogonW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "CreateProcessWithLogonW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CreateProcessWithLogonW(
             string userName,
index 5ee78eb..40d1388 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CreateServiceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "CreateServiceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         public static partial IntPtr CreateService(SafeServiceHandle databaseHandle, string serviceName, string displayName, int access, int serviceType,
             int startType, int errorControl, string binaryPath, string loadOrderGroup, IntPtr pTagId, string dependencies,
             string servicesStartName, string password);
index cc93f46..aba754c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "CreateWellKnownSid", SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "CreateWellKnownSid", SetLastError = true)]
         internal static partial int CreateWellKnownSid(
             int sidType,
             byte[]? domainSid,
index 355b12b..787a9fa 100644 (file)
@@ -20,7 +20,7 @@ internal static partial class Interop
             CRYPT_VERIFYCONTEXT = 0xF0000000      // CRYPT_VERIFYCONTEXT
         }
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptAcquireContext(
             out SafeProvHandle phProv,
index 1af84f6..22c8f6a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptAcquireContext(
             out IntPtr psafeProvHandle,
index a57449a..8657595 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             None = 0,
         }
 
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptCreateHash(
             SafeProvHandle hProv,
index cfad767..1178b49 100644 (file)
@@ -14,7 +14,7 @@ internal static partial class Interop
             CRYPT_DECRYPT_RSA_NO_PADDING_CHECK = 0x00000020
         }
 
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptDecrypt(
             SafeCapiKeyHandle hKey,
index b87c8bb..abac09c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptDeriveKey(
             SafeProvHandle hProv,
index a60d88c..57430f4 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptDestroyHash(IntPtr hHash);
     }
index b386d60..7a98e16 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptDestroyKey(IntPtr hKey);
     }
index 2fdf298..fc35d9c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptEncrypt(
             SafeCapiKeyHandle hKey,
index e285fc5..ffcc0b0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptExportKey(
             SafeCapiKeyHandle hKey,
index ad71af2..48494bd 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptGenKey(SafeProvHandle hProv, int Algid, int dwFlags, out SafeCapiKeyHandle phKey);
     }
index bf893d2..5f1253c 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             CRYPT_USER_DEFAULT = 0x00000002
         }
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptGetDefaultProviderW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptGetDefaultProviderW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptGetDefaultProvider(
             int dwProvType,
index c6df68e..cbf4690 100644 (file)
@@ -18,7 +18,7 @@ internal static partial class Interop
             HP_TLS1PRF_SEED = 0x0007,  // seed for TLS1 PRF
         }
 
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptGetHashParam(
             SafeHashHandle hHash,
@@ -27,7 +27,7 @@ internal static partial class Interop
             ref int pdwDataLen,
             int dwFlags);
 
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptSetHashParam(SafeHashHandle hHash, CryptHashProperty dwParam, byte[] buffer, int dwFlags);
     }
index 3b3bb0a..58a360c 100644 (file)
@@ -17,7 +17,7 @@ internal static partial class Interop
             KP_KEYLEN = 9
         }
 
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptGetKeyParam(
             SafeCapiKeyHandle hKey,
index 7960727..79743c8 100644 (file)
@@ -22,7 +22,7 @@ internal static partial class Interop
             PP_UNIQUE_CONTAINER = 36
         }
 
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptSetProvParam(
             SafeHandle safeProvHandle,
@@ -30,7 +30,7 @@ internal static partial class Interop
             IntPtr pbData,
             int dwFlags);
 
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptSetProvParam(
             SafeProvHandle hProv,
@@ -38,7 +38,7 @@ internal static partial class Interop
             ref IntPtr pbData,
             int dwFlags);
 
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptGetProvParam(
             SafeHandle safeProvHandle,
index 679f155..8a4da68 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptGetUserKey(SafeProvHandle hProv, int dwKeySpec, out SafeCapiKeyHandle phUserKey);
     }
index e7696bc..4d120af 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptHashData(SafeHashHandle hHash, byte[] pbData, int dwDataLen, int dwFlags);
     }
index ee61cd2..468077f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptImportKey(
             SafeProvHandle hProv,
index eb99349..fa8120c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptReleaseContext(
             IntPtr hProv,
index f43ab4c..d48acdc 100644 (file)
@@ -8,11 +8,11 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptSetKeyParam(SafeCapiKeyHandle hKey, int dwParam, byte[] pbData, int dwFlags);
 
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptSetKeyParam(SafeCapiKeyHandle safeKeyHandle, int dwParam, ref int pdw, int dwFlags);
     }
index 44c61c9..13b1665 100644 (file)
@@ -24,7 +24,7 @@ internal static partial class Interop
             CRYPT_X931_FORMAT = 0x00000004,  // Not supported
         }
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptSignHashW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptSignHashW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptSignHash(
             SafeHashHandle hHash,
@@ -34,7 +34,7 @@ internal static partial class Interop
             byte[]? pbSignature,
             ref int pdwSigLen);
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptVerifySignatureW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "CryptVerifySignatureW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptVerifySignature(
             SafeHashHandle hHash,
index b62fd35..2f15a87 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool DeleteService(SafeServiceHandle serviceHandle);
     }
index 58d7053..fd5ca0c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DeregisterEventSource(IntPtr hEventLog);
     }
index 951d32d..98fcb41 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DuplicateTokenEx(
             SafeAccessTokenHandle hExistingToken,
index 4cc73e6..5213692 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DuplicateTokenEx(
             SafeTokenHandle ExistingTokenHandle,
index 0d48bde..2afd209 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use EncryptFile.
         /// </summary>
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EncryptFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "EncryptFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool EncryptFilePrivate(string lpFileName);
 
@@ -24,7 +24,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use DecryptFile.
         /// </summary>
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "DecryptFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "DecryptFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool DecryptFileFilePrivate(
             string lpFileName,
index b57eed7..d96c788 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EnumDependentServicesW", SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "EnumDependentServicesW", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EnumDependentServices(
             SafeServiceHandle serviceHandle,
index a66e136..132c775 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EnumServicesStatusExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "EnumServicesStatusExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EnumServicesStatusEx(
             SafeServiceHandle databaseHandle,
index b0d856c..3f68348 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32)]
+        [LibraryImport(Interop.Libraries.Advapi32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool EqualDomainSid(IntPtr pSid1, IntPtr pSid2, [MarshalAs(UnmanagedType.Bool)] ref bool equal);
     }
index 49c246f..f11d25d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static partial int EventActivityIdControl(ActivityControl ControlCode, ref Guid ActivityId);
     }
 }
index 96d26c1..c108200 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static unsafe partial uint EventRegister(
             in Guid providerId,
             EtwEnableCallback enableCallback,
index aa17159..b4461ee 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static unsafe partial int EventSetInformation(
             long registrationHandle,
             EVENT_INFO_CLASS informationClass,
index f94e895..483cfe0 100644 (file)
@@ -45,7 +45,7 @@ internal static partial class Interop
             public long MatchAllKeyword;
         }
 
-        [GeneratedDllImport(Interop.Libraries.Advapi32)]
+        [LibraryImport(Interop.Libraries.Advapi32)]
         internal static unsafe partial int EnumerateTraceGuidsEx(
             TRACE_QUERY_INFO_CLASS TraceQueryInfoClass,
             void* InBuffer,
index 9fa6b86..946becc 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static partial uint EventUnregister(long registrationHandle);
     }
 }
index 620cfee..cf80389 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static partial int EventWriteString(
             long registrationHandle,
             byte level,
index 6b11373..2c732db 100644 (file)
@@ -36,7 +36,7 @@ internal static partial class Interop
             return HResult;
         }
 
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "EventWriteTransfer")]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "EventWriteTransfer")]
         private static unsafe partial int EventWriteTransfer_PInvoke(
             long registrationHandle,
             in EventDescriptor eventDescriptor,
index 0f97e38..bcaf729 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32)]
+        [LibraryImport(Interop.Libraries.Advapi32)]
         internal static partial int GetLengthSid(IntPtr sid);
     }
 }
index 779a0fb..608030e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool GetNumberOfEventLogRecords(SafeEventLogReadHandle hEventLog, out int NumberOfRecords);
     }
index 501889c..8fcadbe 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool GetOldestEventLogRecord(SafeEventLogReadHandle hEventLog, out int OldestRecord);
     }
index d02e09c..cabd7fe 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static partial uint GetSecurityDescriptorLength(IntPtr byteArray);
     }
 }
index 26c444e..1f4b8cd 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetSecurityInfo")]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "GetSecurityInfo")]
         internal static unsafe partial uint GetSecurityInfoByHandle(
             SafeHandle handle,
             /*DWORD*/ uint objectType,
index fa2a4b7..2898dbb 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "GetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint GetSecurityInfoByName(
             string name,
             /*DWORD*/ uint objectType,
index f14057e..e33d0bd 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetServiceDisplayNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "GetServiceDisplayNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetServiceDisplayName(SafeServiceHandle? SCMHandle, string serviceName, char* displayName, ref int displayNameLength);
     }
index fbefdd1..e51364b 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetServiceKeyNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "GetServiceKeyNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetServiceKeyName(SafeServiceHandle? SCMHandle, string displayName, char* KeyName, ref int KeyNameLength);
     }
index a284321..0ef69da 100644 (file)
@@ -19,13 +19,13 @@ internal static partial class Interop
             public byte b6;
         }
 
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static partial IntPtr GetSidIdentifierAuthority(IntPtr sid);
 
-        [GeneratedDllImport(Interop.Libraries.Advapi32)]
+        [LibraryImport(Interop.Libraries.Advapi32)]
         internal static partial IntPtr GetSidSubAuthority(IntPtr sid, int index);
 
-        [GeneratedDllImport(Interop.Libraries.Advapi32)]
+        [LibraryImport(Interop.Libraries.Advapi32)]
         internal static partial IntPtr GetSidSubAuthorityCount(IntPtr sid);
     }
 }
index 3ca68ca..550b81d 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetTokenInformation(
             IntPtr TokenHandle,
index ba76202..b8b4133 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetTokenInformation(
             SafeAccessTokenHandle TokenHandle,
@@ -18,7 +18,7 @@ internal static partial class Interop
             uint TokenInformationLength,
             out uint ReturnLength);
 
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetTokenInformation(
             IntPtr TokenHandle,
index 72490e9..e04e831 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetTokenInformation(
             SafeAccessTokenHandle TokenHandle,
index 48a2300..5d5bc2b 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", SetLastError = true)]
         internal static partial int GetWindowsAccountDomainSid(
             byte[] sid,
             byte[] resultSid,
index 32130b3..a26ab17 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ImpersonateLoggedOnUser(SafeAccessTokenHandle userToken);
     }
index 8082948..61b560f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         internal static partial int ImpersonateLoggedOnUser(IntPtr userToken);
     }
 }
index 2aef33a..6917731 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ImpersonateNamedPipeClient(SafePipeHandle hNamedPipe);
     }
index 696e10e..f7cfc28 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "EqualDomainSid", SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "EqualDomainSid", SetLastError = true)]
         internal static partial int IsEqualDomainSid(
             byte[] sid1,
             byte[] sid2,
index 398d65b..cf99b26 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool IsValidSid(IntPtr sid);
     }
index 74e8cd5..04c1381 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "IsWellKnownSid", SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "IsWellKnownSid", SetLastError = true)]
         internal static partial int IsWellKnownSid(
             byte[] sid,
             int type);
index 1162888..f4ced42 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "LogonUserW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "LogonUserW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int LogonUser(
             string username,
             string? domain,
index a77ec2a..70d9946 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool LookupAccountNameW(
             string? lpSystemName,
index 8e932fc..8e3b009 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LookupAccountSidW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LookupAccountSidW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         public static unsafe partial int LookupAccountSid(
             string lpSystemName,
             byte[] Sid,
index f8f2971..5c17e8e 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "LookupPrivilegeValueW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "LookupPrivilegeValueW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool LookupPrivilegeValue(
             [MarshalAs(UnmanagedType.LPTStr)] string? lpSystemName, [MarshalAs(UnmanagedType.LPTStr)] string lpName, out LUID lpLuid);
index c703eeb..addce98 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         internal static partial int LsaClose(IntPtr handle);
     }
 }
index 5ba8f03..4a1d6b1 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         internal static partial int LsaFreeMemory(IntPtr handle);
     }
 }
index d799000..50be738 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupNames2",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupNames2",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint LsaLookupNames2(
             SafeLsaPolicyHandle handle,
             int flags,
index 2ed2561..ce84a73 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupSids", SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupSids", SetLastError = true)]
         internal static partial uint LsaLookupSids(
             SafeLsaPolicyHandle handle,
             int count,
index 2da367a..fa32ea0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = false)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = false)]
         internal static partial uint LsaNtStatusToWinError(uint status);
     }
 }
index 861d07e..994f78c 100644 (file)
@@ -27,7 +27,7 @@ internal static partial class Interop
             POLICY_NOTIFICATION = 0x00001000,
         }
 
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaOpenPolicy", SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaOpenPolicy", SetLastError = true)]
         private static partial uint LsaOpenPolicy(
             ref UNICODE_STRING SystemName,
             ref OBJECT_ATTRIBUTES ObjectAttributes,
index d38ac1c..a2e87fc 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static partial uint LsaQueryInformationPolicy(
             IntPtr policyHandle,
             int policyInformationClass,
index 8068ad0..c401739 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool NotifyChangeEventLog(SafeEventLogReadHandle hEventLog, SafeWaitHandle hEvent);
     }
index b5e69c7..80fad58 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenEventLogW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "OpenEventLogW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeEventLogReadHandle OpenEventLog(string lpUNCServerName, string lpSourceName);
     }
 }
index 5f51453..ab40e11 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool OpenProcessToken(IntPtr ProcessHandle, int DesiredAccess, out SafeTokenHandle TokenHandle);
     }
index 7db51d0..b4e7f4e 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool OpenProcessToken(
             IntPtr ProcessToken,
index 7f54f0b..e8dd8f5 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool OpenProcessToken(
             IntPtr ProcessToken,
index 7dcb9b9..5aebbaf 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenSCManagerW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "OpenSCManagerW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr OpenSCManager(string? machineName, string? databaseName, int access);
 
     }
index 027995f..4fac2d3 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenServiceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "OpenServiceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr OpenService(SafeServiceHandle? databaseHandle, string serviceName, int access);
     }
 }
index faafb6d..2fd37e8 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool OpenThreadToken(
             IntPtr ThreadHandle,
index e25dc2b..c545346 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool OpenThreadToken(
             IntPtr ThreadHandle,
index bfe62f3..9a461fd 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "QueryServiceConfigW", SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "QueryServiceConfigW", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool QueryServiceConfig(SafeServiceHandle serviceHandle, IntPtr queryServiceConfigPtr, int bufferSize, out int bytesNeeded);
 
index 1754b65..e9a4cf9 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool QueryServiceStatus(SafeServiceHandle serviceHandle, SERVICE_STATUS* pStatus);
     }
index de24de2..5818fbc 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         internal const int FORWARDS_READ = 0x4;
         internal const int BACKWARDS_READ = 0x8;
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ReadEventLogW", SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "ReadEventLogW", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool ReadEventLog(
             SafeEventLogReadHandle hEventLog,
index 23bc17b..cff4721 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static partial int RegCloseKey(IntPtr hKey);
     }
 }
index e7c6a18..82fa230 100644 (file)
@@ -14,7 +14,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegConnectRegistryW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegConnectRegistryW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegConnectRegistry(
             string machineName,
             SafeRegistryHandle key,
index edf3bc0..9e5e420 100644 (file)
@@ -14,7 +14,7 @@ internal static partial class Interop
     {
         // Note: RegCreateKeyEx won't set the last error on failure - it returns
         // an error code if it fails.
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegCreateKeyExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegCreateKeyExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegCreateKeyEx(
             SafeRegistryHandle hKey,
             string lpSubKey,
index 8881398..0fcd50c 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegDeleteKeyExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegDeleteKeyExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegDeleteKeyEx(
             SafeRegistryHandle hKey,
             string lpSubKey,
index 00ae183..5d1367d 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegDeleteValueW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegDeleteValueW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegDeleteValue(
             SafeRegistryHandle hKey,
             string? lpValueName);
index fbfa4af..bb154eb 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegEnumKeyExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegEnumKeyExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegEnumKeyEx(
             SafeRegistryHandle hKey,
             int dwIndex,
index eb124ca..2823ee3 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegEnumValueW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegEnumValueW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegEnumValue(
             SafeRegistryHandle hKey,
             int dwIndex,
index ce43f1a..04ae6e5 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static partial int RegFlushKey(SafeRegistryHandle hKey);
     }
 }
index 31df277..a035559 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegOpenKeyEx(
             SafeRegistryHandle hKey,
             string? lpSubKey,
@@ -21,7 +21,7 @@ internal static partial class Interop
             int samDesired,
             out SafeRegistryHandle hkResult);
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegOpenKeyEx(
             IntPtr hKey,
             string? lpSubKey,
index 18dd716..d0a0eaf 100644 (file)
@@ -14,7 +14,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryInfoKeyW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryInfoKeyW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegQueryInfoKey(
             SafeRegistryHandle hKey,
             [Out] char[]? lpClass,
index 7154882..a0ba624 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegQueryValueEx(
             SafeRegistryHandle hKey,
             string? lpValueName,
@@ -22,7 +22,7 @@ internal static partial class Interop
             byte[]? lpData,
             ref int lpcbData);
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegQueryValueEx(
             SafeRegistryHandle hKey,
             string? lpValueName,
@@ -31,7 +31,7 @@ internal static partial class Interop
             ref int lpData,
             ref int lpcbData);
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegQueryValueEx(
             SafeRegistryHandle hKey,
             string? lpValueName,
@@ -40,7 +40,7 @@ internal static partial class Interop
             ref long lpData,
             ref int lpcbData);
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegQueryValueEx(
             SafeRegistryHandle hKey,
             string? lpValueName,
index 031fbc0..315fd5c 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegSetValueEx(
             SafeRegistryHandle hKey,
             string? lpValueName,
@@ -21,7 +21,7 @@ internal static partial class Interop
             byte[]? lpData,
             int cbData);
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegSetValueEx(
             SafeRegistryHandle hKey,
             string? lpValueName,
@@ -30,7 +30,7 @@ internal static partial class Interop
             char[]? lpData,
             int cbData);
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegSetValueEx(
             SafeRegistryHandle hKey,
             string? lpValueName,
@@ -39,7 +39,7 @@ internal static partial class Interop
             ref int lpData,
             int cbData);
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegSetValueEx(
             SafeRegistryHandle hKey,
             string? lpValueName,
@@ -48,7 +48,7 @@ internal static partial class Interop
             ref long lpData,
             int cbData);
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int RegSetValueEx(
             SafeRegistryHandle hKey,
             string? lpValueName,
index e995568..e592e81 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegisterEventSourceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegisterEventSourceW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeEventLogWriteHandle RegisterEventSource(string lpUNCServerName, string lpSourceName);
     }
 }
index 7428a4a..c079976 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
     {
         public delegate int ServiceControlCallbackEx(int control, int eventType, IntPtr eventData, IntPtr eventContext);
 
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegisterServiceCtrlHandlerExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "RegisterServiceCtrlHandlerExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         public static partial IntPtr RegisterServiceCtrlHandlerEx(string? serviceName, ServiceControlCallbackEx? callback, IntPtr userData);
     }
 }
index 59da464..ee8ad9e 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ReportEventW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "ReportEventW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool ReportEvent(
             SafeEventLogWriteHandle hEventLog,
index e0ac537..f0a0261 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool RevertToSelf();
     }
index bfae62d..8e6e8ac 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetSecurityInfo", SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "SetSecurityInfo", SetLastError = true)]
         internal static partial uint SetSecurityInfoByHandle(
             SafeHandle handle,
             /*DWORD*/ uint objectType,
index d7b84c1..95e9c17 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetNamedSecurityInfoW",
+        [LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "SetNamedSecurityInfoW",
             SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint SetSecurityInfoByName(
             string name,
index 247c813..02fd6b8 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static unsafe partial bool SetServiceStatus(IntPtr serviceStatusHandle, SERVICE_STATUS* status);
     }
index a0de142..445e61e 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetThreadToken(
             IntPtr ThreadHandle,
index c947f91..531cd2b 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "StartServiceW", SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "StartServiceW", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool StartService(SafeServiceHandle serviceHandle, int argNum, IntPtr argPtrs);
     }
index 010e875..a81c21d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "StartServiceCtrlDispatcherW", SetLastError = true)]
+        [LibraryImport(Libraries.Advapi32, EntryPoint = "StartServiceCtrlDispatcherW", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool StartServiceCtrlDispatcher(IntPtr entry);
     }
index 40011ea..ffba80e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Authz
     {
-        [GeneratedDllImport(Libraries.Authz, SetLastError = true)]
+        [LibraryImport(Libraries.Authz, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool AuthzGetInformationFromContext(
             IntPtr hAuthzClientContext,
index 414ddb5..0a9d61a 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         internal const int AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION = 0x2;
         internal const int AUTHZ_VALID_RM_INIT_FLAGS = (AUTHZ_RM_FLAG_NO_AUDIT | AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION);
 
-        [GeneratedDllImport(Interop.Libraries.Authz, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Authz, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool AuthzInitializeContextFromSid(
             int Flags,
@@ -23,7 +23,7 @@ internal static partial class Interop
             IntPtr DynamicGroupArgs,
             out IntPtr pAuthzClientContext);
 
-        [GeneratedDllImport(Interop.Libraries.Authz)]
+        [LibraryImport(Interop.Libraries.Authz)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool AuthzFreeContext(IntPtr AuthzClientContext);
     }
index 677363a..f80ff38 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Authz
     {
-        [GeneratedDllImport(Libraries.Authz, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Authz, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool AuthzInitializeResourceManager(
             int flags,
@@ -18,7 +18,7 @@ internal static partial class Interop
             string name,
             out IntPtr rm);
 
-        [GeneratedDllImport(Libraries.Authz)]
+        [LibraryImport(Libraries.Authz)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool AuthzFreeResourceManager(IntPtr rm);
     }
index 407118d..a545075 100644 (file)
@@ -121,13 +121,13 @@ namespace Internal.NativeCrypto
     {
         internal static partial class Interop
         {
-            [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
             public static partial NTSTATUS BCryptOpenAlgorithmProvider(out SafeAlgorithmHandle phAlgorithm, string pszAlgId, string? pszImplementation, int dwFlags);
 
-            [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
             public static partial NTSTATUS BCryptSetProperty(SafeAlgorithmHandle hObject, string pszProperty, string pbInput, int cbInput, int dwFlags);
 
-            [GeneratedDllImport(Libraries.BCrypt, EntryPoint = "BCryptSetProperty", StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(Libraries.BCrypt, EntryPoint = "BCryptSetProperty", StringMarshalling = StringMarshalling.Utf16)]
             private static partial NTSTATUS BCryptSetIntPropertyPrivate(SafeBCryptHandle hObject, string pszProperty, ref int pdwInput, int cbInput, int dwFlags);
 
             public static unsafe NTSTATUS BCryptSetIntProperty(SafeBCryptHandle hObject, string pszProperty, ref int pdwInput, int dwFlags)
@@ -145,7 +145,7 @@ namespace Internal.NativeCrypto
             return ntStatus == 0;
         }
 
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         private static partial uint BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int dwFlags);
     }
 
@@ -177,7 +177,7 @@ namespace Internal.NativeCrypto
             return ntStatus == 0;
         }
 
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         private static partial uint BCryptDestroyKey(IntPtr hKey);
     }
 }
index 8856ae7..be438c6 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         internal static partial NTSTATUS BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int dwFlags);
     }
 }
index 06f0707..128d9ac 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
             return BCryptCreateHash(hAlgorithm, out phHash, pbHashObject, cbHashObject, ref MemoryMarshal.GetReference(secret), cbSecret, dwFlags);
         }
 
-        [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
         private static partial NTSTATUS BCryptCreateHash(SafeBCryptAlgorithmHandle hAlgorithm, out SafeBCryptHashHandle phHash, IntPtr pbHashObject, int cbHashObject, ref byte pbSecret, int cbSecret, BCryptCreateHashFlags dwFlags);
 
         [Flags]
index ab67c0d..ee4407f 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial NTSTATUS BCryptDeriveKeyPBKDF2(
             SafeBCryptAlgorithmHandle hPrf,
             byte* pbPassword,
index 0ed212f..b031af0 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         internal static partial NTSTATUS BCryptDestroyHash(IntPtr hHash);
     }
 }
index a8d2988..ff6886a 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         internal static partial NTSTATUS BCryptDestroyKey(IntPtr hKey);
     }
 }
index 9658c17..e122e01 100644 (file)
@@ -23,7 +23,7 @@ internal static partial class Interop
             return newHash;
         }
 
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         private static partial NTSTATUS BCryptDuplicateHash(
             SafeBCryptHashHandle hHash,
             out SafeBCryptHashHandle phNewHash,
index fa2080f..45d9779 100644 (file)
@@ -53,10 +53,10 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         public static unsafe partial NTSTATUS BCryptEncrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, byte[]? pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags);
 
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         public static unsafe partial NTSTATUS BCryptDecrypt(SafeKeyHandle hKey, byte* pbInput, int cbInput, IntPtr paddingInfo, byte[]? pbIV, int cbIV, byte* pbOutput, int cbOutput, out int cbResult, int dwFlags);
     }
 }
index eace8eb..6570c7a 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial NTSTATUS BCryptExportKey(SafeBCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, byte[]? pbOutput, int cbOutput, out int pcbResult, int dwFlags);
     }
 }
index 935ed61..51a6466 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         internal static NTSTATUS BCryptFinishHash(SafeBCryptHashHandle hHash, Span<byte> pbOutput, int cbOutput, int dwFlags) =>
             BCryptFinishHash(hHash, ref MemoryMarshal.GetReference(pbOutput), cbOutput, dwFlags);
 
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         private static partial NTSTATUS BCryptFinishHash(SafeBCryptHashHandle hHash, ref byte pbOutput, int cbOutput, int dwFlags);
     }
 }
index e6ce2a9..7470572 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
     {
         internal const int BCRYPT_USE_SYSTEM_PREFERRED_RNG = 0x00000002;
 
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         internal static unsafe partial NTSTATUS BCryptGenRandom(IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags);
     }
 }
index f2b00b2..14b2a9f 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         internal static unsafe partial NTSTATUS BCryptGenerateSymmetricKey(
             SafeBCryptAlgorithmHandle hAlgorithm,
             out SafeBCryptKeyHandle phKey,
@@ -19,7 +19,7 @@ internal static partial class Interop
             int cbSecret,
             uint dwFlags);
 
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         internal static unsafe partial NTSTATUS BCryptGenerateSymmetricKey(
             nuint hAlgorithm,
             out SafeBCryptKeyHandle phKey,
index 8dc0188..2e56b42 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial NTSTATUS BCryptGetProperty(SafeBCryptHandle hObject, string pszProperty, void* pbOutput, int cbOutput, out int pcbResult, int dwFlags);
     }
 }
index 4b69c44..e1817ce 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial NTSTATUS BCryptHash(nuint hAlgorithm, byte* pbSecret, int cbSecret, byte* pbInput, int cbInput, byte* pbOutput, int cbOutput);
     }
 }
index b8d8ba4..ebbcebc 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         internal static NTSTATUS BCryptHashData(SafeBCryptHashHandle hHash, ReadOnlySpan<byte> pbInput, int cbInput, int dwFlags) =>
             BCryptHashData(hHash, ref MemoryMarshal.GetReference(pbInput), cbInput, dwFlags);
 
-        [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
         private static partial NTSTATUS BCryptHashData(SafeBCryptHashHandle hHash, ref byte pbInput, int cbInput, int dwFlags);
     }
 }
index 05dac93..0cc2698 100644 (file)
@@ -61,7 +61,7 @@ internal static partial class Interop
             public const uint BCRYPT_KEY_DATA_BLOB_VERSION1 = 0x1;
         }
 
-        [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
         private static unsafe partial NTSTATUS BCryptImportKey(SafeAlgorithmHandle hAlgorithm, IntPtr hImportKey, string pszBlobType, out SafeKeyHandle hKey, IntPtr pbKeyObject, int cbKeyObject, byte* pbInput, int cbInput, int dwFlags);
     }
 }
index 0be0796..afa969a 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt)]
+        [LibraryImport(Libraries.BCrypt)]
         internal static unsafe partial NTSTATUS BCryptKeyDerivation(
             SafeBCryptKeyHandle hKey,
             BCryptBufferDesc* pParameterList,
index a898fb2..8b73a51 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial NTSTATUS BCryptOpenAlgorithmProvider(out SafeBCryptAlgorithmHandle phAlgorithm, string pszAlgId, string? pszImplementation, BCryptOpenAlgorithmProviderFlags dwFlags);
 
         [Flags]
index 92f3c08..5f6e8ab 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         internal const int CRED_MAX_USERNAME_LENGTH = 514;
         internal const int CRED_MAX_DOMAIN_TARGET_LENGTH = 338;
 
-        [GeneratedDllImport(Libraries.Credui, EntryPoint = "CredUIParseUserNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Credui, EntryPoint = "CredUIParseUserNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int CredUIParseUserName(
             string pszUserName,
             char* pszUser,
index 8c8169c..479e43a 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertAddCertificateContextToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext);
     }
index 413ee46..5430d70 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
     {
         internal const uint CERT_STORE_ADD_ALWAYS = 4;
 
-        [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertAddCertificateLinkToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, uint dwAddDisposition, SafeCertContextHandle ppStoreContext);
     }
index 35a9a97..2540e19 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertAddCertificateLinkToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext);
     }
index bffe2b3..9172d73 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertCloseStore(IntPtr hCertStore, uint dwFlags);
     }
index d2c0754..707088e 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertControlStore(SafeCertStoreHandle hCertStore, CertControlStoreFlags dwFlags, CertControlStoreType dwControlType, IntPtr pvCtrlPara);
     }
index c0bce7d..5812c36 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertCreateCertificateChainEngine(ref CERT_CHAIN_ENGINE_CONFIG pConfig, out SafeChainEngineHandle hChainEngineHandle);
     }
index 4b96a87..cb4ea0c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial SafeCertContextHandle CertCreateCertificateContext(
             MsgEncodingType dwCertEncodingType,
             void* pbCertEncoded,
index e4d3fac..c0c3a22 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
     internal static partial class Crypt32
     {
         // Note: CertDeleteCertificateFromStore always calls CertFreeCertificateContext on pCertContext, even if an error is encountered.
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CertDeleteCertificateFromStore(CERT_CONTEXT* pCertContext);
     }
index 07d0ff7..f99441a 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial SafeX509ChainHandle CertDuplicateCertificateChain(IntPtr pChainContext);
     }
 }
index 354aa3b..f0cbf8b 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial SafeCertContextHandle CertDuplicateCertificateContext(IntPtr pCertContext);
     }
 }
index 7f30b7d..65c8c55 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertDuplicateCertificateContext",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Crypt32, EntryPoint = "CertDuplicateCertificateContext",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeCertContextHandleWithKeyContainerDeletion CertDuplicateCertificateContextWithKeyContainerDeletion(IntPtr pCertContext);
     }
 }
index 804d671..7ec5150 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial IntPtr CertDuplicateCertificateContext(IntPtr pCertContext);
     }
 }
index 847919d..2e363a4 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial SafeCertStoreHandle CertDuplicateStore(IntPtr hCertStore);
     }
 }
index a362f7e..423dd3e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         public static unsafe partial CERT_CONTEXT* CertEnumCertificatesInStore(
             IntPtr hCertStore,
             CERT_CONTEXT* pPrevCertContext);
index e84ba3f..5c4c40d 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)]
         internal static partial IntPtr CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, IntPtr pPrevCertContext);
     }
 }
index 1170cef..e2898db 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial CERT_CONTEXT* CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, CERT_CONTEXT* pPrevCertContext);
     }
 }
index d65f23e..df22ee4 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial SafeCertContextHandle CertFindCertificateInStore(
             SafeCertStoreHandle hCertStore,
             CertEncodingType dwCertEncodingType,
index f84ced0..f3628b2 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial CERT_EXTENSION* CertFindExtension([MarshalAs(UnmanagedType.LPStr)] string pszObjId, int cExtensions, IntPtr rgExtensions);
     }
 }
index 576a2bd..8e70ad5 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial void CertFreeCertificateChain(IntPtr pChainContext);
     }
 }
index 425dbe7..9198c51 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32)]
+        [LibraryImport(Libraries.Crypt32)]
         internal static partial void CertFreeCertificateChainEngine(IntPtr hChainEngine);
     }
 }
index 3899b9b..603003f 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
     internal static partial class Crypt32
     {
         // Note: This api always return TRUE, regardless of success.
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertFreeCertificateContext(IntPtr pCertContext);
     }
index d57ec7c..96c5d37 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CertGetCertificateChain(
             IntPtr hChainEngine,
index 72222c2..adb049f 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertGetCertificateContextProperty(
             SafeCertContextHandle pCertContext,
@@ -17,7 +17,7 @@ internal static partial class Interop
             byte[]? pvData,
             ref int pcbData);
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertGetCertificateContextProperty(
             SafeCertContextHandle pCertContext,
@@ -25,7 +25,7 @@ internal static partial class Interop
             out IntPtr pvData,
             ref int pcbData);
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertGetCertificateContextProperty(
             SafeCertContextHandle pCertContext,
index 8da8e0f..f12ac77 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetCertificateContextProperty",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Crypt32, EntryPoint = "CertGetCertificateContextProperty",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CertGetCertificateContextPropertyString(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, byte* pvData, ref uint pcbData);
     }
index 227a783..28acc68 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertGetCertificateContextProperty(
             SafeCertContextHandle pCertContext,
index 6c00075..fbc96a3 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
     {
         // Note: It's somewhat unusual to use an API enum as a parameter type to a P/Invoke but in this case, X509KeyUsageFlags was intentionally designed as bit-wise
         // identical to the wincrypt CERT_*_USAGE values.
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CertGetIntendedKeyUsage(
             CertEncodingType dwCertEncodingType,
index e3973c4..160332d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetNameStringW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Crypt32, EntryPoint = "CertGetNameStringW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int CertGetNameString(SafeCertContextHandle pCertContext, CertNameType dwType, CertNameFlags dwFlags, in CertNameStringType pvTypePara, char* pszNameString, int cchNameString);
     }
 }
index e226085..a1c6b8f 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial int CertGetPublicKeyLength(MsgEncodingType dwCertEncodingType, ref CERT_PUBLIC_KEY_INFO pPublicKey);
     }
 }
index f19926c..744dcae 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CertGetValidUsages(int cCerts, ref SafeCertContextHandle rghCerts, out int cNumOIDs, void* rghOIDs, ref int pcbOIDs);
     }
index d9cb722..2a448a7 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertNameToStrW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Crypt32, EntryPoint = "CertNameToStrW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int CertNameToStr(
             int dwCertEncodingType,
             void* pName,
index 0374c23..810542a 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         internal const uint X509_ASN_ENCODING = 0x00000001;
         internal const uint CERT_STORE_PROV_MEMORY = 2;
 
-        [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)]
         internal static partial SafeCertStoreHandle CertOpenStore(IntPtr lpszStoreProvider, uint dwMsgAndCertEncodingType, IntPtr hCryptProv, uint dwFlags, IntPtr pvPara);
     }
 }
index 98bc90b..a4b348f 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial SafeCertStoreHandle CertOpenStore(IntPtr lpszStoreProvider, CertEncodingType dwMsgAndCertEncodingType, IntPtr hCryptProv, CertStoreFlags dwFlags, [MarshalAs(UnmanagedType.LPWStr)] string? pvPara);
     }
 }
index 328ab45..f5462e1 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CertSaveStore(
             SafeCertStoreHandle hCertStore,
index 3672044..d975730 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertSerializeCertificateStoreElement(SafeCertContextHandle pCertContext, int dwFlags, byte[]? pbElement, ref int pcbElement);
     }
index c8552f4..4a0e373 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, CRYPT_KEY_PROV_INFO* pvData);
     }
index 7c2a267..6d9b04d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, DATA_BLOB* pvData);
     }
index c42c9d2..35ceeaf 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, SafeNCryptKeyHandle keyHandle);
     }
index 14b038a..21ac539 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertStrToNameW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Crypt32, EntryPoint = "CertStrToNameW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertStrToName(CertEncodingType dwCertEncodingType, string pszX500, CertNameStrTypeAndFlags dwStrType, IntPtr pvReserved, byte[]? pbEncoded, ref int pcbEncoded, IntPtr ppszError);
     }
index d3cec8d..b35548c 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial int CertVerifyTimeValidity(ref FILETIME pTimeToVerify, CERT_INFO* pCertInfo);
     }
 }
index 54ed734..3cf0ea1 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptAcquireCertificatePrivateKey(
             SafeCertContextHandle pCert,
index 1164c98..0b382cb 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool CryptAcquireCertificatePrivateKey(
             SafeCertContextHandle pCert,
index fdade1e..5a62179 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
             return CryptDecodeObject(MsgEncodingType.All, (IntPtr)lpszStructType, pbEncoded, cbEncoded, 0, pvStructInfo, ref pcbStructInfo);
         }
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static unsafe partial bool CryptDecodeObject(
             MsgEncodingType dwCertEncodingType,
index df1dd34..ad3b2cd 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptDecodeObjectPointer(
             CertEncodingType dwCertEncodingType,
index 00b69c8..658d22c 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptDecodeObjectPointer(
             CertEncodingType dwCertEncodingType,
index b8489a8..7ac987f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptDecodeObject(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, byte[] pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, byte[]? pvStructInfo, ref int pcbStructInfo);
     }
index 336675e..9d346a3 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
             return CryptEncodeObject(dwCertEncodingType, (nint)lpszStructType, pvStructInfo, pbEncoded, ref pcbEncoded);
         }
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static unsafe partial bool CryptEncodeObject(
             MsgEncodingType dwCertEncodingType,
index 0c05b6b..2d0e9b1 100644 (file)
@@ -8,11 +8,11 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptEncodeObject(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded);
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptEncodeObject(CertEncodingType dwCertEncodingType, [MarshalAs(UnmanagedType.LPStr)] string lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded);
     }
index 6590ac6..ae5f4e7 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         internal const int CRYPT_FORMAT_STR_MULTI_LINE = 0x00000001;
         internal const int CRYPT_FORMAT_STR_NO_HEX     = 0x00000010;
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptFormatObject(
             int dwCertEncodingType,   // only valid value is X509_ASN_ENCODING
index 2901218..e295786 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptHashPublicKeyInfo(
             IntPtr hCryptProv,
index dccb2dc..0cf1d7e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptImportPublicKeyInfoEx2(
             CertEncodingType dwCertEncodingType,
index 2ca3b04..d89d849 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptMsgClose(IntPtr hCryptMsg);
     }
index a07bdc3..0d98c73 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptMsgControl(
             SafeCryptMsgHandle hCryptMsg,
@@ -16,7 +16,7 @@ internal static partial class Interop
             MsgControlType dwCtrlType,
             ref CMSG_CTRL_DECRYPT_PARA pvCtrlPara);
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptMsgControl(
             SafeCryptMsgHandle hCryptMsg,
index e4b5c96..4b319df 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptMsgGetParam(
             SafeCryptMsgHandle hCryptMsg,
@@ -18,7 +18,7 @@ internal static partial class Interop
             out int pvData,
             ref int pcbData);
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptMsgGetParam(
             SafeCryptMsgHandle hCryptMsg,
@@ -27,7 +27,7 @@ internal static partial class Interop
             byte* pvData,
             ref int pcbData);
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptMsgGetParam(
             SafeCryptMsgHandle hCryptMsg,
@@ -36,7 +36,7 @@ internal static partial class Interop
             out CryptMsgType pvData,
             ref int pcbData);
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptMsgGetParam(
             SafeCryptMsgHandle hCryptMsg,
index 35461f9..02676c3 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial SafeCryptMsgHandle CryptMsgOpenToDecode(
             MsgEncodingType dwMsgEncodingType,
             int dwFlags,
index d7b6f16..243f2f7 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial SafeCryptMsgHandle CryptMsgOpenToEncode(
             MsgEncodingType dwMsgEncodingType,
             int dwFlags,
index 5c9021d..503789f 100644 (file)
@@ -9,15 +9,15 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, byte[] pbData, int cbData, [MarshalAs(UnmanagedType.Bool)] bool fFinal);
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, IntPtr pbData, int cbData, [MarshalAs(UnmanagedType.Bool)] bool fFinal);
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, ref byte pbData, int cbData, [MarshalAs(UnmanagedType.Bool)] bool fFinal);
     }
index 891b391..1b68c73 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptProtectData(
             in DATA_BLOB pDataIn,
index cb2b731..fb01327 100644 (file)
@@ -10,11 +10,11 @@ internal static partial class Interop
         internal const uint CRYPTPROTECTMEMORY_BLOCK_SIZE = 16;
         internal const uint CRYPTPROTECTMEMORY_SAME_PROCESS = 0;
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptProtectMemory(SafeBuffer pData, uint cbData, uint dwFlags);
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptUnprotectMemory(SafeBuffer pData, uint cbData, uint dwFlags);
     }
index a9deafc..f7cf159 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptQueryObject(
             CertQueryObjectType dwObjectType,
@@ -25,7 +25,7 @@ internal static partial class Interop
             out SafeCertContextHandle ppvContext
             );
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptQueryObject(
             CertQueryObjectType dwObjectType,
@@ -41,7 +41,7 @@ internal static partial class Interop
             IntPtr ppvContext
             );
 
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptQueryObject(
             CertQueryObjectType dwObjectType,
index 773ea2e..ae36988 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CryptQueryObject(
             CertQueryObjectType dwObjectType,
index e4f2ba8..3d13416 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptUnprotectData(
             in DATA_BLOB pDataIn,
index 761a68f..8733d41 100644 (file)
@@ -124,7 +124,7 @@ internal static partial class Interop
                    group == OidGroup.KeyDerivationFunction;
         }
 
-        [GeneratedDllImport(Interop.Libraries.Crypt32)]
+        [LibraryImport(Interop.Libraries.Crypt32)]
         private static partial IntPtr CryptFindOIDInfo(CryptOidInfoKeyType dwKeyType, IntPtr pvKey, OidGroup group);
     }
 }
index ec136c7..4d5110c 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         /// <summary>
         /// Version used for a buffer containing a scalar integer (not an IntPtr)
         /// </summary>
-        [GeneratedDllImport(Libraries.Crypt32)]
+        [LibraryImport(Libraries.Crypt32)]
         private static unsafe partial IntPtr CryptFindOIDInfo(CryptOidInfoKeyType dwKeyType, int* pvKey, OidGroup group);
 
         public static CRYPT_OID_INFO FindAlgIdOidInfo(Interop.BCrypt.ECC_CURVE_ALG_ID_ENUM algId)
index d41daaa..74862a7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool PFXExportCertStore(SafeCertStoreHandle hStore, ref DATA_BLOB pPFX, SafePasswordHandle szPassword, PFXExportFlags dwFlags);
     }
index 0cd8877..7df9fb7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial SafeCertStoreHandle PFXImportCertStore(ref DATA_BLOB pPFX, SafePasswordHandle password, PfxCertStoreFlags dwFlags);
     }
 }
index 80fcc4b..ef4b92b 100644 (file)
@@ -10,11 +10,11 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertFreeCertificateContext(IntPtr pCertContext);
 
-        [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertVerifyCertificateChainPolicy(
             IntPtr pszPolicyOID,
index e655c2c..4bdd088 100644 (file)
@@ -210,12 +210,12 @@ internal static partial class Interop
 #endif
         }
 
-        [GeneratedDllImport(Interop.Libraries.CryptUI, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.CryptUI, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptUIDlgViewCertificateW(
             in CRYPTUI_VIEWCERTIFICATE_STRUCTW ViewInfo, IntPtr pfPropertiesChanged);
 
-        [GeneratedDllImport(Interop.Libraries.CryptUI, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.CryptUI, SetLastError = true)]
         internal static partial SafeCertContextHandle CryptUIDlgSelectCertificateW(ref CRYPTUI_SELECTCERTIFICATE_STRUCTW csc);
     }
 }
index 45c8e53..1954a5e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Dsrole
     {
-        [GeneratedDllImport(Libraries.Dsrole)]
+        [LibraryImport(Libraries.Dsrole)]
         public static partial int DsRoleFreeMemory(IntPtr buffer);
     }
 }
index 2853d27..211939d 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
             DsRolePrimaryDomainInfoBasicEx = 4
         }
 
-        [GeneratedDllImport(Libraries.Dsrole, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Dsrole, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DsRoleGetPrimaryDomainInformation(
             [MarshalAs(UnmanagedType.LPTStr)] string lpServer,
             DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel,
index 6ead12e..fb62fb8 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         public static partial int BitBlt(IntPtr hdc, int x, int y, int cx, int cy,
                                         IntPtr hdcSrc, int x1, int y1, RasterOp rop);
 
index 1f25382..4573cfc 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
             RGN_DIFF = 4,
         }
 
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         public static partial RegionType CombineRgn(IntPtr hrgnDst, IntPtr hrgnSrc1, IntPtr hrgnSrc2, CombineMode iMode);
 
         public static RegionType CombineRgn(HandleRef hrgnDst, HandleRef hrgnSrc1, HandleRef hrgnSrc2, CombineMode iMode)
index 11107c5..3066c33 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         public static partial IntPtr CreateCompatibleDC(IntPtr hdc);
     }
 }
index 768bb63..1474463 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)]
         public static partial IntPtr CreateDCW(string pwszDriver, string pwszDevice, string? pszPort, IntPtr pdm);
     }
 }
index 8536e7c..2a4b9b7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         public static partial IntPtr CreateFontIndirectW(ref User32.LOGFONT lplf);
     }
 }
index 5a91051..afbc6ba 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Gdi32, StringMarshalling = StringMarshalling.Utf16)]
         public static partial IntPtr CreateICW(string pszDriver, string pszDevice, string? pszPort, IntPtr pdm);
     }
 }
index f54cf7e..edf59c5 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         public static partial IntPtr CreateRectRgn(int x1, int y1, int x2, int y2);
     }
 }
index cb1057e..98c0a13 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool DeleteDC(IntPtr hdc);
 
index dec5e67..db9776e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool DeleteObject(IntPtr ho);
 
index 8d5d4dd..fc309ed 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         public static partial int GetClipRgn(IntPtr hdc, IntPtr hrgn);
 
         public static int GetClipRgn(HandleRef hdc, IntPtr hrgn)
index 036cefd..4ca4eba 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         public static partial IntPtr GetCurrentObject(IntPtr hdc, ObjectType type);
 
         public static IntPtr GetCurrentObject(HandleRef hdc, ObjectType type)
index 55cec2b..e45e30b 100644 (file)
@@ -30,7 +30,7 @@ internal static partial class Interop
             public const int DT_RASPRINTER = 2;
         }
 
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         public static partial int GetDeviceCaps(IntPtr hdc, DeviceCapability index);
 
         public static int GetDeviceCaps(HandleRef hdc, DeviceCapability index)
index 5355c10..1517e07 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         public static partial ObjectType GetObjectType(IntPtr h);
     }
 }
index 30e68bb..58d4d9a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         public static partial RegionType GetRgnBox(IntPtr hrgn, ref RECT lprc);
 
         public static RegionType GetRgnBox(HandleRef hrgn, ref RECT lprc)
index a17c3de..1c3f5c6 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
             DEFAULT_GUI_FONT = 17
         }
 
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         public static partial IntPtr GetStockObject(StockObject i);
     }
 }
index 2750cfe..aae92ce 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool OffsetViewportOrgEx(IntPtr hdc, int x, int y, ref Point lppt);
 
index b0e34b5..ac9d431 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool RestoreDC(IntPtr hdc, int nSavedDC);
 
index 52aa47a..31accb0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         public static partial int SaveDC(IntPtr hdc);
 
         public static int SaveDC(HandleRef hdc)
index 7aa96a8..d528fb8 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         public static partial RegionType SelectClipRgn(IntPtr hdc, IntPtr hrgn);
 
         public static RegionType SelectClipRgn(HandleRef hdc, HandleRef hrgn)
index 7822f89..4cb72b9 100644 (file)
@@ -455,53 +455,53 @@ internal static partial class Interop
         }
 
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static partial uint HttpInitialize(HTTPAPI_VERSION version, uint flags, IntPtr pReserved);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static partial uint HttpSetUrlGroupProperty(ulong urlGroupId, HTTP_SERVER_PROPERTY serverProperty, IntPtr pPropertyInfo, uint propertyInfoLength);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static unsafe partial uint HttpCreateServerSession(HTTPAPI_VERSION version, ulong* serverSessionId, uint reserved);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static unsafe partial uint HttpCreateUrlGroup(ulong serverSessionId, ulong* urlGroupId, uint reserved);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static partial uint HttpCloseUrlGroup(ulong urlGroupId);
 
-        [GeneratedDllImport(Libraries.HttpApi,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.HttpApi,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial uint HttpCreateRequestQueue(HTTPAPI_VERSION version, string pName,
             Interop.Kernel32.SECURITY_ATTRIBUTES* pSecurityAttributes, uint flags, out HttpRequestQueueV2Handle pReqQueueHandle);
 
-        [GeneratedDllImport(Libraries.HttpApi,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.HttpApi,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint HttpAddUrlToUrlGroup(ulong urlGroupId, string pFullyQualifiedUrl, ulong context, uint pReserved);
 
-        [GeneratedDllImport(Libraries.HttpApi,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.HttpApi,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint HttpRemoveUrlFromUrlGroup(ulong urlGroupId, string pFullyQualifiedUrl, uint flags);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static unsafe partial uint HttpReceiveHttpRequest(SafeHandle requestQueueHandle, ulong requestId, uint flags, HTTP_REQUEST* pRequestBuffer, uint requestBufferLength, uint* pBytesReturned, NativeOverlapped* pOverlapped);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static unsafe partial uint HttpSendHttpResponse(SafeHandle requestQueueHandle, ulong requestId, uint flags, HTTP_RESPONSE* pHttpResponse, void* pCachePolicy, uint* pBytesSent, SafeLocalAllocHandle pRequestBuffer, uint requestBufferLength, NativeOverlapped* pOverlapped, void* pLogData);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static unsafe partial uint HttpWaitForDisconnect(SafeHandle requestQueueHandle, ulong connectionId, NativeOverlapped* pOverlapped);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static unsafe partial uint HttpReceiveRequestEntityBody(SafeHandle requestQueueHandle, ulong requestId, uint flags, void* pEntityBuffer, uint entityBufferLength, out uint bytesReturned, NativeOverlapped* pOverlapped);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static unsafe partial uint HttpSendResponseEntityBody(SafeHandle requestQueueHandle, ulong requestId, uint flags, ushort entityChunkCount, HTTP_DATA_CHUNK* pEntityChunks, uint* pBytesSent, SafeLocalAllocHandle pRequestBuffer, uint requestBufferLength, NativeOverlapped* pOverlapped, void* pLogData);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static partial uint HttpCloseRequestQueue(IntPtr pReqQueueHandle);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static partial uint HttpCancelHttpRequest(SafeHandle requestQueueHandle, ulong requestId, IntPtr pOverlapped);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static partial uint HttpCloseServerSession(ulong serverSessionId);
 
         internal sealed class SafeLocalFreeChannelBinding : ChannelBinding
@@ -530,10 +530,10 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static unsafe partial uint HttpReceiveClientCertificate(SafeHandle requestQueueHandle, ulong connectionId, uint flags, HTTP_SSL_CLIENT_CERT_INFO* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, NativeOverlapped* pOverlapped);
 
-        [GeneratedDllImport(Libraries.HttpApi, SetLastError = true)]
+        [LibraryImport(Libraries.HttpApi, SetLastError = true)]
         internal static unsafe partial uint HttpReceiveClientCertificate(SafeHandle requestQueueHandle, ulong connectionId, uint flags, byte* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, NativeOverlapped* pOverlapped);
 
         internal static readonly string?[] HttpVerbs = new string?[]
index 992702b..d5244a5 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class IpHlpApi
     {
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetNetworkParams(IntPtr pFixedInfo, uint* pOutBufLen);
     }
 }
index 38d66f9..1a56dd1 100644 (file)
@@ -89,21 +89,21 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
         internal static partial SafeCloseIcmpHandle IcmpCreateFile();
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
         internal static partial SafeCloseIcmpHandle Icmp6CreateFile();
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool IcmpCloseHandle(IntPtr handle);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
         internal static partial uint IcmpSendEcho2(SafeCloseIcmpHandle icmpHandle, SafeWaitHandle Event, IntPtr apcRoutine, IntPtr apcContext,
             uint ipAddress, SafeLocalAllocHandle data, ushort dataSize, ref IPOptions options, SafeLocalAllocHandle replyBuffer, uint replySize, uint timeout);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
         internal static partial uint Icmp6SendEcho2(SafeCloseIcmpHandle icmpHandle, SafeWaitHandle Event, IntPtr apcRoutine, IntPtr apcContext,
             byte[] sourceSocketAddress, byte[] destSocketAddress, SafeLocalAllocHandle data, ushort dataSize, ref IPOptions options, SafeLocalAllocHandle replyBuffer, uint replySize, uint timeout);
     }
index 483653c..11b32ab 100644 (file)
@@ -501,7 +501,7 @@ internal static partial class Interop
             internal ReadOnlySpan<byte> localAddrAsSpan => MemoryMarshal.CreateSpan(ref localAddr[0], 16);
         }
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetAdaptersAddresses(
             AddressFamily family,
             uint flags,
@@ -509,51 +509,51 @@ internal static partial class Interop
             IntPtr adapterAddresses,
             uint* outBufLen);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetBestInterfaceEx(byte* ipAddress, int* index);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static partial uint GetIfEntry2(ref MibIfRow2 pIfRow);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetIpStatisticsEx(MibIpStats* statistics, AddressFamily family);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetTcpStatisticsEx(MibTcpStats* statistics, AddressFamily family);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetUdpStatisticsEx(MibUdpStats* statistics, AddressFamily family);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetIcmpStatistics(MibIcmpInfo* statistics);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static partial uint GetIcmpStatisticsEx(out MibIcmpInfoEx statistics, AddressFamily family);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetTcpTable(IntPtr pTcpTable, uint* dwOutBufLen, [MarshalAs(UnmanagedType.Bool)] bool order);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetExtendedTcpTable(IntPtr pTcpTable, uint* dwOutBufLen, [MarshalAs(UnmanagedType.Bool)] bool order,
                                                         uint IPVersion, TcpTableClass tableClass, uint reserved);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetUdpTable(IntPtr pUdpTable, uint* dwOutBufLen, [MarshalAs(UnmanagedType.Bool)] bool order);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetExtendedUdpTable(IntPtr pUdpTable, uint* dwOutBufLen, [MarshalAs(UnmanagedType.Bool)] bool order,
                                                         uint IPVersion, UdpTableClass tableClass, uint reserved);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetPerAdapterInfo(uint IfIndex, IntPtr pPerAdapterInfo, uint* pOutBufLen);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static partial void FreeMibTable(IntPtr handle);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static partial uint CancelMibChangeNotify2(IntPtr notificationHandle);
 
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
+        [LibraryImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint NotifyStableUnicastIpAddressTable(
             AddressFamily addressFamily,
             out SafeFreeMibTable table,
index 856a1c5..c17641e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class IpHlpApi
     {
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.IpHlpApi, SetLastError = true)]
         internal static partial uint if_nametoindex([MarshalAs(UnmanagedType.LPStr)] string name);
     }
 }
index bf140ef..cf6f3e1 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool Beep(int frequency, int duration);
     }
index 2449962..c86c24c 100644 (file)
@@ -9,11 +9,11 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CancelIoEx(SafeHandle handle, NativeOverlapped* lpOverlapped);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CancelIoEx(IntPtr handle, NativeOverlapped* lpOverlapped);
     }
index dad6a63..b2588e2 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
     {
         internal const uint CTMF_INCLUDE_APPCONTAINER = 0x00000001;
 
-        [GeneratedDllImport(Interop.Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Kernel32, SetLastError = true)]
         internal static partial bool CheckTokenMembershipEx(SafeAccessTokenHandle TokenHandle, byte[] SidToCheck, uint Flags, ref bool IsMember);
     }
 }
index 2061f50..b5b597b 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ClearCommBreak(
             SafeFileHandle hFile);
index 0004b68..3a17ea9 100644 (file)
@@ -9,14 +9,14 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ClearCommError(
             SafeFileHandle hFile,
             ref int lpErrors,
             ref COMSTAT lpStat);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ClearCommError(
             SafeFileHandle hFile,
index eabe864..165ba34 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CloseHandle(IntPtr handle);
     }
index d187b9e..745ac11 100644 (file)
@@ -9,18 +9,18 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial IntPtr CreateIoCompletionPort(IntPtr FileHandle, IntPtr ExistingCompletionPort, UIntPtr CompletionKey, int NumberOfConcurrentThreads);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool PostQueuedCompletionStatus(IntPtr CompletionPort, uint dwNumberOfBytesTransferred, UIntPtr CompletionKey, IntPtr lpOverlapped);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetQueuedCompletionStatus(IntPtr CompletionPort, out uint lpNumberOfBytesTransferred, out UIntPtr CompletionKey, out IntPtr lpOverlapped, int dwMilliseconds);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetQueuedCompletionStatusEx(
             IntPtr CompletionPort,
index f614013..22d3213 100644 (file)
@@ -14,13 +14,13 @@ internal static partial class Interop
             private IntPtr Ptr;
         }
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial void InitializeConditionVariable(CONDITION_VARIABLE* ConditionVariable);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial void WakeConditionVariable(CONDITION_VARIABLE* ConditionVariable);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool SleepConditionVariableCS(CONDITION_VARIABLE* ConditionVariable, CRITICAL_SECTION* CriticalSection, int dwMilliseconds);
     }
index 1838d72..77eabe4 100644 (file)
@@ -10,11 +10,11 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool ConnectNamedPipe(SafePipeHandle handle, NativeOverlapped* overlapped);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ConnectNamedPipe(SafePipeHandle handle, IntPtr overlapped);
     }
index c287ba7..2068b05 100644 (file)
@@ -15,11 +15,11 @@ internal static partial class Interop
             internal BOOL bVisible;
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetConsoleCursorInfo(IntPtr hConsoleOutput, out CONSOLE_CURSOR_INFO cci);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetConsoleCursorInfo(IntPtr hConsoleOutput, ref CONSOLE_CURSOR_INFO cci);
     }
index c15eef8..7760fd8 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use CopyFileEx.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CopyFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CopyFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool CopyFileExPrivate(
             string src,
index 14bfbb5..c679fbb 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use CreateDirectory.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool CreateDirectoryPrivate(
             string path,
index b598f2e..cf75397 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use CreateFile.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         private static unsafe partial SafeFileHandle CreateFilePrivate(
             string lpFileName,
             int dwDesiredAccess,
index 8a4cebb..e211467 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeMemoryMappedFileHandle CreateFileMapping(
             SafeFileHandle hFile,
             ref SECURITY_ATTRIBUTES lpFileMappingAttributes,
@@ -19,7 +19,7 @@ internal static partial class Interop
             int dwMaximumSizeLow,
             string? lpName);
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeMemoryMappedFileHandle CreateFileMapping(
             IntPtr hFile,
             ref SECURITY_ATTRIBUTES lpFileMappingAttributes,
index 37ae80b..3a7d5e0 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use CreateFile.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         private static unsafe partial IntPtr CreateFilePrivate_IntPtr(
             string lpFileName,
             int dwDesiredAccess,
index 0e67ae5..7619219 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateNamedPipeW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateNamedPipeW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafePipeHandle CreateNamedPipe(
             string pipeName,
             int openMode,
index baca7ea..00cefe2 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateFileW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafePipeHandle CreateNamedPipeClient(
             string? lpFileName,
             int dwDesiredAccess,
index 2d05928..d09b9a0 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CreatePipe(out SafeFileHandle hReadPipe, out SafeFileHandle hWritePipe, ref SECURITY_ATTRIBUTES lpPipeAttributes, int nSize);
     }
index 07f5f63..97ee5e6 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CreatePipe(out SafePipeHandle hReadPipe, out SafePipeHandle hWritePipe, ref SECURITY_ATTRIBUTES lpPipeAttributes, int nSize);
     }
index d5bab34..c804e06 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateProcessW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateProcessW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool CreateProcess(
             string? lpApplicationName,
index 1cdcd16..b6d79e4 100644 (file)
@@ -20,7 +20,7 @@ internal static partial class Interop
         /// </summary>
         internal const int SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE = 0x2;
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateSymbolicLinkW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateSymbolicLinkW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool CreateSymbolicLinkPrivate(string lpSymlinkFileName, string lpTargetFileName, int dwFlags);
 
index 777b8b2..1e4c296 100644 (file)
@@ -37,16 +37,16 @@ internal static partial class Interop
         }
 
         // https://docs.microsoft.com/windows/desktop/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial IntPtr CreateToolhelp32Snapshot(SnapshotFlags dwFlags, uint th32ProcessID);
 
         // https://docs.microsoft.com/windows/desktop/api/tlhelp32/nf-tlhelp32-process32first
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "Process32FirstW", SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "Process32FirstW", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool Process32First(IntPtr hSnapshot, ref PROCESSENTRY32 lppe);
 
         // https://docs.microsoft.com/windows/desktop/api/tlhelp32/nf-tlhelp32-process32next
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "Process32NextW", SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "Process32NextW", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool Process32Next(IntPtr hSnapshot, ref PROCESSENTRY32 lppe);
     }
index 729eb0a..bd68847 100644 (file)
@@ -19,16 +19,16 @@ internal static partial class Interop
             private UIntPtr SpinCount;
         }
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial void InitializeCriticalSection(CRITICAL_SECTION* lpCriticalSection);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial void EnterCriticalSection(CRITICAL_SECTION* lpCriticalSection);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial void LeaveCriticalSection(CRITICAL_SECTION* lpCriticalSection);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial void DeleteCriticalSection(CRITICAL_SECTION* lpCriticalSection);
     }
 }
index 8e455ee..2713030 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use DeleteFile.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeleteFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "DeleteFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool DeleteFilePrivate(string path);
 
index e1b97f2..e62fed5 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use DeleteVolumeMountPoint.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeleteVolumeMountPointW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "DeleteVolumeMountPointW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DeleteVolumeMountPointPrivate(string mountPoint);
 
index 21e1b2b..1d20208 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         // https://docs.microsoft.com/windows/win32/api/winioctl/ni-winioctl-fsctl_get_reparse_point
         internal const int FSCTL_GET_REPARSE_POINT = 0x000900a8;
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeviceIoControl", SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "DeviceIoControl", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DeviceIoControl(
             SafeHandle hDevice,
index c0d1376..0c3d3d5 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DisconnectNamedPipe(SafePipeHandle hNamedPipe);
     }
index 20b52d9..b23d9a3 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DuplicateHandle(
             IntPtr hSourceProcessHandle,
index b084c41..b2d2e16 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DuplicateHandle(
             IntPtr hSourceProcessHandle,
index c33fa95..edcaf54 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DuplicateHandle(
             IntPtr hSourceProcessHandle,
index 9793f50..4c60011 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DuplicateHandle(
             IntPtr hSourceProcessHandle,
index 538e5bc..e6ce9d5 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static unsafe partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial IntPtr GetProcAddress(IntPtr hModule, byte* lpProcName);
     }
 }
index 486ddb9..7a23e7f 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32EnumProcessModules",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "K32EnumProcessModules",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EnumProcessModules(SafeProcessHandle handle, IntPtr[]? modules, int size, out int needed);
     }
index 0a67cb1..ce0c3f0 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32EnumProcesses",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "K32EnumProcesses",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EnumProcesses(int[] processIds, int size, out int needed);
     }
index 3e6fa6d..881d5f3 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
             internal const int CLRDTR = 6;
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EscapeCommFunction(
             SafeFileHandle hFile,
index effacb0..f265ff1 100644 (file)
@@ -12,18 +12,18 @@ internal static partial class Interop
         internal const uint CREATE_EVENT_INITIAL_SET = 0x2;
         internal const uint CREATE_EVENT_MANUAL_RESET = 0x1;
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetEvent(SafeWaitHandle handle);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ResetEvent(SafeWaitHandle handle);
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateEventExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateEventExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeWaitHandle CreateEventEx(IntPtr lpSecurityAttributes, string? name, uint flags, uint desiredAccess);
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenEventW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "OpenEventW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeWaitHandle OpenEvent(uint desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheritHandle, string name);
     }
 }
index ff36337..c7aa120 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
     internal static unsafe partial class Kernel32
     {
         [DoesNotReturn]
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ExitProcess")]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "ExitProcess")]
         internal static partial void ExitProcess(int exitCode);
     }
 }
index 8f8ea39..20b90d2 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ExpandEnvironmentStringsW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "ExpandEnvironmentStringsW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint ExpandEnvironmentStrings(string lpSrc, ref char lpDst, uint nSize);
     }
 }
index 42afb96..3ca00bd 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial int ReadFileScatter(
             SafeHandle hFile,
             long* aSegmentArray,
@@ -17,7 +17,7 @@ internal static partial class Interop
             IntPtr lpReserved,
             NativeOverlapped* lpOverlapped);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial int WriteFileGather(
             SafeHandle hFile,
             long* aSegmentArray,
index adab75e..0eac8ca 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [SuppressGCTransition]
         internal static unsafe partial Interop.BOOL FileTimeToSystemTime(ulong* lpFileTime, Interop.Kernel32.SYSTEMTIME* lpSystemTime);
     }
index 48a247a..b2cba0e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool FillConsoleOutputAttribute(IntPtr hConsoleOutput, short wColorAttribute, int numCells, COORD startCoord, out int pNumBytesWritten);
     }
index 11fe930..13ec8f6 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FillConsoleOutputCharacterW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "FillConsoleOutputCharacterW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool FillConsoleOutputCharacter(IntPtr hConsoleOutput, char character, int nLength, COORD dwWriteCoord, out int pNumCharsWritten);
     }
index f35fbcc..d2ba6f9 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool FindClose(IntPtr hFindFile);
     }
index aad022d..0095c09 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use FindFirstFile.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FindFirstFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "FindFirstFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         private static partial SafeFindHandle FindFirstFileExPrivate(string lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, ref WIN32_FIND_DATA lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, IntPtr lpSearchFilter, int dwAdditionalFlags);
 
         internal static SafeFindHandle FindFirstFile(string fileName, ref WIN32_FIND_DATA data)
index 748de48..131384f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FindNextFileW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "FindNextFileW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool FindNextFile(SafeFindHandle hndFindFile, ref WIN32_FIND_DATA lpFindFileData);
     }
index 689e443..0f1edce 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool FlushFileBuffers(SafeHandle hHandle);
     }
index 0fa730c..fb49237 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool FlushViewOfFile(IntPtr lpBaseAddress, UIntPtr dwNumberOfBytesToFlush);
     }
index a3340f1..f07214f 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         private const int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100;
         private const int ERROR_INSUFFICIENT_BUFFER = 0x7A;
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true)]
         private static unsafe partial int FormatMessage(
             int dwFlags,
             IntPtr lpSource,
index 6c14dad..cc01c8b 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         public const int FORMAT_MESSAGE_FROM_HMODULE = 0x00000800;
         public const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000;
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         public static partial int FormatMessage(
             int dwFlags,
             SafeLibraryHandle lpSource,
index 52fd619..dbc151d 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial BOOL FreeEnvironmentStringsW(char* lpszEnvironmentBlock);
     }
 }
index dabec6e..d55825a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool FreeLibrary(IntPtr hModule);
     }
index 0b5f3cc..7f4558d 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
             internal fixed byte LeadByte[12 /* MAX_LEADBYTES */];
         }
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial Interop.BOOL GetCPInfo(uint codePage, CPINFO* lpCpInfo);
     }
 }
index e47bb8a..76ca4c5 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetCPInfoExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "GetCPInfoExW", StringMarshalling = StringMarshalling.Utf16)]
         private static unsafe partial Interop.BOOL GetCPInfoExW(uint CodePage, uint dwFlags, CPINFOEXW* lpCPInfoEx);
 
         [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
index 0552a7a..e55bd08 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             internal const int MS_RLSD_ON = 0x80;
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetCommModemStatus(
             SafeFileHandle hFile,
index c19e80f..3d17ae7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetCommProperties(
             SafeFileHandle hFile,
index 6714e54..1d85a6e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetCommState(
             SafeFileHandle hFile,
index fe44183..7180888 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetComputerNameW")]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "GetComputerNameW")]
         private static unsafe partial int GetComputerName(char* lpBuffer, uint* nSize);
 
         // maximum length of the NETBIOS name (not including NULL)
index 33e73f8..c534815 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial uint GetConsoleCP();
     }
 }
index b2d211e..1b2ee78 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetConsoleMode(IntPtr handle, out int mode);
 
@@ -17,7 +17,7 @@ internal static partial class Interop
             return GetConsoleMode(handle, out _);
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetConsoleMode(IntPtr handle, int mode);
 
index 3d8c546..ba9bafe 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial uint GetConsoleOutputCP();
     }
 }
index cbee47a..1cb27e4 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetConsoleScreenBufferInfo(IntPtr hConsoleOutput, out CONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo);
     }
index 955d497..6568961 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial uint GetConsoleTitleW(char* title, uint nSize);
     }
 }
index 4860846..98f484f 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetCurrentDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "GetCurrentDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint GetCurrentDirectory(uint nBufferLength, ref char lpBuffer);
     }
 }
index 89f04ad..efa5c56 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial IntPtr GetCurrentProcess();
     }
 }
index be0fd40..bc2b3e8 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial uint GetCurrentProcessId();
     }
 }
index 13865d7..a726b97 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial uint GetCurrentProcessorNumber();
     }
 }
index 73d3339..75aea62 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Interop.Libraries.Kernel32)]
+        [LibraryImport(Interop.Libraries.Kernel32)]
         internal static partial IntPtr GetCurrentThread();
     }
 }
index 10b761f..773fd3d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [SuppressGCTransition]
         public static partial int GetCurrentThreadId();
     }
index cf86b13..d06b21c 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
     {
         // NOTE: The out parameters are PULARGE_INTEGERs and may require
         // some byte munging magic.
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetDiskFreeSpaceExW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "GetDiskFreeSpaceExW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetDiskFreeSpaceEx(string drive, out long freeBytesForUser, out long totalBytes, out long freeBytes);
     }
index 641be55..6efddcd 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetDriveTypeW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "GetDriveTypeW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int GetDriveType(string drive);
 
     }
index ec02db6..d92e85a 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial char* GetEnvironmentStringsW();
     }
 }
index e3691f6..ac80503 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "GetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint GetEnvironmentVariable(string lpName, ref char lpBuffer, uint nSize);
     }
 }
index d2b6fb5..1789bac 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetExitCodeProcess(SafeProcessHandle processHandle, out int exitCode);
     }
index 04daf34..59f6d49 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use GetFileAttributesEx.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetFileAttributesExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "GetFileAttributesExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool GetFileAttributesExPrivate(
             string? name,
index 585306b..6f978f9 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetFileInformationByHandleEx(SafeFileHandle hFile, int FileInformationClass, void* lpFileInformation, uint dwBufferSize);
     }
index 1a2e543..deb355a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial uint GetFileType(IntPtr hFile);
     }
 }
index 76f99ac..eeca5b6 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial int GetFileType(SafeHandle hFile);
     }
 }
index 3d15bf6..cdc0fcc 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         internal const uint FILE_NAME_NORMALIZED = 0x0;
 
         // https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-getfinalpathnamebyhandlew (kernel32)
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetFinalPathNameByHandleW", SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "GetFinalPathNameByHandleW", SetLastError = true)]
         internal static unsafe partial uint GetFinalPathNameByHandle(
             SafeFileHandle hFile,
             char* lpszFilePath,
index 687d5bf..7339009 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use GetFullPathName or PathHelper.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint GetFullPathNameW(
             ref char lpFileName,
             uint nBufferLength,
index ca7bf2b..83fb840 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial Interop.Kernel32.COORD GetLargestConsoleWindowSize(IntPtr hConsoleOutput);
     }
 }
index 55a8417..e75b403 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [SuppressGCTransition]
         internal static partial int GetLastError();
     }
index f084be9..1704ee8 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial int GetLogicalDrives();
     }
 }
index a99a77a..6a86e79 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use GetFullPath/PathHelper.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint GetLongPathNameW(
             ref char lpszShortPath,
             ref char lpszLongPath,
index def7124..d60af48 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32GetModuleBaseNameW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "K32GetModuleBaseNameW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int GetModuleBaseName(SafeProcessHandle processHandle, IntPtr moduleHandle, [Out] char[] baseName, int size);
     }
 }
index 08b6784..095e6a8 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetModuleFileNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "GetModuleFileNameW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint GetModuleFileName(IntPtr hModule, ref char lpFilename, uint nSize);
     }
 }
index 1b89788..489cc9f 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32GetModuleFileNameExW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "K32GetModuleFileNameExW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int GetModuleFileNameEx(SafeProcessHandle processHandle, IntPtr moduleHandle, [Out] char[] baseName, int size);
     }
 }
index 710e14f..25c7ded 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetModuleHandleW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "GetModuleHandleW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr GetModuleHandle(string? moduleName);
     }
 }
index f2b80ac..114cd37 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "K32GetModuleInformation",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "K32GetModuleInformation",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool GetModuleInformation(SafeProcessHandle processHandle, IntPtr moduleHandle, out NtModuleInfo ntModuleInfo, int size);
 
index 2d0b553..c663cc2 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetNamedPipeHandleStateW(
             SafePipeHandle hNamedPipe,
index 3e6f1f1..5945fa9 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetNamedPipeInfo(
             SafePipeHandle hNamedPipe,
index 076079e..7505529 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial void GetNativeSystemInfo(SYSTEM_INFO* lpSystemInfo);
     }
 }
index fa2db04..6ef5b0c 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetOverlappedResult(
             SafeFileHandle hFile,
index fc66080..8cedaaf 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial int GetPriorityClass(SafeProcessHandle handle);
     }
 }
index c76bda4..4c7723b 100644 (file)
@@ -10,10 +10,10 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         public static partial IntPtr GetProcAddress(SafeLibraryHandle hModule, [MarshalAs(UnmanagedType.LPStr)] string lpProcName);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         public static partial IntPtr GetProcAddress(IntPtr hModule, [MarshalAs(UnmanagedType.LPStr)] string lpProcName);
     }
 }
index dd7752b..c09afa1 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetProcessAffinityMask(SafeProcessHandle handle, out IntPtr processMask, out IntPtr systemMask);
     }
index 5261c0d..2465c0d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         public static partial int GetProcessId(SafeProcessHandle nativeHandle);
     }
 }
index 07b94f8..15b09ca 100644 (file)
@@ -23,7 +23,7 @@ internal static partial class Interop
             public UIntPtr PeakPagefileUsage;
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint ="K32GetProcessMemoryInfo")]
+        [LibraryImport(Libraries.Kernel32, EntryPoint ="K32GetProcessMemoryInfo")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetProcessMemoryInfo(IntPtr Process, ref PROCESS_MEMORY_COUNTERS ppsmemCounters, uint cb);
     }
index ec1c773..871108a 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "QueryFullProcessImageNameW", SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "QueryFullProcessImageNameW", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static unsafe partial bool QueryFullProcessImageName(
             SafeHandle hProcess,
index 1b17230..6258f55 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetProcessPriorityBoost(SafeProcessHandle handle, [MarshalAs(UnmanagedType.Bool)] out bool disabled);
     }
index 7ceb948..64c234b 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetProcessTimes(
             SafeProcessHandle handle, out long creation, out long exit, out long kernel, out long user);
index 79f6a90..3d4eb64 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetProcessTimes(IntPtr handleProcess, out long creation, out long exit, out long kernel, out long user);
     }
index 3ededb0..859a85a 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetProcessWorkingSetSizeEx(SafeProcessHandle handle, out IntPtr min, out IntPtr max, out int flags);
     }
index 501c25f..e763e01 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
 #if !NO_SUPPRESS_GC_TRANSITION
         [SuppressGCTransition]
 #endif
index 699d4b9..97d100e 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint GetSystemDirectoryW(ref char lpBuffer, uint uSize);
     }
 }
index 383a26f..f4d79fa 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial void GetSystemInfo(SYSTEM_INFO* lpSystemInfo);
     }
 }
index e97c565..9b80349 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [SuppressGCTransition]
         internal static unsafe partial void GetSystemTime(Interop.Kernel32.SYSTEMTIME* lpSystemTime);
     }
index d273de7..9234cd8 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetSystemTimes(out long idle, out long kernel, out long user);
     }
index a0c3956..fba61bf 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint GetTempFileNameW(ref char lpPathName, string lpPrefixString, uint uUnique, ref char lpTempFileName);
     }
 }
index bef74a9..7c30b97 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint GetTempPathW(int bufferLen, ref char buffer);
     }
 }
index 4a0aef6..bcbd89b 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial int GetThreadPriority(SafeThreadHandle handle);
     }
 }
index 9a60f83..97aa81e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetThreadPriorityBoost(SafeThreadHandle handle, [MarshalAs(UnmanagedType.Bool)] out bool disabled);
     }
index 6054ffd..d1e72ce 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetThreadTimes(SafeThreadHandle handle, out long creation, out long exit, out long kernel, out long user);
     }
index b0b6d90..24ee8eb 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static unsafe partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [SuppressGCTransition]
         internal static partial ulong GetTickCount64();
     }
index bfe62ac..ad4edf6 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Interop.Libraries.Kernel32)]
+        [LibraryImport(Interop.Libraries.Kernel32)]
         internal static partial int GetUserDefaultLCID();
     }
 }
index af5f7af..4082bc4 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetVolumeInformationW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "GetVolumeInformationW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetVolumeInformation(
             string drive,
index f62db37..9fc80bc 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         public static partial IntPtr GlobalFree(IntPtr handle);
 
         public static IntPtr GlobalFree(HandleRef handle)
index c618bac..66b2ccb 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         public static partial IntPtr GlobalLock(IntPtr hMem);
 
         public static IntPtr GlobalLock(HandleRef hMem)
@@ -18,7 +18,7 @@ internal static partial class Interop
             return result;
         }
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         public static partial IntPtr GlobalUnlock(IntPtr hMem);
 
         public static IntPtr GlobalUnlock(HandleRef hMem)
index 9704e1c..7012582 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial BOOL GlobalMemoryStatusEx(MEMORYSTATUSEX* lpBuffer);
     }
 }
index 4c6d51b..99e18ca 100644 (file)
@@ -47,13 +47,13 @@ internal static partial class Interop
         internal const string LOCALE_NAME_USER_DEFAULT = null;
         internal const string LOCALE_NAME_SYSTEM_DEFAULT = "!x-sys-default-locale";
 
-        [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int LCIDToLocaleName(int locale, char* pLocaleName, int cchName, uint dwFlags);
 
-        [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int LocaleNameToLCID(string lpName, uint dwFlags);
 
-        [GeneratedDllImport("kernel32.dll",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("kernel32.dll",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int LCMapStringEx(
                     string? lpLocaleName,
                     uint dwMapFlags,
@@ -65,7 +65,7 @@ internal static partial class Interop
                     void* lpReserved,
                     IntPtr sortHandle);
 
-        [GeneratedDllImport("kernel32.dll", EntryPoint = "FindNLSStringEx", SetLastError = SetLastErrorForDebug)]
+        [LibraryImport("kernel32.dll", EntryPoint = "FindNLSStringEx", SetLastError = SetLastErrorForDebug)]
         internal static unsafe partial int FindNLSStringEx(
                     char* lpLocaleName,
                     uint dwFindNLSStringFlags,
@@ -78,7 +78,7 @@ internal static partial class Interop
                     void* lpReserved,
                     IntPtr sortHandle);
 
-        [GeneratedDllImport("kernel32.dll", EntryPoint = "CompareStringEx")]
+        [LibraryImport("kernel32.dll", EntryPoint = "CompareStringEx")]
         internal static unsafe partial int CompareStringEx(
                     char* lpLocaleName,
                     uint dwCmpFlags,
@@ -90,7 +90,7 @@ internal static partial class Interop
                     void* lpReserved,
                     IntPtr lParam);
 
-        [GeneratedDllImport("kernel32.dll", EntryPoint = "CompareStringOrdinal")]
+        [LibraryImport("kernel32.dll", EntryPoint = "CompareStringOrdinal")]
         internal static unsafe partial int CompareStringOrdinal(
                     char* lpString1,
                     int cchCount1,
@@ -98,7 +98,7 @@ internal static partial class Interop
                     int cchCount2,
                     [MarshalAs(UnmanagedType.Bool)] bool bIgnoreCase);
 
-        [GeneratedDllImport("kernel32.dll", EntryPoint = "FindStringOrdinal", SetLastError = SetLastErrorForDebug)]
+        [LibraryImport("kernel32.dll", EntryPoint = "FindStringOrdinal", SetLastError = SetLastErrorForDebug)]
         internal static unsafe partial int FindStringOrdinal(
                     uint dwFindStringOrdinalFlags,
                     char* lpStringSource,
@@ -107,7 +107,7 @@ internal static partial class Interop
                     int cchValue,
                     BOOL bIgnoreCase);
 
-        [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool IsNLSDefinedString(
                     int Function,
@@ -116,33 +116,33 @@ internal static partial class Interop
                     char* lpString,
                     int cchStr);
 
-        [GeneratedDllImport("kernel32.dll")]
+        [LibraryImport("kernel32.dll")]
         internal static unsafe partial Interop.BOOL GetUserPreferredUILanguages(uint dwFlags, uint* pulNumLanguages, char* pwszLanguagesBuffer, uint* pcchLanguagesBuffer);
 
-        [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int GetLocaleInfoEx(string lpLocaleName, uint LCType, void* lpLCData, int cchData);
 
-        [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool EnumSystemLocalesEx(delegate* unmanaged<char*, uint, void*, BOOL> lpLocaleEnumProcEx, uint dwFlags, void* lParam, IntPtr reserved);
 
-        [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool EnumTimeFormatsEx(delegate* unmanaged<char*, void*, BOOL> lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam);
 
-        [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, out int lpValue);
 
-        [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, IntPtr lpValue);
 
-        [GeneratedDllImport("kernel32.dll")]
+        [LibraryImport("kernel32.dll")]
         internal static partial int GetUserGeoID(int geoClass);
 
-        [GeneratedDllImport("kernel32.dll", EntryPoint = "GetGeoInfoW")]
+        [LibraryImport("kernel32.dll", EntryPoint = "GetGeoInfoW")]
         internal static unsafe partial int GetGeoInfo(int location, int geoType, char* lpGeoData, int cchData, int LangId);
 
-        [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool EnumCalendarInfoExEx(delegate* unmanaged<char*, uint, IntPtr, void*, BOOL> pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string? lpReserved, uint CalType, void* lParam);
 
@@ -156,7 +156,7 @@ internal static partial class Interop
             internal Guid guidCustomVersion;
         }
 
-        [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool GetNLSVersionEx(int function, string localeName, NlsVersionInfoEx* lpVersionInformation);
     }
index 979e4b9..5576bdd 100644 (file)
@@ -17,7 +17,7 @@ internal static partial class Interop
             HANDLE_FLAG_PROTECT_FROM_CLOSE = 2
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetHandleInformation(SafeHandle hObject, HandleFlags dwMask, HandleFlags dwFlags);
     }
index c68b192..5de5b8d 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial IntPtr GetProcessHeap();
 
         [Flags]
@@ -21,10 +21,10 @@ internal static partial class Interop
             HEAP_GENERATE_EXCEPTIONS = 0x00000004,
         }
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial SafeHeapAllocHandle HeapAlloc(IntPtr hHeap, HeapAllocFlags dwFlags, nint dwBytes);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool HeapFree(IntPtr hHeap, HeapAllocFlags dwFlags, IntPtr lpMem);
     }
index e1fa109..8dc6f52 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool IsDebuggerPresent();
     }
index 855f904..bf35601 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool IsWow64Process(IntPtr hProcess, [MarshalAs(UnmanagedType.Bool)] out bool Wow64Process);
     }
index c6eb675..2be93bc 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool IsWow64Process(SafeProcessHandle hProcess, [MarshalAs(UnmanagedType.Bool)] out bool Wow64Process);
     }
index eb9e381..8cc0f4b 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "LoadLibraryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "LoadLibraryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         public static partial IntPtr LoadLibrary(string libFilename);
     }
 }
index 9d1f7a8..d862ab6 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         public const int LOAD_LIBRARY_AS_DATAFILE = 0x00000002;
         public const int LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800;
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         public static partial SafeLibraryHandle LoadLibraryExW(string lpwLibFileName, IntPtr hFile, uint dwFlags);
     }
 }
index b987f56..5dea038 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
         internal const int LOAD_LIBRARY_AS_DATAFILE = 0x00000002;
         internal const int LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800;
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "LoadLibraryExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "LoadLibraryExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr LoadLibraryEx(string libFilename, IntPtr reserved, int flags);
     }
 }
index 0bcd7e3..eb64d0d 100644 (file)
@@ -12,13 +12,13 @@ internal static partial class Interop
         internal const uint LMEM_MOVEABLE = 0x0002;
         internal const uint LMEM_ZEROINIT = 0x0040;
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial IntPtr LocalAlloc(uint uFlags, nuint uBytes);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial IntPtr LocalReAlloc(IntPtr hMem, nuint uBytes, uint uFlags);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial IntPtr LocalFree(IntPtr hMem);
     }
 }
index ac97866..9584a8b 100644 (file)
@@ -8,11 +8,11 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool LockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool UnlockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh);
     }
index 79a3387..898f476 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "MapViewOfFile",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "MapViewOfFile",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeMemoryMappedViewHandle MapViewOfFile(
             SafeMemoryMappedFileHandle hFileMappingObject,
             int dwDesiredAccess,
index dede505..da1d8bb 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use MoveFile.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "MoveFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "MoveFileExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool MoveFileExPrivate(
             string src, string dst, uint flags);
index dfb7a73..4b2b30b 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial int MultiByteToWideChar(
             uint CodePage, uint dwFlags,
             byte* lpMultiByteStr, int cbMultiByte,
index b110c47..9b9bfff 100644 (file)
@@ -11,13 +11,13 @@ internal static partial class Interop
     {
         internal const uint CREATE_MUTEX_INITIAL_OWNER = 0x1;
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenMutexW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "OpenMutexW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeWaitHandle OpenMutex(uint desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheritHandle, string name);
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateMutexExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateMutexExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeWaitHandle CreateMutexEx(IntPtr lpMutexAttributes, string? name, uint flags, uint desiredAccess);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return:MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ReleaseMutex(SafeWaitHandle handle);
     }
index 8d8a0c9..347ec7c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "OpenFileMappingW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeMemoryMappedFileHandle OpenFileMapping(
             int dwDesiredAccess,
             [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle,
index b33a81f..2a1fdd1 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial SafeProcessHandle OpenProcess(
             int access, [MarshalAs(UnmanagedType.Bool)] bool inherit, int processId);
     }
index f662ea5..f608aae 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial SafeThreadHandle OpenThread(int access, [MarshalAs(UnmanagedType.Bool)] bool inherit, int threadId);
     }
 }
index 937999e..0012b5d 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Interop.Libraries.Kernel32, EntryPoint = "OutputDebugStringW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Kernel32, EntryPoint = "OutputDebugStringW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial void OutputDebugString(string message);
     }
 }
index ff2d562..23b9e80 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "PeekConsoleInputW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "PeekConsoleInputW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool PeekConsoleInput(IntPtr hConsoleInput, out InputRecord buffer, int numInputRecords_UseOne, out int numEventsRead);
     }
index e6b8f1c..757e72b 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
             internal const uint PURGE_RXCLEAR = 0x0008;  // Kill the typeahead buffer if there.
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool PurgeComm(
             SafeFileHandle hFile,
index f43439a..506c14a 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         // We take a long* (rather than a out long) to avoid the pinning overhead.
         // We don't set last error since we don't need the extended error info.
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [SuppressGCTransition]
         internal static unsafe partial BOOL QueryPerformanceCounter(long* lpPerformanceCount);
     }
index 2ed59d0..11b3bf7 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         // We take a long* (rather than a out long) to avoid the pinning overhead.
         // We don't set last error since we don't need the extended error info.
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial BOOL QueryPerformanceFrequency(long* lpFrequency);
     }
 }
index 1694738..fd2cb68 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool QueryUnbiasedInterruptTime(out ulong UnbiasedTime);
     }
index 004ca3a..58b48a5 100644 (file)
@@ -49,7 +49,7 @@ internal partial class Interop
                 pExAddress == IntPtr.Zero ? FAIL_FAST_GENERATE_EXCEPTION_ADDRESS : 0);
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "RaiseFailFastException")]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "RaiseFailFastException")]
         [DoesNotReturn]
         private static unsafe partial void RaiseFailFastException(
             EXCEPTION_RECORD* pExceptionRecord,
index 21e161c..8960bf7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReadConsoleW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "ReadConsoleW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool ReadConsole(
             IntPtr hConsoleInput,
index 2153e7c..5036757 100644 (file)
@@ -32,7 +32,7 @@ internal static partial class Interop
 
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReadConsoleInputW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "ReadConsoleInputW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ReadConsoleInput(IntPtr hConsoleInput, out InputRecord buffer, int numInputRecords_UseOne, out int numEventsRead);
     }
index 2e4c002..52679d9 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             private short attributes;
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReadConsoleOutputW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "ReadConsoleOutputW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool ReadConsoleOutput(IntPtr hConsoleOutput, CHAR_INFO* pBuffer, COORD bufferSize, COORD bufferCoord, ref SMALL_RECT readRegion);
     }
index f426040..b5eec92 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReadDirectoryChangesW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "ReadDirectoryChangesW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool ReadDirectoryChangesW(
             SafeFileHandle hDirectory,
index 6e8aa47..d6482bb 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial int ReadFile(
             IntPtr handle,
             byte* bytes,
index 00b66c4..8ec2b02 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial int ReadFile(
             SafeHandle handle,
             byte* bytes,
index ceebb11..bc1c7fd 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial int ReadFile(
             SafeHandle handle,
             byte* bytes,
@@ -17,7 +17,7 @@ internal static partial class Interop
             IntPtr numBytesRead_mustBeZero,
             NativeOverlapped* overlapped);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial int ReadFile(
             SafeHandle handle,
             byte* bytes,
index e701be6..7c123d1 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use RemoveDirectory.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "RemoveDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "RemoveDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool RemoveDirectoryPrivate(string path);
 
index 531107f..0a0ec60 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReplaceFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "ReplaceFileW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool ReplaceFilePrivate(
             string replacedFileName, string replacementFileName, string? backupFileName,
index b70c6d8..f7502cc 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
     {
         internal const int LOCALE_NAME_MAX_LENGTH = 85;
 
-        [GeneratedDllImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("kernel32.dll", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int ResolveLocaleName(string lpNameToResolve, char* lpLocaleName, int cchLocaleName);
     }
 }
index 8b50d13..150df2d 100644 (file)
@@ -9,13 +9,13 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenSemaphoreW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "OpenSemaphoreW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeWaitHandle OpenSemaphore(uint desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheritHandle, string name);
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateSemaphoreExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "CreateSemaphoreExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SafeWaitHandle CreateSemaphoreEx(IntPtr lpSecurityAttributes, int initialCount, int maximumCount, string? name, uint flags, uint desiredAccess);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool ReleaseSemaphore(SafeWaitHandle handle, int releaseCount, out int previousCount);
     }
index b862c71..238c967 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetCommBreak(
             SafeFileHandle hFile);
index 898a359..6179d1a 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             internal const int ALL_EVENTS = 0x1fb;
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetCommMask(
             SafeFileHandle hFile,
index 558f3e9..1f88b89 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetCommState(
             SafeFileHandle hFile,
index e1ed765..58b3c7a 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
     {
         internal const int MAXDWORD = -1; // This is 0xfffffff, or UInt32.MaxValue, here used as an int
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetCommTimeouts(
             SafeFileHandle hFile,
index 88fd242..f136274 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetConsoleCP(int codePage);
     }
index 64d037e..3148bcf 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
     {
         internal delegate bool ConsoleCtrlHandlerRoutine(int controlType);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetConsoleCtrlHandler(ConsoleCtrlHandlerRoutine handler, [MarshalAs(UnmanagedType.Bool)] bool addOrRemove);
     }
index 1596458..63d2db5 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         internal const int CTRL_LOGOFF_EVENT = 5;
         internal const int CTRL_SHUTDOWN_EVENT = 6;
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool SetConsoleCtrlHandler(delegate* unmanaged<int, BOOL> handler, [MarshalAs(UnmanagedType.Bool)] bool Add);
     }
index 30b4276..cde79e4 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetConsoleCursorPosition(IntPtr hConsoleOutput, COORD cursorPosition);
     }
index 177fe5f..2db5b53 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetConsoleOutputCP(int codePage);
     }
index bc913cf..c7392fa 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetConsoleScreenBufferSize(IntPtr hConsoleOutput, Interop.Kernel32.COORD size);
     }
index 23bd38e..64adfc4 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial int SetConsoleTextAttribute(IntPtr hConsoleOutput, short wAttributes);
     }
 }
index fae0deb..20c7a70 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetConsoleTitleW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "SetConsoleTitleW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetConsoleTitle(string title);
     }
index fbe96c5..b8ea92d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool SetConsoleWindowInfo(IntPtr hConsoleOutput, [MarshalAs(UnmanagedType.Bool)] bool absolute, SMALL_RECT* consoleWindow);
     }
index 3cec488..7f19ed2 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetCurrentDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "SetCurrentDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetCurrentDirectory(string path);
     }
index 32b2060..960ee03 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetEnvironmentVariable(string lpName, string? lpValue);
     }
index c2f1912..d421566 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
         /// <summary>
         /// WARNING: This method does not implicitly handle long paths. Use SetFileAttributes.
         /// </summary>
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetFileAttributesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "SetFileAttributesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool SetFileAttributesPrivate(
             string name,
index f9150e0..408c3d6 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
             SkipSetEventOnHandle = 2
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetFileCompletionNotificationModes(SafeHandle handle, FileCompletionNotificationModes flags);
     }
index 15b6fb2..e80bf32 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool SetFileInformationByHandle(
             SafeFileHandle hFile,
index b1ee5a8..e7050d1 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetFilePointerEx(SafeFileHandle hFile, long liDistanceToMove, out long lpNewFilePointer, uint dwMoveMethod);
     }
index baf852e..b04a0dd 100644 (file)
@@ -7,7 +7,7 @@ internal partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [SuppressGCTransition]
         internal static partial void SetLastError(int errorCode);
     }
index 2ee9911..b618d10 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool SetNamedPipeHandleState(
           SafePipeHandle hNamedPipe,
index 12aed4e..000002e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetPriorityClass(SafeProcessHandle handle, int priorityClass);
     }
index ea6222a..67edaa1 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetProcessAffinityMask(SafeProcessHandle handle, IntPtr mask);
     }
index 8744b06..31ab0f4 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetProcessPriorityBoost(SafeProcessHandle handle, [MarshalAs(UnmanagedType.Bool)] bool disabled);
     }
index 8efac8a..02cd318 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetProcessWorkingSetSizeEx(SafeProcessHandle handle, IntPtr min, IntPtr max, int flags);
     }
index 3831b95..65e762c 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial IntPtr SetThreadAffinityMask(SafeThreadHandle handle, IntPtr mask);
     }
 }
index 98c0ac2..340b751 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
     internal static partial class Kernel32
     {
         [SuppressGCTransition]
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetThreadErrorMode(
             uint dwNewMode,
index d8cc9a8..f96dfe1 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial int SetThreadIdealProcessor(SafeThreadHandle handle, int processor);
     }
 }
index a559829..5b62e53 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetThreadPriority(SafeThreadHandle handle, int priority);
     }
index 3c6d855..24f869a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetThreadPriorityBoost(SafeThreadHandle handle, [MarshalAs(UnmanagedType.Bool)] bool disabled);
     }
index f891a34..4cd4109 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetVolumeLabelW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "SetVolumeLabelW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetVolumeLabel(string driveLetter, string? volumeName);
     }
index e0f1db3..574d9ab 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetupComm(
             SafeFileHandle hFile,
index 10fe408..9b267a4 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [SuppressGCTransition]
         internal static unsafe partial Interop.BOOL SystemTimeToFileTime(Interop.Kernel32.SYSTEMTIME* lpSystemTime, ulong* lpFileTime);
     }
index 4b20386..0835d1d 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool TerminateProcess(SafeProcessHandle processHandle, int exitCode);
     }
index 5a94d5e..bb25506 100644 (file)
@@ -8,25 +8,25 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial IntPtr CreateThreadpoolWork(delegate* unmanaged<IntPtr, IntPtr, IntPtr, void> pfnwk, IntPtr pv, IntPtr pcbe);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial void SubmitThreadpoolWork(IntPtr pwk);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial void CloseThreadpoolWork(IntPtr pwk);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial IntPtr CreateThreadpoolWait(delegate* unmanaged<IntPtr, IntPtr, IntPtr, uint, void> pfnwa, IntPtr pv, IntPtr pcbe);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial void SetThreadpoolWait(IntPtr pwa, IntPtr h, IntPtr pftTimeout);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial void WaitForThreadpoolWaitCallbacks(IntPtr pwa, [MarshalAs(UnmanagedType.Bool)] bool fCancelPendingCallbacks);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial void CloseThreadpoolWait(IntPtr pwa);
     }
 }
index a0dda79..ba21435 100644 (file)
@@ -9,16 +9,16 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial SafeThreadPoolIOHandle CreateThreadpoolIo(SafeHandle fl, delegate* unmanaged<IntPtr, IntPtr, IntPtr, uint, UIntPtr, IntPtr, void> pfnio, IntPtr context, IntPtr pcbe);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial void CloseThreadpoolIo(IntPtr pio);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial void StartThreadpoolIo(SafeThreadPoolIOHandle pio);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial void CancelThreadpoolIo(SafeThreadPoolIOHandle pio);
     }
 }
index 464b7e1..b1e9ed9 100644 (file)
@@ -11,22 +11,22 @@ internal static partial class Interop
     {
         internal const int WAIT_FAILED = unchecked((int)0xFFFFFFFF);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial uint WaitForMultipleObjectsEx(uint nCount, IntPtr lpHandles, BOOL bWaitAll, uint dwMilliseconds, BOOL bAlertable);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial uint WaitForSingleObject(IntPtr hHandle, uint dwMilliseconds);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial uint SignalObjectAndWait(IntPtr hObjectToSignal, IntPtr hObjectToWaitOn, uint dwMilliseconds, BOOL bAlertable);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial void Sleep(uint milliseconds);
 
         internal const uint CREATE_SUSPENDED = 0x00000004;
         internal const uint STACK_SIZE_PARAM_IS_A_RESERVATION = 0x00010000;
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial SafeWaitHandle CreateThread(
             IntPtr lpThreadAttributes,
             IntPtr dwStackSize,
@@ -35,15 +35,15 @@ internal static partial class Interop
             uint dwCreationFlags,
             out uint lpThreadId);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial uint ResumeThread(SafeWaitHandle hThread);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial IntPtr GetCurrentThread();
 
         internal const int DUPLICATE_SAME_ACCESS = 2;
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return:MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DuplicateHandle(
             IntPtr hSourceProcessHandle,
@@ -67,10 +67,10 @@ internal static partial class Interop
             ErrorReturn = 0x7FFFFFFF
         }
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial ThreadPriority GetThreadPriority(SafeWaitHandle hThread);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [return:MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetThreadPriority(SafeWaitHandle hThread, int nPriority);
     }
index 4ecb0f4..705d97a 100644 (file)
@@ -83,10 +83,10 @@ internal static partial class Interop
 
         internal const uint TIME_ZONE_ID_INVALID = unchecked((uint)-1);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial uint GetDynamicTimeZoneInformation(out TIME_DYNAMIC_ZONE_INFORMATION pTimeZoneInformation);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial uint GetTimeZoneInformation(out TIME_ZONE_INFORMATION lpTimeZoneInformation);
     }
 }
index 1fcf7da..426e57c 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial IntPtr CreateThreadpoolTimer(delegate* unmanaged<IntPtr, IntPtr, IntPtr, void> pfnti, IntPtr pv, IntPtr pcbe);
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial IntPtr SetThreadpoolTimer(IntPtr pti, long* pftDueTime, uint msPeriod, uint msWindowLength);
     }
 }
index 7fc3013..de38b9e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial Interop.BOOL TzSpecificLocalTimeToSystemTime(
             IntPtr lpTimeZoneInformation,
             Interop.Kernel32.SYSTEMTIME* lpLocalTime,
index c3b60fa..953f380 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool UnmapViewOfFile(IntPtr lpBaseAddress);
     }
index 179b07c..06ed937 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "VerLanguageNameW")]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "VerLanguageNameW")]
         internal static unsafe partial int VerLanguageName(uint wLang, char* szLang, uint cchLang);
     }
 }
index 6ca6d77..791124d 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static partial ulong VerSetConditionMask(ulong ConditionMask, uint TypeMask, byte Condition);
     }
 }
index 6d5d9b5..aa45365 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         internal const uint VER_SERVICEPACKMAJOR = 0x0000020;
         internal const uint VER_SERVICEPACKMINOR = 0x0000010;
 
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool VerifyVersionInfoW(ref OSVERSIONINFOEX lpVersionInfo, uint dwTypeMask, ulong dwlConditionMask);
     }
index d734016..28aa861 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial IntPtr VirtualAlloc(SafeHandle lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect);
     }
 }
index fb9e9d5..48d1854 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial void* VirtualAlloc(void* lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect);
     }
 }
index 1b72482..c50cb30 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool VirtualFree(void* lpAddress, UIntPtr dwSize, int dwFreeType);
     }
index e9ac4ea..de2ab38 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial UIntPtr VirtualQuery(
             SafeHandle lpAddress,
             ref MEMORY_BASIC_INFORMATION lpBuffer,
index 95f175a..3abedcf 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial UIntPtr VirtualQuery(void* lpAddress, ref MEMORY_BASIC_INFORMATION lpBuffer, UIntPtr dwLength);
     }
 }
index 9b861b8..0a73d3a 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool WaitCommEvent(
             SafeFileHandle hFile,
index fc879c3..91db5d1 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial int WaitForSingleObject(SafeWaitHandle handle, int timeout);
     }
 }
index 1a65625..529848d 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "WaitNamedPipeW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "WaitNamedPipeW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool WaitNamedPipe(string? name, int timeout);
     }
index ad2d77e..a411175 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32)]
+        [LibraryImport(Libraries.Kernel32)]
         internal static unsafe partial int WideCharToMultiByte(
             uint CodePage, uint dwFlags,
             char* lpWideCharStr, int cchWideChar,
index 34225c6..b490dd0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "WriteConsoleW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "WriteConsoleW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool WriteConsole(
             IntPtr hConsoleOutput,
index 5a41c07..bcae4c0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "WriteConsoleOutputW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "WriteConsoleOutputW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool WriteConsoleOutput(IntPtr hConsoleOutput, CHAR_INFO* buffer, COORD bufferSize, COORD bufferCoord, ref SMALL_RECT writeRegion);
     }
index 2c4e963..40e1800 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial int WriteFile(
             IntPtr handle,
             byte* bytes,
index 0e7cc88..3e2b483 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         // struct in a callback (or an EndWrite method called by that callback),
         // and pass in an address for the numBytesRead parameter.
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial int WriteFile(
             SafeHandle handle,
             byte* bytes,
index 3ae10aa..b55f050 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         // simultaneously: overlapped IO, free the memory for the overlapped
         // struct in a callback (or an EndWrite method called by that callback),
         // and pass in an address for the numBytesRead parameter.
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial int WriteFile(
             SafeHandle handle,
             byte* bytes,
@@ -23,7 +23,7 @@ internal static partial class Interop
             IntPtr numBytesWritten_mustBeZero,
             NativeOverlapped* lpOverlapped);
 
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial int WriteFile(
             SafeHandle handle,
             byte* bytes,
index af7280f..c24b2fc 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Logoncli
     {
-        [GeneratedDllImport(Libraries.Logoncli, EntryPoint = "DsGetDcNameW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Logoncli, EntryPoint = "DsGetDcNameW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DsGetDcName(
             string computerName,
             string domainName,
index 42126dc..f758396 100644 (file)
@@ -12,13 +12,13 @@ internal static partial class Interop
         internal static unsafe ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, Span<byte> pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags) =>
             NCryptEncrypt(hKey, ref MemoryMarshal.GetReference(pbInput), cbInput, pPaddingInfo, ref MemoryMarshal.GetReference(pbOutput), cbOutput, out pcbResult, dwFlags);
 
-        [GeneratedDllImport(Interop.Libraries.NCrypt)]
+        [LibraryImport(Interop.Libraries.NCrypt)]
         private static unsafe partial ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, ref byte pbInput, int cbInput, void* pPaddingInfo, ref byte pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags);
 
         internal static unsafe ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, Span<byte> pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags) =>
             NCryptDecrypt(hKey, ref MemoryMarshal.GetReference(pbInput), cbInput, pPaddingInfo, ref MemoryMarshal.GetReference(pbOutput), cbOutput, out pcbResult, dwFlags);
 
-        [GeneratedDllImport(Interop.Libraries.NCrypt)]
+        [LibraryImport(Interop.Libraries.NCrypt)]
         private static unsafe partial ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, ref byte pbInput, int cbInput, void* pPaddingInfo, ref byte pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags);
     }
 }
index abd0f17..1b24ea9 100644 (file)
@@ -16,31 +16,31 @@ internal static partial class Interop
 
         internal const int NCRYPT_CIPHER_KEY_BLOB_MAGIC = 0x52485043;  //'CPHR'
 
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ErrorCode NCryptOpenKey(SafeNCryptProviderHandle hProvider, out SafeNCryptKeyHandle phKey, string pszKeyName, int dwLegacyKeySpec, CngKeyOpenOptions dwFlags);
 
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ErrorCode NCryptImportKey(SafeNCryptProviderHandle hProvider, IntPtr hImportKey, string pszBlobType, IntPtr pParameterList, out SafeNCryptKeyHandle phKey, ref byte pbData, int cbData, int dwFlags);
 
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ErrorCode NCryptImportKey(SafeNCryptProviderHandle hProvider, IntPtr hImportKey, string pszBlobType, ref NCryptBufferDesc pParameterList, out SafeNCryptKeyHandle phKey, ref byte pbData, int cbData, int dwFlags);
 
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, byte[]? pbOutput, int cbOutput, out int pcbResult, int dwFlags);
 
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, ref byte pbOutput, int cbOutput, out int pcbResult, int dwFlags);
 
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, ref NCryptBufferDesc pParameterList, ref byte pbOutput, int cbOutput, out int pcbResult, int dwFlags);
 
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ErrorCode NCryptDeleteKey(SafeNCryptKeyHandle hKey, int dwFlags);
 
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ErrorCode NCryptCreatePersistedKey(SafeNCryptProviderHandle hProvider, out SafeNCryptKeyHandle phKey, string pszAlgId, string? pszKeyName, int dwLegacyKeySpec, CngKeyCreationOptions dwFlags);
 
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ErrorCode NCryptFinalizeKey(SafeNCryptKeyHandle hKey, int dwFlags);
 
         [StructLayout(LayoutKind.Sequential)]
index 02298a6..9378368 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         /// <summary>
         ///     Generate a key from a secret agreement
         /// </summary>
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         private static partial ErrorCode NCryptDeriveKey(
             SafeNCryptSecretHandle hSharedSecret,
             string pwszKDF,
index 78a18d5..6886fe2 100644 (file)
@@ -21,7 +21,7 @@ internal static partial class Interop
         /// <summary>
         ///     Generate a secret agreement for generating shared key material
         /// </summary>
-        [GeneratedDllImport(Interop.Libraries.NCrypt)]
+        [LibraryImport(Interop.Libraries.NCrypt)]
         private static partial ErrorCode NCryptSecretAgreement(
             SafeNCryptKeyHandle hPrivKey,
             SafeNCryptKeyHandle hPubKey,
index d97f1b1..3639139 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class NCrypt
     {
-        [GeneratedDllImport(Interop.Libraries.NCrypt)]
+        [LibraryImport(Interop.Libraries.NCrypt)]
         internal static partial ErrorCode NCryptFreeObject(IntPtr hObject);
     }
 }
index 28adee9..294612f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class NCrypt
     {
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial ErrorCode NCryptOpenStorageProvider(out SafeNCryptProviderHandle phProvider, string pszProviderName, int dwFlags);
     }
 }
index a52da43..41c079d 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
 {
     internal static partial class NCrypt
     {
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial ErrorCode NCryptGetProperty(
             SafeNCryptHandle hObject,
             string pszProperty,
@@ -22,7 +22,7 @@ internal static partial class Interop
             out int pcbResult,
             CngPropertyOptions dwFlags);
 
-        [GeneratedDllImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial ErrorCode NCryptSetProperty(
             SafeNCryptHandle hObject,
             string pszProperty,
index 723f78e..e3b184c 100644 (file)
@@ -12,13 +12,13 @@ internal static partial class Interop
         internal static unsafe ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan<byte> pbHashValue, int cbHashValue, Span<byte> pbSignature, int cbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags) =>
             NCryptSignHash(hKey, pPaddingInfo, ref MemoryMarshal.GetReference(pbHashValue), cbHashValue, ref MemoryMarshal.GetReference(pbSignature), cbSignature, out pcbResult, dwFlags);
 
-        [GeneratedDllImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         private static unsafe partial ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ref byte pbHashValue, int cbHashValue, ref byte pbSignature, int cbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags);
 
         internal static unsafe ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan<byte> pbHashValue, int cbHashValue, ReadOnlySpan<byte> pbSignature, int cbSignature, AsymmetricPaddingMode dwFlags) =>
             NCryptVerifySignature(hKey, pPaddingInfo, ref MemoryMarshal.GetReference(pbHashValue), cbHashValue, ref MemoryMarshal.GetReference(pbSignature), cbSignature, dwFlags);
 
-        [GeneratedDllImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
         private static unsafe partial ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ref byte pbHashValue, int cbHashValue, ref byte pbSignature, int cbSignature, AsymmetricPaddingMode dwFlags);
     }
 }
index 1f84f9a..4089336 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Netutils
     {
-        [GeneratedDllImport(Libraries.Netutils)]
+        [LibraryImport(Libraries.Netutils)]
         internal static partial int NetApiBufferFree(IntPtr buffer);
     }
 }
index 63104e2..b7dd6ed 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
         //  Idn APIs
         //
 
-        [GeneratedDllImport("Normaliz.dll",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("Normaliz.dll",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int IdnToAscii(
                                         uint dwFlags,
                                         char* lpUnicodeCharStr,
@@ -19,7 +19,7 @@ internal static partial class Interop
                                         char* lpASCIICharStr,
                                         int cchASCIIChar);
 
-        [GeneratedDllImport("Normaliz.dll",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("Normaliz.dll",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int IdnToUnicode(
                                         uint dwFlags,
                                         char* lpASCIICharStr,
index 7413801..f05fbc0 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal static partial class Normaliz
     {
-        [GeneratedDllImport("Normaliz.dll",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("Normaliz.dll",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial BOOL IsNormalizedString(NormalizationForm normForm, char* source, int length);
 
-        [GeneratedDllImport("Normaliz.dll",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("Normaliz.dll",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int NormalizeString(
                                         NormalizationForm normForm,
                                         char* source,
index c72613c..cc80f32 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
     {
         // https://msdn.microsoft.com/en-us/library/bb432380.aspx
         // https://msdn.microsoft.com/en-us/library/windows/hardware/ff566424.aspx
-        [GeneratedDllImport(Libraries.NtDll)]
+        [LibraryImport(Libraries.NtDll)]
         private static unsafe partial uint NtCreateFile(
             IntPtr* FileHandle,
             DesiredAccess DesiredAccess,
index 3ada672..fbbf8b9 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
     {
         // https://msdn.microsoft.com/en-us/library/windows/hardware/ff556633.aspx
         // https://msdn.microsoft.com/en-us/library/windows/hardware/ff567047.aspx
-        [GeneratedDllImport(Libraries.NtDll)]
+        [LibraryImport(Libraries.NtDll)]
         public static unsafe partial int NtQueryDirectoryFile(
             IntPtr FileHandle,
             IntPtr Event,
index b3acd8b..b7a8452 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class NtDll
     {
-        [GeneratedDllImport(Libraries.NtDll)]
+        [LibraryImport(Libraries.NtDll)]
         internal static unsafe partial int NtQueryInformationFile(
             SafeFileHandle FileHandle,
             out IO_STATUS_BLOCK IoStatusBlock,
index 5d00c44..526530f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class NtDll
     {
-        [GeneratedDllImport(Libraries.NtDll)]
+        [LibraryImport(Libraries.NtDll)]
         internal static unsafe partial uint NtQueryInformationProcess(SafeProcessHandle ProcessHandle, int ProcessInformationClass, void* ProcessInformation, uint ProcessInformationLength, out uint ReturnLength);
     }
 }
index 3a31c39..858ae9c 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class NtDll
     {
-        [GeneratedDllImport(Libraries.NtDll)]
+        [LibraryImport(Libraries.NtDll)]
         internal static unsafe partial uint NtQuerySystemInformation(int SystemInformationClass, void* SystemInformation, uint SystemInformationLength, uint* ReturnLength);
 
         internal const uint STATUS_INFO_LENGTH_MISMATCH = 0xC0000004;
index a73a7ef..3fb9740 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class NtDll
     {
-        [GeneratedDllImport(Libraries.NtDll)]
+        [LibraryImport(Libraries.NtDll)]
         private static partial int RtlGetVersion(ref RTL_OSVERSIONINFOEX lpVersionInformation);
 
         internal static unsafe int RtlGetVersionEx(out RTL_OSVERSIONINFOEX osvi)
index d572883..7492ef1 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
     internal static partial class NtDll
     {
         // https://msdn.microsoft.com/en-us/library/windows/desktop/ms680600(v=vs.85).aspx
-        [GeneratedDllImport(Libraries.NtDll)]
+        [LibraryImport(Libraries.NtDll)]
         public static partial uint RtlNtStatusToDosError(int Status);
     }
 }
index b2af31c..5a9b58d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Ole32
     {
-        [GeneratedDllImport(Interop.Libraries.Ole32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Ole32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int CLSIDFromProgID(string lpszProgID, out Guid lpclsid);
     }
 }
index e2cc05f..92b36a0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Ole32
     {
-        [GeneratedDllImport(Interop.Libraries.Ole32)]
+        [LibraryImport(Interop.Libraries.Ole32)]
         internal static partial int CoCreateGuid(out Guid guid);
     }
 }
index be519d9..c9fdf3f 100644 (file)
@@ -29,7 +29,7 @@ internal static partial class Interop
 
     internal static partial class Ole32
     {
-        [GeneratedDllImport(Interop.Libraries.Ole32)]
+        [LibraryImport(Interop.Libraries.Ole32)]
         internal static partial int CoGetApartmentType(out APTTYPE pAptType, out APTTYPEQUALIFIER pAptQualifier);
     }
 }
index af00fce..32527be 100644 (file)
@@ -17,7 +17,7 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.Ole32)]
+        [LibraryImport(Libraries.Ole32)]
         internal static unsafe partial int CoGetObjectContext(Guid* riid, IntPtr* ppv);
     }
 }
index 8e9149a..11d2676 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Ole32
     {
-        [GeneratedDllImport(Interop.Libraries.Ole32)]
+        [LibraryImport(Interop.Libraries.Ole32)]
         internal static partial int CoGetStandardMarshal(ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags, out IntPtr ppMarshal);
     }
 }
index ecef102..ee658ac 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
         internal const uint COINIT_APARTMENTTHREADED = 2;
         internal const uint COINIT_MULTITHREADED = 0;
 
-        [GeneratedDllImport(Interop.Libraries.Ole32)]
+        [LibraryImport(Interop.Libraries.Ole32)]
         internal static partial int CoInitializeEx(IntPtr reserved, uint dwCoInit);
     }
 }
index 6053602..9171eb2 100644 (file)
@@ -8,13 +8,13 @@ internal static partial class Interop
 {
     internal static partial class Ole32
     {
-        [GeneratedDllImport(Libraries.Ole32)]
+        [LibraryImport(Libraries.Ole32)]
         internal static partial IntPtr CoTaskMemAlloc(nuint cb);
 
-        [GeneratedDllImport(Libraries.Ole32)]
+        [LibraryImport(Libraries.Ole32)]
         internal static partial IntPtr CoTaskMemRealloc(IntPtr pv, nuint cb);
 
-        [GeneratedDllImport(Libraries.Ole32)]
+        [LibraryImport(Libraries.Ole32)]
         internal static partial void CoTaskMemFree(IntPtr ptr);
     }
 }
index 461b286..f8e83df 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Ole32
     {
-        [GeneratedDllImport(Interop.Libraries.Ole32)]
+        [LibraryImport(Interop.Libraries.Ole32)]
         internal static partial int CoUninitialize();
     }
 }
index d93d595..32acb65 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Ole32
     {
-        [GeneratedDllImport(Interop.Libraries.Ole32)]
+        [LibraryImport(Interop.Libraries.Ole32)]
         internal static partial void PropVariantClear(IntPtr pObject);
     }
 }
index 87b81e9..93b0fa1 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
     internal static partial class OleAut32
     {
         // only using this to clear existing error info with null
-        [GeneratedDllImport(Interop.Libraries.OleAut32)]
+        [LibraryImport(Interop.Libraries.OleAut32)]
         // TLS values are preserved between threads, need to check that we use this API to clear the error state only.
         internal static partial void SetErrorInfo(int dwReserved, IntPtr pIErrorInfo);
     }
index 7da0659..717fb1c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class OleAut32
     {
-        [GeneratedDllImport(Libraries.OleAut32)]
+        [LibraryImport(Libraries.OleAut32)]
         internal static partial IntPtr SysAllocStringByteLen(byte[]? str, uint len);
     }
 }
index 4b262a1..3fa76be 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal static partial class OleAut32
     {
-        [GeneratedDllImport(Libraries.OleAut32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.OleAut32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr SysAllocStringLen(IntPtr src, uint len);
 
-        [GeneratedDllImport(Libraries.OleAut32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.OleAut32, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr SysAllocStringLen(string src, uint len);
     }
 }
index 09b31d1..adf400a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class OleAut32
     {
-        [GeneratedDllImport(Libraries.OleAut32)]
+        [LibraryImport(Libraries.OleAut32)]
         internal static partial void SysFreeString(IntPtr bstr);
     }
 }
index bc32786..6e980e6 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class OleAut32
     {
-        [GeneratedDllImport(Libraries.OleAut32)]
+        [LibraryImport(Libraries.OleAut32)]
         internal static partial void VariantClear(IntPtr variant);
     }
 }
index 6c93168..4652781 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Pdh
     {
-        [GeneratedDllImport(Libraries.Pdh)]
+        [LibraryImport(Libraries.Pdh)]
         public static partial int PdhFormatFromRawValue(
             uint dwCounterType,
             uint dwFormat,
index 0019272..24db68e 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class PerfCounter
     {
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static partial uint PerfStopProvider(
             IntPtr hProvider
         );
@@ -53,14 +53,14 @@ internal static partial class Interop
             internal uint InstanceNameSize;
         }
 
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static partial uint PerfStartProvider(
             ref Guid ProviderGuid,
             PERFLIBREQUEST ControlCallback,
             out SafePerfProviderHandle phProvider
         );
 
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Advapi32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial PerfCounterSetInstanceStruct* PerfCreateInstance(
             SafePerfProviderHandle hProvider,
             ref Guid CounterSetGuid,
@@ -68,20 +68,20 @@ internal static partial class Interop
             uint dwInstance
         );
 
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static unsafe partial uint PerfSetCounterSetInfo(
             SafePerfProviderHandle hProvider,
             PerfCounterSetInfoStruct* pTemplate,
             uint dwTemplateSize
         );
 
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static unsafe partial uint PerfDeleteInstance(
             SafePerfProviderHandle hProvider,
             PerfCounterSetInstanceStruct* InstanceBlock
         );
 
-        [GeneratedDllImport(Libraries.Advapi32)]
+        [LibraryImport(Libraries.Advapi32)]
         internal static unsafe partial uint PerfSetCounterRefValue(
             SafePerfProviderHandle hProvider,
             PerfCounterSetInstanceStruct* pInstance,
index d0b16e7..a997bbe 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Secur32
     {
-        [GeneratedDllImport(Libraries.Secur32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Secur32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial BOOLEAN GetUserNameExW(int NameFormat, ref char lpNameBuffer, ref uint lpnSize);
 
         internal const int NameSamCompatible = 2;
index ce96b7e..dd8226a 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
         internal const int COR_E_PLATFORMNOTSUPPORTED = unchecked((int)0x80131539);
 
         // https://msdn.microsoft.com/en-us/library/windows/desktop/bb762188.aspx
-        [GeneratedDllImport(Libraries.Shell32, SetLastError = false, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Shell32, SetLastError = false, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int SHGetKnownFolderPath(
             in Guid rfid,
             uint dwFlags,
index 984a121..b9391bb 100644 (file)
@@ -50,7 +50,7 @@ internal static partial class Interop
         internal const uint SEE_MASK_NOCLOSEPROCESS = 0x00000040;
         internal const uint SEE_MASK_FLAG_NO_UI = 0x00000400;
 
-        [GeneratedDllImport(Libraries.Shell32, SetLastError = true)]
+        [LibraryImport(Libraries.Shell32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool ShellExecuteExW(
             SHELLEXECUTEINFO* pExecInfo);
index b537e78..1c2444f 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class SspiCli
     {
-        [GeneratedDllImport(Interop.Libraries.SspiCli)]
+        [LibraryImport(Interop.Libraries.SspiCli)]
         internal static partial int LsaConnectUntrusted(out SafeLsaHandle LsaHandle);
     }
 }
index 8cc158e..4d4b9fe 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class SspiCli
     {
-        [GeneratedDllImport(Interop.Libraries.SspiCli)]
+        [LibraryImport(Interop.Libraries.SspiCli)]
         internal static partial int LsaDeregisterLogonProcess(IntPtr LsaHandle);
     }
 }
index 1c6705e..89bef75 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class SspiCli
     {
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int LsaFreeReturnBuffer(IntPtr handle);
     }
 }
index 08f1da5..ea358a4 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class SspiCli
     {
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int LsaGetLogonSessionData(
             ref LUID LogonId,
             out SafeLsaReturnBufferHandle ppLogonSessionData);
index 83efbba..3907341 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class SspiCli
     {
-        [GeneratedDllImport(Libraries.SspiCli)]
+        [LibraryImport(Libraries.SspiCli)]
         internal static partial int LsaLogonUser(
             SafeLsaHandle LsaHandle,
             in Advapi32.LSA_STRING OriginName,
index a6c910e..b99810a 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class SspiCli
     {
-        [GeneratedDllImport(Libraries.SspiCli)]
+        [LibraryImport(Libraries.SspiCli)]
         internal static partial int LsaLookupAuthenticationPackage(
             SafeLsaHandle LsaHandle,
             ref Advapi32.LSA_STRING PackageName,
index dfc7ac0..2201294 100644 (file)
@@ -331,38 +331,38 @@ internal static partial class Interop
             public char* pwszSslCtlIdentifier;
         }
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int EncryptMessage(
             ref CredHandle contextHandle,
             uint qualityOfProtection,
             ref SecBufferDesc inputOutput,
             uint sequenceNumber);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static unsafe partial int DecryptMessage(
             ref CredHandle contextHandle,
             ref SecBufferDesc inputOutput,
             uint sequenceNumber,
             uint* qualityOfProtection);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int QuerySecurityContextToken(
             ref CredHandle phContext,
             out SecurityContextTokenHandle handle);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int FreeContextBuffer(
             IntPtr contextBuffer);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int FreeCredentialsHandle(
             ref CredHandle handlePtr);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int DeleteSecurityContext(
             ref CredHandle handlePtr);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static unsafe partial int AcceptSecurityContext(
             ref CredHandle credentialHandle,
             void* inContextPtr,
@@ -374,25 +374,25 @@ internal static partial class Interop
             ref ContextFlags attributes,
             out long timeStamp);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static unsafe partial int QueryContextAttributesW(
             ref CredHandle contextHandle,
             ContextAttribute attribute,
             void* buffer);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int SetContextAttributesW(
             ref CredHandle contextHandle,
             ContextAttribute attribute,
             byte[] buffer,
             int bufferSize);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int EnumerateSecurityPackagesW(
             out int pkgnum,
             out SafeFreeContextBuffer_SECURITY handle);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int AcquireCredentialsHandleW(
             string? principal,
             string moduleName,
@@ -404,7 +404,7 @@ internal static partial class Interop
             ref CredHandle handlePtr,
             out long timeStamp);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int AcquireCredentialsHandleW(
             string? principal,
             string moduleName,
@@ -416,7 +416,7 @@ internal static partial class Interop
             ref CredHandle handlePtr,
             out long timeStamp);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int AcquireCredentialsHandleW(
             string? principal,
             string moduleName,
@@ -428,7 +428,7 @@ internal static partial class Interop
             ref CredHandle handlePtr,
             out long timeStamp);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int AcquireCredentialsHandleW(
             string? principal,
             string moduleName,
@@ -440,7 +440,7 @@ internal static partial class Interop
             ref CredHandle handlePtr,
             out long timeStamp);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static unsafe partial int InitializeSecurityContextW(
             ref CredHandle credentialHandle,
             void* inContextPtr,
@@ -455,28 +455,28 @@ internal static partial class Interop
             ref ContextFlags attributes,
             out long timeStamp);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static unsafe partial int CompleteAuthToken(
             void* inContextPtr,
             ref SecBufferDesc inputBuffers);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static unsafe partial int ApplyControlToken(
             void* inContextPtr,
             ref SecBufferDesc inputBuffers);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial SECURITY_STATUS SspiFreeAuthIdentity(
             IntPtr authData);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial SECURITY_STATUS SspiEncodeStringsAsAuthIdentity(
             string userName,
             string domainName,
             string password,
             out SafeSspiAuthDataHandle authData);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial SECURITY_STATUS SetCredentialsAttributesW(
             in CredHandle handlePtr,
             long ulAttribute,
index a87db60..89481e2 100644 (file)
@@ -9,31 +9,31 @@ internal static partial class Interop
     internal static unsafe partial class Ucrtbase
     {
 #pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant
-        [GeneratedDllImport(Libraries.Ucrtbase)]
+        [LibraryImport(Libraries.Ucrtbase)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial void* _aligned_malloc(nuint size, nuint alignment);
 
-        [GeneratedDllImport(Libraries.Ucrtbase)]
+        [LibraryImport(Libraries.Ucrtbase)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial void _aligned_free(void* ptr);
 
-        [GeneratedDllImport(Libraries.Ucrtbase)]
+        [LibraryImport(Libraries.Ucrtbase)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial void* _aligned_realloc(void* ptr, nuint size, nuint alignment);
 
-        [GeneratedDllImport(Libraries.Ucrtbase)]
+        [LibraryImport(Libraries.Ucrtbase)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial void* calloc(nuint num, nuint size);
 
-        [GeneratedDllImport(Libraries.Ucrtbase)]
+        [LibraryImport(Libraries.Ucrtbase)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial void free(void* ptr);
 
-        [GeneratedDllImport(Libraries.Ucrtbase)]
+        [LibraryImport(Libraries.Ucrtbase)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial void* malloc(nuint size);
 
-        [GeneratedDllImport(Libraries.Ucrtbase)]
+        [LibraryImport(Libraries.Ucrtbase)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial void* realloc(void* ptr, nuint new_size);
 #pragma warning restore CS3016 // Arrays as attribute arguments is not CLS-compliant
index 18f69bd..b85d0d4 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.User32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         public static partial IntPtr CreateWindowExW(
             int exStyle,
             string lpszClassName,
index b41bcf9..81dfd50 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial IntPtr DefWindowProcW(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
     }
 }
index 17ae958..461244a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool DestroyWindow(IntPtr hWnd);
     }
index efd057a..7aedb0e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial int DispatchMessageW(ref MSG msg);
     }
 }
index c500842..a7e3b0b 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static unsafe partial Interop.BOOL EnumWindows(delegate* unmanaged<IntPtr, IntPtr, Interop.BOOL> callback, IntPtr extraData);
     }
 }
index 3cd5818..7218439 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)]
         public static partial IntPtr FindWindowW(string lpClassName, string lpWindowName);
     }
 }
index b433075..642e305 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool GetClassInfoW(IntPtr hInst, string lpszClass, ref WNDCLASS wc);
     }
index 597ad6b..5f6c796 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial IntPtr GetDC(IntPtr hWnd);
 
         public static IntPtr GetDC(HandleRef hWnd)
index 9ee51a0..be75119 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         internal static partial short GetKeyState(int virtualKeyCode);
     }
 }
index 70caaca..e9033a7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial int GetMessageW(ref MSG msg, IntPtr hwnd, int msgMin, int msgMax);
     }
 }
index a63a0e5..9d5a460 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         internal static partial IntPtr GetProcessWindowStation();
     }
 }
index 96f6201..618389c 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         // index that doesn't exist.
 
         [SuppressGCTransition]
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         internal static partial uint GetSysColor(int nIndex);
     }
 }
index e026a50..6095fdf 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+        [LibraryImport(Libraries.User32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static unsafe partial bool GetUserObjectInformationW(IntPtr hObj, int nIndex, void* pvBuffer, uint nLength, ref uint lpnLengthNeeded);
     }
index 3091b5c..f4bb6c8 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial IntPtr GetWindow(IntPtr hWnd, int uCmd);
     }
 }
index 9cc34ee..62b267f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, EntryPoint = "GetWindowLongW")]
+        [LibraryImport(Libraries.User32, EntryPoint = "GetWindowLongW")]
         public static partial int GetWindowLong(IntPtr hWnd, int uCmd);
     }
 }
index c2b4a2c..d379b13 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+        [LibraryImport(Libraries.User32, SetLastError = true)]
         public static partial int GetWindowTextLengthW(IntPtr hWnd);
     }
 }
index 9eb8c1f..f7b1fdf 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+        [LibraryImport(Libraries.User32, SetLastError = true)]
         public static unsafe partial int GetWindowTextW(IntPtr hWnd, char* lpString, int nMaxCount);
     }
 }
index 0b8fecf..03a9fd0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static unsafe partial int GetWindowThreadProcessId(IntPtr handle, int* processId);
     }
 }
index 96ae83d..11ae55e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool IsWindow(IntPtr hWnd);
     }
index c09bfb7..8acaaae 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial BOOL IsWindowVisible(IntPtr hWnd);
     }
 }
index a6b0864..10da9e2 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool KillTimer(IntPtr hwnd, IntPtr idEvent);
     }
index 639c0b1..d0e411c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, EntryPoint = "LoadStringW", SetLastError = true)]
+        [LibraryImport(Libraries.User32, EntryPoint = "LoadStringW", SetLastError = true)]
         internal static unsafe partial int LoadString(IntPtr hInstance, uint uID, char* lpBuffer, int cchBufferMax);
     }
 }
index a98afe4..48df434 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         internal const int MB_ICONEXCLAMATION = 0x30;
         internal const int MB_ICONASTERISK = 0x40;
 
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool MessageBeep(int type);
     }
index 0d7e99c..8f2caae 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial int MsgWaitForMultipleObjectsEx(int nCount, IntPtr pHandles, int dwMilliseconds, int dwWakeMask, int dwFlags);
     }
 }
index 729cedb..7d3efed 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial int PostMessageW(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);
     }
 }
index 1b9f801..78fd2af 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial void PostQuitMessage(int exitCode);
     }
 }
index 5254e3e..e18c480 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+        [LibraryImport(Libraries.User32, SetLastError = true)]
         public static partial short RegisterClassW(ref WNDCLASS wc);
     }
 }
index 1bf0969..60e6527 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.User32, StringMarshalling = StringMarshalling.Utf16)]
         public static partial int RegisterWindowMessageW(string msg);
     }
 }
index 0f596aa..c4d1866 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial int ReleaseDC(IntPtr hWnd, IntPtr hDC);
 
         public static int ReleaseDC(HandleRef hWnd, IntPtr hDC)
index 72f350a..cdd78ab 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial IntPtr SendMessageW(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
     }
 }
index d3ebb4a..7d30556 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, EntryPoint = "SendMessageTimeoutW")]
+        [LibraryImport(Libraries.User32, EntryPoint = "SendMessageTimeoutW")]
         public static unsafe partial IntPtr SendMessageTimeout(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam, int flags, int timeout, IntPtr* pdwResult);
     }
 }
index 59705ea..180e51f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial IntPtr SetClassLongW(IntPtr hwnd, int nIndex, IntPtr dwNewLong);
     }
 }
index 8a1924e..802ffd5 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial IntPtr SetClassLongPtrW(IntPtr hwnd, int nIndex, IntPtr dwNewLong);
     }
 }
index efc613f..a54cb03 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial IntPtr SetTimer(IntPtr hWnd, IntPtr nIDEvent, int uElapse, IntPtr lpTimerProc);
     }
 }
index b0532f1..8a16532 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial IntPtr SetWindowLongW(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
     }
 }
index 04f3812..d9bbfbf 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial IntPtr SetWindowLongPtrW(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
     }
 }
index fa52581..5bca617 100644 (file)
@@ -14,7 +14,7 @@ internal static partial class Interop
             SPI_GETNONCLIENTMETRICS = 0x29
         }
 
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static unsafe partial bool SystemParametersInfoW(SystemParametersAction uiAction, uint uiParam, void* pvParam, uint fWinIni);
     }
index c26f669..a1821fa 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool TranslateMessage(ref MSG msg);
     }
index 3379b06..77e1b7c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.User32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         public static partial short UnregisterClassW(string lpClassName, IntPtr hInstance);
     }
 }
index e4f98ac..ee65f3b 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial int WaitForInputIdle(SafeProcessHandle handle, int milliseconds);
     }
 }
index b925725..b88ace7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32)]
+        [LibraryImport(Libraries.User32)]
         public static partial IntPtr WindowFromDC(IntPtr hDC);
 
         public static IntPtr WindowFromDC(HandleRef hDC)
index a06cefa..0b2dd9d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Version
     {
-        [GeneratedDllImport(Libraries.Version, EntryPoint = "GetFileVersionInfoExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Version, EntryPoint = "GetFileVersionInfoExW", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetFileVersionInfoEx(
                     uint dwFlags,
index b592847..be1e64b 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Version
     {
-        [GeneratedDllImport(Libraries.Version, EntryPoint = "GetFileVersionInfoSizeExW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Version, EntryPoint = "GetFileVersionInfoSizeExW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial uint GetFileVersionInfoSizeEx(uint dwFlags, string lpwstrFilename, out uint lpdwHandle);
     }
 }
index 746285f..4bd3a4a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Version
     {
-        [GeneratedDllImport(Libraries.Version, EntryPoint = "VerQueryValueW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Version, EntryPoint = "VerQueryValueW", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool VerQueryValue(IntPtr pBlock, string lpSubBlock, out IntPtr lplpBuffer, out uint puLen);
     }
index 9d771af..6201d6f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class WebSocket
     {
-        [GeneratedDllImport(Libraries.WebSocket)]
+        [LibraryImport(Libraries.WebSocket)]
         internal static partial void WebSocketAbortHandle(SafeHandle webSocketHandle);
     }
 }
index f545dcf..72eba5e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class WebSocket
     {
-        [GeneratedDllImport(Libraries.WebSocket)]
+        [LibraryImport(Libraries.WebSocket)]
         internal static partial int WebSocketBeginClientHandshake(
             SafeHandle webSocketHandle,
             IntPtr subProtocols,
index 5d93d76..20b0d9c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class WebSocket
     {
-        [GeneratedDllImport(Libraries.WebSocket)]
+        [LibraryImport(Libraries.WebSocket)]
         internal static partial int WebSocketBeginServerHandshake(
             SafeHandle webSocketHandle,
             IntPtr subProtocol,
index c79f029..1966bd9 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class WebSocket
     {
-        [GeneratedDllImport(Libraries.WebSocket)]
+        [LibraryImport(Libraries.WebSocket)]
         internal static partial void WebSocketCompleteAction(
             SafeHandle webSocketHandle,
             IntPtr actionContext,
index dac7cc8..33c64a7 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class WebSocket
     {
-        [GeneratedDllImport(Libraries.WebSocket)]
+        [LibraryImport(Libraries.WebSocket)]
         internal static partial int WebSocketCreateClientHandle(
            Property[] properties,
            uint propertyCount,
index c901426..e7f0584 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class WebSocket
     {
-        [GeneratedDllImport(Libraries.WebSocket)]
+        [LibraryImport(Libraries.WebSocket)]
         internal static partial int WebSocketCreateServerHandle(
             Property[] properties,
             uint propertyCount,
index d7f9b9d..c8cccbd 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class WebSocket
     {
-        [GeneratedDllImport(Libraries.WebSocket)]
+        [LibraryImport(Libraries.WebSocket)]
         internal static partial void WebSocketDeleteHandle(
             IntPtr webSocketHandle);
     }
index 8be9ebe..e7a43c9 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class WebSocket
     {
-        [GeneratedDllImport(Libraries.WebSocket)]
+        [LibraryImport(Libraries.WebSocket)]
         internal static partial int WebSocketEndServerHandshake(SafeHandle webSocketHandle);
     }
 }
index 567705d..9f4ac61 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class WebSocket
     {
-        [GeneratedDllImport(Libraries.WebSocket)]
+        [LibraryImport(Libraries.WebSocket)]
         internal static partial int WebSocketGetAction(
             SafeHandle webSocketHandle,
             ActionQueue actionQueue,
index 3d40348..45980ec 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class WebSocket
     {
-        [GeneratedDllImport(Libraries.WebSocket)]
+        [LibraryImport(Libraries.WebSocket)]
         internal static partial int WebSocketReceive(
             SafeHandle webSocketHandle,
             IntPtr buffers,
index eb6205f..2ebd535 100644 (file)
@@ -10,14 +10,14 @@ internal static partial class Interop
 {
     internal static partial class WebSocket
     {
-        [GeneratedDllImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")]
+        [LibraryImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")]
         internal static partial int WebSocketSend_Raw(
             SafeHandle webSocketHandle,
             BufferType bufferType,
             ref Buffer buffer,
             IntPtr applicationContext);
 
-        [GeneratedDllImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")]
+        [LibraryImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")]
         internal static partial int WebSocketSendWithoutBody_Raw(
             SafeHandle webSocketHandle,
             BufferType bufferType,
index 8edc9e6..7074ad6 100644 (file)
@@ -9,26 +9,26 @@ internal static partial class Interop
 {
     internal static partial class WinHttp
     {
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         public static partial SafeWinHttpHandle WinHttpOpen(
             IntPtr userAgent,
             uint accessType,
             string? proxyName,
             string? proxyBypass, int flags);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpCloseHandle(
             IntPtr handle);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         public static partial SafeWinHttpHandle WinHttpConnect(
             SafeWinHttpHandle sessionHandle,
             string serverName,
             ushort serverPort,
             uint reserved);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         public static partial SafeWinHttpHandle WinHttpOpenRequest(
             SafeWinHttpHandle connectHandle,
             string verb,
@@ -38,7 +38,7 @@ internal static partial class Interop
             string acceptTypes,
             uint flags);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpAddRequestHeaders(
             SafeWinHttpHandle requestHandle,
@@ -73,7 +73,7 @@ internal static partial class Interop
         }
 #endif
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpAddRequestHeaders(
             SafeWinHttpHandle requestHandle,
@@ -81,7 +81,7 @@ internal static partial class Interop
             uint headersLength,
             uint modifiers);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpSendRequest(
             SafeWinHttpHandle requestHandle,
@@ -92,19 +92,19 @@ internal static partial class Interop
             uint totalLength,
             IntPtr context);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpReceiveResponse(
             SafeWinHttpHandle requestHandle,
             IntPtr reserved);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpQueryDataAvailable(
             SafeWinHttpHandle requestHandle,
             IntPtr parameterIgnoredAndShouldBeNullForAsync);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpReadData(
             SafeWinHttpHandle requestHandle,
@@ -112,7 +112,7 @@ internal static partial class Interop
             uint bufferSize,
             IntPtr parameterIgnoredAndShouldBeNullForAsync);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpQueryHeaders(
             SafeWinHttpHandle requestHandle,
@@ -122,7 +122,7 @@ internal static partial class Interop
             ref uint bufferLength,
             ref uint index);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpQueryHeaders(
             SafeWinHttpHandle requestHandle,
@@ -132,7 +132,7 @@ internal static partial class Interop
             ref uint bufferLength,
             IntPtr index);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpQueryOption(
             SafeWinHttpHandle handle,
@@ -140,7 +140,7 @@ internal static partial class Interop
             ref IntPtr buffer,
             ref uint bufferSize);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpQueryOption(
             SafeWinHttpHandle handle,
@@ -148,7 +148,7 @@ internal static partial class Interop
             IntPtr buffer,
             ref uint bufferSize);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpQueryOption(
             SafeWinHttpHandle handle,
@@ -156,7 +156,7 @@ internal static partial class Interop
             ref uint buffer,
             ref uint bufferSize);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpWriteData(
             SafeWinHttpHandle requestHandle,
@@ -164,7 +164,7 @@ internal static partial class Interop
             uint bufferSize,
             IntPtr parameterIgnoredAndShouldBeNullForAsync);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpSetOption(
             SafeWinHttpHandle handle,
@@ -172,7 +172,7 @@ internal static partial class Interop
             ref uint optionData,
             uint optionLength = sizeof(uint));
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpSetOption(
             SafeWinHttpHandle handle,
@@ -180,7 +180,7 @@ internal static partial class Interop
             IntPtr optionData,
             uint optionLength);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpSetCredentials(
             SafeWinHttpHandle requestHandle,
@@ -190,7 +190,7 @@ internal static partial class Interop
             string? password,
             IntPtr reserved);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpQueryAuthSchemes(
             SafeWinHttpHandle requestHandle,
@@ -198,7 +198,7 @@ internal static partial class Interop
             out uint firstScheme,
             out uint authTarget);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpSetTimeouts(
             SafeWinHttpHandle handle,
@@ -207,19 +207,19 @@ internal static partial class Interop
             int sendTimeout,
             int receiveTimeout);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WinHttpGetIEProxyConfigForCurrentUser(
             out WINHTTP_CURRENT_USER_IE_PROXY_CONFIG proxyConfig);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]public static partial bool WinHttpGetProxyForUrl(
             SafeWinHttpHandle? sessionHandle,
             string url,
             ref WINHTTP_AUTOPROXY_OPTIONS autoProxyOptions,
             out WINHTTP_PROXY_INFO proxyInfo);
 
-        [GeneratedDllImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.WinHttp,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         public static partial IntPtr WinHttpSetStatusCallback(
             SafeWinHttpHandle handle,
             WINHTTP_STATUS_CALLBACK callback,
index 45a8251..55ca778 100644 (file)
@@ -17,11 +17,11 @@ internal static partial class Interop
         internal const int SND_FILENAME = 0x20000;
         internal const int SND_NOSTOP = 0x10;
 
-        [GeneratedDllImport(Libraries.WinMM, EntryPoint = "PlaySoundW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.WinMM, EntryPoint = "PlaySoundW", StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool PlaySound(string soundName, IntPtr hmod, int soundFlags);
 
-        [GeneratedDllImport(Libraries.WinMM, EntryPoint = "PlaySoundW")]
+        [LibraryImport(Libraries.WinMM, EntryPoint = "PlaySoundW")]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool PlaySound(byte[]? soundName, IntPtr hmod, int soundFlags);
     }
index 66ca175..54dada5 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class WinMM
     {
-        [GeneratedDllImport(Libraries.WinMM)]
+        [LibraryImport(Libraries.WinMM)]
         internal static unsafe partial int mmioAscend(IntPtr hMIO, MMCKINFO* lpck, int flags);
     }
 }
index dc3c9af..3117353 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class WinMM
     {
-        [GeneratedDllImport(Interop.Libraries.WinMM)]
+        [LibraryImport(Interop.Libraries.WinMM)]
         internal static partial int mmioClose(IntPtr hMIO, int flags);
     }
 }
index 9b33963..ba40197 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
     {
         internal const int MMIO_FINDRIFF = 0x00000020;
 
-        [GeneratedDllImport(Libraries.WinMM)]
+        [LibraryImport(Libraries.WinMM)]
         internal static unsafe partial int mmioDescend(
             IntPtr hMIO,
             MMCKINFO* lpck,
index 85da9df..d0f01df 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
         internal const int MMIO_READ = 0x00000000;
         internal const int MMIO_ALLOCBUF = 0x00010000;
 
-        [GeneratedDllImport(Libraries.WinMM, EntryPoint = "mmioOpenW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.WinMM, EntryPoint = "mmioOpenW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr mmioOpen(string fileName, IntPtr not_used, int flags);
     }
 }
index 18c4007..ecf8a0e 100644 (file)
@@ -24,7 +24,7 @@ internal static partial class Interop
         internal const int WAVE_FORMAT_ADPCM = 0x0002;
         internal const int WAVE_FORMAT_IEEE_FLOAT = 0x0003;
 
-        [GeneratedDllImport(Libraries.WinMM)]
+        [LibraryImport(Libraries.WinMM)]
         internal static partial int mmioRead(IntPtr hMIO, [MarshalAs(UnmanagedType.LPArray)] byte[] wf, int cch);
     }
 }
index ffbd582..b7b6e4e 100644 (file)
@@ -14,7 +14,7 @@ internal static partial class Interop
         /// <param name="hwo">Handle to the waveform-audio output device. If the function
         /// succeeds, the handle is no longer valid after this call.</param>
         /// <returns>MMSYSERR</returns>
-        [GeneratedDllImport(Libraries.WinMM)]
+        [LibraryImport(Libraries.WinMM)]
         internal static partial MMSYSERR waveOutClose(IntPtr hwo);
     }
 }
index 31a5a78..5a13e91 100644 (file)
@@ -34,7 +34,7 @@ internal static partial class Interop
         /// information about the capabilities of the device.</param>
         /// <param name="cbwoc">Size, in bytes, of the WAVEOUTCAPS structure.</param>
         /// <returns>MMSYSERR</returns>
-#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
+#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
         // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable types.
         [DllImport(Libraries.WinMM)]
         internal static extern MMSYSERR waveOutGetDevCaps(IntPtr uDeviceID, ref WAVEOUTCAPS caps, int cbwoc);
index 0878bc9..396649f 100644 (file)
@@ -14,7 +14,7 @@ internal static partial class Interop
         /// </summary>
         /// <returns>The number of devices indicates success. Zero indicates that
         /// no devices are present or that an error occurred.</returns>
-        [GeneratedDllImport(Libraries.WinMM)]
+        [LibraryImport(Libraries.WinMM)]
         internal static partial int waveOutGetNumDevs();
     }
 }
index 1fbb89c..41e4695 100644 (file)
@@ -45,7 +45,7 @@ internal static partial class Interop
         /// mechanism.</param>
         /// <param name="fdwOpen">Flags for opening the device.</param>
         /// <returns>MMSYSERR</returns>
-        [GeneratedDllImport(Libraries.WinMM)]
+        [LibraryImport(Libraries.WinMM)]
         internal static partial MMSYSERR waveOutOpen(ref IntPtr phwo, int uDeviceID, byte[] pwfx, WaveOutProc dwCallback, IntPtr dwInstance, uint fdwOpen);
     }
 }
index 02b5d5a..092463d 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         /// </summary>
         /// <param name="hwo">Handle to the waveform-audio output device.</param>
         /// <returns>MMSYSERR</returns>
-        [GeneratedDllImport(Libraries.WinMM)]
+        [LibraryImport(Libraries.WinMM)]
         internal static partial MMSYSERR waveOutPause(IntPtr hwo);
     }
 }
index a892112..87cb552 100644 (file)
@@ -33,7 +33,7 @@ internal static partial class Interop
         /// respect to the sample size.</param>
         /// <param name="cbwh">Size, in bytes, of the WaveHeader structure.</param>
         /// <returns>MMSYSERR</returns>
-        [GeneratedDllImport(Libraries.WinMM)]
+        [LibraryImport(Libraries.WinMM)]
         internal static partial MMSYSERR waveOutPrepareHeader(IntPtr hwo, IntPtr pwh, int cbwh);
 
         /// <summary>
@@ -46,7 +46,7 @@ internal static partial class Interop
         /// to be cleaned up.</param>
         /// <param name="cbwh">Size, in bytes, of the WaveHeader structure.</param>
         /// <returns>MMSYSERR</returns>
-        [GeneratedDllImport(Libraries.WinMM)]
+        [LibraryImport(Libraries.WinMM)]
         internal static partial MMSYSERR waveOutUnprepareHeader(IntPtr hwo, IntPtr pwh, int cbwh);
     }
 }
index 6b98aa8..0920075 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         /// </summary>
         /// <param name="hwo">Handle to the waveform-audio output device.</param>
         /// <returns>MMSYSERR</returns>
-        [GeneratedDllImport(Libraries.WinMM)]
+        [LibraryImport(Libraries.WinMM)]
         internal static partial MMSYSERR waveOutReset(IntPtr hwo);
     }
 }
index c9282fd..438deda 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
         /// </summary>
         /// <param name="hwo">Handle to the waveform-audio output device.</param>
         /// <returns>MMSYSERR</returns>
-        [GeneratedDllImport(Libraries.WinMM)]
+        [LibraryImport(Libraries.WinMM)]
         internal static partial MMSYSERR waveOutRestart(IntPtr hwo);
     }
 }
index ff37bc6..d6e9851 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
         /// about the data block.</param>
         /// <param name="cbwh">Size, in bytes, of the WaveHeader structure.</param>
         /// <returns>MMSYSERR</returns>
-        [GeneratedDllImport(Libraries.WinMM)]
+        [LibraryImport(Libraries.WinMM)]
         internal static partial MMSYSERR waveOutWrite(IntPtr hwo, IntPtr pwh, int cbwh);
     }
 }
index 4fc9f28..a0d6906 100644 (file)
@@ -17,7 +17,7 @@ internal static partial class Interop
 
         internal const int NS_ALL = 0;
 
-        [GeneratedDllImport(Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int GetAddrInfoExW(
             string pName,
             string? pServiceName,
@@ -30,10 +30,10 @@ internal static partial class Interop
             delegate* unmanaged<int, int, NativeOverlapped*, void> lpCompletionRoutine,
             IntPtr* lpNameHandle);
 
-        [GeneratedDllImport(Libraries.Ws2_32)]
+        [LibraryImport(Libraries.Ws2_32)]
         internal static unsafe partial int GetAddrInfoExCancel(IntPtr* lpHandle);
 
-        [GeneratedDllImport(Libraries.Ws2_32)]
+        [LibraryImport(Libraries.Ws2_32)]
         internal static unsafe partial void FreeAddrInfoExW(AddressInfoEx* pAddrInfo);
 
         [StructLayout(LayoutKind.Sequential)]
index 70be2c9..a1f93ba 100644 (file)
@@ -9,14 +9,14 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial int GetAddrInfoW(
             string pNameName,
             string? pServiceName,
             AddressInfo* pHints,
             AddressInfo** ppResult);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial void FreeAddrInfoW(AddressInfo* info);
 
         [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
index 2a5882d..e98ab74 100644 (file)
@@ -19,7 +19,7 @@ internal static partial class Interop
             NI_DGRAM = 0x10, /* Service is a datagram service */
         }
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Ws2_32,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static unsafe partial SocketError GetNameInfoW(
             byte* pSockaddr,
             int SockaddrLength,
index f355905..d3f4970 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Mswsock
     {
-        [GeneratedDllImport(Interop.Libraries.Mswsock, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Mswsock, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool TransmitFile(
             SafeHandle socket,
index 6d827d9..77c846a 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError WSAConnect(
             SafeSocketHandle socketHandle,
             byte[] socketAddress,
index 1d12546..99adc78 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, EntryPoint = "WSADuplicateSocketW", SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, EntryPoint = "WSADuplicateSocketW", SetLastError = true)]
         internal static unsafe partial int WSADuplicateSocket(
             SafeSocketHandle s,
             uint dwProcessId,
index a3903f2..bdd0758 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError WSAEventSelect(
             SafeSocketHandle socketHandle,
             SafeHandle Event,
index daab120..da25134 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static unsafe partial bool WSAGetOverlappedResult(
             SafeSocketHandle socketHandle,
index 67757a5..d7804bc 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
     internal static partial class Winsock
     {
         // Used with SIOGETEXTENSIONFUNCTIONPOINTER - we're assuming that will never block.
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError WSAIoctl(
             SafeSocketHandle socketHandle,
             int ioControlCode,
@@ -22,7 +22,7 @@ internal static partial class Interop
             IntPtr shouldBeNull,
             IntPtr shouldBeNull2);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, EntryPoint = "WSAIoctl", SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, EntryPoint = "WSAIoctl", SetLastError = true)]
         internal static partial SocketError WSAIoctl_Blocking(
             SafeSocketHandle socketHandle,
             int ioControlCode,
index 1a9f090..90afd2f 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial SocketError WSARecv(
             SafeHandle socketHandle,
             WSABuffer* buffer,
index dc200e6..7783bb3 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         private static unsafe partial SocketError WSARecvFrom(
             SafeHandle socketHandle,
             WSABuffer* buffers,
index 583674f..6b10133 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial SocketError WSASend(
             SafeHandle socketHandle,
             WSABuffer* buffers,
index 4896eb8..997af04 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         private static unsafe partial SocketError WSASendTo(
             SafeHandle socketHandle,
             WSABuffer* buffers,
index 9ababac..fe2974d 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Ws2_32,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr WSASocketW(
             AddressFamily addressFamily,
             SocketType socketType,
index f18f7d2..45f8612 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Ws2_32,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial IntPtr WSASocketW(
             AddressFamily addressFamily,
             SocketType socketType,
index 4031576..c9f4926 100644 (file)
@@ -39,10 +39,10 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.Ws2_32)]
+        [LibraryImport(Libraries.Ws2_32)]
         private static unsafe partial SocketError WSAStartup(short wVersionRequested, WSAData* lpWSAData);
 
-        [GeneratedDllImport(Libraries.Ws2_32)]
+        [LibraryImport(Libraries.Ws2_32)]
         private static partial SocketError WSACleanup();
 
         [StructLayout(LayoutKind.Sequential, Size = 408)]
index 2cdc1bb..2202c08 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial IntPtr accept(
             SafeSocketHandle socketHandle,
             byte[] socketAddress,
index a5f8d3b..6d5f0d4 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError bind(
             SafeSocketHandle socketHandle,
             byte[] socketAddress,
index c646d47..bcf8271 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError closesocket(IntPtr socketHandle);
     }
 }
index 54b90ef..184a369 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial SocketError gethostname(byte* name, int namelen);
     }
 }
index fa7b346..67cf50c 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial SocketError getpeername(
             SafeSocketHandle socketHandle,
             byte* socketAddress,
index d177ac7..8d1d9d0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial SocketError getsockname(
             SafeSocketHandle socketHandle,
             byte* socketAddress,
index f9885d4..aa06846 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial SocketError getsockopt(
             SafeSocketHandle socketHandle,
             SocketOptionLevel optionLevel,
@@ -16,7 +16,7 @@ internal static partial class Interop
             byte* optionValue,
             ref int optionLength);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError getsockopt(
             SafeSocketHandle socketHandle,
             SocketOptionLevel optionLevel,
@@ -24,7 +24,7 @@ internal static partial class Interop
             out Linger optionValue,
             ref int optionLength);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError getsockopt(
             SafeSocketHandle socketHandle,
             SocketOptionLevel optionLevel,
@@ -32,7 +32,7 @@ internal static partial class Interop
             out IPMulticastRequest optionValue,
             ref int optionLength);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError getsockopt(
             SafeSocketHandle socketHandle,
             SocketOptionLevel optionLevel,
index f539723..c838a10 100644 (file)
@@ -9,13 +9,13 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError ioctlsocket(
             IntPtr handle,
             int cmd,
             ref int argp);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError ioctlsocket(
             SafeSocketHandle socketHandle,
             int cmd,
index a864472..cc7940e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError listen(
             SafeSocketHandle socketHandle,
             int backlog);
index 20f0a68..479d412 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial int recv(
             SafeSocketHandle socketHandle,
             byte* pinnedBuffer,
index 14daa97..8c470c3 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
     internal static partial class Winsock
     {
         // This method is always blocking, so it uses an IntPtr.
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial int recvfrom(
             SafeSocketHandle socketHandle,
             byte* pinnedBuffer,
index 889bdee..2762e4e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial int select(
             int ignoredParameter,
             IntPtr* readfds,
@@ -16,7 +16,7 @@ internal static partial class Interop
             IntPtr* exceptfds,
             ref TimeValue timeout);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial int select(
             int ignoredParameter,
             IntPtr* readfds,
index 4c75af9..69dd71f 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial int send(
             SafeSocketHandle socketHandle,
             byte* pinnedBuffer,
index c2dfd48..01e0366 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial int sendto(
             SafeSocketHandle socketHandle,
             byte* pinnedBuffer,
index f980e31..803748e 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError setsockopt(
             IntPtr handle,
             SocketOptionLevel optionLevel,
@@ -17,7 +17,7 @@ internal static partial class Interop
             ref Linger linger,
             int optionLength);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError setsockopt(
             SafeSocketHandle socketHandle,
             SocketOptionLevel optionLevel,
@@ -25,7 +25,7 @@ internal static partial class Interop
             ref int optionValue,
             int optionLength);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial SocketError setsockopt(
             SafeSocketHandle socketHandle,
             SocketOptionLevel optionLevel,
@@ -33,7 +33,7 @@ internal static partial class Interop
             byte* optionValue,
             int optionLength);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError setsockopt(
             SafeSocketHandle socketHandle,
             SocketOptionLevel optionLevel,
@@ -41,7 +41,7 @@ internal static partial class Interop
             ref IntPtr pointer,
             int optionLength);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError setsockopt(
             SafeSocketHandle socketHandle,
             SocketOptionLevel optionLevel,
@@ -49,7 +49,7 @@ internal static partial class Interop
             ref Linger linger,
             int optionLength);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError setsockopt(
             SafeSocketHandle socketHandle,
             SocketOptionLevel optionLevel,
@@ -57,7 +57,7 @@ internal static partial class Interop
             ref IPMulticastRequest mreq,
             int optionLength);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError setsockopt(
             SafeSocketHandle socketHandle,
             SocketOptionLevel optionLevel,
index 870a9c3..4fd9231 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError shutdown(
             SafeSocketHandle socketHandle,
             int how);
index b218522..caef99c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Wkscli
     {
-        [GeneratedDllImport(Libraries.Wkscli, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wkscli, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int NetWkstaGetInfo(string server, int level, ref IntPtr buffer);
     }
 }
index ea1f38f..9d5d838 100644 (file)
@@ -9,63 +9,63 @@ internal static partial class Interop
 {
     internal static partial class Ldap
     {
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_free", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_free", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ber_free(IntPtr berelement, int option);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_alloc_t", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_alloc_t", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ber_alloc(int option);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ber_printf(SafeBerHandle berElement, string format, IntPtr value);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ber_printf(SafeBerHandle berElement, string format, HGlobalMemHandle value, uint length);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ber_printf(SafeBerHandle berElement, string format);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ber_printf(SafeBerHandle berElement, string format, int value);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_printf", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ber_printf(SafeBerHandle berElement, string format, uint tag);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_flatten", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_flatten", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ber_flatten(SafeBerHandle berElement, ref IntPtr value);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_init", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_init", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ber_init(BerVal value);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ber_scanf(SafeBerHandle berElement, string format);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ber_scanf(SafeBerHandle berElement, string format, ref IntPtr ptrResult, ref uint bitLength);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ber_scanf(SafeBerHandle berElement, string format, ref int result);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_scanf", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ber_scanf(SafeBerHandle berElement, string format, ref IntPtr value);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_bvfree", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_bvfree", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ber_bvfree(IntPtr value);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ber_bvecfree", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ber_bvecfree", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ber_bvecfree(IntPtr value);
     }
index c784fe9..7ebc9ac 100644 (file)
@@ -9,194 +9,194 @@ internal static partial class Interop
 {
     internal static partial class Ldap
     {
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_bind_sW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_bind_sW", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_bind_s(ConnectionHandle ldapHandle, string dn, in SEC_WINNT_AUTH_IDENTITY_EX credentials, BindMethod method);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_initW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_initW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ldap_init(string hostName, int portNumber);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_connect")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_connect")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_connect(ConnectionHandle ldapHandle, in LDAP_TIMEVAL timeout);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_unbind")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_unbind")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_unbind(IntPtr ldapHandle);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_get_option_int(ConnectionHandle ldapHandle, LdapOption option, ref int outValue);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_set_option_int(ConnectionHandle ldapHandle, LdapOption option, ref int inValue);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_get_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr outValue);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_set_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_get_option_sechandle(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_optionW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static unsafe partial int ldap_get_option_secInfo(ConnectionHandle ldapHandle, LdapOption option, void* outValue);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_set_option_referral(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_set_option_clientcert(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_set_optionW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_set_option_servercert(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "LdapGetLastError")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "LdapGetLastError")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int LdapGetLastError();
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "cldap_openW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "cldap_openW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr cldap_open(string hostName, int portNumber);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_simple_bind_sW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_simple_bind_sW", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_simple_bind_s(ConnectionHandle ldapHandle, string distinguishedName, string password);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_delete_extW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_delete_extW", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_delete_ext(ConnectionHandle ldapHandle, string dn, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_result", SetLastError = true)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_result", SetLastError = true)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_result(ConnectionHandle ldapHandle, int messageId, int all, in LDAP_TIMEVAL timeout, ref IntPtr Mesage);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_parse_resultW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_parse_resultW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_parse_result(ConnectionHandle ldapHandle, IntPtr result, ref int serverError, ref IntPtr dn, ref IntPtr message, ref IntPtr referral, ref IntPtr control, byte freeIt);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_parse_resultW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_parse_resultW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_parse_result_referral(ConnectionHandle ldapHandle, IntPtr result, IntPtr serverError, IntPtr dn, IntPtr message, ref IntPtr referral, IntPtr control, byte freeIt);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_memfreeW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_memfreeW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial void ldap_memfree(IntPtr value);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_value_freeW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_value_freeW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_value_free(IntPtr value);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_controls_freeW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_controls_freeW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_controls_free(IntPtr value);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_abandon")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_abandon")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_abandon(ConnectionHandle ldapHandle, int messagId);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_start_tls_sW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_start_tls_sW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_start_tls(ConnectionHandle ldapHandle, ref int ServerReturnValue, ref IntPtr Message, IntPtr ServerControls, IntPtr ClientControls);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_stop_tls_s")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_stop_tls_s")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial byte ldap_stop_tls(ConnectionHandle ldapHandle);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_rename_extW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_rename_extW", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_rename(ConnectionHandle ldapHandle, string dn, string newRdn, string newParentDn, int deleteOldRdn, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_compare_extW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_compare_extW", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_compare(ConnectionHandle ldapHandle, string dn, string attributeName, string strValue, BerVal binaryValue, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_add_extW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_add_extW", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_add(ConnectionHandle ldapHandle, string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_modify_extW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_modify_extW", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_modify(ConnectionHandle ldapHandle, string dn, IntPtr attrs, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_extended_operationW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_extended_operationW", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_extended_operation(ConnectionHandle ldapHandle, string oid, BerVal data, IntPtr servercontrol, IntPtr clientcontrol, ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_parse_extended_resultW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_parse_extended_resultW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_parse_extended_result(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr oid, ref IntPtr data, byte freeIt);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_msgfree")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_msgfree")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_msgfree(IntPtr result);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_search_extW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_search_extW", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_search(ConnectionHandle ldapHandle, string dn, int scope, string filter, IntPtr attributes, [MarshalAs(UnmanagedType.Bool)] bool attributeOnly, IntPtr servercontrol, IntPtr clientcontrol, int timelimit, int sizelimit, ref int messageNumber);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_first_entry")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_first_entry")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ldap_first_entry(ConnectionHandle ldapHandle, IntPtr result);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_next_entry")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_next_entry")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ldap_next_entry(ConnectionHandle ldapHandle, IntPtr result);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_first_reference")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_first_reference")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ldap_first_reference(ConnectionHandle ldapHandle, IntPtr result);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_next_reference")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_next_reference")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ldap_next_reference(ConnectionHandle ldapHandle, IntPtr result);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_dnW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_dnW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ldap_get_dn(ConnectionHandle ldapHandle, IntPtr result);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_first_attributeW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_first_attributeW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ldap_first_attribute(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr address);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_next_attributeW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_next_attributeW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ldap_next_attribute(ConnectionHandle ldapHandle, IntPtr result, IntPtr address);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_get_values_lenW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_get_values_lenW", StringMarshalling = StringMarshalling.Utf16)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ldap_get_values_len(ConnectionHandle ldapHandle, IntPtr result, string name);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_value_free_len")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_value_free_len")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial IntPtr ldap_value_free_len(IntPtr berelement);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_parse_referenceW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_parse_referenceW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_parse_reference(ConnectionHandle ldapHandle, IntPtr result, ref IntPtr referrals);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_create_sort_controlW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_create_sort_controlW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_create_sort_control(ConnectionHandle handle, IntPtr keys, byte critical, ref IntPtr control);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_control_freeW")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_control_freeW")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_control_free(IntPtr control);
 
-        [GeneratedDllImport("Crypt32.dll", EntryPoint = "CertFreeCRLContext")]
+        [LibraryImport("Crypt32.dll", EntryPoint = "CertFreeCRLContext")]
         public static partial int CertFreeCRLContext(IntPtr certContext);
 
-        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_result2error")]
+        [LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_result2error")]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_result2error(ConnectionHandle ldapHandle, IntPtr result, int freeIt);
     }
index e6811b1..7f1b2f1 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Wtsapi32
     {
-        [GeneratedDllImport(Libraries.Wtsapi32)]
+        [LibraryImport(Libraries.Wtsapi32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WTSRegisterSessionNotification(IntPtr hWnd, int dwFlags);
     }
index f5a5213..23d1b34 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Wtsapi32
     {
-        [GeneratedDllImport(Libraries.Wtsapi32)]
+        [LibraryImport(Libraries.Wtsapi32)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool WTSUnRegisterSessionNotification(IntPtr hWnd);
     }
@@ -17,14 +17,14 @@ namespace System.Runtime.InteropServices
 #else
     internal
 #endif
-    sealed class GeneratedDllImportAttribute : Attribute
+    sealed class LibraryImportAttribute : Attribute
     {
         public string? EntryPoint { get; set; }
         public bool SetLastError { get; set; }
         public StringMarshalling StringMarshalling { get; set; }
         public Type? StringMarshallingCustomType { get; set; }
 
-        public GeneratedDllImportAttribute(string dllName)
+        public LibraryImportAttribute(string dllName)
         {
             LibraryName = dllName;
         }
index e3d9021..3b2d8d7 100644 (file)
@@ -292,7 +292,7 @@ namespace System.Buffers
             private const string KERNEL32_LIB = "kernel32.dll";
 
             // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366887(v=vs.85).aspx
-            [GeneratedDllImport(KERNEL32_LIB, SetLastError = true)]
+            [LibraryImport(KERNEL32_LIB, SetLastError = true)]
             public static partial VirtualAllocHandle VirtualAlloc(
                 IntPtr lpAddress,
                 IntPtr dwSize,
@@ -300,7 +300,7 @@ namespace System.Buffers
                 VirtualAllocProtection flProtect);
 
             // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366892(v=vs.85).aspx
-            [GeneratedDllImport(KERNEL32_LIB, SetLastError = true)]
+            [LibraryImport(KERNEL32_LIB, SetLastError = true)]
             [return: MarshalAs(UnmanagedType.Bool)]
             public static partial bool VirtualFree(
                 IntPtr lpAddress,
@@ -308,7 +308,7 @@ namespace System.Buffers
                 VirtualAllocAllocationType dwFreeType);
 
             // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366898(v=vs.85).aspx
-            [GeneratedDllImport(KERNEL32_LIB, SetLastError = true)]
+            [LibraryImport(KERNEL32_LIB, SetLastError = true)]
             [return: MarshalAs(UnmanagedType.Bool)]
             public static partial bool VirtualProtect(
                 IntPtr lpAddress,
@@ -317,7 +317,7 @@ namespace System.Buffers
                 out VirtualAllocProtection lpflOldProtect);
 
             // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366902(v=vs.85).aspx
-            [GeneratedDllImport(KERNEL32_LIB, SetLastError = true)]
+            [LibraryImport(KERNEL32_LIB, SetLastError = true)]
             public static partial IntPtr VirtualQuery(
                 IntPtr lpAddress,
                 out MEMORY_BASIC_INFORMATION lpBuffer,
index 5524fd8..16755d5 100644 (file)
@@ -326,13 +326,13 @@ namespace System
 
         private static partial class @libc
         {
-            [GeneratedDllImport("libc", SetLastError = true)]
+            [LibraryImport("libc", SetLastError = true)]
             public static unsafe partial uint geteuid();
 
-            [GeneratedDllImport("libc")]
+            [LibraryImport("libc")]
             public static partial IntPtr gnu_get_libc_release();
 
-            [GeneratedDllImport("libc")]
+            [LibraryImport("libc")]
             public static partial IntPtr gnu_get_libc_version();
         }
     }
index bd18d0c..c51437b 100644 (file)
@@ -145,7 +145,7 @@ namespace System
         private const int PRODUCT_HOME_PREMIUM = 0x00000003;
         private const int PRODUCT_HOME_PREMIUM_N = 0x0000001A;
 
-        [GeneratedDllImport("kernel32.dll", SetLastError = false)]
+        [LibraryImport("kernel32.dll", SetLastError = false)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool GetProductInfo(
             int dwOSMajorVersion,
@@ -155,7 +155,7 @@ namespace System
             out int pdwReturnedProductType
         );
 
-        [GeneratedDllImport("kernel32.dll")]
+        [LibraryImport("kernel32.dll")]
         private static partial int GetCurrentApplicationUserModelId(ref uint applicationUserModelIdLength, byte[] applicationUserModelId);
 
         private static volatile Version s_windowsVersionObject;
index bcb5850..371069c 100644 (file)
@@ -109,17 +109,17 @@ namespace System
             }
         }
 
-        [GeneratedDllImport("advapi32.dll", EntryPoint = "LogonUserW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("advapi32.dll", EntryPoint = "LogonUserW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool LogonUser(string userName, string domain, string password, int logonType, int logonProvider, out SafeAccessTokenHandle safeAccessTokenHandle);
 
-#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
-        // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we add support for non-blittable struct marshalling.
+#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
+        // TODO: [DllImportGenerator] Switch to use LibraryImport once we add support for non-blittable struct marshalling.
         [DllImport("netapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static extern uint NetUserAdd([MarshalAs(UnmanagedType.LPWStr)]string servername, uint level, ref USER_INFO_1 buf, out uint parm_err);
-#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
+#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
 
-        [GeneratedDllImport("netapi32.dll")]
+        [LibraryImport("netapi32.dll")]
         internal static partial uint NetUserDel([MarshalAs(UnmanagedType.LPWStr)]string servername, [MarshalAs(UnmanagedType.LPWStr)]string username);
 
         [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
index 3d569d7..11bb615 100644 (file)
@@ -65,10 +65,10 @@ internal static partial class Interop
     [SuppressUnmanagedCodeSecurityAttribute]
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(nameof(Kernel32))]
+        [LibraryImport(nameof(Kernel32))]
         internal static partial int GetCurrentThreadId();
 
-        [GeneratedDllImport(nameof(Kernel32))]
+        [LibraryImport(nameof(Kernel32))]
         internal static partial uint GetCurrentProcessId();
     }
 }
index faee4c9..2eb0534 100644 (file)
@@ -9,7 +9,7 @@ namespace Microsoft.Win32.RegistryTests
 {
     internal static partial class Helpers
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32,  EntryPoint = "RegSetValueW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Advapi32,  EntryPoint = "RegSetValueW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         private static partial int RegSetValue(SafeRegistryHandle handle, string value, int regType, string sb, int sizeIgnored);
 
         internal static bool SetDefaultValue(this RegistryKey key, string value)
@@ -18,7 +18,7 @@ namespace Microsoft.Win32.RegistryTests
             return RegSetValue(key.Handle, null, REG_SZ, value, 0) == 0;
         }
 
-        [GeneratedDllImport(Interop.Libraries.Advapi32,  EntryPoint = "RegQueryValueExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Advapi32,  EntryPoint = "RegQueryValueExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         private static partial int RegQueryValueEx(SafeRegistryHandle handle, string valueName, int[] reserved, IntPtr regType, byte[] value, ref int size);
 
         internal static bool IsDefaultValueSet(this RegistryKey key)
@@ -29,7 +29,7 @@ namespace Microsoft.Win32.RegistryTests
             return RegQueryValueEx(key.Handle, null, null, IntPtr.Zero, b, ref size) != ERROR_FILE_NOT_FOUND;
         }
 
-        [GeneratedDllImport(Interop.Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool SetEnvironmentVariable(string lpName, string lpValue);
     }
index 69aa37b..3211c14 100644 (file)
@@ -134,10 +134,10 @@ public partial class CancelKeyPressTests
         }
     }
 
-    [GeneratedDllImport("libc", SetLastError = true)]
+    [LibraryImport("libc", SetLastError = true)]
     private static partial int kill(int pid, int sig);
 
-    [GeneratedDllImport("libc", SetLastError = true)]
+    [LibraryImport("libc", SetLastError = true)]
     private static unsafe partial int sigaction(int signum, struct_sigaction* act, struct_sigaction* oldact);
 
     private const int SIGINT = 2;
index 3236339..7e19d38 100644 (file)
@@ -67,9 +67,9 @@ public partial class ConsoleEncoding
         }).Dispose();
     }
 
-    [GeneratedDllImport("kernel32.dll")]
+    [LibraryImport("kernel32.dll")]
     public static partial uint GetConsoleCP();
 
-    [GeneratedDllImport("kernel32.dll")]
+    [LibraryImport("kernel32.dll")]
     public static partial uint GetConsoleOutputCP();
 }
index e92d2cb..147bf16 100644 (file)
@@ -35,13 +35,13 @@ namespace System.Data.Common
             return actualPtr;
         }
 
-        [GeneratedDllImport(Interop.Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Kernel32, SetLastError = true)]
         internal static partial int ReleaseSemaphore(IntPtr handle, int releaseCount, IntPtr previousCount);
 
-        [GeneratedDllImport(Interop.Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Kernel32, SetLastError = true)]
         internal static partial int WaitForMultipleObjectsEx(uint nCount, IntPtr lpHandles, [MarshalAs(UnmanagedType.Bool)] bool bWaitAll, uint dwMilliseconds, [MarshalAs(UnmanagedType.Bool)] bool bAlertable);
 
-        [GeneratedDllImport(Interop.Libraries.Kernel32/*, SetLastError=true*/)]
+        [LibraryImport(Interop.Libraries.Kernel32/*, SetLastError=true*/)]
         internal static partial int WaitForSingleObjectEx(IntPtr lpHandles, uint dwMilliseconds, [MarshalAs(UnmanagedType.Bool)] bool bAlertable);
 
         internal sealed class Wrapper
index d874526..d09e45b 100644 (file)
@@ -12,7 +12,7 @@ namespace System.Data.Common
         // Oleaut32
         //
 
-        [GeneratedDllImport(Interop.Libraries.OleAut32)]
+        [LibraryImport(Interop.Libraries.OleAut32)]
         internal static unsafe partial OleDbHResult GetErrorInfo(
             int dwReserved,
             System.IntPtr* ppIErrorInfo);
index 202abc1..a9b92a3 100644 (file)
@@ -432,7 +432,7 @@ namespace Microsoft.Win32
             EvtSeekStrict = 0x10000
         }
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         internal static partial EventLogHandle EvtQuery(
                             EventLogHandle session,
                             [MarshalAs(UnmanagedType.LPWStr)] string path,
@@ -440,7 +440,7 @@ namespace Microsoft.Win32
                             int flags);
 
         // SEEK
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtSeek(
                             EventLogHandle resultSet,
@@ -449,7 +449,7 @@ namespace Microsoft.Win32
                             int timeout,
                             EvtSeekFlags flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         internal static partial EventLogHandle EvtSubscribe(
                             EventLogHandle session,
                             SafeWaitHandle signalEvent,
@@ -460,7 +460,7 @@ namespace Microsoft.Win32
                             IntPtr callback,
                             int flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtNext(
                             EventLogHandle queryHandle,
@@ -470,15 +470,15 @@ namespace Microsoft.Win32
                             int flags,
                             ref int returned);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtCancel(EventLogHandle handle);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi)]
+        [LibraryImport(Interop.Libraries.Wevtapi)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtClose(IntPtr handle);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtGetEventInfo(
                             EventLogHandle eventHandle,
@@ -487,7 +487,7 @@ namespace Microsoft.Win32
                             IntPtr bufferPtr,
                             out int bufferUsed);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtGetQueryInfo(
                             EventLogHandle queryHandle,
@@ -497,7 +497,7 @@ namespace Microsoft.Win32
                             ref int bufferRequired);
 
         // PUBLISHER METADATA
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         internal static partial EventLogHandle EvtOpenPublisherMetadata(
                             EventLogHandle session,
                             [MarshalAs(UnmanagedType.LPWStr)] string publisherId,
@@ -505,7 +505,7 @@ namespace Microsoft.Win32
                             int locale,
                             int flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtGetPublisherMetadataProperty(
                             EventLogHandle publisherMetadataHandle,
@@ -517,13 +517,13 @@ namespace Microsoft.Win32
 
         // NEW
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtGetObjectArraySize(
                             EventLogHandle objectArray,
                             out int objectArraySize);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtGetObjectArrayProperty(
                             EventLogHandle objectArray,
@@ -535,17 +535,17 @@ namespace Microsoft.Win32
                             out int propertyValueBufferUsed);
 
         // NEW 2
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         internal static partial EventLogHandle EvtOpenEventMetadataEnum(
                             EventLogHandle publisherMetadata,
                             int flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         internal static partial EventLogHandle EvtNextEventMetadata(
                             EventLogHandle eventMetadataEnum,
                             int flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtGetEventMetadataProperty(
                             EventLogHandle eventMetadata,
@@ -557,12 +557,12 @@ namespace Microsoft.Win32
 
         // Channel Configuration Native Api
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         internal static partial EventLogHandle EvtOpenChannelEnum(
                             EventLogHandle session,
                             int flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtNextChannelPath(
                             EventLogHandle channelEnum,
@@ -570,12 +570,12 @@ namespace Microsoft.Win32
                             [Out] char[]? channelPathBuffer,
                             out int channelPathBufferUsed);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         internal static partial EventLogHandle EvtOpenPublisherEnum(
                             EventLogHandle session,
                             int flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtNextPublisherId(
                             EventLogHandle publisherEnum,
@@ -583,19 +583,19 @@ namespace Microsoft.Win32
                             [Out] char[]? publisherIdBuffer,
                             out int publisherIdBufferUsed);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         internal static partial EventLogHandle EvtOpenChannelConfig(
                             EventLogHandle session,
                             [MarshalAs(UnmanagedType.LPWStr)] string channelPath,
                             int flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtSaveChannelConfig(
                             EventLogHandle channelConfig,
                             int flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtSetChannelConfigProperty(
                             EventLogHandle channelConfig,
@@ -603,7 +603,7 @@ namespace Microsoft.Win32
                             int flags,
                             ref EvtVariant propertyValue);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtGetChannelConfigProperty(
                             EventLogHandle channelConfig,
@@ -615,13 +615,13 @@ namespace Microsoft.Win32
 
         // Log Information Native Api
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         internal static partial EventLogHandle EvtOpenLog(
                             EventLogHandle session,
                             [MarshalAs(UnmanagedType.LPWStr)] string path,
                             PathType flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtGetLogInfo(
                             EventLogHandle log,
@@ -632,7 +632,7 @@ namespace Microsoft.Win32
 
         // LOG MANIPULATION
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtExportLog(
                             EventLogHandle session,
@@ -641,7 +641,7 @@ namespace Microsoft.Win32
                             [MarshalAs(UnmanagedType.LPWStr)] string targetFilePath,
                             int flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtArchiveExportedLog(
                             EventLogHandle session,
@@ -649,7 +649,7 @@ namespace Microsoft.Win32
                             int locale,
                             int flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtClearLog(
                             EventLogHandle session,
@@ -658,14 +658,14 @@ namespace Microsoft.Win32
                             int flags);
 
         // RENDERING
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         internal static partial EventLogHandle EvtCreateRenderContext(
                             int valuePathsCount,
                             [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)]
                                 string[] valuePaths,
                             EvtRenderContextFlags flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtRender(
                             EventLogHandle context,
@@ -676,7 +676,7 @@ namespace Microsoft.Win32
                             out int buffUsed,
                             out int propCount);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtRender", SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtRender", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtRender(
                             EventLogHandle context,
@@ -736,7 +736,7 @@ namespace Microsoft.Win32
 #endif
         };
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtFormatMessage(
                              EventLogHandle publisherMetadataHandle,
@@ -749,7 +749,7 @@ namespace Microsoft.Win32
                              [Out] char[]? buffer,
                              out int bufferUsed);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtFormatMessage", SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtFormatMessage", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtFormatMessageBuffer(
                              EventLogHandle publisherMetadataHandle,
@@ -763,7 +763,7 @@ namespace Microsoft.Win32
                              out int bufferUsed);
 
         // SESSION
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         internal static partial EventLogHandle EvtOpenSession(
                             EvtLoginClass loginClass,
                             ref EvtRpcLogin login,
@@ -771,11 +771,11 @@ namespace Microsoft.Win32
                             int flags);
 
         // BOOKMARK
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtCreateBookmark", SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtCreateBookmark", SetLastError = true)]
         internal static partial EventLogHandle EvtCreateBookmark(
                             [MarshalAs(UnmanagedType.LPWStr)] string bookmarkXml);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)]
+        [LibraryImport(Interop.Libraries.Wevtapi, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool EvtUpdateBookmark(
                             EventLogHandle bookmark,
index 4b25a5d..65280fe 100644 (file)
@@ -9,10 +9,10 @@ namespace System.DirectoryServices.Interop
 {
     internal static partial class SafeNativeMethods
     {
-        [GeneratedDllImport(global::Interop.Libraries.OleAut32)]
+        [LibraryImport(global::Interop.Libraries.OleAut32)]
         public static partial void VariantInit(IntPtr pObject);
 
-        [GeneratedDllImport(global::Interop.Libraries.Activeds)]
+        [LibraryImport(global::Interop.Libraries.Activeds)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool FreeADsMem(IntPtr pVoid);
 
@@ -23,10 +23,10 @@ namespace System.DirectoryServices.Interop
             ERROR_MORE_DATA = 234,
             ERROR_SUCCESS = 0;
 
-        [GeneratedDllImport(global::Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
         public static unsafe partial int ADsGetLastError(out int error, char* errorBuffer, int errorBufferLength, char* nameBuffer, int nameBufferLength);
 
-        [GeneratedDllImport(global::Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Activeds, StringMarshalling = StringMarshalling.Utf16)]
         public static partial int ADsSetLastError(int error, string? errorString, string? provider);
 
         public class EnumVariant
index c7fed2b..6d7a83a 100644 (file)
@@ -309,7 +309,7 @@ namespace System.DirectoryServices.ActiveDirectory
                 ULONG Flags,
                 PDOMAIN_CONTROLLER_INFO* DomainControllerInfo
                 );*/
-        [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcNameW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcNameW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DsGetDcName(
             string? computerName,
             string? domainName,
@@ -327,7 +327,7 @@ namespace System.DirectoryServices.ActiveDirectory
                          ULONG DcFlags,
                          PHANDLE RetGetDcContext
                          );*/
-        [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcOpenW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcOpenW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DsGetDcOpen(
             string? dnsName,
             int optionFlags,
@@ -343,7 +343,7 @@ namespace System.DirectoryServices.ActiveDirectory
                         LPSOCKET_ADDRESS* SockAddresses,
                         LPTSTR* DnsHostName
                         );*/
-        [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcNextW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcNextW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DsGetDcNext(
             IntPtr getDcContextHandle,
             ref IntPtr sockAddressCount,
@@ -353,14 +353,14 @@ namespace System.DirectoryServices.ActiveDirectory
         /*void WINAPI DsGetDcClose(
                         HANDLE GetDcContextHandle
                         );*/
-        [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcCloseW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetDcCloseW", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial void DsGetDcClose(
             IntPtr getDcContextHandle);
 
         /*NET_API_STATUS NetApiBufferFree(
                 LPVOID Buffer
                 );*/
-        [GeneratedDllImport(global::Interop.Libraries.Netapi32)]
+        [LibraryImport(global::Interop.Libraries.Netapi32)]
         internal static partial int NetApiBufferFree(
             IntPtr buffer);
 
@@ -380,7 +380,7 @@ namespace System.DirectoryServices.ActiveDirectory
             PDNS_RECORD *ppQueryResultsSet,
             PVOID *pReserved
             );*/
-        [GeneratedDllImport(global::Interop.Libraries.Dnsapi, EntryPoint = "DnsQuery_W", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Dnsapi, EntryPoint = "DnsQuery_W", StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DnsQuery(
             string recordName,
             short recordType,
@@ -393,7 +393,7 @@ namespace System.DirectoryServices.ActiveDirectory
             PDNS_RECORD pRecordList,
             DNS_FREE_TYPE FreeType
             );*/
-        [GeneratedDllImport(global::Interop.Libraries.Dnsapi)]
+        [LibraryImport(global::Interop.Libraries.Dnsapi)]
         internal static partial void DnsRecordListFree(
             IntPtr dnsResultList,
             [MarshalAs(UnmanagedType.Bool)] bool dnsFreeType);
@@ -401,7 +401,7 @@ namespace System.DirectoryServices.ActiveDirectory
         /*NTSTATUS LsaConnectUntrusted(
               PHANDLE LsaHandle
             );*/
-        [GeneratedDllImport(global::Interop.Libraries.Secur32)]
+        [LibraryImport(global::Interop.Libraries.Secur32)]
         internal static partial uint LsaConnectUntrusted(
              out LsaLogonProcessSafeHandle lsaHandle);
 
@@ -416,7 +416,7 @@ namespace System.DirectoryServices.ActiveDirectory
               PULONG ReturnBufferLength,
               PNTSTATUS ProtocolStatus
             );*/
-        [GeneratedDllImport(global::Interop.Libraries.Secur32)]
+        [LibraryImport(global::Interop.Libraries.Secur32)]
         internal static partial uint LsaCallAuthenticationPackage(
             LsaLogonProcessSafeHandle lsaHandle,
             int authenticationPackage,
@@ -429,14 +429,14 @@ namespace System.DirectoryServices.ActiveDirectory
         /*NTSTATUS LsaFreeReturnBuffer(
               PVOID Buffer
             );*/
-        [GeneratedDllImport(global::Interop.Libraries.Secur32)]
+        [LibraryImport(global::Interop.Libraries.Secur32)]
         internal static partial uint LsaFreeReturnBuffer(
             IntPtr buffer);
 
         /*NTSTATUS LsaDeregisterLogonProcess(
               HANDLE LsaHandle
             );*/
-        [GeneratedDllImport(global::Interop.Libraries.Secur32)]
+        [LibraryImport(global::Interop.Libraries.Secur32)]
         internal static partial int LsaDeregisterLogonProcess(
             IntPtr lsaHandle);
 
@@ -447,7 +447,7 @@ namespace System.DirectoryServices.ActiveDirectory
             DWORD lpString2,
             DWORD cchCount2
             );*/
-        [GeneratedDllImport(global::Interop.Libraries.Kernel32, EntryPoint = "CompareStringW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Kernel32, EntryPoint = "CompareStringW",  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int CompareString(
             uint locale,
             uint dwCmpFlags,
index bbce2d8..2b490f4 100644 (file)
@@ -574,53 +574,53 @@ namespace System.DirectoryServices.ActiveDirectory
 
     internal static partial class UnsafeNativeMethods
     {
-        [GeneratedDllImport(global::Interop.Libraries.Activeds, EntryPoint = "ADsEncodeBinaryData", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Activeds, EntryPoint = "ADsEncodeBinaryData", StringMarshalling = StringMarshalling.Utf16)]
         public static partial int ADsEncodeBinaryData(byte[] data, int length, ref IntPtr result);
 
-        [GeneratedDllImport(global::Interop.Libraries.Activeds, EntryPoint = "FreeADsMem")]
+        [LibraryImport(global::Interop.Libraries.Activeds, EntryPoint = "FreeADsMem")]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool FreeADsMem(IntPtr pVoid);
 
-        [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetSiteNameW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsGetSiteNameW", StringMarshalling = StringMarshalling.Utf16)]
         public static partial int DsGetSiteName(string? dcName, ref IntPtr ptr);
 
-        [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsEnumerateDomainTrustsW", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsEnumerateDomainTrustsW", StringMarshalling = StringMarshalling.Utf16)]
         public static partial int DsEnumerateDomainTrustsW(string serverName, int flags, out IntPtr domains, out int count);
 
-        [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "NetApiBufferFree")]
+        [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "NetApiBufferFree")]
         public static partial int NetApiBufferFree(IntPtr buffer);
 
-        [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaSetForestTrustInformation")]
+        [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaSetForestTrustInformation")]
         public static partial uint LsaSetForestTrustInformation(SafeLsaPolicyHandle handle, in global::Interop.UNICODE_STRING target, IntPtr forestTrustInfo, int checkOnly, out IntPtr collisionInfo);
 
-        [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaQueryForestTrustInformation")]
+        [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaQueryForestTrustInformation")]
         public static partial uint LsaQueryForestTrustInformation(SafeLsaPolicyHandle handle, in global::Interop.UNICODE_STRING target, ref IntPtr ForestTrustInfo);
 
-        [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaQueryTrustedDomainInfoByName")]
+        [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaQueryTrustedDomainInfoByName")]
         public static partial uint LsaQueryTrustedDomainInfoByName(SafeLsaPolicyHandle handle, in global::Interop.UNICODE_STRING trustedDomain, TRUSTED_INFORMATION_CLASS infoClass, ref IntPtr buffer);
 
-        [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaSetTrustedDomainInfoByName")]
+        [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaSetTrustedDomainInfoByName")]
         public static partial uint LsaSetTrustedDomainInfoByName(SafeLsaPolicyHandle handle, in global::Interop.UNICODE_STRING trustedDomain, TRUSTED_INFORMATION_CLASS infoClass, IntPtr buffer);
 
-        [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaDeleteTrustedDomain")]
+        [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaDeleteTrustedDomain")]
         public static partial uint LsaDeleteTrustedDomain(SafeLsaPolicyHandle handle, IntPtr pSid);
 
-        [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "I_NetLogonControl2", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "I_NetLogonControl2", StringMarshalling = StringMarshalling.Utf16)]
         public static partial int I_NetLogonControl2(string serverName, int FunctionCode, int QueryLevel, IntPtr data, out IntPtr buffer);
 
-        [GeneratedDllImport(global::Interop.Libraries.Kernel32, EntryPoint = "GetSystemTimeAsFileTime")]
+        [LibraryImport(global::Interop.Libraries.Kernel32, EntryPoint = "GetSystemTimeAsFileTime")]
         public static partial void GetSystemTimeAsFileTime(IntPtr fileTime);
 
-        [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaCreateTrustedDomainEx")]
+        [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "LsaCreateTrustedDomainEx")]
         public static partial uint LsaCreateTrustedDomainEx(SafeLsaPolicyHandle handle, in TRUSTED_DOMAIN_INFORMATION_EX domainEx, in TRUSTED_DOMAIN_AUTH_INFORMATION authInfo, int classInfo, out IntPtr domainHandle);
 
-        [GeneratedDllImport(global::Interop.Libraries.Kernel32, EntryPoint = "OpenThread", SetLastError = true)]
+        [LibraryImport(global::Interop.Libraries.Kernel32, EntryPoint = "OpenThread", SetLastError = true)]
         public static partial IntPtr OpenThread(uint desiredAccess, [MarshalAs(UnmanagedType.Bool)] bool inheirted, int threadID);
 
-        [GeneratedDllImport(global::Interop.Libraries.Advapi32, EntryPoint = "ImpersonateAnonymousToken", SetLastError = true)]
+        [LibraryImport(global::Interop.Libraries.Advapi32, EntryPoint = "ImpersonateAnonymousToken", SetLastError = true)]
         public static partial int ImpersonateAnonymousToken(IntPtr token);
 
-        [GeneratedDllImport(global::Interop.Libraries.NtDll, EntryPoint = "RtlInitUnicodeString")]
+        [LibraryImport(global::Interop.Libraries.NtDll, EntryPoint = "RtlInitUnicodeString")]
         public static partial int RtlInitUnicodeString(out global::Interop.UNICODE_STRING result, IntPtr s);
 
         /*
@@ -630,13 +630,13 @@ namespace System.DirectoryServices.ActiveDirectory
           PBYTE* Buffer
         ); */
 
-        [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsRoleGetPrimaryDomainInformation", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsRoleGetPrimaryDomainInformation", StringMarshalling = StringMarshalling.Utf16)]
         public static partial int DsRoleGetPrimaryDomainInformation(
             [MarshalAs(UnmanagedType.LPTStr)] string lpServer,
             DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel,
             out IntPtr Buffer);
 
-        [GeneratedDllImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsRoleGetPrimaryDomainInformation", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(global::Interop.Libraries.Netapi32, EntryPoint = "DsRoleGetPrimaryDomainInformation", StringMarshalling = StringMarshalling.Utf16)]
         public static partial int DsRoleGetPrimaryDomainInformation(
             IntPtr lpServer,
             DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel,
@@ -647,7 +647,7 @@ namespace System.DirectoryServices.ActiveDirectory
           PVOID Buffer
         );
         */
-        [GeneratedDllImport(global::Interop.Libraries.Netapi32)]
+        [LibraryImport(global::Interop.Libraries.Netapi32)]
         public static partial int DsRoleFreeMemory(
             IntPtr buffer);
     }
index a7d6515..8fe0c9b 100644 (file)
@@ -8,11 +8,11 @@ internal static partial class Interop
 {
     internal static partial class Comdlg32
     {
-        [GeneratedDllImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)]
+        [LibraryImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool PrintDlg(ref PRINTDLG lppd);
 
-        [GeneratedDllImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)]
+        [LibraryImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool PrintDlg(ref PRINTDLGX86 lppd);
 
index c1e712a..545856d 100644 (file)
@@ -15,14 +15,14 @@ internal static partial class Interop
         internal const int CHECKJPEGFORMAT = 4119;
         internal const int CHECKPNGFORMAT = 4120;
 
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         internal static partial IntPtr CreateCompatibleBitmap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC, int width, int height);
 
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         internal static partial int GetDIBits(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -33,56 +33,56 @@ internal static partial class Interop
 #endif
             HandleRef hbm, int arg1, int arg2, IntPtr arg3, ref BITMAPINFO_FLAT bmi, int arg5);
 
-        [GeneratedDllImport(Libraries.Gdi32)]
+        [LibraryImport(Libraries.Gdi32)]
         internal static partial uint GetPaletteEntries(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hpal, int iStartIndex, int nEntries, byte[] lppe);
 
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         internal static partial IntPtr CreateDIBSection(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hdc, ref BITMAPINFO_FLAT bmi, int iUsage, ref IntPtr ppvBits, IntPtr hSection, int dwOffset);
 
-        [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "StartDocW", SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, EntryPoint = "StartDocW", SetLastError = true)]
         internal static partial int StartDoc(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC, DOCINFO lpDocInfo);
 
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         internal static partial int StartPage(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC);
 
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         internal static partial int EndPage(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC);
 
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         internal static partial int AbortDoc(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC);
 
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         internal static partial int EndDoc(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC);
 
-        [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "ResetDCW", SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, EntryPoint = "ResetDCW", SetLastError = true)]
         internal static partial IntPtr /*HDC*/ ResetDC(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -93,7 +93,7 @@ internal static partial class Interop
 #endif
             HandleRef /*DEVMODE*/ lpDevMode);
 
-        [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "AddFontResourceExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Gdi32, EntryPoint = "AddFontResourceExW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int AddFontResourceEx(string lpszFilename, int fl, IntPtr pdv);
 
         internal static int AddFontFile(string fileName)
@@ -101,35 +101,35 @@ internal static partial class Interop
             return AddFontResourceEx(fileName, /*FR_PRIVATE*/ 0x10, IntPtr.Zero);
         }
 
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         internal static partial int ExtEscape(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC, int nEscape, int cbInput, ref int inData, int cbOutput, out int outData);
 
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         internal static partial int ExtEscape(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC, int nEscape, int cbInput, byte[] inData, int cbOutput, out int outData);
 
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         internal static partial int IntersectClipRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC, int x1, int y1, int x2, int y2);
 
-        [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true)]
         internal static partial int GetObject(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hObject, int nSize, ref BITMAP bm);
 
-        [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Gdi32, EntryPoint = "GetObjectW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int GetObject(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
index 3d2545e..4cf179f 100644 (file)
@@ -11,10 +11,10 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, SetLastError = true)]
         public static partial int GetSystemDefaultLCID();
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GlobalAlloc", SetLastError = true)]
+        [LibraryImport(Libraries.Kernel32, EntryPoint = "GlobalAlloc", SetLastError = true)]
         internal static partial IntPtr IntGlobalAlloc(int uFlags, UIntPtr dwBytes); // size should be 32/64bits compatible
 
         internal static IntPtr GlobalAlloc(int uFlags, uint dwBytes)
@@ -22,7 +22,7 @@ internal static partial class Interop
             return IntGlobalAlloc(uFlags, new UIntPtr(dwBytes));
         }
 
-        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
+        [LibraryImport(Libraries.Gdi32, SetLastError = true)]
         internal static partial IntPtr SelectObject(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
index 97dbc84..0f76475 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class Shell32
     {
-        [GeneratedDllImport(Libraries.Shell32, EntryPoint = "ExtractAssociatedIconW")]
+        [LibraryImport(Libraries.Shell32, EntryPoint = "ExtractAssociatedIconW")]
         internal static unsafe partial IntPtr ExtractAssociatedIcon(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
index 0290a65..6c1cdf0 100644 (file)
@@ -11,14 +11,14 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, EntryPoint = "LoadIconW", SetLastError = true)]
+        [LibraryImport(Libraries.User32, EntryPoint = "LoadIconW", SetLastError = true)]
         internal static partial IntPtr LoadIcon(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hInst, IntPtr iconId);
 
-        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+        [LibraryImport(Libraries.User32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DestroyIcon(
 #if NET7_0_OR_GREATER
@@ -26,14 +26,14 @@ internal static partial class Interop
 #endif
             HandleRef hIcon);
 
-        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+        [LibraryImport(Libraries.User32, SetLastError = true)]
         internal static partial IntPtr CopyImage(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hImage, int uType, int cxDesired, int cyDesired, int fuFlags);
 
-        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+        [LibraryImport(Libraries.User32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool GetIconInfo(
 #if NET7_0_OR_GREATER
@@ -41,10 +41,10 @@ internal static partial class Interop
 #endif
             HandleRef hIcon, ref ICONINFO info);
 
-        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+        [LibraryImport(Libraries.User32, SetLastError = true)]
         public static partial int GetSystemMetrics(int nIndex);
 
-        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+        [LibraryImport(Libraries.User32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool DrawIconEx(
 #if NET7_0_OR_GREATER
@@ -60,7 +60,7 @@ internal static partial class Interop
 #endif
             HandleRef hBrushFlickerFree, int diFlags);
 
-        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
+        [LibraryImport(Libraries.User32, SetLastError = true)]
         internal static unsafe partial IntPtr CreateIconFromResourceEx(byte* pbIconBits, uint cbIconBits, [MarshalAs(UnmanagedType.Bool)] bool fIcon, int dwVersion, int csDesired, int cyDesired, int flags);
 
         [StructLayout(LayoutKind.Sequential)]
index 715c8cf..5d059b6 100644 (file)
@@ -11,10 +11,10 @@ internal static partial class Interop
 {
     internal static partial class Winspool
     {
-        [GeneratedDllImport(Libraries.Winspool, EntryPoint = "DeviceCapabilitiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Winspool, EntryPoint = "DeviceCapabilitiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DeviceCapabilities(string pDevice, string pPort, short fwCapabilities, IntPtr pOutput, IntPtr /*DEVMODE*/ pDevMode);
 
-        [GeneratedDllImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DocumentProperties(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -29,7 +29,7 @@ internal static partial class Interop
 #endif
             HandleRef /*DEVMODE*/ pDevModeInput, int fMode);
 
-        [GeneratedDllImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int DocumentProperties(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -40,7 +40,7 @@ internal static partial class Interop
 #endif
             HandleRef hPrinter, string pDeviceName, IntPtr /*DEVMODE*/ pDevModeOutput, IntPtr /*DEVMODE*/ pDevModeInput, int fMode);
 
-        [GeneratedDllImport(Libraries.Winspool, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(Libraries.Winspool, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         internal static partial int EnumPrinters(int flags, string? name, int level, IntPtr pPrinterEnum/*buffer*/, int cbBuf, out int pcbNeeded, out int pcReturned);
     }
 }
index 8973435..440fdba 100644 (file)
@@ -69,39 +69,39 @@ namespace System.Drawing
             }
 
             // Imported functions
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdiplusStartup(out IntPtr token, in StartupInputEx input, out StartupOutput output);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial void GdiplusShutdown(ref ulong token);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial IntPtr GdipAlloc(int size);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial void GdipFree(IntPtr ptr);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeleteBrush(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetBrushType(IntPtr brush, out BrushType type);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeleteGraphics(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipRestoreGraphics(IntPtr graphics, uint graphicsState);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipReleaseDC(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -112,310 +112,310 @@ namespace System.Drawing
 #endif
             HandleRef hdc);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipFillPath(IntPtr graphics, IntPtr brush, IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetNearestColor(IntPtr graphics, out int argb);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipAddPathString(IntPtr path, string s, int lenght, IntPtr family, int style, float emSize, ref RectangleF layoutRect, IntPtr format);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipAddPathStringI(IntPtr path, string s, int lenght, IntPtr family, int style, float emSize, ref Rectangle layoutRect, IntPtr format);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateFromHWND(IntPtr hwnd, out IntPtr graphics);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCloneImage(IntPtr image, out IntPtr imageclone);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImagePaletteSize(IntPtr image, out int size);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImagePalette(IntPtr image, IntPtr palette, int size);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetImagePalette(IntPtr image, IntPtr palette);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageBounds(IntPtr image, out RectangleF source, ref GraphicsUnit unit);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageThumbnail(IntPtr image, uint width, uint height, out IntPtr thumbImage, IntPtr callback, IntPtr callBackData);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipSaveImageToFile(IntPtr image, string filename, ref Guid encoderClsID, IntPtr encoderParameters);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSaveAdd(IntPtr image, IntPtr encoderParameters);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSaveAddImage(IntPtr image, IntPtr imagenew, IntPtr encoderParameters);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageGraphicsContext(IntPtr image, out IntPtr graphics);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreatePath(FillMode brushMode, out IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreatePath2(PointF[] points, byte[] types, int count, FillMode brushMode, out IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreatePath2I(Point[] points, byte[] types, int count, FillMode brushMode, out IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipClonePath(IntPtr path, out IntPtr clonePath);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeletePath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipResetPath(IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPointCount(IntPtr path, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathTypes(IntPtr path, byte[] types, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathPoints(IntPtr path, PointF[] points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathPointsI(IntPtr path, Point[] points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathFillMode(IntPtr path, out FillMode fillMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathFillMode(IntPtr path, FillMode fillMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipStartPathFigure(IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipClosePathFigure(IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipClosePathFigures(IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathMarker(IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipClearPathMarkers(IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipReversePath(IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathLastPoint(IntPtr path, out PointF lastPoint);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathLine(IntPtr path, float x1, float y1, float x2, float y2);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathLine2(IntPtr path, PointF[] points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathLine2I(IntPtr path, Point[] points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathArc(IntPtr path, float x, float y, float width, float height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathBezier(IntPtr path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathBeziers(IntPtr path, PointF[] points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathCurve(IntPtr path, PointF[] points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathCurveI(IntPtr path, Point[] points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathCurve2(IntPtr path, PointF[] points, int count, float tension);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathCurve2I(IntPtr path, Point[] points, int count, float tension);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathCurve3(IntPtr path, PointF[] points, int count, int offset, int numberOfSegments, float tension);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathCurve3I(IntPtr path, Point[] points, int count, int offset, int numberOfSegments, float tension);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathClosedCurve(IntPtr path, PointF[] points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathClosedCurveI(IntPtr path, Point[] points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathClosedCurve2(IntPtr path, PointF[] points, int count, float tension);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathClosedCurve2I(IntPtr path, Point[] points, int count, float tension);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathRectangle(IntPtr path, float x, float y, float width, float height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathRectangles(IntPtr path, RectangleF[] rects, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathEllipse(IntPtr path, float x, float y, float width, float height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathEllipseI(IntPtr path, int x, int y, int width, int height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathPie(IntPtr path, float x, float y, float width, float height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathPieI(IntPtr path, int x, int y, int width, int height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathPolygon(IntPtr path, PointF[] points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathPath(IntPtr path, IntPtr addingPath, [MarshalAs(UnmanagedType.Bool)] bool connect);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathLineI(IntPtr path, int x1, int y1, int x2, int y2);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathArcI(IntPtr path, int x, int y, int width, int height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathBezierI(IntPtr path, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathBeziersI(IntPtr path, Point[] points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathPolygonI(IntPtr path, Point[] points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathRectangleI(IntPtr path, int x, int y, int width, int height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathRectanglesI(IntPtr path, Rectangle[] rects, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipFlattenPath(IntPtr path, IntPtr matrix, float floatness);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTransformPath(IntPtr path, IntPtr matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipWarpPath(IntPtr path, IntPtr matrix, PointF[] points, int count, float srcx, float srcy, float srcwidth, float srcheight, WarpMode mode, float flatness);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipWidenPath(IntPtr path, IntPtr pen, IntPtr matrix, float flatness);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathWorldBounds(IntPtr path, out RectangleF bounds, IntPtr matrix, IntPtr pen);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathWorldBoundsI(IntPtr path, out Rectangle bounds, IntPtr matrix, IntPtr pen);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisiblePathPoint(IntPtr path, float x, float y, IntPtr graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisiblePathPointI(IntPtr path, int x, int y, IntPtr graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsOutlineVisiblePathPoint(IntPtr path, float x, float y, IntPtr pen, IntPtr graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsOutlineVisiblePathPointI(IntPtr path, int x, int y, IntPtr pen, IntPtr graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateFontFromLogfont(IntPtr hdc, ref Interop.User32.LOGFONT lf, out IntPtr ptr);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateFontFromHfont(IntPtr hdc, out IntPtr font, ref Interop.User32.LOGFONT lf);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipGetMetafileHeaderFromFile(string filename, IntPtr header);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetMetafileHeaderFromMetafile(IntPtr metafile, IntPtr header);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetMetafileHeaderFromEmf(IntPtr hEmf, IntPtr header);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetMetafileHeaderFromWmf(IntPtr hWmf, IntPtr wmfPlaceableFileHeader, IntPtr header);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetHemfFromMetafile(IntPtr metafile, out IntPtr hEmf);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetMetafileDownLevelRasterizationLimit(IntPtr metafile, ref uint metafileRasterizationLimitDpi);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetMetafileDownLevelRasterizationLimit(IntPtr metafile, uint metafileRasterizationLimitDpi);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateFromContext_macosx(IntPtr cgref, int width, int height, out IntPtr graphics);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetVisibleClip_linux(IntPtr graphics, ref Rectangle rect);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateFromXDrawable_linux(IntPtr drawable, IntPtr display, out IntPtr graphics);
 
             // Stream functions for non-Win32 (libgdiplus specific)
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipLoadImageFromDelegate_linux(StreamGetHeaderDelegate getHeader,
                 StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
                 StreamCloseDelegate close, StreamSizeDelegate size, out IntPtr image);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSaveImageToDelegate_linux(IntPtr image, StreamGetBytesDelegate getBytes,
                 StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close,
                 StreamSizeDelegate size, ref Guid encoderClsID, IntPtr encoderParameters);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateMetafileFromDelegate_linux(StreamGetHeaderDelegate getHeader,
                 StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
                 StreamCloseDelegate close, StreamSizeDelegate size, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetMetafileHeaderFromDelegate_linux(StreamGetHeaderDelegate getHeader,
                 StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
                 StreamCloseDelegate close, StreamSizeDelegate size, IntPtr header);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipRecordMetafileFromDelegate_linux(StreamGetHeaderDelegate getHeader,
                 StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
                 StreamCloseDelegate close, StreamSizeDelegate size, IntPtr hdc, EmfType type, ref RectangleF frameRect,
                 MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipRecordMetafileFromDelegateI_linux(StreamGetHeaderDelegate getHeader,
                 StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
                 StreamCloseDelegate close, StreamSizeDelegate size, IntPtr hdc, EmfType type, ref Rectangle frameRect,
                 MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPostScriptGraphicsContext(
                 [MarshalAs(UnmanagedType.LPStr)] string filename,
                 int width, int height, double dpix, double dpiy, ref IntPtr graphics);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPostScriptSavePage(IntPtr graphics);
         }
     }
index 30f5970..e5a1b81 100644 (file)
@@ -22,236 +22,236 @@ namespace System.Drawing
             }
 
             // Imported functions
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             private static partial int GdiplusStartup(out IntPtr token, in StartupInputEx input, out StartupOutput output);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreatePath(int brushMode, out IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreatePath2(PointF* points, byte* types, int count, int brushMode, out IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreatePath2I(Point* points, byte* types, int count, int brushMode, out IntPtr path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipClonePath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, out IntPtr clonepath);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeletePath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipResetPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPointCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathTypes(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, byte[] types, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathPoints(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathFillMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, out FillMode fillmode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathFillMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, FillMode fillmode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathData(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, GpPathData* pathData);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipStartPathFigure(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipClosePathFigure(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipClosePathFigures(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathMarker(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipClearPathMarkers(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipReversePath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathLastPoint(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, out PointF lastPoint);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathLine(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, float x1, float y1, float x2, float y2);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathLine2(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathArc(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, float x, float y, float width, float height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathBezier(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathBeziers(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathCurve(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathCurve2(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, PointF* points, int count, float tension);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathCurve3(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, PointF* points, int count, int offset, int numberOfSegments, float tension);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathClosedCurve(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathClosedCurve2(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, PointF* points, int count, float tension);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathRectangle(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, float x, float y, float width, float height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathRectangles(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, RectangleF* rects, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathEllipse(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, float x, float y, float width, float height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathPie(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, float x, float y, float width, float height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathPolygon(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -262,7 +262,7 @@ namespace System.Drawing
 #endif
             HandleRef addingPath, [MarshalAs(UnmanagedType.Bool)] bool connect);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipAddPathString(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -277,7 +277,7 @@ namespace System.Drawing
 #endif
             HandleRef format);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipAddPathStringI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -292,112 +292,112 @@ namespace System.Drawing
 #endif
             HandleRef format);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathLineI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, int x1, int y1, int x2, int y2);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathLine2I(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathArcI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, int x, int y, int width, int height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathBezierI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathBeziersI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathCurveI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathCurve2I(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, Point* points, int count, float tension);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathCurve3I(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, Point* points, int count, int offset, int numberOfSegments, float tension);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathClosedCurveI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathClosedCurve2I(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, Point* points, int count, float tension);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathRectangleI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, int x, int y, int width, int height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathRectanglesI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, Rectangle* rects, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathEllipseI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, int x, int y, int width, int height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathPieI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, int x, int y, int width, int height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipAddPathPolygonI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipFlattenPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -408,7 +408,7 @@ namespace System.Drawing
 #endif
             HandleRef matrixfloat, float flatness);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipWidenPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -423,7 +423,7 @@ namespace System.Drawing
 #endif
             HandleRef matrix, float flatness);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipWarpPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -434,7 +434,7 @@ namespace System.Drawing
 #endif
             HandleRef matrix, PointF* points, int count, float srcX, float srcY, float srcWidth, float srcHeight, WarpMode warpMode, float flatness);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTransformPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -445,7 +445,7 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathWorldBounds(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -460,7 +460,7 @@ namespace System.Drawing
 #endif
             HandleRef pen);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisiblePathPoint(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -471,7 +471,7 @@ namespace System.Drawing
 #endif
             HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisiblePathPointI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -482,7 +482,7 @@ namespace System.Drawing
 #endif
             HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsOutlineVisiblePathPoint(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -497,7 +497,7 @@ namespace System.Drawing
 #endif
             HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsOutlineVisiblePathPointI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -512,27 +512,27 @@ namespace System.Drawing
 #endif
             HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeleteBrush(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipLoadImageFromStream(IntPtr stream, IntPtr* image);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipLoadImageFromStreamICM(IntPtr stream, IntPtr* image);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCloneImage(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out IntPtr cloneimage);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipSaveImageToFile(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -543,7 +543,7 @@ namespace System.Drawing
 #endif
             HandleRef encoderParams);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSaveImageToStream(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -554,7 +554,7 @@ namespace System.Drawing
 #endif
             HandleRef encoderParams);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSaveAdd(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -565,7 +565,7 @@ namespace System.Drawing
 #endif
             HandleRef encoderParams);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSaveAddImage(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -580,82 +580,82 @@ namespace System.Drawing
 #endif
             HandleRef encoderParams);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageGraphicsContext(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out IntPtr graphics);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageBounds(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out RectangleF gprectf, out GraphicsUnit unit);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageThumbnail(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, int thumbWidth, int thumbHeight, out IntPtr thumbImage, Image.GetThumbnailImageAbort? callback, IntPtr callbackdata);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImagePalette(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, IntPtr palette, int size);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetImagePalette(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, IntPtr palette);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImagePaletteSize(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out int size);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipImageForceValidation(IntPtr image);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateFromHDC2(IntPtr hdc, IntPtr hdevice, out IntPtr graphics);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateFromHWND(IntPtr hwnd, out IntPtr graphics);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeleteGraphics(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipReleaseDC(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, IntPtr hdc);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetNearestColor(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, ref int color);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial IntPtr GdipCreateHalftonePalette();
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawBeziers(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -666,7 +666,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawBeziersI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -677,7 +677,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -692,7 +692,7 @@ namespace System.Drawing
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEnumerateMetafileDestPoint(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -707,7 +707,7 @@ namespace System.Drawing
 #endif
             HandleRef imageattributes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEnumerateMetafileDestPointI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -722,7 +722,7 @@ namespace System.Drawing
 #endif
             HandleRef imageattributes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEnumerateMetafileDestRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -737,7 +737,7 @@ namespace System.Drawing
 #endif
             HandleRef imageattributes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEnumerateMetafileDestRectI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -752,7 +752,7 @@ namespace System.Drawing
 #endif
             HandleRef imageattributes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEnumerateMetafileDestPoints(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -767,7 +767,7 @@ namespace System.Drawing
 #endif
             HandleRef imageattributes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEnumerateMetafileDestPointsI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -782,7 +782,7 @@ namespace System.Drawing
 #endif
             HandleRef imageattributes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEnumerateMetafileSrcRectDestPoint(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -797,7 +797,7 @@ namespace System.Drawing
 #endif
             HandleRef imageattributes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEnumerateMetafileSrcRectDestPointI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -812,7 +812,7 @@ namespace System.Drawing
 #endif
             HandleRef imageattributes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEnumerateMetafileSrcRectDestRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -827,7 +827,7 @@ namespace System.Drawing
 #endif
             HandleRef imageattributes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEnumerateMetafileSrcRectDestRectI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -842,7 +842,7 @@ namespace System.Drawing
 #endif
             HandleRef imageattributes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEnumerateMetafileSrcRectDestPoints(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -857,7 +857,7 @@ namespace System.Drawing
 #endif
             HandleRef imageattributes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEnumerateMetafileSrcRectDestPointsI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -872,14 +872,14 @@ namespace System.Drawing
 #endif
             HandleRef imageattributes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipRestoreGraphics(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, int state);
 
-            [GeneratedDllImport(LibraryName, EntryPoint = "GdipGetMetafileHeaderFromWmf")]
+            [LibraryImport(LibraryName, EntryPoint = "GdipGetMetafileHeaderFromWmf")]
             private static partial int GdipGetMetafileHeaderFromWmf_Internal(IntPtr hMetafile,
 #if NET7_0_OR_GREATER
                 [MarshalUsing(typeof(WmfPlaceableFileHeader.PinningMarshaller))]
@@ -907,55 +907,55 @@ namespace System.Drawing
                     );
             }
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetMetafileHeaderFromEmf(IntPtr hEnhMetafile, MetafileHeaderEmf metafileHeaderEmf);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipGetMetafileHeaderFromFile(string filename, IntPtr header);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetMetafileHeaderFromStream(IntPtr stream, IntPtr header);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetMetafileHeaderFromMetafile(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef metafile, IntPtr header);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetHemfFromMetafile(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef metafile, out IntPtr hEnhMetafile);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateMetafileFromStream(IntPtr stream, IntPtr* metafile);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipRecordMetafileStream(IntPtr stream, IntPtr referenceHdc, EmfType emfType, RectangleF* frameRect, MetafileFrameUnit frameUnit, string? description, IntPtr* metafile);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipRecordMetafileStream(IntPtr stream, IntPtr referenceHdc, EmfType emfType, IntPtr pframeRect, MetafileFrameUnit frameUnit, string? description, IntPtr* metafile);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipRecordMetafileStreamI(IntPtr stream, IntPtr referenceHdc, EmfType emfType, Rectangle* frameRect, MetafileFrameUnit frameUnit, string? description, IntPtr* metafile);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipComment(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, int sizeData, byte[] data);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateFontFromLogfontW(IntPtr hdc, ref Interop.User32.LOGFONT lf, out IntPtr font);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateBitmapFromStream(IntPtr stream, IntPtr* bitmap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateBitmapFromStreamICM(IntPtr stream, IntPtr* bitmap);
         }
     }
index 8919863..fcc8636 100644 (file)
@@ -18,97 +18,97 @@ namespace System.Drawing
         internal static unsafe partial class Gdip
         {
             // Shared function imports (all platforms)
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipBeginContainer(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, ref RectangleF dstRect, ref RectangleF srcRect, GraphicsUnit unit, out int state);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipBeginContainer2(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out int state);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipBeginContainerI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, ref Rectangle dstRect, ref Rectangle srcRect, GraphicsUnit unit, out int state);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipEndContainer(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, int state);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateAdjustableArrowCap(float height, float width, [MarshalAs(UnmanagedType.Bool)] bool isFilled, out IntPtr adjustableArrowCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetAdjustableArrowCapHeight(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef adjustableArrowCap, out float height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetAdjustableArrowCapHeight(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef adjustableArrowCap, float height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetAdjustableArrowCapWidth(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef adjustableArrowCap, float width);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetAdjustableArrowCapWidth(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef adjustableArrowCap, out float width);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetAdjustableArrowCapMiddleInset(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef adjustableArrowCap, float middleInset);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetAdjustableArrowCapMiddleInset(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef adjustableArrowCap, out float middleInset);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetAdjustableArrowCapFillState(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef adjustableArrowCap, [MarshalAs(UnmanagedType.Bool)] bool fillState);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetAdjustableArrowCapFillState(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef adjustableArrowCap, [MarshalAs(UnmanagedType.Bool)] out bool fillState);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetCustomLineCapType(IntPtr customCap, out CustomLineCapType capType);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateCustomLineCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -119,115 +119,115 @@ namespace System.Drawing
 #endif
             HandleRef strokepath, LineCap baseCap, float baseInset, out IntPtr customCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeleteCustomLineCap(IntPtr customCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeleteCustomLineCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef customCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCloneCustomLineCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef customCap, out IntPtr clonedCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetCustomLineCapStrokeCaps(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef customCap, LineCap startCap, LineCap endCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetCustomLineCapStrokeCaps(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef customCap, out LineCap startCap, out LineCap endCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetCustomLineCapStrokeJoin(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef customCap, LineJoin lineJoin);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetCustomLineCapStrokeJoin(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef customCap, out LineJoin lineJoin);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetCustomLineCapBaseCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef customCap, LineCap baseCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetCustomLineCapBaseCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef customCap, out LineCap baseCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetCustomLineCapBaseInset(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef customCap, float inset);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetCustomLineCapBaseInset(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef customCap, out float inset);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetCustomLineCapWidthScale(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef customCap, float widthScale);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetCustomLineCapWidthScale(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef customCap, out float widthScale);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreatePathIter(out IntPtr pathIter,
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeletePathIter(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pathIter);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPathIterNextSubpath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pathIter, out int resultCount, out int startIndex, out int endIndex, [MarshalAs(UnmanagedType.Bool)] out bool isClosed);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPathIterNextSubpathPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -238,21 +238,21 @@ namespace System.Drawing
 #endif
             HandleRef path, [MarshalAs(UnmanagedType.Bool)] out bool isClosed);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPathIterNextPathType(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pathIter, out int resultCount, out byte pathType, out int startIndex, out int endIndex);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPathIterNextMarker(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pathIter, out int resultCount, out int startIndex, out int endIndex);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPathIterNextMarkerPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -263,210 +263,210 @@ namespace System.Drawing
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPathIterGetCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pathIter, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPathIterGetSubpathCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pathIter, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPathIterHasCurve(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pathIter, [MarshalAs(UnmanagedType.Bool)] out bool hasCurve);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPathIterRewind(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pathIter);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPathIterEnumerate(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pathIter, out int resultCount, PointF* points, byte* types, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPathIterCopyData(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pathIter, out int resultCount, PointF* points, byte* types, int startIndex, int endIndex);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateHatchBrush(int hatchstyle, int forecol, int backcol, out IntPtr brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetHatchStyle(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int hatchstyle);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetHatchForegroundColor(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int forecol);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetHatchBackgroundColor(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int backcol);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCloneBrush(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out IntPtr clonebrush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateLineBrush(ref PointF point1, ref PointF point2, int color1, int color2, WrapMode wrapMode, out IntPtr lineGradient);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateLineBrushI(ref Point point1, ref Point point2, int color1, int color2, WrapMode wrapMode, out IntPtr lineGradient);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateLineBrushFromRect(ref RectangleF rect, int color1, int color2, LinearGradientMode lineGradientMode, WrapMode wrapMode, out IntPtr lineGradient);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateLineBrushFromRectI(ref Rectangle rect, int color1, int color2, LinearGradientMode lineGradientMode, WrapMode wrapMode, out IntPtr lineGradient);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateLineBrushFromRectWithAngle(ref RectangleF rect, int color1, int color2, float angle, [MarshalAs(UnmanagedType.Bool)] bool isAngleScaleable, WrapMode wrapMode, out IntPtr lineGradient);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateLineBrushFromRectWithAngleI(ref Rectangle rect, int color1, int color2, float angle, [MarshalAs(UnmanagedType.Bool)] bool isAngleScaleable, WrapMode wrapMode, out IntPtr lineGradient);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetLineColors(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, int color1, int color2);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetLineColors(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, int[] colors);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetLineRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out RectangleF gprectf);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetLineGammaCorrection(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, [MarshalAs(UnmanagedType.Bool)] out bool useGammaCorrection);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetLineGammaCorrection(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, [MarshalAs(UnmanagedType.Bool)] bool useGammaCorrection);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetLineSigmaBlend(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float focus, float scale);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetLineLinearBlend(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float focus, float scale);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetLineBlendCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetLineBlend(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, IntPtr blend, IntPtr positions, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetLineBlend(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, IntPtr blend, IntPtr positions, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetLinePresetBlendCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetLinePresetBlend(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, IntPtr blend, IntPtr positions, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetLinePresetBlend(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, IntPtr blend, IntPtr positions, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetLineWrapMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, int wrapMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetLineWrapMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int wrapMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipResetLineTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipMultiplyLineTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -477,7 +477,7 @@ namespace System.Drawing
 #endif
             HandleRef matrix, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetLineTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -488,7 +488,7 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetLineTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -499,174 +499,174 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTranslateLineTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float dx, float dy, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipScaleLineTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float sx, float sy, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipRotateLineTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float angle, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreatePathGradient(PointF* points, int count, WrapMode wrapMode, out IntPtr brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreatePathGradientI(Point* points, int count, WrapMode wrapMode, out IntPtr brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreatePathGradientFromPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, out IntPtr brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientCenterColor(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int color);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathGradientCenterColor(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, int color);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientSurroundColorsWithCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, int[] color, ref int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathGradientSurroundColorsWithCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, int[] argb, ref int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientCenterPoint(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out PointF point);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathGradientCenterPoint(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, ref PointF point);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out RectangleF gprectf);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientPointCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientSurroundColorCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientBlendCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientBlend(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float[] blend, float[] positions, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathGradientBlend(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, IntPtr blend, IntPtr positions, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientPresetBlendCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientPresetBlend(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, int[] blend, float[] positions, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathGradientPresetBlend(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, int[] blend, float[] positions, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathGradientSigmaBlend(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float focus, float scale);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathGradientLinearBlend(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float focus, float scale);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathGradientWrapMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, int wrapmode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientWrapMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int wrapmode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathGradientTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -677,7 +677,7 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -688,14 +688,14 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipResetPathGradientTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipMultiplyPathGradientTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -706,59 +706,59 @@ namespace System.Drawing
 #endif
             HandleRef matrix, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTranslatePathGradientTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float dx, float dy, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipScalePathGradientTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float sx, float sy, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipRotatePathGradientTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float angle, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPathGradientFocusScales(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float[] xScale, float[] yScale);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPathGradientFocusScales(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float xScale, float yScale);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateImageAttributes(out IntPtr imageattr);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCloneImageAttributes(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef imageattr, out IntPtr cloneImageattr);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDisposeImageAttributes(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef imageattr);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetImageAttributesColorMatrix(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -773,92 +773,92 @@ namespace System.Drawing
 #endif
             ColorMatrix? grayMatrix, ColorMatrixFlag flags);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetImageAttributesThreshold(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, float threshold);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetImageAttributesGamma(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, float gamma);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetImageAttributesNoOp(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetImageAttributesColorKeys(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, int colorLow, int colorHigh);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetImageAttributesOutputChannel(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, ColorChannelFlag flags);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipSetImageAttributesOutputChannelColorProfile(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, string colorProfileFilename);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetImageAttributesRemapTable(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef imageattr, ColorAdjustType type, [MarshalAs(UnmanagedType.Bool)] bool enableFlag, int mapSize, IntPtr map);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetImageAttributesWrapMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef imageattr, int wrapmode, int argb, [MarshalAs(UnmanagedType.Bool)] bool clamp);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageAttributesAdjustedPalette(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef imageattr, IntPtr palette, ColorAdjustType type);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageDecodersSize(out int numDecoders, out int size);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageDecoders(int numDecoders, int size, IntPtr decoders);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageEncodersSize(out int numEncoders, out int size);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageEncoders(int numEncoders, int size, IntPtr encoders);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateSolidFill(int color, out IntPtr brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetSolidFillColor(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, int color);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetSolidFillColor(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -866,21 +866,21 @@ namespace System.Drawing
             HandleRef brush, out int color);
 
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateTexture(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef bitmap, int wrapmode, out IntPtr texture);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateTexture2(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef bitmap, int wrapmode, float x, float y, float width, float height, out IntPtr texture);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateTextureIA(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -891,14 +891,14 @@ namespace System.Drawing
 #endif
             HandleRef imageAttrib, float x, float y, float width, float height, out IntPtr texture);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateTexture2I(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef bitmap, int wrapmode, int x, int y, int width, int height, out IntPtr texture);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateTextureIAI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -909,7 +909,7 @@ namespace System.Drawing
 #endif
             HandleRef imageAttrib, int x, int y, int width, int height, out IntPtr texture);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetTextureTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -920,7 +920,7 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetTextureTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -931,14 +931,14 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipResetTextureTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipMultiplyTextureTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -949,199 +949,199 @@ namespace System.Drawing
 #endif
             HandleRef matrix, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTranslateTextureTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float dx, float dy, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipScaleTextureTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float sx, float sy, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipRotateTextureTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float angle, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetTextureWrapMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, int wrapMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetTextureWrapMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out int wrapMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetTextureImage(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, out IntPtr image);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetFontCollectionFamilyCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef fontCollection, out int numFound);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetFontCollectionFamilyList(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef fontCollection, int numSought, IntPtr[] gpfamilies, out int numFound);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCloneFontFamily(IntPtr fontfamily, out IntPtr clonefontfamily);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipCreateFontFamilyFromName(string name,
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef fontCollection, out IntPtr FontFamily);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetGenericFontFamilySansSerif(out IntPtr fontfamily);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetGenericFontFamilySerif(out IntPtr fontfamily);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetGenericFontFamilyMonospace(out IntPtr fontfamily);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeleteFontFamily(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef fontFamily);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipGetFamilyName(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef family, char* name, int language);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsStyleAvailable(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef family, FontStyle style, out int isStyleAvailable);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetEmHeight(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef family, FontStyle style, out int EmHeight);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetCellAscent(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef family, FontStyle style, out int CellAscent);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetCellDescent(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef family, FontStyle style, out int CellDescent);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetLineSpacing(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef family, FontStyle style, out int LineSpaceing);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipNewInstalledFontCollection(out IntPtr fontCollection);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipNewPrivateFontCollection(out IntPtr fontCollection);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeletePrivateFontCollection(ref IntPtr fontCollection);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipPrivateAddFontFile(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef fontCollection, string filename);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPrivateAddMemoryFont(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef fontCollection, IntPtr memory, int length);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateFont(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef fontFamily, float emSize, FontStyle style, GraphicsUnit unit, out IntPtr font);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateFontFromDC(IntPtr hdc, ref IntPtr font);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCloneFont(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef font, out IntPtr cloneFont);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeleteFont(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef font);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetFamily(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef font, out IntPtr family);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetFontStyle(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef font, out FontStyle style);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetFontSize(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef font, out float size);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetFontHeight(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1152,21 +1152,21 @@ namespace System.Drawing
 #endif
             HandleRef graphics, out float size);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetFontHeightGivenDPI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef font, float dpi, out float size);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetFontUnit(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef font, out GraphicsUnit unit);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetLogFontW(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1177,122 +1177,122 @@ namespace System.Drawing
 #endif
             HandleRef graphics, ref Interop.User32.LOGFONT lf);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreatePen1(int argb, float width, int unit, out IntPtr pen);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreatePen2(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float width, int unit, out IntPtr pen);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipClonePen(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out IntPtr clonepen);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeletePen(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef Pen);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, PenAlignment penAlign);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out PenAlignment penAlign);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenWidth(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, float width);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenWidth(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, float[] width);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenLineCap197819(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, int startCap, int endCap, int dashCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenStartCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, int startCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenEndCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, int endCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenStartCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out int startCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenEndCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out int endCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenDashCap197819(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out int dashCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenDashCap197819(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, int dashCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenLineJoin(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, int lineJoin);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenLineJoin(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out int lineJoin);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenCustomStartCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1303,14 +1303,14 @@ namespace System.Drawing
 #endif
             HandleRef customCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenCustomStartCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out IntPtr customCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenCustomEndCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1321,28 +1321,28 @@ namespace System.Drawing
 #endif
             HandleRef customCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenCustomEndCap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out IntPtr customCap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenMiterLimit(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, float miterLimit);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenMiterLimit(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, float[] miterLimit);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1353,7 +1353,7 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1364,14 +1364,14 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipResetPenTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipMultiplyPenTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1382,42 +1382,42 @@ namespace System.Drawing
 #endif
             HandleRef matrix, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTranslatePenTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float dx, float dy, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipScalePenTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float sx, float sy, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipRotatePenTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef brush, float angle, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenColor(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, int argb);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenColor(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out int argb);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenBrushFill(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1428,35 +1428,35 @@ namespace System.Drawing
 #endif
             HandleRef brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenBrushFill(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out IntPtr brush);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenFillType(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out int pentype);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenDashStyle(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out int dashstyle);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenDashStyle(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, int dashstyle);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenDashArray(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1467,56 +1467,56 @@ namespace System.Drawing
 #endif
             HandleRef memorydash, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenDashOffset(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, float[] dashoffset);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenDashOffset(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, float dashoffset);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenDashCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out int dashcount);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenDashArray(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, float[] memorydash, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenCompoundCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPenCompoundArray(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, float[] array, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPenCompoundArray(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef pen, float[] array, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetWorldTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1527,14 +1527,14 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipResetWorldTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipMultiplyWorldTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1545,28 +1545,28 @@ namespace System.Drawing
 #endif
             HandleRef matrix, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTranslateWorldTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, float dx, float dy, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipScaleWorldTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, float sx, float sy, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipRotateWorldTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, float angle, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetWorldTransform(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1577,194 +1577,194 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetCompositingMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, CompositingMode compositingMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetTextRenderingHint(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, TextRenderingHint textRenderingHint);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetTextContrast(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, int textContrast);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetInterpolationMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, InterpolationMode interpolationMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetCompositingMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out CompositingMode compositingMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetRenderingOrigin(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, int x, int y);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetRenderingOrigin(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out int x, out int y);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetCompositingQuality(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, CompositingQuality quality);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetCompositingQuality(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out CompositingQuality quality);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetSmoothingMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, SmoothingMode smoothingMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetSmoothingMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out SmoothingMode smoothingMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPixelOffsetMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, PixelOffsetMode pixelOffsetMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPixelOffsetMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out PixelOffsetMode pixelOffsetMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetTextRenderingHint(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out TextRenderingHint textRenderingHint);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetTextContrast(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out int textContrast);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetInterpolationMode(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out InterpolationMode interpolationMode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPageUnit(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out GraphicsUnit unit);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPageScale(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out float scale);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPageUnit(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, GraphicsUnit unit);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPageScale(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, float scale);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetDpiX(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out float dpi);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetDpiY(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out float dpi);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateMatrix(out IntPtr matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateMatrix2(float m11, float m12, float m21, float m22, float dx, float dy, out IntPtr matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateMatrix3(ref RectangleF rect, PointF* dstplg, out IntPtr matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateMatrix3I(ref Rectangle rect, Point* dstplg, out IntPtr matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCloneMatrix(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, out IntPtr cloneMatrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeleteMatrix(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetMatrixElements(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, float m11, float m12, float m21, float m22, float dx, float dy);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipMultiplyMatrix(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1775,91 +1775,91 @@ namespace System.Drawing
 #endif
             HandleRef matrix2, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTranslateMatrix(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, float offsetX, float offsetY, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipScaleMatrix(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, float scaleX, float scaleY, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipRotateMatrix(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, float angle, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipShearMatrix(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, float shearX, float shearY, MatrixOrder order);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipInvertMatrix(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTransformMatrixPoints(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, PointF* pts, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTransformMatrixPointsI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, Point* pts, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipVectorTransformMatrixPoints(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, PointF* pts, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipVectorTransformMatrixPointsI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, Point* pts, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static unsafe partial int GdipGetMatrixElements(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, float* m);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsMatrixInvertible(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, out int boolean);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsMatrixIdentity(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef matrix, out int boolean);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsMatrixEqual(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1870,43 +1870,43 @@ namespace System.Drawing
 #endif
             HandleRef matrix2, out int boolean);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateRegion(out IntPtr region);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateRegionRect(ref RectangleF gprectf, out IntPtr region);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateRegionRectI(ref Rectangle gprect, out IntPtr region);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateRegionPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef path, out IntPtr region);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateRegionRgnData(byte[] rgndata, int size, out IntPtr region);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateRegionHrgn(IntPtr hRgn, out IntPtr region);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCloneRegion(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef region, out IntPtr cloneregion);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeleteRegion(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef region);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillRegion(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1921,35 +1921,35 @@ namespace System.Drawing
 #endif
             HandleRef region);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetInfinite(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef region);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetEmpty(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef region);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCombineRegionRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef region, ref RectangleF gprectf, CombineMode mode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCombineRegionRectI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef region, ref Rectangle gprect, CombineMode mode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCombineRegionPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1960,7 +1960,7 @@ namespace System.Drawing
 #endif
             HandleRef path, CombineMode mode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCombineRegionRegion(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1971,21 +1971,21 @@ namespace System.Drawing
 #endif
             HandleRef region2, CombineMode mode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTranslateRegion(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef region, float dx, float dy);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTranslateRegionI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef region, int dx, int dy);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTransformRegion(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -1996,7 +1996,7 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetRegionBounds(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2007,7 +2007,7 @@ namespace System.Drawing
 #endif
             HandleRef graphics, out RectangleF gprectf);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetRegionHRgn(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2018,7 +2018,7 @@ namespace System.Drawing
 #endif
             HandleRef graphics, out IntPtr hrgn);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsEmptyRegion(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2029,7 +2029,7 @@ namespace System.Drawing
 #endif
             HandleRef graphics, out int boolean);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsInfiniteRegion(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2040,7 +2040,7 @@ namespace System.Drawing
 #endif
             HandleRef graphics, out int boolean);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsEqualRegion(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2055,21 +2055,21 @@ namespace System.Drawing
 #endif
             HandleRef graphics, out int boolean);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetRegionDataSize(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef region, out int bufferSize);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetRegionData(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef region, byte[] regionData, int bufferSize, out int sizeFilled);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisibleRegionPoint(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2080,7 +2080,7 @@ namespace System.Drawing
 #endif
             HandleRef graphics, out int boolean);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisibleRegionPointI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2091,7 +2091,7 @@ namespace System.Drawing
 #endif
             HandleRef graphics, out int boolean);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisibleRegionRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2102,7 +2102,7 @@ namespace System.Drawing
 #endif
             HandleRef graphics, out int boolean);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisibleRegionRectI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2113,7 +2113,7 @@ namespace System.Drawing
 #endif
             HandleRef graphics, out int boolean);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetRegionScansCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2124,7 +2124,7 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetRegionScans(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2135,10 +2135,10 @@ namespace System.Drawing
 #endif
             HandleRef matrix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateFromHDC(IntPtr hdc, out IntPtr graphics);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetClipGraphics(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2149,21 +2149,21 @@ namespace System.Drawing
 #endif
             HandleRef srcgraphics, CombineMode mode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetClipRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, float x, float y, float width, float height, CombineMode mode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetClipRectI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, int x, int y, int width, int height, CombineMode mode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetClipPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2174,7 +2174,7 @@ namespace System.Drawing
 #endif
             HandleRef path, CombineMode mode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetClipRegion(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2185,21 +2185,21 @@ namespace System.Drawing
 #endif
             HandleRef region, CombineMode mode);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipResetClip(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTranslateClip(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, float dx, float dy);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetClip(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2210,425 +2210,425 @@ namespace System.Drawing
 #endif
             HandleRef region);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetClipBounds(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out RectangleF rect);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsClipEmpty(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetVisibleClipBounds(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out RectangleF rect);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisibleClipEmpty(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisiblePoint(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, float x, float y, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisiblePointI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, int x, int y, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisibleRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, float x, float y, float width, float height, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipIsVisibleRectI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, int x, int y, int width, int height, [MarshalAs(UnmanagedType.Bool)] out bool result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipFlush(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, FlushIntention intention);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetDC(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out IntPtr hdc);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetStringFormatMeasurableCharacterRanges(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, int rangeCount, CharacterRange[] range);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateStringFormat(StringFormatFlags options, int language, out IntPtr format);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipStringFormatGetGenericDefault(out IntPtr format);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipStringFormatGetGenericTypographic(out IntPtr format);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDeleteStringFormat(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCloneStringFormat(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, out IntPtr newFormat);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetStringFormatFlags(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, StringFormatFlags options);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetStringFormatFlags(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, out StringFormatFlags result);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetStringFormatAlign(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, StringAlignment align);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetStringFormatAlign(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, out StringAlignment align);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetStringFormatLineAlign(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, StringAlignment align);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetStringFormatLineAlign(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, out StringAlignment align);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetStringFormatHotkeyPrefix(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, HotkeyPrefix hotkeyPrefix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetStringFormatHotkeyPrefix(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, out HotkeyPrefix hotkeyPrefix);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetStringFormatTabStops(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, float firstTabOffset, int count, float[] tabStops);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetStringFormatTabStops(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, int count, out float firstTabOffset, float[] tabStops);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetStringFormatTabStopCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetStringFormatMeasurableCharacterRangeCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetStringFormatTrimming(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, StringTrimming trimming);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetStringFormatTrimming(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, out StringTrimming trimming);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetStringFormatDigitSubstitution(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, int langID, StringDigitSubstitute sds);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetStringFormatDigitSubstitution(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef format, out int langID, out StringDigitSubstitute sds);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageDimension(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out float width, out float height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageWidth(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out int width);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageHeight(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out int height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageHorizontalResolution(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out float horzRes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageVerticalResolution(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out float vertRes);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageFlags(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out int flags);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageRawFormat(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, ref Guid format);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImagePixelFormat(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out PixelFormat format);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipImageGetFrameCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, ref Guid dimensionID, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipImageSelectActiveFrame(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, ref Guid dimensionID, int frameIndex);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipImageRotateFlip(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, int rotateFlipType);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetAllPropertyItems(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, uint totalBufferSize, uint numProperties, PropertyItemInternal* allItems);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPropertyCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out uint numOfProperty);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPropertyIdList(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, uint numOfProperty, int* list);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPropertyItem(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, int propid, uint propSize, PropertyItemInternal* buffer);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPropertyItemSize(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, int propid, out uint size);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetPropertySize(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out uint totalBufferSize, out uint numProperties);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipRemovePropertyItem(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, int propid);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSetPropertyItem(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, PropertyItemInternal* item);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageType(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out int type);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetImageType(IntPtr image, out int type);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDisposeImage(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipDisposeImage(IntPtr image);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipCreateBitmapFromFile(string filename, out IntPtr bitmap);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipCreateBitmapFromFileICM(string filename, out IntPtr bitmap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateBitmapFromScan0(int width, int height, int stride, int format, IntPtr scan0, out IntPtr bitmap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateBitmapFromGraphics(int width, int height,
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out IntPtr bitmap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateBitmapFromHBITMAP(IntPtr hbitmap, IntPtr hpalette, out IntPtr bitmap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateBitmapFromHICON(IntPtr hicon, out IntPtr bitmap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateBitmapFromResource(IntPtr hresource, IntPtr name, out IntPtr bitmap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateHBITMAPFromBitmap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef nativeBitmap, out IntPtr hbitmap, int argbBackground);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateHICONFromBitmap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef nativeBitmap, out IntPtr hicon);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCloneBitmapArea(float x, float y, float width, float height, int format,
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef srcbitmap, out IntPtr dstbitmap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCloneBitmapAreaI(int x, int y, int width, int height, int format,
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef srcbitmap, out IntPtr dstbitmap);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipBitmapLockBits(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2639,7 +2639,7 @@ namespace System.Drawing
 #endif
             BitmapData lockedBitmapData);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipBitmapUnlockBits(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2650,87 +2650,87 @@ namespace System.Drawing
 #endif
             BitmapData lockedBitmapData);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipBitmapGetPixel(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef bitmap, int x, int y, out int argb);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipBitmapSetPixel(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef bitmap, int x, int y, int argb);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipBitmapSetResolution(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef bitmap, float dpix, float dpiy);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipImageGetFrameDimensionsCount(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, out int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipImageGetFrameDimensionsList(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, Guid* dimensionIDs, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateMetafileFromEmf(IntPtr hEnhMetafile, [MarshalAs(UnmanagedType.Bool)] bool deleteEmf, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipCreateMetafileFromWmf(IntPtr hMetafile, [MarshalAs(UnmanagedType.Bool)] bool deleteWmf,
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(WmfPlaceableFileHeader.PinningMarshaller))]
 #endif
                 WmfPlaceableFileHeader wmfplacealbeHeader, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipCreateMetafileFromFile(string file, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipRecordMetafile(IntPtr referenceHdc, EmfType emfType, IntPtr pframeRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipRecordMetafile(IntPtr referenceHdc, EmfType emfType, ref RectangleF frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipRecordMetafileI(IntPtr referenceHdc, EmfType emfType, ref Rectangle frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipRecordMetafileFileName(string fileName, IntPtr referenceHdc, EmfType emfType, ref RectangleF frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipRecordMetafileFileName(string fileName, IntPtr referenceHdc, EmfType emfType, IntPtr pframeRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipRecordMetafileFileNameI(string fileName, IntPtr referenceHdc, EmfType emfType, ref Rectangle frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipPlayMetafileRecord(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef metafile, EmfPlusRecordType recordType, int flags, int dataSize, byte[] data);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipSaveGraphics(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, out int state);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawArc(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2741,7 +2741,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, float x, float y, float width, float height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawArcI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2752,7 +2752,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawLinesI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2763,7 +2763,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawBezier(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2774,7 +2774,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawEllipse(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2785,7 +2785,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, float x, float y, float width, float height);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawEllipseI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2796,7 +2796,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, int x, int y, int width, int height);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawLine(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2807,7 +2807,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, float x1, float y1, float x2, float y2);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawLineI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2818,7 +2818,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, int x1, int y1, int x2, int y2);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawLines(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2829,7 +2829,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawPath(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2844,7 +2844,7 @@ namespace System.Drawing
 #endif
             HandleRef path);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawPie(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2855,7 +2855,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, float x, float y, float width, float height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawPieI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2866,7 +2866,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawPolygon(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2877,7 +2877,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawPolygonI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2888,7 +2888,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillEllipse(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2899,7 +2899,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, float x, float y, float width, float height);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillEllipseI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2910,7 +2910,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, int x, int y, int width, int height);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillPolygon(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2921,7 +2921,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, PointF* points, int count, FillMode brushMode);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillPolygonI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2932,7 +2932,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, Point* points, int count, FillMode brushMode);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillRectangle(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2943,7 +2943,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, float x, float y, float width, float height);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillRectangleI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2954,7 +2954,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, int x, int y, int width, int height);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillRectangles(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2965,7 +2965,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, RectangleF* rects, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillRectanglesI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2976,7 +2976,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, Rectangle* rects, int count);
 
-            [GeneratedDllImport(LibraryName,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName,  SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipDrawString(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -2995,7 +2995,7 @@ namespace System.Drawing
 #endif
             HandleRef brush);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawImageRectI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3006,14 +3006,14 @@ namespace System.Drawing
 #endif
             HandleRef image, int x, int y, int width, int height);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGraphicsClear(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, int argb);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawClosedCurve(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3024,7 +3024,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawClosedCurveI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3035,7 +3035,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawClosedCurve2(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3046,7 +3046,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, PointF* points, int count, float tension);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawClosedCurve2I(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3057,7 +3057,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, Point* points, int count, float tension);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawCurve(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3068,7 +3068,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawCurveI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3079,7 +3079,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawCurve2(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3090,7 +3090,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, PointF* points, int count, float tension);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawCurve2I(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3101,7 +3101,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, Point* points, int count, float tension);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawCurve3(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3112,7 +3112,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, PointF* points, int count, int offset, int numberOfSegments, float tension);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawCurve3I(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3123,7 +3123,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, Point* points, int count, int offset, int numberOfSegments, float tension);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillClosedCurve(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3134,7 +3134,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillClosedCurveI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3145,7 +3145,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillClosedCurve2(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3156,7 +3156,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, PointF* points, int count, float tension, FillMode mode);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillClosedCurve2I(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3167,7 +3167,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, Point* points, int count, float tension, FillMode mode);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillPie(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3178,7 +3178,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, float x, float y, float width, float height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipFillPieI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3189,7 +3189,7 @@ namespace System.Drawing
 #endif
             HandleRef brush, int x, int y, int width, int height, float startAngle, float sweepAngle);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipMeasureString(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3204,7 +3204,7 @@ namespace System.Drawing
 #endif
             HandleRef stringFormat, ref RectangleF boundingBox, out int codepointsFitted, out int linesFilled);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipMeasureCharacterRanges(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3219,7 +3219,7 @@ namespace System.Drawing
 #endif
             HandleRef stringFormat, int characterCount, IntPtr[] region);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawImageI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3230,7 +3230,7 @@ namespace System.Drawing
 #endif
             HandleRef image, int x, int y);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawImage(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3241,7 +3241,7 @@ namespace System.Drawing
 #endif
             HandleRef image, float x, float y);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawImagePoints(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3252,7 +3252,7 @@ namespace System.Drawing
 #endif
             HandleRef image, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawImagePointsI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3263,7 +3263,7 @@ namespace System.Drawing
 #endif
             HandleRef image, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawImageRectRectI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3282,7 +3282,7 @@ namespace System.Drawing
 #endif
             HandleRef callbackdata);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawImagePointsRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3301,7 +3301,7 @@ namespace System.Drawing
 #endif
             HandleRef callbackdata);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawImageRectRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3320,7 +3320,7 @@ namespace System.Drawing
 #endif
             HandleRef callbackdata);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawImagePointsRectI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3339,7 +3339,7 @@ namespace System.Drawing
 #endif
             HandleRef callbackdata);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawImageRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3350,7 +3350,7 @@ namespace System.Drawing
 #endif
             HandleRef image, float x, float y, float width, float height);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawImagePointRect(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3361,7 +3361,7 @@ namespace System.Drawing
 #endif
             HandleRef image, float x, float y, float srcx, float srcy, float srcwidth, float srcheight, int srcunit);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawImagePointRectI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3372,7 +3372,7 @@ namespace System.Drawing
 #endif
             HandleRef image, int x, int y, int srcx, int srcy, int srcwidth, int srcheight, int srcunit);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawRectangle(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3383,7 +3383,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, float x, float y, float width, float height);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawRectangleI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3394,7 +3394,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, int x, int y, int width, int height);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawRectangles(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3405,7 +3405,7 @@ namespace System.Drawing
 #endif
             HandleRef pen, RectangleF* rects, int count);
 
-            [GeneratedDllImport(LibraryName, SetLastError = true)]
+            [LibraryImport(LibraryName, SetLastError = true)]
             internal static partial int GdipDrawRectanglesI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -3416,34 +3416,34 @@ namespace System.Drawing
 #endif
             HandleRef pen, Rectangle* rects, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTransformPoints(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, int destSpace, int srcSpace, PointF* points, int count);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipTransformPointsI(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef graphics, int destSpace, int srcSpace, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipLoadImageFromFileICM(string filename, out IntPtr image);
 
-            [GeneratedDllImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(LibraryName, StringMarshalling = StringMarshalling.Utf16)]
             internal static partial int GdipLoadImageFromFile(string filename, out IntPtr image);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetEncoderParameterListSize(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef image, ref Guid encoder, out int size);
 
-            [GeneratedDllImport(LibraryName)]
+            [LibraryImport(LibraryName)]
             internal static partial int GdipGetEncoderParameterList(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
index 0f77c8b..caf7f18 100644 (file)
@@ -61,7 +61,7 @@ namespace System.Drawing
             }
         }
 
-        [GeneratedDllImport(Interop.Libraries.Oleaut32)]
+        [LibraryImport(Interop.Libraries.Oleaut32)]
         private static unsafe partial int OleCreatePictureIndirect(PICTDESC* pictdesc, Guid* refiid, int fOwn, IntPtr* lplpvObj);
 
         [StructLayout(LayoutKind.Sequential)]
index 43effde..aa78cd0 100644 (file)
@@ -46,7 +46,7 @@ namespace System.Drawing
             }
         }
 
-        [GeneratedDllImport(Interop.Libraries.Oleaut32, PreserveSig = false)]
+        [LibraryImport(Interop.Libraries.Oleaut32, PreserveSig = false)]
         internal static partial IntPtr OleCreatePictureIndirect(in PICTDESC pictdesc, in Guid refiid, bool fOwn);
 
         [ComImport]
index 0727247..ffd594d 100644 (file)
@@ -10,40 +10,40 @@ namespace System.Drawing
     internal static partial class LibX11Functions
     {
         // Some special X11 stuff
-        [GeneratedDllImport("libX11", EntryPoint = "XOpenDisplay")]
+        [LibraryImport("libX11", EntryPoint = "XOpenDisplay")]
         internal static partial IntPtr XOpenDisplay(IntPtr display);
 
-        [GeneratedDllImport("libX11", EntryPoint = "XCloseDisplay")]
+        [LibraryImport("libX11", EntryPoint = "XCloseDisplay")]
         internal static partial int XCloseDisplay(IntPtr display);
 
-        [GeneratedDllImport("libX11", EntryPoint = "XRootWindow")]
+        [LibraryImport("libX11", EntryPoint = "XRootWindow")]
         internal static partial IntPtr XRootWindow(IntPtr display, int screen);
 
-        [GeneratedDllImport("libX11", EntryPoint = "XDefaultScreen")]
+        [LibraryImport("libX11", EntryPoint = "XDefaultScreen")]
         internal static partial int XDefaultScreen(IntPtr display);
 
-        [GeneratedDllImport("libX11", EntryPoint = "XDefaultDepth")]
+        [LibraryImport("libX11", EntryPoint = "XDefaultDepth")]
         internal static partial uint XDefaultDepth(IntPtr display, int screen);
 
-        [GeneratedDllImport("libX11", EntryPoint = "XGetImage")]
+        [LibraryImport("libX11", EntryPoint = "XGetImage")]
         internal static partial IntPtr XGetImage(IntPtr display, IntPtr drawable, int src_x, int src_y, int width, int height, int pane, int format);
 
-        [GeneratedDllImport("libX11", EntryPoint = "XGetPixel")]
+        [LibraryImport("libX11", EntryPoint = "XGetPixel")]
         internal static partial int XGetPixel(IntPtr image, int x, int y);
 
-        [GeneratedDllImport("libX11", EntryPoint = "XDestroyImage")]
+        [LibraryImport("libX11", EntryPoint = "XDestroyImage")]
         internal static partial int XDestroyImage(IntPtr image);
 
-        [GeneratedDllImport("libX11", EntryPoint = "XDefaultVisual")]
+        [LibraryImport("libX11", EntryPoint = "XDefaultVisual")]
         internal static partial IntPtr XDefaultVisual(IntPtr display, int screen);
 
-        [GeneratedDllImport("libX11", EntryPoint = "XGetVisualInfo")]
+        [LibraryImport("libX11", EntryPoint = "XGetVisualInfo")]
         internal static partial IntPtr XGetVisualInfo(IntPtr display, int vinfo_mask, ref XVisualInfo vinfo_template, ref int nitems);
 
-        [GeneratedDllImport("libX11", EntryPoint = "XVisualIDFromVisual")]
+        [LibraryImport("libX11", EntryPoint = "XVisualIDFromVisual")]
         internal static partial IntPtr XVisualIDFromVisual(IntPtr visual);
 
-        [GeneratedDllImport("libX11", EntryPoint = "XFree")]
+        [LibraryImport("libX11", EntryPoint = "XFree")]
         internal static partial void XFree(IntPtr data);
     }
 
index 6052738..463d105 100644 (file)
@@ -26,19 +26,19 @@ namespace System.Drawing.Printing
             return lib;
         }
 
-        [GeneratedDllImport(LibraryName)]
+        [LibraryImport(LibraryName)]
         internal static partial int cupsGetDests(ref IntPtr dests);
 
-        [GeneratedDllImport(LibraryName)]
+        [LibraryImport(LibraryName)]
         internal static partial void cupsFreeDests(int num_dests, IntPtr dests);
 
-        [GeneratedDllImport(LibraryName)]
+        [LibraryImport(LibraryName)]
         internal static partial IntPtr cupsTempFd(sbyte[] sb, int len);
 
-        [GeneratedDllImport(LibraryName)]
+        [LibraryImport(LibraryName)]
         internal static partial IntPtr cupsGetDefault();
 
-        [GeneratedDllImport(LibraryName)]
+        [LibraryImport(LibraryName)]
         internal static partial int cupsPrintFile(
             [MarshalAs(UnmanagedType.LPUTF8Str)] string printer,
             [MarshalAs(UnmanagedType.LPUTF8Str)] string filename,
@@ -46,22 +46,22 @@ namespace System.Drawing.Printing
             int num_options,
             IntPtr options);
 
-        [GeneratedDllImport(LibraryName)]
+        [LibraryImport(LibraryName)]
         internal static partial IntPtr cupsGetPPD([MarshalAs(UnmanagedType.LPUTF8Str)] string printer);
 
-        [GeneratedDllImport(LibraryName)]
+        [LibraryImport(LibraryName)]
         internal static partial IntPtr ppdOpenFile([MarshalAs(UnmanagedType.LPUTF8Str)] string filename);
 
-        [GeneratedDllImport(LibraryName)]
+        [LibraryImport(LibraryName)]
         internal static partial IntPtr ppdFindOption(IntPtr ppd_file, [MarshalAs(UnmanagedType.LPUTF8Str)] string keyword);
 
-        [GeneratedDllImport(LibraryName)]
+        [LibraryImport(LibraryName)]
         internal static partial void ppdClose(IntPtr ppd);
 
-        [GeneratedDllImport(LibraryName)]
+        [LibraryImport(LibraryName)]
         internal static partial int cupsParseOptions([MarshalAs(UnmanagedType.LPUTF8Str)] string arg, int number_of_options, ref IntPtr options);
 
-        [GeneratedDllImport(LibraryName)]
+        [LibraryImport(LibraryName)]
         internal static partial void cupsFreeOptions(int number_options, IntPtr options);
     }
 }
index e7f6405..df6a192 100644 (file)
@@ -151,83 +151,83 @@ namespace System.Drawing
         }
 
         #region Cocoa Methods
-        [GeneratedDllImport("libobjc.dylib", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport("libobjc.dylib", StringMarshalling = StringMarshalling.Utf8)]
         public static partial IntPtr objc_getClass(string className);
-        [GeneratedDllImport("libobjc.dylib", EntryPoint = "objc_msgSend")]
+        [LibraryImport("libobjc.dylib", EntryPoint = "objc_msgSend")]
         public static partial IntPtr intptr_objc_msgSend(IntPtr basePtr, IntPtr selector);
-        [GeneratedDllImport("libobjc.dylib", EntryPoint = "objc_msgSend_stret")]
+        [LibraryImport("libobjc.dylib", EntryPoint = "objc_msgSend_stret")]
         public static partial void Rect_objc_msgSend_stret(out Rect arect, IntPtr basePtr, IntPtr selector);
-        [GeneratedDllImport("libobjc.dylib", EntryPoint = "objc_msgSend")]
+        [LibraryImport("libobjc.dylib", EntryPoint = "objc_msgSend")]
         [return:MarshalAs(UnmanagedType.U1)]
         public static partial bool bool_objc_msgSend(IntPtr handle, IntPtr selector);
-        [GeneratedDllImport("libobjc.dylib", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport("libobjc.dylib", StringMarshalling = StringMarshalling.Utf8)]
         public static partial IntPtr sel_registerName(string selectorName);
         #endregion
 
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial IntPtr CGMainDisplayID();
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial Rect CGDisplayBounds(IntPtr display);
 
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial int HIViewGetBounds(IntPtr vHnd, ref Rect r);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial int HIViewConvertRect(ref Rect r, IntPtr a, IntPtr b);
 
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial IntPtr GetControlOwner(IntPtr aView);
 
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial int GetWindowBounds(IntPtr wHnd, uint reg, ref QDRect rect);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial IntPtr GetWindowPort(IntPtr hWnd);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial IntPtr GetQDGlobalsThePort();
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CreateCGContextForPort(IntPtr port, ref IntPtr context);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CFRelease(IntPtr context);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void QDBeginCGContext(IntPtr port, ref IntPtr context);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void QDEndCGContext(IntPtr port, ref IntPtr context);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial int CGContextClipToRect(IntPtr context, Rect clip);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial int CGContextClipToRects(IntPtr context, Rect[] clip_rects, int count);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextTranslateCTM(IntPtr context, float tx, float ty);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextScaleCTM(IntPtr context, float x, float y);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextFlush(IntPtr context);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextSynchronize(IntPtr context);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial IntPtr CGPathCreateMutable();
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGPathAddRects(IntPtr path, IntPtr _void, Rect[] rects, int count);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGPathAddRect(IntPtr path, IntPtr _void, Rect rect);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextAddRects(IntPtr context, Rect[] rects, int count);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextAddRect(IntPtr context, Rect rect);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextBeginPath(IntPtr context);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextClosePath(IntPtr context);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextAddPath(IntPtr context, IntPtr path);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextClip(IntPtr context);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextEOClip(IntPtr context);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextEOFillPath(IntPtr context);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextSaveGState(IntPtr context);
-        [GeneratedDllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+        [LibraryImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
         internal static partial void CGContextRestoreGState(IntPtr context);
     }
 
index def9a99..23f667c 100644 (file)
@@ -196,7 +196,7 @@ namespace System.IO.Compression.Tests
             return expectedPermissions;
         }
 
-        [GeneratedDllImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         private static partial int mkfifo(string path, int mode);
     }
 }
index 9fd5f1d..f4d2dd3 100644 (file)
@@ -10,7 +10,7 @@ namespace System.IO.Tests
     [ActiveIssue("https://github.com/dotnet/runtime/issues/34583", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
     public partial class Directory_NotifyFilter_Tests : FileSystemWatcherTest
     {
-        [GeneratedDllImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         private static partial uint SetSecurityInfoByHandle( string name, uint objectType, uint securityInformation,
             IntPtr owner, IntPtr group, IntPtr dacl, IntPtr sacl);
 
index e3f2c95..b706552 100644 (file)
@@ -12,7 +12,7 @@ namespace System.IO.Tests
     [ActiveIssue("https://github.com/dotnet/runtime/issues/34583", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
     public partial class File_NotifyFilter_Tests : FileSystemWatcherTest
     {
-        [GeneratedDllImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
         private static partial uint SetSecurityInfoByHandle(string name, uint objectType, uint securityInformation,
             IntPtr owner, IntPtr group, IntPtr dacl, IntPtr sacl);
 
index 011e4c1..213f215 100644 (file)
@@ -8,10 +8,10 @@ namespace System.IO.Tests
 {
     public abstract partial class FileSystemTest
     {
-        [GeneratedDllImport("libc", SetLastError = true)]
+        [LibraryImport("libc", SetLastError = true)]
         protected static partial int geteuid();
 
-        [GeneratedDllImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         protected static partial int mkfifo(string path, int mode);
     }
 }
index cd0c98c..8764766 100644 (file)
@@ -31,10 +31,10 @@ namespace System.IO.MemoryMappedFiles.Tests
             return pageSize;
         });
 
-        [GeneratedDllImport("libc", SetLastError = true)]
+        [LibraryImport("libc", SetLastError = true)]
         private static partial int sysconf(int name);
 
-        [GeneratedDllImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
+        [LibraryImport("libc", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
         protected static partial int mkfifo(string path, int mode);
 
         /// <summary>Asserts that the handle's inheritability matches the specified value.</summary>
index 018f7e1..d0dd22a 100644 (file)
@@ -20,13 +20,13 @@ namespace System.IO.MemoryMappedFiles.Tests
             return pageSize;
         });
 
-        [GeneratedDllImport("kernel32.dll")]
+        [LibraryImport("kernel32.dll")]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool GetHandleInformation(IntPtr hObject, out uint lpdwFlags);
 
         private const uint HANDLE_FLAG_INHERIT = 0x00000001;
 
-        [GeneratedDllImport("kernel32.dll")]
+        [LibraryImport("kernel32.dll")]
         private static partial void GetSystemInfo(out SYSTEM_INFO input);
 
         [StructLayout(LayoutKind.Sequential)]
index c91d060..6f75ed9 100644 (file)
@@ -66,7 +66,7 @@ namespace System.IO.MemoryMappedFiles.Tests
             Assert.NotNull(handle);
         }
 
-        [GeneratedDllImport("libc")]
+        [LibraryImport("libc")]
         private static unsafe partial SafeMemoryMappedViewHandle mmap(IntPtr addr, nint lengthint, int prot, int flags, int fd, nuint offset);
     }
 }
index efd2492..3cf2bcb 100644 (file)
       <!--
         Note that removing this attribute can change runtime behavior. For example,
         System.Xml.Serialization will behave differently if a ctor is Obsolete.
-        This is low enough risk on when 'System.AggressiveAttributeTrimming' is enabled to justify 
+        This is low enough risk on when 'System.AggressiveAttributeTrimming' is enabled to justify
         removing the attribute for size savings. The app developer can override this setting
         to keep all ObsoleteAttributes.
         -->
     <type fullname="System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute">
       <attribute internal="RemoveAttributeInstances" />
     </type>
-    <type fullname="System.Runtime.InteropServices.GeneratedDllImportAttribute">
+    <type fullname="System.Runtime.InteropServices.LibraryImportAttribute">
       <attribute internal="RemoveAttributeInstances" />
     </type>
     <type fullname="System.CodeDom.Compiler.GeneratedCodeAttribute">
index f6a1b15..7de4004 100644 (file)
@@ -38,11 +38,11 @@ namespace System.Diagnostics.Tracing
             return null;
         }
 
-        [GeneratedDllImport(RuntimeHelpers.QCall)]
+        [LibraryImport(RuntimeHelpers.QCall)]
         [return: MarshalAs(UnmanagedType.Bool)]
         private static partial bool IsEventSourceLoggingEnabled();
 
-        [GeneratedDllImport(RuntimeHelpers.QCall, StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(RuntimeHelpers.QCall, StringMarshalling = StringMarshalling.Utf16)]
         private static partial void LogEventSource(int eventID, string? eventName, string eventSourceName, string payload);
 
         private static readonly List<char> escape_seq = new List<char> { '\b', '\f', '\n', '\r', '\t', '\"', '\\' };
index 1470c03..5d2d29b 100644 (file)
@@ -47,9 +47,9 @@ namespace Microsoft.Interop.Analyzers
             context.RegisterCompilationStartAction(
                 compilationContext =>
                 {
-                    // Nothing to do if the GeneratedDllImportAttribute is not in the compilation
-                    INamedTypeSymbol? generatedDllImportAttrType = compilationContext.Compilation.GetTypeByMetadataName(TypeNames.GeneratedDllImportAttribute);
-                    if (generatedDllImportAttrType == null)
+                    // Nothing to do if the LibraryImportAttribute is not in the compilation
+                    INamedTypeSymbol? libraryImportAttrType = compilationContext.Compilation.GetTypeByMetadataName(TypeNames.LibraryImportAttribute);
+                    if (libraryImportAttrType == null)
                         return;
 
                     INamedTypeSymbol? marshalAsAttrType = compilationContext.Compilation.GetTypeByMetadataName(TypeNames.System_Runtime_InteropServices_MarshalAsAttribute);
@@ -77,11 +77,11 @@ namespace Microsoft.Interop.Analyzers
             if (dllImportData == null)
                 return;
 
-            // Ignore methods already marked GeneratedDllImport
+            // Ignore methods already marked LibraryImport
             // This can be the case when the generator creates an extern partial function for blittable signatures.
             foreach (AttributeData attr in method.GetAttributes())
             {
-                if (attr.AttributeClass?.ToDisplayString() == TypeNames.GeneratedDllImportAttribute)
+                if (attr.AttributeClass?.ToDisplayString() == TypeNames.LibraryImportAttribute)
                 {
                     return;
                 }
index cb21c8d..4a15fb9 100644 (file)
@@ -201,7 +201,7 @@ namespace Microsoft.Interop.Analyzers
                 return methodSyntax;
 
             // We wouldn't have offered this code fix if the LibraryImport type isn't available, so we can be sure it isn't null here.
-            INamedTypeSymbol generatedDllImportAttrType = editor.SemanticModel.Compilation.GetTypeByMetadataName(TypeNames.GeneratedDllImportAttribute)!;
+            INamedTypeSymbol libraryImportAttrType = editor.SemanticModel.Compilation.GetTypeByMetadataName(TypeNames.LibraryImportAttribute)!;
 
             // Make sure the method has the DllImportAttribute
             if (!TryGetAttribute(methodSymbol, dllImportAttrType, out AttributeData? dllImportAttr))
@@ -215,7 +215,7 @@ namespace Microsoft.Interop.Analyzers
                 generator,
                 dllImportSyntax,
                 methodSymbol,
-                generatedDllImportAttrType,
+                libraryImportAttrType,
                 entryPointSuffix,
                 out SyntaxNode? unmanagedCallConvAttributeMaybe);
 
@@ -436,7 +436,7 @@ namespace Microsoft.Interop.Analyzers
             SyntaxGenerator generator,
             AttributeSyntax dllImportSyntax,
             IMethodSymbol methodSymbol,
-            INamedTypeSymbol generatedDllImportAttrType,
+            INamedTypeSymbol libraryImportAttrType,
             char? entryPointSuffix,
             out SyntaxNode? unmanagedCallConvAttributeMaybe)
         {
@@ -448,7 +448,7 @@ namespace Microsoft.Interop.Analyzers
             // Create LibraryImport based on the DllImport attribute
             SyntaxNode libraryImportSyntax = generator.ReplaceNode(dllImportSyntax,
                 dllImportSyntax.Name,
-                generator.TypeExpression(generatedDllImportAttrType));
+                generator.TypeExpression(libraryImportAttrType));
 
             // Update attribute arguments for LibraryImport
             bool hasEntryPointAttributeArgument = false;
index b5c9908..1040ca2 100644 (file)
@@ -61,7 +61,7 @@ namespace Microsoft.Interop
                     {
                         MethodDeclarationSyntax syntax = (MethodDeclarationSyntax)context.Node;
                         if (context.SemanticModel.GetDeclaredSymbol(syntax, ct) is IMethodSymbol methodSymbol
-                            && methodSymbol.GetAttributes().Any(static attribute => attribute.AttributeClass?.ToDisplayString() == TypeNames.GeneratedDllImportAttribute))
+                            && methodSymbol.GetAttributes().Any(static attribute => attribute.AttributeClass?.ToDisplayString() == TypeNames.LibraryImportAttribute))
                         {
                             return new { Syntax = syntax, Symbol = methodSymbol };
                         }
@@ -321,9 +321,9 @@ namespace Microsoft.Interop
             };
         }
 
-        private static LibraryImportData? ProcessGeneratedDllImportAttribute(AttributeData attrData)
+        private static LibraryImportData? ProcessLibraryImportAttribute(AttributeData attrData)
         {
-            // Found the GeneratedDllImport, but it has an error so report the error.
+            // Found the LibraryImport, but it has an error so report the error.
             // This is most likely an issue with targeting an incorrect TFM.
             if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
             {
@@ -418,7 +418,7 @@ namespace Microsoft.Interop
             foreach (AttributeData attr in symbol.GetAttributes())
             {
                 if (attr.AttributeClass is not null
-                    && attr.AttributeClass.ToDisplayString() == TypeNames.GeneratedDllImportAttribute)
+                    && attr.AttributeClass.ToDisplayString() == TypeNames.LibraryImportAttribute)
                 {
                     generatedDllImportAttr = attr;
                 }
@@ -444,8 +444,8 @@ namespace Microsoft.Interop
 
             var generatorDiagnostics = new GeneratorDiagnostics();
 
-            // Process the GeneratedDllImport attribute
-            LibraryImportData? libraryImportData = ProcessGeneratedDllImportAttribute(generatedDllImportAttr!);
+            // Process the LibraryImport attribute
+            LibraryImportData? libraryImportData = ProcessLibraryImportAttribute(generatedDllImportAttr!);
 
             if (libraryImportData is null)
             {
@@ -472,7 +472,7 @@ namespace Microsoft.Interop
 
             if (lcidConversionAttr is not null)
             {
-                // Using LCIDConversion with GeneratedDllImport is not supported
+                // Using LCIDConversion with LibraryImport is not supported
                 generatorDiagnostics.ReportConfigurationNotSupported(lcidConversionAttr, nameof(TypeNames.LCIDConversionAttribute));
             }
 
@@ -552,7 +552,7 @@ namespace Microsoft.Interop
             {
                 diagnostics.ReportCannotForwardToDllImport(
                     userDeclaredMethod,
-                    $"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}",
+                    $"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}",
                     $"{nameof(StringMarshalling)}{Type.Delimiter}{pinvokeData.StringMarshalling}");
 
                 pinvokeData = pinvokeData with { IsUserDefined = pinvokeData.IsUserDefined & ~LibraryImportMember.StringMarshalling };
@@ -562,7 +562,7 @@ namespace Microsoft.Interop
             {
                 diagnostics.ReportCannotForwardToDllImport(
                     userDeclaredMethod,
-                    $"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(LibraryImportMember.StringMarshallingCustomType)}");
+                    $"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(LibraryImportMember.StringMarshallingCustomType)}");
 
                 pinvokeData = pinvokeData with { IsUserDefined = pinvokeData.IsUserDefined & ~LibraryImportMember.StringMarshallingCustomType };
             }
index 5da6deb..65920dc 100644 (file)
@@ -19,7 +19,7 @@ namespace Microsoft.Interop
     /// This type enables multiple code generators for P/Invoke-style marshalling
     /// to reuse the same basic method body, but with different designs of how to emit the target native method.
     /// This enables users to write code generators that work with slightly different semantics.
-    /// For example, the source generator for [GeneratedDllImport] emits the target P/Invoke as
+    /// For example, the source generator for [LibraryImport] emits the target P/Invoke as
     /// a local function inside the generated stub body.
     /// However, other managed-to-native code generators using a P/Invoke style might want to define
     /// the target DllImport outside of the stub as a static non-local function or as a function pointer field.
@@ -143,7 +143,7 @@ namespace Microsoft.Interop
             // for our lengths.
             // Here's an example signature where the dependency shows up:
             //
-            // [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "transpose_matrix")]
+            // [LibraryImport(NativeExportsNE_Binary, EntryPoint = "transpose_matrix")]
             // [return: MarshalUsing(CountElementName = "numColumns")]
             // [return: MarshalUsing(CountElementName = "numRows", ElementIndirectionLevel = 1)]
             // public static partial int[][] TransposeMatrix(
index 51bca2e..fcad506 100644 (file)
@@ -10,8 +10,8 @@
 
 namespace Microsoft.Interop {
     using System;
-    
-    
+
+
     /// <summary>
     ///   A strongly-typed resource class, for looking up localized strings, etc.
     /// </summary>
@@ -23,15 +23,15 @@ namespace Microsoft.Interop {
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     internal class Resources {
-        
+
         private static global::System.Resources.ResourceManager resourceMan;
-        
+
         private static global::System.Globalization.CultureInfo resourceCulture;
-        
+
         [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
         internal Resources() {
         }
-        
+
         /// <summary>
         ///   Returns the cached ResourceManager instance used by this class.
         /// </summary>
@@ -45,7 +45,7 @@ namespace Microsoft.Interop {
                 return resourceMan;
             }
         }
-        
+
         /// <summary>
         ///   Overrides the current thread's CurrentUICulture property for all
         ///   resource lookups using this strongly typed resource class.
@@ -59,7 +59,7 @@ namespace Microsoft.Interop {
                 resourceCulture = value;
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to A type marked with &apos;BlittableTypeAttribute&apos; must be blittable..
         /// </summary>
@@ -68,7 +68,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("BlittableTypeMustBeBlittableDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Type &apos;{0}&apos; is marked with &apos;BlittableTypeAttribute&apos; but is not blittable.
         /// </summary>
@@ -77,7 +77,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("BlittableTypeMustBeBlittableMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to When a constructor taking a Span&lt;byte&gt; is specified on the native type, the type must also have a public integer constant named BufferSize to provide the size of the caller-allocated buffer..
         /// </summary>
@@ -86,7 +86,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CallerAllocConstructorMustHaveBufferSizeConstantDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type &apos;{0}&apos; must have a &apos;public const int BufferSize&apos; field that specifies the size of the stack buffer because it has a constructor that takes a caller-allocated Span&lt;byte&gt;.
         /// </summary>
@@ -95,7 +95,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CallerAllocConstructorMustHaveBufferSizeConstantMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to A type that supports marshalling from managed to native using a caller-allocated buffer should also support marshalling from managed to native where using a caller-allocated buffer is impossible..
         /// </summary>
@@ -104,7 +104,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CallerAllocMarshallingShouldSupportAllocatingMarshallingFallbackDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Native type &apos;{0}&apos; has a constructor taking a caller-allocated buffer, but does not support marshalling in scenarios where using a caller-allocated buffer is impossible.
         /// </summary>
@@ -113,7 +113,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CallerAllocMarshallingShouldSupportAllocatingMarshallingFallbackMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The generated &apos;DllImportAttribute&apos; will not have a value corresponding to &apos;{0}&apos;..
         /// </summary>
@@ -122,7 +122,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CannotForwardToDllImportDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to &apos;{0}&apos; has no equivalent in &apos;DllImportAtttribute&apos; and will not be forwarded.
         /// </summary>
@@ -131,16 +131,16 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CannotForwardToDllImportMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
-        ///   Looks up a localized string similar to Specified &apos;GeneratedDllImportAttribute&apos; arguments cannot be forwarded to &apos;DllImportAttribute&apos;.
+        ///   Looks up a localized string similar to Specified &apos;LibraryImportAttribute&apos; arguments cannot be forwarded to &apos;DllImportAttribute&apos;.
         /// </summary>
         internal static string CannotForwardToDllImportTitle {
             get {
                 return ResourceManager.GetString("CannotForwardToDllImportTitle", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;BlittableTypeAttribute&apos; and &apos;NativeMarshallingAttribute&apos; attributes are mutually exclusive..
         /// </summary>
@@ -149,7 +149,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Type &apos;{0}&apos; is marked with &apos;BlittableTypeAttribute&apos; and &apos;NativeMarshallingAttribute&apos;. A type can only have one of these two attributes..
         /// </summary>
@@ -158,7 +158,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to A native type with the &apos;GenericContiguousCollectionMarshallerAttribute&apos; must have at least one of the two marshalling methods as well as a &apos;ManagedValues&apos; property of type &apos;Span&lt;T&gt;&apos; for some &apos;T&apos; and a &apos;NativeValueStorage&apos; property of type &apos;Span&lt;byte&gt;&apos; to enable marshalling the managed type..
         /// </summary>
@@ -167,7 +167,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type &apos;{0}&apos; must be a value type and have a constructor that takes two parameters, one of type &apos;{1}&apos; and an &apos;int&apos;, or have a parameterless instance method named &apos;ToManaged&apos; that returns &apos;{1}&apos; as well as a &apos;ManagedValues&apos; property of type &apos;Span&lt;T&gt;&apos; for some &apos;T&apos; and a &apos;NativeValueStorage&apos; property of type &apos;Span&lt;byte&gt;&apos;.
         /// </summary>
@@ -176,7 +176,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Source-generated P/Invokes will ignore any configuration that is not supported..
         /// </summary>
@@ -185,7 +185,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConfigurationNotSupportedDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;{0}&apos; configuration is not supported by source-generated P/Invokes. If the specified configuration is required, use a regular `DllImport` instead..
         /// </summary>
@@ -194,7 +194,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConfigurationNotSupportedMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The specified marshalling configuration is not supported by source-generated P/Invokes. {0}..
         /// </summary>
@@ -203,7 +203,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConfigurationNotSupportedMessageMarshallingInfo", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The specified &apos;{0}&apos; configuration for parameter &apos;{1}&apos; is not supported by source-generated P/Invokes. If the specified configuration is required, use a regular `DllImport` instead..
         /// </summary>
@@ -212,7 +212,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConfigurationNotSupportedMessageParameter", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The specified &apos;{0}&apos; configuration for the return value of method &apos;{1}&apos; is not supported by source-generated P/Invokes. If the specified configuration is required, use a regular `DllImport` instead..
         /// </summary>
@@ -221,7 +221,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConfigurationNotSupportedMessageReturn", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The specified value &apos;{0}&apos; for &apos;{1}&apos; is not supported by source-generated P/Invokes. If the specified configuration is required, use a regular `DllImport` instead..
         /// </summary>
@@ -230,7 +230,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConfigurationNotSupportedMessageValue", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Specified configuration is not supported by source-generated P/Invokes..
         /// </summary>
@@ -239,7 +239,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConfigurationNotSupportedTitle", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Only one of &apos;ConstantElementCount&apos; or &apos;ElementCountInfo&apos; may be used in a &apos;MarshalUsingAttribute&apos; for a given &apos;ElementIndirectionLevel&apos;.
         /// </summary>
@@ -248,7 +248,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConstantAndElementCountInfoDisallowed", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Automatically converting a P/Invoke with &apos;PreserveSig&apos; set to &apos;false&apos; to a source-generated P/Invoke may produce invalid code.
         /// </summary>
@@ -257,7 +257,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConvertNoPreserveSigDllImportToGeneratedMayProduceInvalidCode", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Convert to &apos;LibraryImport&apos;.
         /// </summary>
@@ -266,7 +266,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConvertToLibraryImport", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Use &apos;LibraryImportAttribute&apos; instead of &apos;DllImportAttribute&apos; to generate P/Invoke marshalling code at compile time.
         /// </summary>
@@ -275,7 +275,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConvertToLibraryImportDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Mark the method &apos;{0}&apos; with &apos;LibraryImportAttribute&apos; instead of &apos;DllImportAttribute&apos; to generate P/Invoke marshalling code at compile time.
         /// </summary>
@@ -284,7 +284,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConvertToLibraryImportMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Use &apos;LibraryImportAttribute&apos; instead of &apos;DllImportAttribute&apos; to generate P/Invoke marshalling code at compile time.
         /// </summary>
@@ -293,7 +293,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConvertToLibraryImportTitle", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Conversion to &apos;LibraryImport&apos; may change behavior and compatibility. See {0} for more information..
         /// </summary>
@@ -302,7 +302,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConvertToLibraryImportWarning", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Convert to &apos;LibraryImport&apos; with &apos;{0}&apos; suffix.
         /// </summary>
@@ -311,7 +311,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConvertToLibraryImportWithSuffix", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The specified parameter needs to be marshalled from managed to native, but the native type &apos;{0}&apos; does not support it..
         /// </summary>
@@ -320,7 +320,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CustomTypeMarshallingManagedToNativeUnsupported", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The specified parameter needs to be marshalled from native to managed, but the native type &apos;{0}&apos; does not support it..
         /// </summary>
@@ -329,7 +329,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CustomTypeMarshallingNativeToManagedUnsupported", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The return type of &apos;GetPinnableReference&apos; (after accounting for &apos;ref&apos;) must be blittable..
         /// </summary>
@@ -338,7 +338,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("GetPinnableReferenceReturnTypeBlittableDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The dereferenced type of the return type of the &apos;GetPinnableReference&apos; method must be blittable.
         /// </summary>
@@ -347,7 +347,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("GetPinnableReferenceReturnTypeBlittableMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to A type that supports marshalling from managed to native by pinning should also support marshalling from managed to native where pinning is impossible..
         /// </summary>
@@ -356,7 +356,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("GetPinnableReferenceShouldSupportAllocatingMarshallingFallbackDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Type &apos;{0}&apos; has a &apos;GetPinnableReference&apos; method but its native type does not support marshalling in scenarios where pinning is impossible.
         /// </summary>
@@ -365,7 +365,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("GetPinnableReferenceShouldSupportAllocatingMarshallingFallbackMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Method &apos;{0}&apos; is contained in a type &apos;{1}&apos; that is not marked &apos;partial&apos;. P/Invoke source generation will ignore method &apos;{0}&apos;..
         /// </summary>
@@ -374,25 +374,25 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("InvalidAttributedMethodContainingTypeMissingModifiersMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
-        ///   Looks up a localized string similar to Methods marked with &apos;GeneratedDllImportAttribute&apos; should be &apos;static&apos;, &apos;partial&apos;, and non-generic. P/Invoke source generation will ignore methods that are non-&apos;static&apos;, non-&apos;partial&apos;, or generic..
+        ///   Looks up a localized string similar to Methods marked with &apos;LibraryImportAttribute&apos; should be &apos;static&apos;, &apos;partial&apos;, and non-generic. P/Invoke source generation will ignore methods that are non-&apos;static&apos;, non-&apos;partial&apos;, or generic..
         /// </summary>
         internal static string InvalidAttributedMethodDescription {
             get {
                 return ResourceManager.GetString("InvalidAttributedMethodDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
-        ///   Looks up a localized string similar to Method &apos;{0}&apos; should be &apos;static&apos;, &apos;partial&apos;, and non-generic when marked with &apos;GeneratedDllImportAttribute&apos;. P/Invoke source generation will ignore method &apos;{0}&apos;..
+        ///   Looks up a localized string similar to Method &apos;{0}&apos; should be &apos;static&apos;, &apos;partial&apos;, and non-generic when marked with &apos;LibraryImportAttribute&apos;. P/Invoke source generation will ignore method &apos;{0}&apos;..
         /// </summary>
         internal static string InvalidAttributedMethodSignatureMessage {
             get {
                 return ResourceManager.GetString("InvalidAttributedMethodSignatureMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Invalid &apos;LibraryImportAttribute&apos; usage.
         /// </summary>
@@ -401,7 +401,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("InvalidLibraryImportAttributeUsageTitle", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The configuration of &apos;StringMarshalling&apos; and &apos;StringMarshallingCustomType&apos; is invalid..
         /// </summary>
@@ -410,7 +410,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("InvalidStringMarshallingConfigurationDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The configuration of &apos;StringMarshalling&apos; and &apos;StringMarshallingCustomType&apos; on method &apos;{0}&apos; is invalid. {1}.
         /// </summary>
@@ -419,7 +419,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("InvalidStringMarshallingConfigurationMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to &apos;StringMarshallingCustomType&apos; must be specified when &apos;StringMarshalling&apos; is set to &apos;StringMarshalling.Custom&apos;..
         /// </summary>
@@ -428,7 +428,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("InvalidStringMarshallingConfigurationMissingCustomType", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to &apos;StringMarshalling&apos; should be set to &apos;StringMarshalling.Custom&apos; when &apos;StringMarshallingCustomType&apos; is specified..
         /// </summary>
@@ -437,7 +437,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("InvalidStringMarshallingConfigurationNotCustom", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The use cases for &apos;GetPinnableReference&apos; are not applicable in any scenarios where a &apos;Value&apos; property is not also required..
         /// </summary>
@@ -446,7 +446,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("MarshallerGetPinnableReferenceRequiresValuePropertyDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;GetPinnableReference&apos; method cannot be provided on the native type &apos;{0}&apos; unless a &apos;Value&apos; property is also provided.
         /// </summary>
@@ -455,7 +455,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("MarshallerGetPinnableReferenceRequiresValuePropertyMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type &apos;{0}&apos; must be a closed generic so the emitted code can use a specific instantiation..
         /// </summary>
@@ -464,7 +464,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeGenericTypeMustBeClosedDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type &apos;{0}&apos; must be a closed generic or have the same number of generic parameters as the managed type so the emitted code can use a specific instantiation..
         /// </summary>
@@ -473,7 +473,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeGenericTypeMustBeClosedOrMatchArityDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type &apos;{0}&apos; for managed type &apos;{1}&apos; must be a closed generic type or have the same arity as the managed type..
         /// </summary>
@@ -482,7 +482,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeGenericTypeMustBeClosedOrMatchArityMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to A native type for a given type must be blittable..
         /// </summary>
@@ -491,7 +491,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeTypeMustBeBlittableDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type &apos;{0}&apos; for the type &apos;{1}&apos; is not blittable.
         /// </summary>
@@ -500,7 +500,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeTypeMustBeBlittableMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to A native type for a given type must be non-null..
         /// </summary>
@@ -509,7 +509,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeTypeMustBeNonNullDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type for the type &apos;{0}&apos; is null.
         /// </summary>
@@ -518,7 +518,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeTypeMustBeNonNullMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type must be pointer sized so the pinned result of &apos;GetPinnableReference&apos; can be cast to the native type..
         /// </summary>
@@ -527,7 +527,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeTypeMustBePointerSizedDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type &apos;{0}&apos; must be pointer sized because the managed type &apos;{1}&apos; has a &apos;GetPinnableReference&apos; method.
         /// </summary>
@@ -536,7 +536,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeTypeMustBePointerSizedMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type must have at least one of the two marshalling methods to enable marshalling the managed type..
         /// </summary>
@@ -545,7 +545,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type &apos;{0}&apos; must be a value type and have a constructor that takes one parameter of type &apos;{1}&apos; or a parameterless instance method named &apos;ToManaged&apos; that returns &apos;{1}&apos;.
         /// </summary>
@@ -554,7 +554,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;Value&apos; property must not be a &apos;ref&apos; or &apos;readonly ref&apos; property..
         /// </summary>
@@ -563,7 +563,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("RefValuePropertyUnsupportedDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;Value&apos; property on the native type &apos;{0}&apos; must not be a &apos;ref&apos; or &apos;readonly ref&apos; property..
         /// </summary>
@@ -572,7 +572,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("RefValuePropertyUnsupportedMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to .
         /// </summary>
@@ -581,7 +581,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("RuntimeMarshallingMustBeDisabled", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to An abstract type derived from &apos;SafeHandle&apos; cannot be marshalled by reference. The provided type must be concrete..
         /// </summary>
@@ -590,7 +590,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("SafeHandleByRefMustBeConcrete", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to P/Invoke source generation is not supported on unknown target framework v{0}. The generated source will not be compatible with other frameworks..
         /// </summary>
@@ -599,16 +599,16 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("TargetFrameworkNotSupportedDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
-        ///   Looks up a localized string similar to &apos;GeneratedDllImportAttribute&apos; cannot be used for source-generated P/Invokes on an unknown target framework v{0}..
+        ///   Looks up a localized string similar to &apos;LibraryImportAttribute&apos; cannot be used for source-generated P/Invokes on an unknown target framework v{0}..
         /// </summary>
         internal static string TargetFrameworkNotSupportedMessage {
             get {
                 return ResourceManager.GetString("TargetFrameworkNotSupportedMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Current target framework is not supported by source-generated P/Invokes.
         /// </summary>
@@ -617,7 +617,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("TargetFrameworkNotSupportedTitle", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to For types that are not supported by source-generated P/Invokes, the resulting P/Invoke will rely on the underlying runtime to marshal the specified type..
         /// </summary>
@@ -626,7 +626,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("TypeNotSupportedDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The type &apos;{0}&apos; is not supported by source-generated P/Invokes. The generated source will not handle marshalling of parameter &apos;{1}&apos;..
         /// </summary>
@@ -635,7 +635,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("TypeNotSupportedMessageParameter", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to {0} The generated source will not handle marshalling of parameter &apos;{1}&apos;..
         /// </summary>
@@ -644,7 +644,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("TypeNotSupportedMessageParameterWithDetails", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The type &apos;{0}&apos; is not supported by source-generated P/Invokes. The generated source will not handle marshalling of the return value of method &apos;{1}&apos;..
         /// </summary>
@@ -653,7 +653,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("TypeNotSupportedMessageReturn", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to {0} The generated source will not handle marshalling of the return value of method &apos;{1}&apos;..
         /// </summary>
@@ -662,7 +662,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("TypeNotSupportedMessageReturnWithDetails", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Specified type is not supported by source-generated P/Invokes.
         /// </summary>
@@ -671,7 +671,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("TypeNotSupportedTitle", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type&apos;s &apos;Value&apos; property must have a getter to support marshalling from managed to native..
         /// </summary>
@@ -680,7 +680,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ValuePropertyMustHaveGetterDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;Value&apos; property on the native type &apos;{0}&apos; must have a getter.
         /// </summary>
@@ -689,7 +689,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ValuePropertyMustHaveGetterMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type&apos;s &apos;Value&apos; property must have a setter to support marshalling from native to managed..
         /// </summary>
@@ -698,7 +698,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ValuePropertyMustHaveSetterDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;Value&apos; property on the native type &apos;{0}&apos; must have a setter.
         /// </summary>
index fbe7c31..1d6467f 100644 (file)
@@ -1,17 +1,17 @@
 ï»¿<?xml version="1.0" encoding="utf-8"?>
 <root>
-  <!-- 
-    Microsoft ResX Schema 
-    
+  <!--
+    Microsoft ResX Schema
+
     Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
+
+    The primary goals of this format is to allow a simple XML format
+    that is mostly human readable. The generation and parsing of the
+    various data types are done through the TypeConverter classes
     associated with the data types.
-    
+
     Example:
-    
+
     ... ado.net/XML headers & schema ...
     <resheader name="resmimetype">text/microsoft-resx</resheader>
     <resheader name="version">2.0</resheader>
         <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
         <comment>This is a comment</comment>
     </data>
-                
-    There are any number of "resheader" rows that contain simple 
+
+    There are any number of "resheader" rows that contain simple
     name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
+
+    Each data row contains a name, and value. The row also contains a
+    type or mimetype. Type corresponds to a .NET class that support
+    text/value conversion through the TypeConverter architecture.
+    Classes that don't support this are serialized and stored with the
     mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
+
+    The mimetype is used for serialized objects, and tells the
+    ResXResourceReader how to depersist the object. This is currently not
     extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
+
+    Note - application/x-microsoft.net.object.binary.base64 is the format
+    that the ResXResourceWriter will generate, however the reader can
     read any of the formats listed below.
-    
+
     mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
+    value   : The object must be serialized with
             : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
             : and then encoded with base64 encoding.
-    
+
     mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
+    value   : The object must be serialized with
             : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
             : and then encoded with base64 encoding.
 
     mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
+    value   : The object must be serialized into a byte array
             : using a System.ComponentModel.TypeConverter
             : and then encoded with base64 encoding.
     -->
     <value>'{0}' has no equivalent in 'DllImportAtttribute' and will not be forwarded</value>
   </data>
   <data name="CannotForwardToDllImportTitle" xml:space="preserve">
-    <value>Specified 'GeneratedDllImportAttribute' arguments cannot be forwarded to 'DllImportAttribute'</value>
+    <value>Specified 'LibraryImportAttribute' arguments cannot be forwarded to 'DllImportAttribute'</value>
   </data>
   <data name="CannotHaveMultipleMarshallingAttributesDescription" xml:space="preserve">
     <value>The 'BlittableTypeAttribute' and 'NativeMarshallingAttribute' attributes are mutually exclusive.</value>
     <value>Method '{0}' is contained in a type '{1}' that is not marked 'partial'. P/Invoke source generation will ignore method '{0}'.</value>
   </data>
   <data name="InvalidAttributedMethodDescription" xml:space="preserve">
-    <value>Methods marked with 'GeneratedDllImportAttribute' should be 'static', 'partial', and non-generic. P/Invoke source generation will ignore methods that are non-'static', non-'partial', or generic.</value>
+    <value>Methods marked with 'LibraryImportAttribute' should be 'static', 'partial', and non-generic. P/Invoke source generation will ignore methods that are non-'static', non-'partial', or generic.</value>
   </data>
   <data name="InvalidAttributedMethodSignatureMessage" xml:space="preserve">
-    <value>Method '{0}' should be 'static', 'partial', and non-generic when marked with 'GeneratedDllImportAttribute'. P/Invoke source generation will ignore method '{0}'.</value>
+    <value>Method '{0}' should be 'static', 'partial', and non-generic when marked with 'LibraryImportAttribute'. P/Invoke source generation will ignore method '{0}'.</value>
   </data>
   <data name="InvalidLibraryImportAttributeUsageTitle" xml:space="preserve">
     <value>Invalid 'LibraryImportAttribute' usage</value>
     <comment>{0} is a version number</comment>
   </data>
   <data name="TargetFrameworkNotSupportedMessage" xml:space="preserve">
-    <value>'GeneratedDllImportAttribute' cannot be used for source-generated P/Invokes on an unknown target framework v{0}.</value>
+    <value>'LibraryImportAttribute' cannot be used for source-generated P/Invokes on an unknown target framework v{0}.</value>
     <comment>{0} is a version number</comment>
   </data>
   <data name="TargetFrameworkNotSupportedTitle" xml:space="preserve">
index 4ff500d..0000772 100644 (file)
@@ -791,7 +791,7 @@ namespace Microsoft.Interop
                 if (_defaultInfo.CharEncoding == CharEncoding.Custom && _defaultInfo.StringMarshallingCustomType is not null)
                 {
                     AttributeData attrData = _contextSymbol is IMethodSymbol
-                        ? _contextSymbol.GetAttributes().First(a => a.AttributeClass.ToDisplayString() == TypeNames.GeneratedDllImportAttribute)
+                        ? _contextSymbol.GetAttributes().First(a => a.AttributeClass.ToDisplayString() == TypeNames.LibraryImportAttribute)
                         : default;
                     marshallingInfo = CreateNativeMarshallingInfo(type, _defaultInfo.StringMarshallingCustomType, attrData, true, indirectionLevel, parsedCountInfo, useSiteAttributes, inspectedElements, ref maxIndirectionLevelUsed);
                     return true;
index d724a69..90e95ec 100644 (file)
@@ -10,8 +10,8 @@
 
 namespace Microsoft.Interop {
     using System;
-    
-    
+
+
     /// <summary>
     ///   A strongly-typed resource class, for looking up localized strings, etc.
     /// </summary>
@@ -23,15 +23,15 @@ namespace Microsoft.Interop {
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     internal class Resources {
-        
+
         private static global::System.Resources.ResourceManager resourceMan;
-        
+
         private static global::System.Globalization.CultureInfo resourceCulture;
-        
+
         [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
         internal Resources() {
         }
-        
+
         /// <summary>
         ///   Returns the cached ResourceManager instance used by this class.
         /// </summary>
@@ -45,7 +45,7 @@ namespace Microsoft.Interop {
                 return resourceMan;
             }
         }
-        
+
         /// <summary>
         ///   Overrides the current thread's CurrentUICulture property for all
         ///   resource lookups using this strongly typed resource class.
@@ -59,7 +59,7 @@ namespace Microsoft.Interop {
                 resourceCulture = value;
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Marshalling an array from unmanaged to managed requires either the &apos;SizeParamIndex&apos; or &apos;SizeConst&apos; fields to be set on a &apos;MarshalAsAttribute&apos; or the &apos;ConstantElementCount&apos; or &apos;CountElementName&apos; properties to be set on a &apos;MarshalUsingAttribute&apos;..
         /// </summary>
@@ -68,7 +68,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ArraySizeMustBeSpecified", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;SizeParamIndex&apos; value in the &apos;MarshalAsAttribute&apos; is out of range..
         /// </summary>
@@ -77,7 +77,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ArraySizeParamIndexOutOfRange", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;BlittableTypeAttribute&apos; and &apos;NativeMarshallingAttribute&apos; attributes are mutually exclusive..
         /// </summary>
@@ -86,7 +86,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Type &apos;{0}&apos; is marked with &apos;BlittableTypeAttribute&apos; and &apos;NativeMarshallingAttribute&apos;. A type can only have one of these two attributes..
         /// </summary>
@@ -95,7 +95,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CannotHaveMultipleMarshallingAttributesMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to A native type with the &apos;GenericContiguousCollectionMarshallerAttribute&apos; must have at least one of the two marshalling methods as well as a &apos;ManagedValues&apos; property of type &apos;Span&lt;T&gt;&apos; for some &apos;T&apos; and a &apos;NativeValueStorage&apos; property of type &apos;Span&lt;byte&gt;&apos; to enable marshalling the managed type..
         /// </summary>
@@ -104,7 +104,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type &apos;{0}&apos; must be a value type and have a constructor that takes two parameters, one of type &apos;{1}&apos; and an &apos;int&apos;, or have a parameterless instance method named &apos;ToManaged&apos; that returns &apos;{1}&apos; as well as a &apos;ManagedValues&apos; property of type &apos;Span&lt;T&gt;&apos; for some &apos;T&apos; and a &apos;NativeValueStorage&apos; property of type &apos;Span&lt;byte&gt;&apos;.
         /// </summary>
@@ -113,7 +113,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CollectionNativeTypeMustHaveRequiredShapeMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The specified collection size parameter for an collection must be an integer type. If the size information is applied to a nested collection, the size parameter must be a collection of one less level of nesting with an integral element..
         /// </summary>
@@ -122,7 +122,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CollectionSizeParamTypeMustBeIntegral", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Only one of &apos;ConstantElementCount&apos; or &apos;ElementCountInfo&apos; may be used in a &apos;MarshalUsingAttribute&apos; for a given &apos;ElementIndirectionLevel&apos;.
         /// </summary>
@@ -131,7 +131,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ConstantAndElementCountInfoDisallowed", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The specified parameter needs to be marshalled from managed to native, but the native type &apos;{0}&apos; does not support it..
         /// </summary>
@@ -140,7 +140,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CustomTypeMarshallingManagedToNativeUnsupported", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The specified parameter needs to be marshalled from native to managed, but the native type &apos;{0}&apos; does not support it..
         /// </summary>
@@ -149,7 +149,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CustomTypeMarshallingNativeToManagedUnsupported", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to This element cannot depend on &apos;{0}&apos; for collection size information without creating a dependency cycle.
         /// </summary>
@@ -158,7 +158,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("CyclicalCountInfo", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Count information for a given element at a given indirection level can only be specified once.
         /// </summary>
@@ -167,7 +167,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("DuplicateCountInfo", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Multiple marshalling attributes per element per indirection level is unsupported, but duplicate information was provided for indirection level {0}.
         /// </summary>
@@ -176,7 +176,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("DuplicateMarshallingInfo", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Marshalling info was specified for &apos;ElementIndirectionLevel&apos; {0}, but marshalling info was only needed for {1} level(s) of indirection.
         /// </summary>
@@ -185,7 +185,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ExtraneousMarshallingInfo", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The provided graph has cycles and cannot be topologically sorted..
         /// </summary>
@@ -194,7 +194,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("GraphHasCycles", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;[In]&apos; attribute is not supported unless the &apos;[Out]&apos; attribute is also used. The behavior of the &apos;[In]&apos; attribute without the &apos;[Out]&apos; attribute is the same as the default behavior..
         /// </summary>
@@ -203,7 +203,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("InAttributeNotSupportedWithoutOut", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;[In]&apos; and &apos;[Out]&apos; attributes are unsupported on parameters passed by reference. Use the &apos;in&apos;, &apos;ref&apos;, or &apos;out&apos; keywords instead..
         /// </summary>
@@ -212,7 +212,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("InOutAttributeByRefNotSupported", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The provided &apos;[In]&apos; and &apos;[Out]&apos; attributes on this parameter are unsupported on this parameter..
         /// </summary>
@@ -221,7 +221,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("InOutAttributeMarshalerNotSupported", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Marshalling bool without explicit marshalling information is not supported. Specify either &apos;MarshalUsingAttribute&apos; or &apos;MarshalAsAttribute&apos;..
         /// </summary>
@@ -229,8 +229,8 @@ namespace Microsoft.Interop {
             get {
                 return ResourceManager.GetString("MarshallingBoolAsUndefinedNotSupported", resourceCulture);
             }
-        }     
-           
+        }
+
         /// <summary>
         ///   Looks up a localized string similar to Marshalling char with &apos;CharSet.{0}&apos; is not supported. Instead, manually convert the char type to the desired byte representation and pass to the source-generated P/Invoke..
         /// </summary>
@@ -239,16 +239,16 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("MarshallingCharAsSpecifiedCharSetNotSupported", resourceCulture);
             }
         }
-        
+
         /// <summary>
-        ///   Looks up a localized string similar to Marshalling string or char without explicit marshalling information is not supported. Specify either &apos;GeneratedDllImportAttribute.CharSet&apos; or &apos;MarshalAsAttribute&apos;..
+        ///   Looks up a localized string similar to Marshalling string or char without explicit marshalling information is not supported. Specify either &apos;LibraryImportAttribute.CharSet&apos; or &apos;MarshalAsAttribute&apos;..
         /// </summary>
         internal static string MarshallingStringOrCharAsUndefinedNotSupported {
             get {
                 return ResourceManager.GetString("MarshallingStringOrCharAsUndefinedNotSupported", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type &apos;{0}&apos; for managed type &apos;{1}&apos; must be a closed generic type or have the same arity as the managed type..
         /// </summary>
@@ -257,7 +257,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeGenericTypeMustBeClosedOrMatchArityMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type must have at least one of the two marshalling methods to enable marshalling the managed type..
         /// </summary>
@@ -266,7 +266,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type &apos;{0}&apos; must be a value type and have a constructor that takes one parameter of type &apos;{1}&apos; or a parameterless instance method named &apos;ToManaged&apos; that returns &apos;{1}&apos;.
         /// </summary>
@@ -275,7 +275,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("NativeTypeMustHaveRequiredShapeMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;[Out]&apos; attribute is only supported on array parameters..
         /// </summary>
@@ -284,7 +284,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("OutByValueNotSupportedDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;[Out]&apos; attribute is not supported on the &apos;{0}&apos; parameter..
         /// </summary>
@@ -293,7 +293,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("OutByValueNotSupportedMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;Value&apos; property must not be a &apos;ref&apos; or &apos;readonly ref&apos; property..
         /// </summary>
@@ -302,7 +302,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("RefValuePropertyUnsupportedDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;Value&apos; property on the native type &apos;{0}&apos; must not be a &apos;ref&apos; or &apos;readonly ref&apos; property..
         /// </summary>
@@ -311,7 +311,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("RefValuePropertyUnsupportedMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Runtime marshalling must be disabled in this project by applying the &apos;System.Runtime.InteropServices.DisableRuntimeMarshallingAttribute&apos; to the assembly to enable marshalling this type..
         /// </summary>
@@ -320,7 +320,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("RuntimeMarshallingMustBeDisabled", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to An abstract type derived from &apos;SafeHandle&apos; cannot be marshalled by reference. The provided type must be concrete..
         /// </summary>
@@ -329,7 +329,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("SafeHandleByRefMustBeConcrete", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Specified type is not supported by source-generated P/Invokes.
         /// </summary>
@@ -338,7 +338,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("TypeNotSupportedTitle", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to Marshalling a value between managed and native with a native type with a &apos;Value&apos; property requires extra state, which is not supported in this context..
         /// </summary>
@@ -347,7 +347,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ValuePropertyMarshallingRequiresAdditionalState", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type&apos;s &apos;Value&apos; property must have a getter to support marshalling from managed to native..
         /// </summary>
@@ -356,7 +356,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ValuePropertyMustHaveGetterDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;Value&apos; property on the native type &apos;{0}&apos; must have a getter.
         /// </summary>
@@ -365,7 +365,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ValuePropertyMustHaveGetterMessage", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The native type&apos;s &apos;Value&apos; property must have a setter to support marshalling from native to managed..
         /// </summary>
@@ -374,7 +374,7 @@ namespace Microsoft.Interop {
                 return ResourceManager.GetString("ValuePropertyMustHaveSetterDescription", resourceCulture);
             }
         }
-        
+
         /// <summary>
         ///   Looks up a localized string similar to The &apos;Value&apos; property on the native type &apos;{0}&apos; must have a setter.
         /// </summary>
index f1b937f..abac39f 100644 (file)
@@ -1,17 +1,17 @@
 ï»¿<?xml version="1.0" encoding="utf-8"?>
 <root>
-  <!-- 
-    Microsoft ResX Schema 
-    
+  <!--
+    Microsoft ResX Schema
+
     Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
+
+    The primary goals of this format is to allow a simple XML format
+    that is mostly human readable. The generation and parsing of the
+    various data types are done through the TypeConverter classes
     associated with the data types.
-    
+
     Example:
-    
+
     ... ado.net/XML headers & schema ...
     <resheader name="resmimetype">text/microsoft-resx</resheader>
     <resheader name="version">2.0</resheader>
         <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
         <comment>This is a comment</comment>
     </data>
-                
-    There are any number of "resheader" rows that contain simple 
+
+    There are any number of "resheader" rows that contain simple
     name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
+
+    Each data row contains a name, and value. The row also contains a
+    type or mimetype. Type corresponds to a .NET class that support
+    text/value conversion through the TypeConverter architecture.
+    Classes that don't support this are serialized and stored with the
     mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
+
+    The mimetype is used for serialized objects, and tells the
+    ResXResourceReader how to depersist the object. This is currently not
     extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
+
+    Note - application/x-microsoft.net.object.binary.base64 is the format
+    that the ResXResourceWriter will generate, however the reader can
     read any of the formats listed below.
-    
+
     mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
+    value   : The object must be serialized with
             : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
             : and then encoded with base64 encoding.
-    
+
     mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
+    value   : The object must be serialized with
             : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
             : and then encoded with base64 encoding.
 
     mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
+    value   : The object must be serialized into a byte array
             : using a System.ComponentModel.TypeConverter
             : and then encoded with base64 encoding.
     -->
     <value>Marshalling char with 'CharSet.{0}' is not supported. Instead, manually convert the char type to the desired byte representation and pass to the source-generated P/Invoke.</value>
   </data>
   <data name="MarshallingStringOrCharAsUndefinedNotSupported" xml:space="preserve">
-    <value>Marshalling string or char without explicit marshalling information is not supported. Specify either 'GeneratedDllImportAttribute.CharSet' or 'MarshalAsAttribute'.</value>
+    <value>Marshalling string or char without explicit marshalling information is not supported. Specify either 'LibraryImportAttribute.CharSet' or 'MarshalAsAttribute'.</value>
   </data>
   <data name="OutByValueNotSupportedDescription" xml:space="preserve">
     <value>The '[Out]' attribute is only supported on array parameters.</value>
index 6cffa1f..1a812d4 100644 (file)
@@ -6,7 +6,7 @@ namespace Microsoft.Interop
     public static class TypeNames
     {
         public const string DllImportAttribute = "System.Runtime.InteropServices.DllImportAttribute";
-        public const string GeneratedDllImportAttribute = "System.Runtime.InteropServices.GeneratedDllImportAttribute";
+        public const string LibraryImportAttribute = "System.Runtime.InteropServices.LibraryImportAttribute";
         public const string StringMarshalling = "System.Runtime.InteropServices.StringMarshalling";
 
         public const string GeneratedMarshallingAttribute = "System.Runtime.InteropServices.GeneratedMarshallingAttribute";
index 054016b..60e5360 100644 (file)
@@ -11,7 +11,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs" Link="GeneratedDllImportAttribute.cs" />
+    <Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/LibraryImportAttribute.cs" Link="LibraryImportAttribute.cs" />
     <Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/GeneratedMarshallingAttribute.cs" Link="GeneratedMarshallingAttribute.cs" />
     <Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/ArrayMarshaller.cs" Link="ArrayMarshaller.cs" />
     <Compile Include="$(LibrariesProjectRoot)Common/src/System/Runtime/InteropServices/StringMarshalling.cs" Link="StringMarshalling.cs" />
index 5e24cae..8fd1140 100644 (file)
@@ -16,66 +16,66 @@ namespace LibraryImportGenerator.IntegrationTests
     {
         public partial class Arrays
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
             public static partial int Sum(int[] values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
             public static partial int Sum(ref int values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")]
             public static partial int SumInArray(in int[] values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
             public static partial void Duplicate([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] ref int[] values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")]
             [return:MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]
             public static partial int[] CreateRange(int start, int end, out int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")]
             public static partial void CreateRange_Out(int start, int end, out int numValues, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] out int[] res);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_char_array", StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_char_array", StringMarshalling = StringMarshalling.Utf16)]
             public static partial int SumChars(char[] chars, int numElements);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "fill_char_array", StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "fill_char_array", StringMarshalling = StringMarshalling.Utf16)]
             public static partial void FillChars([Out] char[] chars, int length, ushort start);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_char_array", StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_char_array", StringMarshalling = StringMarshalling.Utf16)]
             public static partial void ReverseChars([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] ref char[] chars, int numElements);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")]
             public static partial int SumStringLengths([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] strArray);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")]
             public static partial void ReverseStrings_Ref([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1)] ref string[] strArray, out int numElements);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")]
             [return: MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1)]
             public static partial string[] ReverseStrings_Return([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] strArray, out int numElements);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_out")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_out")]
             public static partial void ReverseStrings_Out([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] strArray, out int numElements, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1)] out string[] res);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")]
             [return:MarshalAs(UnmanagedType.LPArray, SizeConst = sizeof(long))]
             public static partial byte[] GetLongBytes(long l);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "append_int_to_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "append_int_to_array")]
             public static partial void Append([MarshalAs(UnmanagedType.LPArray, SizeConst = 1, SizeParamIndex = 1)] ref int[] values, int numOriginalValues, int newValue);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "fill_range_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "fill_range_array")]
             [return: MarshalAs(UnmanagedType.U1)]
             public static partial bool FillRangeArray([Out] IntStructWrapper[] array, int length, int start);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "double_values")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "double_values")]
             public static partial void DoubleValues([In, Out] IntStructWrapper[] array, int length);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")]
             [return:MarshalAs(UnmanagedType.U1)]
             public static partial bool AndAllMembers(BoolStruct[] pArray, int length);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "transpose_matrix")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "transpose_matrix")]
             [return: MarshalUsing(CountElementName = "numColumns")]
             [return: MarshalUsing(CountElementName = "numRows", ElementIndirectionLevel = 1)]
             public static partial int[][] TransposeMatrix(int[][] matrix, int[] numRows, int numColumns);
index 1375901..f02379d 100644 (file)
@@ -11,32 +11,32 @@ namespace LibraryImportGenerator.IntegrationTests
 {
     partial class NativeExportsNE
     {
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_return_instance")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_return_instance")]
         public static partial IntFields DoubleIntFields(IntFields result);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")]
         public static partial void DoubleIntFieldsByRef(ref IntFields result);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")]
         public static partial void DoubleIntFieldsByRefIn(in IntFields result);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_refreturn")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_refreturn")]
         public static partial void DoubleIntFieldsRefReturn(
             IntFields input,
             ref IntFields result);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_refreturn")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_refreturn")]
         public static partial void DoubleIntFieldsOutReturn(
             IntFields input,
             out IntFields result);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")]
         public static partial void IncrementInvertPointerFieldsByRef(ref PointerFields result);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")]
         public static partial void IncrementInvertPointerFieldsByRefIn(in PointerFields result);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_refreturn")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_refreturn")]
         public static partial void IncrementInvertPointerFieldsRefReturn(
             PointerFields input,
             ref PointerFields result);
index 3b66fc6..2f82082 100644 (file)
@@ -11,61 +11,61 @@ namespace LibraryImportGenerator.IntegrationTests
 {
     partial class NativeExportsNE
     {
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "bytebool_return_as_uint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "bytebool_return_as_uint")]
         public static partial uint ReturnByteBoolAsUInt([MarshalAs(UnmanagedType.U1)] bool input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "bytebool_return_as_uint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "bytebool_return_as_uint")]
         public static partial uint ReturnSByteBoolAsUInt([MarshalAs(UnmanagedType.I1)] bool input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "variantbool_return_as_uint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "variantbool_return_as_uint")]
         public static partial uint ReturnVariantBoolAsUInt([MarshalAs(UnmanagedType.VariantBool)] bool input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
         public static partial uint ReturnIntBoolAsUInt([MarshalAs(UnmanagedType.I4)] bool input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
         public static partial uint ReturnUIntBoolAsUInt([MarshalAs(UnmanagedType.U4)] bool input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
         public static partial uint ReturnWinBoolAsUInt([MarshalAs(UnmanagedType.Bool)] bool input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
         [return: MarshalAs(UnmanagedType.U1)]
         public static partial bool ReturnUIntAsByteBool(uint input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
         [return: MarshalAs(UnmanagedType.VariantBool)]
         public static partial bool ReturnUIntAsVariantBool(uint input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_uint")]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool ReturnUIntAsWinBool(uint input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
         public static partial void ReturnUIntAsByteBool_Ref(uint input, [MarshalAs(UnmanagedType.U1)] ref bool res);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
         public static partial void ReturnUIntAsByteBool_Out(uint input, [MarshalAs(UnmanagedType.U1)] out bool res);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
         public static partial void ReturnUIntAsByteBool_In(uint input, [MarshalAs(UnmanagedType.U1)] in bool res);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
         public static partial void ReturnUIntAsVariantBool_Ref(uint input, [MarshalAs(UnmanagedType.VariantBool)] ref bool res);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
         public static partial void ReturnUIntAsVariantBool_Out(uint input, [MarshalAs(UnmanagedType.VariantBool)] out bool res);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
         public static partial void ReturnUIntAsVariantBool_In(uint input, [MarshalAs(UnmanagedType.VariantBool)] in bool res);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
         public static partial void ReturnUIntAsWinBool_Ref(uint input, [MarshalAs(UnmanagedType.Bool)] ref bool res);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
         public static partial void ReturnUIntAsWinBool_Out(uint input, [MarshalAs(UnmanagedType.Bool)] out bool res);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "winbool_return_as_refuint")]
         public static partial void ReturnUIntAsWinBool_In(uint input, [MarshalAs(UnmanagedType.Bool)] in bool res);
     }
 
index d58e6cc..1452fef 100644 (file)
@@ -16,10 +16,10 @@ namespace LibraryImportGenerator.IntegrationTests
     {
         internal partial class CallingConventions
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "add_integers_cdecl")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "add_integers_cdecl")]
             [UnmanagedCallConv(CallConvs = new[] { typeof(CallConvCdecl) })]
             public static partial long AddLongsCdecl(long i, long j, long k, long l, long m, long n, long o, long p, long q);
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "add_integers_stdcall")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "add_integers_stdcall")]
             [UnmanagedCallConv(CallConvs = new[] { typeof(CallConvStdcall) })]
             public static partial long AddLongsStdcall(long i, long j, long k, long l, long m, long n, long o, long p, long q);
         }
index f55902e..48dcdd1 100644 (file)
@@ -12,30 +12,30 @@ namespace LibraryImportGenerator.IntegrationTests
 {
     partial class NativeExportsNE
     {
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "unicode_return_as_uint", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "unicode_return_as_uint", StringMarshalling = StringMarshalling.Utf16)]
         public static partial uint ReturnUnicodeAsUInt(char input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf16)]
         public static partial char ReturnUIntAsUnicode(uint input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)]
         public static partial void ReturnUIntAsUnicode_Ref(uint input, ref char res);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)]
         public static partial void ReturnUIntAsUnicode_Out(uint input, out char res);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_refuint", StringMarshalling = StringMarshalling.Utf16)]
         public static partial void ReturnUIntAsUnicode_In(uint input, in char res);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf8)]
         [return: MarshalAs(UnmanagedType.U2)]
         public static partial char ReturnU2AsU2IgnoreCharSet([MarshalAs(UnmanagedType.U2)] char input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf8)]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_return_as_uint", StringMarshalling = StringMarshalling.Utf8)]
         [return: MarshalAs(UnmanagedType.I2)]
         public static partial char ReturnI2AsI2IgnoreCharSet([MarshalAs(UnmanagedType.I2)] char input);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "char_reverse_buffer_ref", StringMarshalling = StringMarshalling.Utf16)]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "char_reverse_buffer_ref", StringMarshalling = StringMarshalling.Utf16)]
         public static partial void ReverseBuffer(ref char buffer, int len);
     }
 
index d33fad2..f8676d6 100644 (file)
@@ -16,46 +16,46 @@ namespace LibraryImportGenerator.IntegrationTests
     {
         public partial class Collections
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
             public static partial int Sum([MarshalUsing(typeof(ListMarshaller<int>))] List<int> values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
             public static partial int Sum(ref int values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")]
             public static partial int SumInArray([MarshalUsing(typeof(ListMarshaller<int>))] in List<int> values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
             public static partial void Duplicate([MarshalUsing(typeof(ListMarshaller<int>), CountElementName = "numValues")] ref List<int> values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")]
             [return:MarshalUsing(typeof(ListMarshaller<int>), CountElementName = "numValues")]
             public static partial List<int> CreateRange(int start, int end, out int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")]
             public static partial void CreateRange_Out(int start, int end, out int numValues, [MarshalUsing(typeof(ListMarshaller<int>), CountElementName = "numValues")] out List<int> res);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")]
             public static partial int SumStringLengths([MarshalUsing(typeof(ListMarshaller<string>)), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] List<string> strArray);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_replace")]
             public static partial void ReverseStrings_Ref([MarshalUsing(typeof(ListMarshaller<string>), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] ref List<string> strArray, out int numElements);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_return")]
             [return: MarshalUsing(typeof(ListMarshaller<string>), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)]
             public static partial List<string> ReverseStrings_Return([MarshalUsing(typeof(ListMarshaller<string>), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] List<string> strArray, out int numElements);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_out")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_strings_out")]
             public static partial void ReverseStrings_Out(
                 [MarshalUsing(typeof(ListMarshaller<string>)), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] List<string> strArray,
                 out int numElements,
                 [MarshalUsing(typeof(ListMarshaller<string>), CountElementName = "numElements"), MarshalUsing(typeof(Utf16StringMarshaller), ElementIndirectionLevel = 1)] out List<string> res);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")]
             [return:MarshalUsing(typeof(ListMarshaller<byte>), ConstantElementCount = sizeof(long))]
             public static partial List<byte> GetLongBytes(long l);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")]
             [return:MarshalAs(UnmanagedType.U1)]
             public static partial bool AndAllMembers([MarshalUsing(typeof(ListMarshaller<BoolStruct>))] List<BoolStruct> pArray, int length);
         }
index 0477c6b..f563b6f 100644 (file)
@@ -12,31 +12,31 @@ namespace LibraryImportGenerator.IntegrationTests
 {
     partial class NativeExportsNE
     {
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "stringcontainer_deepduplicate")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "stringcontainer_deepduplicate")]
         public static partial void DeepDuplicateStrings(StringContainer strings, out StringContainer pStringsOut);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "stringcontainer_reverse_strings")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "stringcontainer_reverse_strings")]
         public static partial void ReverseStrings(ref StringContainer strings);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes_as_double")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes_as_double")]
         public static partial double GetLongBytesAsDouble([MarshalUsing(typeof(DoubleToLongMarshaler))] double d);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "negate_bools")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "negate_bools")]
         public static partial void NegateBools(
             BoolStruct boolStruct,
             out BoolStruct pBoolStructOut);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "and_bools_ref")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "and_bools_ref")]
         [return: MarshalAs(UnmanagedType.U1)]
         public static partial bool AndBoolsRef(in BoolStruct boolStruct);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "double_int_ref")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "double_int_ref")]
         public static partial IntWrapper DoubleIntRef(IntWrapper pInt);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_replace_ref_ushort")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "reverse_replace_ref_ushort")]
         public static partial void ReverseReplaceString([MarshalUsing(typeof(Utf16StringMarshaller))] ref string s);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "return_length_ushort")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "return_length_ushort")]
         public static partial int ReturnStringLength([MarshalUsing(typeof(Utf16StringMarshaller))] string s);
     }
 
index b7db866..639c607 100644 (file)
@@ -11,12 +11,12 @@ namespace LibraryImportGenerator.IntegrationTests
     {
         public delegate void VoidVoid();
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")]
         public static partial void InvokeAfterGC(VoidVoid cb);
 
         public delegate int IntIntInt(int a, int b);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")]
         public static partial int InvokeWithBlittableArgument(IntIntInt cb, int a, int b);
     }
 
index c5d06dd..14585b2 100644 (file)
@@ -12,31 +12,31 @@ namespace LibraryImportGenerator.IntegrationTests
     {
         public partial class IntEnum
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_return_int")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_return_int")]
             public static partial EnumTests.IntEnum Subtract_Return(EnumTests.IntEnum a, EnumTests.IntEnum b);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_out_int")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_out_int")]
             public static partial void Subtract_Out(EnumTests.IntEnum a, EnumTests.IntEnum b, out EnumTests.IntEnum c);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")]
             public static partial void Subtract_Ref(EnumTests.IntEnum a, ref EnumTests.IntEnum b);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")]
             public static partial void Subtract_In(EnumTests.IntEnum a, in EnumTests.IntEnum b);
         }
 
         public partial class ByteEnum
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_return_byte")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_return_byte")]
             public static partial EnumTests.ByteEnum Subtract_Return(EnumTests.ByteEnum a, EnumTests.ByteEnum b);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_out_byte")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_out_byte")]
             public static partial void Subtract_Out(EnumTests.ByteEnum a, EnumTests.ByteEnum b, out EnumTests.ByteEnum c);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")]
             public static partial void Subtract_Ref(EnumTests.ByteEnum a, ref EnumTests.ByteEnum b);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")]
             public static partial void Subtract_In(EnumTests.ByteEnum a, in EnumTests.ByteEnum b);
         }
     }
index ce270b6..fde6b23 100644 (file)
@@ -13,22 +13,22 @@ namespace LibraryImportGenerator.IntegrationTests
     {
         public partial class FunctionPointer
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_managed_callback_after_gc")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_managed_callback_after_gc")]
             public static unsafe partial void InvokeAfterGC(delegate* <void> cb);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")]
             public static unsafe partial void InvokeAfterGC(delegate* unmanaged<void> cb);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_after_gc")]
             public static unsafe partial void InvokeAfterGC(delegate* unmanaged[Stdcall]<void> cb);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_managed_callback_blittable_args")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_managed_callback_blittable_args")]
             public static unsafe partial int InvokeWithBlittableArgument(delegate* <int, int, int> cb, int a, int b);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")]
             public static unsafe partial int InvokeWithBlittableArgument(delegate* unmanaged<int, int, int> cb, int a, int b);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "invoke_callback_blittable_args")]
             public static unsafe partial int InvokeWithBlittableArgument(delegate* unmanaged[Stdcall]<int, int, int> cb, int a, int b);
         }
     }
index dd3cef0..f1b68d8 100644 (file)
@@ -11,13 +11,13 @@ namespace LibraryImportGenerator.IntegrationTests
 {
     partial class NativeExportsNE
     {
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_int")]
         public static unsafe partial void Subtract_Int_Ptr(int a, int* b);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "subtract_ref_byte")]
         public static unsafe partial void Subtract_Byte_Ptr(byte a, byte* b);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_double_intfields_byref")]
         public static unsafe partial void DoubleIntFields_Ptr(IntFields* result);
     }
 
index 2e5b9af..1ae443c 100644 (file)
@@ -25,25 +25,25 @@ namespace LibraryImportGenerator.IntegrationTests
             public static NativeExportsSafeHandle CreateNewHandle() => AllocateHandle();
 
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle")]
             private static partial NativeExportsSafeHandle AllocateHandle();
         }
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle")]
         public static partial NativeExportsSafeHandle AllocateHandle();
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle_out")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "alloc_handle_out")]
         public static partial void AllocateHandle(out NativeExportsSafeHandle handle);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "release_handle")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "release_handle")]
         [return:MarshalAs(UnmanagedType.I1)]
         private static partial bool ReleaseHandle(nint handle);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "is_handle_alive")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "is_handle_alive")]
         [return:MarshalAs(UnmanagedType.I1)]
         public static partial bool IsHandleAlive(NativeExportsSafeHandle handle);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "modify_handle")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "modify_handle")]
         public static partial void ModifyHandle(ref NativeExportsSafeHandle handle, [MarshalAs(UnmanagedType.I1)] bool newHandle);
     }
 
index 02db038..057bef9 100644 (file)
@@ -29,14 +29,14 @@ namespace LibraryImportGenerator.IntegrationTests
     {
         public partial class SetLastError
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "set_error", SetLastError = true)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "set_error", SetLastError = true)]
             public static partial int SetError(int error, byte shouldSetError);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "set_error", SetLastError = true)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "set_error", SetLastError = true)]
             [return: MarshalUsing(typeof(SetLastErrorMarshaller))]
             public static partial int SetError_CustomMarshallingSetsError(int error, byte shouldSetError);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "set_error_return_string", SetLastError = true)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "set_error_return_string", SetLastError = true)]
             [return: MarshalAs(UnmanagedType.LPWStr)]
             public static partial string SetError_NonBlittableSignature(int error, [MarshalAs(UnmanagedType.U1)] bool shouldSetError, [MarshalAs(UnmanagedType.LPWStr)] string errorString);
         }
index fc30ca2..3b0a91c 100644 (file)
@@ -18,36 +18,36 @@ namespace LibraryImportGenerator.IntegrationTests
     {
         public partial class Span
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
             public static partial int Sum([MarshalUsing(typeof(SpanMarshaller<int>))] Span<int> values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
             public static partial int SumNeverNull([MarshalUsing(typeof(NeverNullSpanMarshaller<int>))] Span<int> values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array")]
             public static partial int SumNeverNull([MarshalUsing(typeof(NeverNullReadOnlySpanMarshaller<int>))] ReadOnlySpan<int> values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sum_int_array_ref")]
             public static partial int SumInArray([MarshalUsing(typeof(SpanMarshaller<int>))] in Span<int> values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
             public static partial void Duplicate([MarshalUsing(typeof(SpanMarshaller<int>), CountElementName = "numValues")] ref Span<int> values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "duplicate_int_array")]
             public static partial void DuplicateRaw([MarshalUsing(typeof(DirectSpanMarshaller<int>), CountElementName = "numValues")] ref Span<int> values, int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array")]
             [return: MarshalUsing(typeof(SpanMarshaller<int>), CountElementName = "numValues")]
             public static partial Span<int> CreateRange(int start, int end, out int numValues);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")]
             public static partial void CreateRange_Out(int start, int end, out int numValues, [MarshalUsing(typeof(SpanMarshaller<int>), CountElementName = "numValues")] out Span<int> res);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_long_bytes")]
             [return: MarshalUsing(typeof(SpanMarshaller<byte>), ConstantElementCount = sizeof(long))]
             public static partial Span<byte> GetLongBytes(long l);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = "and_all_members")]
             [return: MarshalAs(UnmanagedType.U1)]
             public static partial bool AndAllMembers([MarshalUsing(typeof(SpanMarshaller<BoolStruct>))] Span<BoolStruct> pArray, int length);
         }
index 29d0922..73ac84a 100644 (file)
@@ -44,143 +44,143 @@ namespace LibraryImportGenerator.IntegrationTests
 
         public partial class Utf16
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf16)]
             public static partial int ReturnLength(string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn, StringMarshalling = StringMarshalling.Utf16)]
             public static partial string Reverse_Return(string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut, StringMarshalling = StringMarshalling.Utf16)]
             public static partial void Reverse_Out(string s, out string ret);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshalling = StringMarshalling.Utf16)]
             public static partial void Reverse_Ref(ref string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshalling = StringMarshalling.Utf16)]
             public static partial void Reverse_In(in string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReplace, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReplace, StringMarshalling = StringMarshalling.Utf16)]
             public static partial void Reverse_Replace_Ref(ref string s);
         }
 
         public partial class LPTStr
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength)]
             public static partial int ReturnLength([MarshalAs(UnmanagedType.LPTStr)] string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf8)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf8)]
             public static partial int ReturnLength_IgnoreStringMarshalling([MarshalAs(UnmanagedType.LPTStr)] string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn)]
             [return: MarshalAs(UnmanagedType.LPTStr)]
             public static partial string Reverse_Return([MarshalAs(UnmanagedType.LPTStr)] string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut)]
             public static partial void Reverse_Out([MarshalAs(UnmanagedType.LPTStr)] string s, [MarshalAs(UnmanagedType.LPTStr)] out string ret);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
             public static partial void Reverse_Ref([MarshalAs(UnmanagedType.LPTStr)] ref string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
             public static partial void Reverse_In([MarshalAs(UnmanagedType.LPTStr)] in string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
             public static partial void Reverse_Replace_Ref([MarshalAs(UnmanagedType.LPTStr)] ref string s);
         }
 
         public partial class LPWStr
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength)]
             public static partial int ReturnLength([MarshalAs(UnmanagedType.LPWStr)] string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf8)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshalling = StringMarshalling.Utf8)]
             public static partial int ReturnLength_IgnoreStringMarshalling([MarshalAs(UnmanagedType.LPWStr)] string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn)]
             [return: MarshalAs(UnmanagedType.LPWStr)]
             public static partial string Reverse_Return([MarshalAs(UnmanagedType.LPWStr)] string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut)]
             public static partial void Reverse_Out([MarshalAs(UnmanagedType.LPWStr)] string s, [MarshalAs(UnmanagedType.LPWStr)] out string ret);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
             public static partial void Reverse_Ref([MarshalAs(UnmanagedType.LPWStr)] ref string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
             public static partial void Reverse_In([MarshalAs(UnmanagedType.LPWStr)] in string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace)]
             public static partial void Reverse_Replace_Ref([MarshalAs(UnmanagedType.LPWStr)] ref string s);
         }
 
         public partial class LPUTF8Str
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength)]
             public static partial int ReturnLength([MarshalAs(UnmanagedType.LPUTF8Str)] string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf16)]
             public static partial int ReturnLength_IgnoreStringMarshalling([MarshalAs(UnmanagedType.LPUTF8Str)] string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn)]
             [return: MarshalAs(UnmanagedType.LPUTF8Str)]
             public static partial string Reverse_Return([MarshalAs(UnmanagedType.LPUTF8Str)] string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut)]
             public static partial void Reverse_Out([MarshalAs(UnmanagedType.LPUTF8Str)] string s, [MarshalAs(UnmanagedType.LPUTF8Str)] out string ret);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
             public static partial void Reverse_In([MarshalAs(UnmanagedType.LPUTF8Str)] in string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
             public static partial void Reverse_Ref([MarshalAs(UnmanagedType.LPUTF8Str)] ref string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
             public static partial void Reverse_Replace_Ref([MarshalAs(UnmanagedType.LPUTF8Str)] ref string s);
         }
 
         public partial class Utf8
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf8)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf8)]
             public static partial int ReturnLength(string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn, StringMarshalling = StringMarshalling.Utf8)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn, StringMarshalling = StringMarshalling.Utf8)]
             public static partial string Reverse_Return(string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut, StringMarshalling = StringMarshalling.Utf8)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut, StringMarshalling = StringMarshalling.Utf8)]
             public static partial void Reverse_Out(string s, out string ret);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)]
             public static partial void Reverse_Ref(ref string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)]
             public static partial void Reverse_In(in string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshalling = StringMarshalling.Utf8)]
             public static partial void Reverse_Replace_Ref(ref string s);
         }
 
         public partial class LPStr
         {
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength)]
             public static partial int ReturnLength([MarshalAs(UnmanagedType.LPStr)] string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf16)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshalling = StringMarshalling.Utf16)]
             public static partial int ReturnLength_IgnoreStringMarshalling([MarshalAs(UnmanagedType.LPStr)] string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn)]
             [return: MarshalAs(UnmanagedType.LPStr)]
             public static partial string Reverse_Return([MarshalAs(UnmanagedType.LPStr)] string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut)]
             public static partial void Reverse_Out([MarshalAs(UnmanagedType.LPStr)] string s, [MarshalAs(UnmanagedType.LPStr)] out string ret);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
             public static partial void Reverse_Ref([MarshalAs(UnmanagedType.LPStr)] ref string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
             public static partial void Reverse_In([MarshalAs(UnmanagedType.LPStr)] in string s);
 
-            [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
+            [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace)]
             public static partial void Reverse_Replace_Ref([MarshalAs(UnmanagedType.LPStr)] ref string s);
         }
 
@@ -188,43 +188,43 @@ namespace LibraryImportGenerator.IntegrationTests
         {
             public partial class Utf16
             {
-                [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
+                [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReturnLength, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
                 public static partial int ReturnLength(string s);
 
-                [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
+                [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReturn, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
                 public static partial string Reverse_Return(string s);
 
-                [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
+                [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseOut, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
                 public static partial void Reverse_Out(string s, out string ret);
 
-                [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
+                [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
                 public static partial void Reverse_Ref(ref string s);
 
-                [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
+                [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
                 public static partial void Reverse_In(in string s);
 
-                [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
+                [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.UShort.ReverseReplace, StringMarshallingCustomType = typeof(SharedTypes.Utf16StringMarshaller))]
                 public static partial void Reverse_Replace_Ref(ref string s);
             }
 
             public partial class Utf8
             {
-                [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
+                [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReturnLength, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
                 public static partial int ReturnLength(string s);
 
-                [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
+                [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReturn, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
                 public static partial string Reverse_Return(string s);
 
-                [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
+                [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseOut, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
                 public static partial void Reverse_Out(string s, out string ret);
 
-                [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
+                [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
                 public static partial void Reverse_Ref(ref string s);
 
-                [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
+                [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseInplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
                 public static partial void Reverse_In(in string s);
 
-                [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
+                [LibraryImport(NativeExportsNE_Binary, EntryPoint = EntryPoints.Byte.ReverseReplace, StringMarshallingCustomType = typeof(SharedTypes.Utf8StringMarshaller))]
                 public static partial void Reverse_Replace_Ref(ref string s);
             }
         }
index 7894fbe..748e160 100644 (file)
@@ -22,7 +22,7 @@ using System.Runtime.InteropServices;
 [assembly:DisableRuntimeMarshalling]
 partial class C
 {
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial S Method();
 }
 
@@ -52,7 +52,7 @@ struct Native
 using System.Runtime.InteropServices;
 partial class C
 {
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial void Method();
 }";
             Compilation comp = await TestUtils.CreateCompilation(source);
@@ -73,7 +73,7 @@ using System.Runtime.InteropServices;
 [assembly:DisableRuntimeMarshalling]
 partial class C
 {
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial S Method();
 }
 
@@ -103,7 +103,7 @@ struct Native
 using System.Runtime.InteropServices;
 partial class C
 {
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial void Method();
 }";
             Compilation comp = await TestUtils.CreateCompilation(source);
@@ -131,10 +131,10 @@ partial class C
         {
             string source = $@"
 using System.Runtime.InteropServices;
-{CodeSnippets.GeneratedDllImportAttributeDeclaration}
+{CodeSnippets.LibraryImportAttributeDeclaration}
 partial class C
 {{
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.Bool)]
     public static partial bool Method();
 }}";
@@ -163,7 +163,7 @@ using System.Runtime.CompilerServices;
 [module:SkipLocalsInit]
 partial class C
 {
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial S Method();
 }
 
@@ -195,7 +195,7 @@ using System.Runtime.CompilerServices;
 [SkipLocalsInit]
 partial class C
 {
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial S Method();
 }
 
@@ -227,7 +227,7 @@ using System.Runtime.CompilerServices;
 partial class C
 {
     [SkipLocalsInit]
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial S Method();
 }
 
index 7a7c59a..3e24015 100644 (file)
@@ -29,7 +29,7 @@ using System.Runtime.InteropServices;
 partial class C
 {{
     [{attributeSourceName}]
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial S Method1();
 }}
 
@@ -70,7 +70,7 @@ using System.Runtime.InteropServices;
 partial class C
 {
     [UnmanagedCallConv(CallConvs = new Type[0])]
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial S Method1();
 }
 
@@ -113,7 +113,7 @@ using System.Runtime.InteropServices;
 partial class C
 {
     [UnmanagedCallConv(CallConvs = new[]{typeof(CallConvStdcall)})]
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial S Method1();
 }
 
@@ -160,7 +160,7 @@ using System.Runtime.InteropServices;
 partial class C
 {
     [UnmanagedCallConv(CallConvs = new[]{typeof(CallConvStdcall), typeof(CallConvSuppressGCTransition)})]
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial S Method1();
 }
 
@@ -211,7 +211,7 @@ using System.Runtime.InteropServices;
 partial class C
 {{
     [DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.UserDirectories)]
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial S Method1();
 }}
 
@@ -259,7 +259,7 @@ class OtherAttribute : Attribute {}
 partial class C
 {
     [Other]
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial S Method1();
 }
 
@@ -298,11 +298,11 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 partial class C
 {
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.Bool)]
     public static partial bool Method1([In, Out] int[] a);
 }
-" + CodeSnippets.GeneratedDllImportAttributeDeclaration;
+" + CodeSnippets.LibraryImportAttributeDeclaration;
             Compilation origComp = await TestUtils.CreateCompilation(source, TestTargetFramework.Standard);
             Compilation newComp = TestUtils.RunGenerators(origComp, out _, new Microsoft.Interop.LibraryImportGenerator());
 
@@ -341,11 +341,11 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 partial class C
 {
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.Bool)]
     public static partial bool Method1([MarshalAs(UnmanagedType.I2)] int a);
 }
-" + CodeSnippets.GeneratedDllImportAttributeDeclaration;
+" + CodeSnippets.LibraryImportAttributeDeclaration;
             Compilation origComp = await TestUtils.CreateCompilation(source, TestTargetFramework.Standard);
             Compilation newComp = TestUtils.RunGenerators(origComp, out _, new Microsoft.Interop.LibraryImportGenerator());
 
@@ -370,11 +370,11 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 partial class C
 {
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.Bool)]
     public static partial bool Method1([MarshalAs(UnmanagedType.LPArray, SizeConst = 10, SizeParamIndex = 1, ArraySubType = UnmanagedType.I4)] int[] a, int b);
 }
-" + CodeSnippets.GeneratedDllImportAttributeDeclaration;
+" + CodeSnippets.LibraryImportAttributeDeclaration;
             Compilation origComp = await TestUtils.CreateCompilation(source, TestTargetFramework.Standard);
             Compilation newComp = TestUtils.RunGenerators(origComp, out _, new Microsoft.Interop.LibraryImportGenerator());
 
index a1be0ba..93b822d 100644 (file)
@@ -8,9 +8,9 @@ namespace LibraryImportGenerator.UnitTests
     internal static class CodeSnippets
     {
         /// <summary>
-        /// Partially define attribute for pre-.NET 6.0
+        /// Partially define attribute for pre-.NET 7.0
         /// </summary>
-        public static readonly string GeneratedDllImportAttributeDeclaration = @"
+        public static readonly string LibraryImportAttributeDeclaration = @"
 namespace System.Runtime.InteropServices
 {
     internal enum StringMarshalling
@@ -20,9 +20,9 @@ namespace System.Runtime.InteropServices
         Utf16,
     }
 
-    sealed class GeneratedDllImportAttribute : System.Attribute
+    sealed class LibraryImportAttribute : System.Attribute
     {
-        public GeneratedDllImportAttribute(string a) { }
+        public LibraryImportAttribute(string a) { }
         public StringMarshalling StringMarshalling { get; set; }
         public Type StringMarshallingCustomType { get; set; }
     }
@@ -30,42 +30,42 @@ namespace System.Runtime.InteropServices
 ";
 
         /// <summary>
-        /// Trivial declaration of GeneratedDllImport usage
+        /// Trivial declaration of LibraryImport usage
         /// </summary>
         public static readonly string TrivialClassDeclarations = @"
 using System.Runtime.InteropServices;
 partial class Basic
 {
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial void Method1();
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method2();
 
-    [System.Runtime.InteropServices.GeneratedDllImportAttribute(""DoesNotExist"")]
+    [System.Runtime.InteropServices.LibraryImportAttribute(""DoesNotExist"")]
     public static partial void Method3();
 
-    [System.Runtime.InteropServices.GeneratedDllImport(""DoesNotExist"")]
+    [System.Runtime.InteropServices.LibraryImport(""DoesNotExist"")]
     public static partial void Method4();
 }
 ";
         /// <summary>
-        /// Trivial declaration of GeneratedDllImport usage
+        /// Trivial declaration of LibraryImport usage
         /// </summary>
         public static readonly string TrivialStructDeclarations = @"
 using System.Runtime.InteropServices;
 partial struct Basic
 {
-    [GeneratedDllImportAttribute(""DoesNotExist"")]
+    [LibraryImportAttribute(""DoesNotExist"")]
     public static partial void Method1();
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method2();
 
-    [System.Runtime.InteropServices.GeneratedDllImportAttribute(""DoesNotExist"")]
+    [System.Runtime.InteropServices.LibraryImportAttribute(""DoesNotExist"")]
     public static partial void Method3();
 
-    [System.Runtime.InteropServices.GeneratedDllImport(""DoesNotExist"")]
+    [System.Runtime.InteropServices.LibraryImport(""DoesNotExist"")]
     public static partial void Method4();
 }
 ";
@@ -90,7 +90,7 @@ sealed class Dummy2Attribute : Attribute
 partial class Test
 {
     [DummyAttribute]
-    [GeneratedDllImport(""DoesNotExist""), Dummy2Attribute(""string value"")]
+    [LibraryImport(""DoesNotExist""), Dummy2Attribute(""string value"")]
     public static partial void Method();
 }
 ";
@@ -106,7 +106,7 @@ namespace NS
     {
         partial class Test
         {
-            [GeneratedDllImport(""DoesNotExist"")]
+            [LibraryImport(""DoesNotExist"")]
             public static partial void Method1();
         }
     }
@@ -115,7 +115,7 @@ namespace NS.InnerNS
 {
     partial class Test
     {
-        [GeneratedDllImport(""DoesNotExist"")]
+        [LibraryImport(""DoesNotExist"")]
         public static partial void Method2();
     }
 }
@@ -132,7 +132,7 @@ namespace NS
     {
         partial class InnerClass
         {
-            [GeneratedDllImport(""DoesNotExist"")]
+            [LibraryImport(""DoesNotExist"")]
             public static partial void Method();
         }
     }
@@ -140,7 +140,7 @@ namespace NS
     {
         partial struct InnerStruct
         {
-            [GeneratedDllImport(""DoesNotExist"")]
+            [LibraryImport(""DoesNotExist"")]
             public static partial void Method();
         }
     }
@@ -148,7 +148,7 @@ namespace NS
     {
         partial struct InnerStruct
         {
-            [GeneratedDllImport(""DoesNotExist"")]
+            [LibraryImport(""DoesNotExist"")]
             public static partial void Method();
         }
     }
@@ -156,7 +156,7 @@ namespace NS
     {
         partial class InnerClass
         {
-            [GeneratedDllImport(""DoesNotExist"")]
+            [LibraryImport(""DoesNotExist"")]
             public static partial void Method();
         }
     }
@@ -170,12 +170,12 @@ namespace NS
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method1();
 }
 unsafe partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial int* Method2();
 }
 ";
@@ -186,19 +186,19 @@ unsafe partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint=""UserDefinedEntryPoint"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint=""UserDefinedEntryPoint"")]
     public static partial void NotAnExport();
 }
 ";
 
         /// <summary>
-        /// Declaration with all GeneratedDllImport named arguments.
+        /// Declaration with all LibraryImport named arguments.
         /// </summary>
-        public static readonly string AllGeneratedDllImportNamedArguments = @"
+        public static readonly string AllLibraryImportNamedArguments = @"
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"",
+    [LibraryImport(""DoesNotExist"",
         StringMarshalling = StringMarshalling.Utf16,
         EntryPoint = ""UserDefinedEntryPoint"",
         SetLastError = true)]
@@ -219,19 +219,19 @@ partial class Test
     private const int One = 1;
     private const int Two = 2;
 
-    [GeneratedDllImport(nameof(Test),
+    [LibraryImport(nameof(Test),
         StringMarshalling = (StringMarshalling)2,
         EntryPoint = EntryPointName,
         SetLastError = IsFalse)]
     public static partial void Method1();
 
-    [GeneratedDllImport(nameof(Test),
+    [LibraryImport(nameof(Test),
         StringMarshalling = (StringMarshalling)Two,
         EntryPoint = EntryPointName,
         SetLastError = !IsTrue)]
     public static partial void Method2();
 
-    [GeneratedDllImport(nameof(Test),
+    [LibraryImport(nameof(Test),
         StringMarshalling = (StringMarshalling)2,
         EntryPoint = EntryPointName,
         SetLastError = 0 != 1)]
@@ -246,7 +246,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(int t = 0);
 }
 ";
@@ -259,7 +259,7 @@ using System.Runtime.InteropServices;
 partial class Test
 {
     [LCIDConversion(0)]
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method();
 }
 ";
@@ -296,11 +296,11 @@ namespace NS
 
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(NS.MyCustomMarshaler), MarshalCookie=""COOKIE1"")]
     public static partial bool Method1([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(NS.MyCustomMarshaler), MarshalCookie=""COOKIE2"")]bool t);
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = ""NS.MyCustomMarshaler"", MarshalCookie=""COOKIE3"")]
     public static partial bool Method2([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = ""NS.MyCustomMarshaler"", MarshalCookie=""COOKIE4"")]bool t);
 }
@@ -316,21 +316,21 @@ using System.Runtime.InteropServices;
 namespace System.Runtime.InteropServices
 {
     // Prefix with ATTRIBUTE so the lengths will match during check.
-    sealed class ATTRIBUTEGeneratedDllImportAttribute : Attribute
+    sealed class ATTRIBUTELibraryImportAttribute : Attribute
     {
-        public ATTRIBUTEGeneratedDllImportAttribute(string a) { }
+        public ATTRIBUTELibraryImportAttribute(string a) { }
     }
 }
 
 partial class Test
 {
-    [ATTRIBUTEGeneratedDllImportAttribute(""DoesNotExist"")]
+    [ATTRIBUTELibraryImportAttribute(""DoesNotExist"")]
     public static partial void Method1();
 
-    [ATTRIBUTEGeneratedDllImport(""DoesNotExist"")]
+    [ATTRIBUTELibraryImport(""DoesNotExist"")]
     public static partial void Method2();
 
-    [System.Runtime.InteropServices.ATTRIBUTEGeneratedDllImport(""DoesNotExist"")]
+    [System.Runtime.InteropServices.ATTRIBUTELibraryImport(""DoesNotExist"")]
     public static partial void Method3();
 }
 ";
@@ -345,7 +345,7 @@ using System.Runtime.InteropServices;
 {preDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.{value})]
+    [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.{value})]
     public static partial {typename} Method(
         {typename} p,
         in {typename} pIn,
@@ -365,7 +365,7 @@ using System.Runtime.InteropServices;
 {preDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", StringMarshallingCustomType = typeof({stringMarshallingCustomTypeName}))]
+    [LibraryImport(""DoesNotExist"", StringMarshallingCustomType = typeof({stringMarshallingCustomTypeName}))]
     public static partial {typeName} Method(
         {typeName} p,
         in {typeName} pIn,
@@ -397,7 +397,7 @@ using System.Runtime.InteropServices;
 {preDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial {typeName} Method(
         {typeName} p,
         in {typeName} pIn,
@@ -413,7 +413,7 @@ using System.Runtime.InteropServices;
 {preDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial {typeName} Method(
         {typeName} p,
         in {typeName} pIn,
@@ -428,7 +428,7 @@ using System.Runtime.InteropServices;
 {preDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static unsafe partial {typeName} Method(
         {typeName} p,
         in {typeName} pIn,
@@ -446,7 +446,7 @@ using System.Runtime.InteropServices;
 {preDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         [{attributeName}] {typeName} p);
 }}";
@@ -460,7 +460,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void {methodName}(
         int {paramName});
 }}";
@@ -472,7 +472,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.{unmanagedType})]
     public static partial {typeName} Method(
         [MarshalAs(UnmanagedType.{unmanagedType})] {typeName} p,
@@ -489,7 +489,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.{unmanagedType})]
     public static unsafe partial {typeName} Method(
         [MarshalAs(UnmanagedType.{unmanagedType})] {typeName} p,
@@ -515,7 +515,7 @@ namespace NS
 
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial MyEnum Method(
         MyEnum p,
         in MyEnum pIn,
@@ -535,7 +535,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", SetLastError = true)]
+    [LibraryImport(""DoesNotExist"", SetLastError = true)]
     public static partial {typeName} Method({typeName} p);
 }}";
 
@@ -569,7 +569,7 @@ using System.Runtime.InteropServices;
 {preDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return:MarshalAs(UnmanagedType.LPArray, SizeConst=10)]
     public static partial {elementType}[] Method(
         {elementType}[] p,
@@ -588,7 +588,7 @@ using System.Runtime.InteropServices;
 {DisableRuntimeMarshalling}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         {(isByRef ? "ref" : "")} {sizeParamType} pRefSize,
         [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ref int[] pRef
@@ -603,7 +603,7 @@ using System.Runtime.InteropServices;
 {preDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.{nestedMarshalInfo})] {elementType}[] pRef
         );
@@ -619,7 +619,7 @@ using System.Runtime.InteropServices;
 {preDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return: MarshalUsing(typeof({nativeTypeName}))]
     public static partial {typeName} Method(
         [MarshalUsing(typeof({nativeTypeName}))] {typeName} p,
@@ -857,7 +857,7 @@ unsafe ref struct Native
 
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         S s,
         in S sIn);
@@ -889,7 +889,7 @@ using System.Runtime.InteropServices;
 {preDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         {byRefKind} {typeName} p);
 }}";
@@ -899,7 +899,7 @@ using System.Runtime.InteropServices;
 {preDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         {typeName} p);
 }}";
@@ -909,7 +909,7 @@ using System.Runtime.InteropServices;
 {preDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial {typeName} Method();
 }}";
 
@@ -1019,7 +1019,7 @@ class MySafeHandle : SafeHandle
 partial class Test
 {{
 #if {define}
-    [System.Runtime.InteropServices.GeneratedDllImport(""DoesNotExist"")]
+    [System.Runtime.InteropServices.LibraryImport(""DoesNotExist"")]
     public static partial int Method(
         int p,
         in int pIn,
@@ -1033,7 +1033,7 @@ using System.Runtime.InteropServices;
 partial class Test
 {{
 #if {define}
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial int Method(
         int p,
         in int pIn,
@@ -1048,7 +1048,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
 #if {define}
     public static partial int Method(
         int p,
@@ -1067,7 +1067,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
 #if {define}
     public static partial int Method(
         int p,
@@ -1133,7 +1133,7 @@ using System.Runtime.InteropServices;
 {DisableRuntimeMarshalling}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return:MarshalUsing(ConstantElementCount=10)]
     public static partial {collectionType} Method(
         {collectionType} p,
@@ -1174,7 +1174,7 @@ using System.Runtime.InteropServices;
 {DisableRuntimeMarshalling}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return:MarshalUsing(typeof({marshallerType}), ConstantElementCount=10)]
     public static partial {collectionType} Method(
         [MarshalUsing(typeof({marshallerType}))] {collectionType} p,
@@ -1195,7 +1195,7 @@ using System.Runtime.InteropServices;
 {DisableRuntimeMarshalling}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial int Method(
         [MarshalUsing(typeof({marshallerType}), CountElementName = MarshalUsingAttribute.ReturnsCountValue)] out {collectionType} pOut
         );
@@ -1210,7 +1210,7 @@ using System.Runtime.InteropServices;
 {DisableRuntimeMarshalling}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         {(isByRef ? "ref" : "")} {sizeParamType} pRefSize,
         [MarshalUsing(CountElementName = ""pRefSize"")] ref int[] pRef
@@ -1224,7 +1224,7 @@ using System.Runtime.InteropServices;
 {DisableRuntimeMarshalling}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         int pRefSize,
         [MarshalUsing(ConstantElementCount = 10, CountElementName = ""pRefSize"")] ref int[] pRef
@@ -1236,7 +1236,7 @@ using System.Runtime.InteropServices;
 {DisableRuntimeMarshalling}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         int pRefSize,
         [MarshalUsing(CountElementName = null)] ref int[] pRef
@@ -1262,7 +1262,7 @@ using System.Runtime.InteropServices;
 [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return:MarshalUsing(ConstantElementCount=10)]
     [return:MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 1)]
     public static partial TestCollection<int> Method(
@@ -1288,7 +1288,7 @@ using System.Runtime.InteropServices;
 [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         [MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 1)] [MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 1)] TestCollection<int> p);
 }
@@ -1306,7 +1306,7 @@ using System.Runtime.InteropServices;
 [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         [MarshalUsing(typeof(IntWrapper), ElementIndirectionLevel = 2)] TestCollection<int> p);
 }
@@ -1324,7 +1324,7 @@ using System.Runtime.InteropServices;
 [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return:MarshalUsing(ConstantElementCount=10)]
     [return:MarshalAs(UnmanagedType.LPArray, SizeConst=10)]
     public static partial int[] Method();
@@ -1336,7 +1336,7 @@ using System.Runtime.InteropServices;
 [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return:MarshalUsing(CountElementName=MarshalUsingAttribute.ReturnsCountValue)]
     public static partial int[] Method();
 }
@@ -1347,7 +1347,7 @@ using System.Runtime.InteropServices;
 [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         [MarshalUsing(CountElementName=""arr"")] ref int[] arr
     );
@@ -1358,7 +1358,7 @@ using System.Runtime.InteropServices;
 [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         [MarshalUsing(CountElementName=""arr2"")] ref int[] arr,
         [MarshalUsing(CountElementName=""arr"")] ref int[] arr2
@@ -1370,7 +1370,7 @@ using System.Runtime.InteropServices;
 [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] ref int[] arr,
         [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ref int[] arr2
@@ -1383,7 +1383,7 @@ using System.Runtime.InteropServices;
 [assembly:System.Runtime.CompilerServices.DisableRuntimeMarshalling]
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(
         [MarshalUsing(CountElementName=""arr0"", ElementIndirectionLevel = 0)]
         [MarshalUsing(CountElementName=""arr1"", ElementIndirectionLevel = 1)]
@@ -1460,9 +1460,9 @@ partial class Test
 using System.Runtime.InteropServices;
 partial struct Basic
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial ref {typeName} RefReturn();
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial ref readonly {typeName} RefReadonlyReturn();
 }}";
 
@@ -1471,7 +1471,7 @@ using System.Runtime.InteropServices;
 
 partial struct Basic
 {
-    [GeneratedDllImport(""DoesNotExist"", SetLa)]
+    [LibraryImport(""DoesNotExist"", SetLa)]
     public static partial void Method();
 }
 ";
@@ -1480,7 +1480,7 @@ using System.Runtime.InteropServices;
 
 partial struct Basic
 {
-    [GeneratedDllImport(DoesNotExist)]
+    [LibraryImport(DoesNotExist)]
     public static partial void Method();
 }
 ";
@@ -1489,7 +1489,7 @@ using System.Runtime.InteropServices;
 
 partial struct Basic
 {
-    [GeneratedDllImport(""DoesNotExist"", SetLastError = ""Foo"")]
+    [LibraryImport(""DoesNotExist"", SetLastError = ""Foo"")]
     public static partial void Method();
 }
 ";
index 686e478..eb10a52 100644 (file)
@@ -17,7 +17,7 @@ namespace LibraryImportGenerator.UnitTests
     {
         public static IEnumerable<object[]> CodeSnippetsToCompile()
         {
-            // Not GeneratedDllImportAttribute
+            // Not LibraryImportAttribute
             yield return new object[] { CodeSnippets.UserDefinedPrefixedAttributes, 0, 3 };
 
             // No explicit marshalling for char or string
index 0ce0de3..9ee978e 100644 (file)
@@ -24,7 +24,7 @@ namespace LibraryImportGenerator.UnitTests
             yield return new[] { CodeSnippets.NestedTypes };
             yield return new[] { CodeSnippets.UnsafeContext };
             yield return new[] { CodeSnippets.UserDefinedEntryPoint };
-            yield return new[] { CodeSnippets.AllGeneratedDllImportNamedArguments };
+            yield return new[] { CodeSnippets.AllLibraryImportNamedArguments };
             yield return new[] { CodeSnippets.DefaultParameters };
             yield return new[] { CodeSnippets.UseCSharpFeaturesForConstants };
 
@@ -277,7 +277,7 @@ namespace LibraryImportGenerator.UnitTests
 
             // Confirm that all unsupported target frameworks can be generated.
             {
-                string code = CodeSnippets.BasicParametersAndModifiers<byte>(CodeSnippets.GeneratedDllImportAttributeDeclaration);
+                string code = CodeSnippets.BasicParametersAndModifiers<byte>(CodeSnippets.LibraryImportAttributeDeclaration);
                 yield return new object[] { code, TestTargetFramework.Net5, false };
                 yield return new object[] { code, TestTargetFramework.Core, false };
                 yield return new object[] { code, TestTargetFramework.Standard, false };
@@ -286,7 +286,7 @@ namespace LibraryImportGenerator.UnitTests
 
             // Confirm that all unsupported target frameworks fallback to a forwarder.
             {
-                string code = CodeSnippets.BasicParametersAndModifiers<byte[]>(CodeSnippets.GeneratedDllImportAttributeDeclaration);
+                string code = CodeSnippets.BasicParametersAndModifiers<byte[]>(CodeSnippets.LibraryImportAttributeDeclaration);
                 yield return new object[] { code, TestTargetFramework.Net5, true };
                 yield return new object[] { code, TestTargetFramework.Core, true };
                 yield return new object[] { code, TestTargetFramework.Standard, true };
@@ -295,7 +295,7 @@ namespace LibraryImportGenerator.UnitTests
 
             // Confirm that all unsupported target frameworks fallback to a forwarder.
             {
-                string code = CodeSnippets.BasicParametersAndModifiersWithStringMarshalling<string>(StringMarshalling.Utf16, CodeSnippets.GeneratedDllImportAttributeDeclaration);
+                string code = CodeSnippets.BasicParametersAndModifiersWithStringMarshalling<string>(StringMarshalling.Utf16, CodeSnippets.LibraryImportAttributeDeclaration);
                 yield return new object[] { code, TestTargetFramework.Net5, true };
                 yield return new object[] { code, TestTargetFramework.Core, true };
                 yield return new object[] { code, TestTargetFramework.Standard, true };
@@ -369,7 +369,7 @@ namespace LibraryImportGenerator.UnitTests
 
         public static IEnumerable<object[]> SnippetsWithBlittableTypesButNonBlittableDataToCompile()
         {
-            yield return new[] { CodeSnippets.AllGeneratedDllImportNamedArguments };
+            yield return new[] { CodeSnippets.AllLibraryImportNamedArguments };
             yield return new[] { CodeSnippets.BasicParametersAndModifiers<int>() };
             yield return new[] { CodeSnippets.SetLastErrorTrue<int>() };
         }
index 23c9db0..fca4e29 100644 (file)
@@ -153,13 +153,13 @@ unsafe partial class Test
         }
 
         [ConditionalFact]
-        public async Task GeneratedDllImport_NoDiagnostic()
+        public async Task LibraryImport_NoDiagnostic()
         {
             string source = @$"
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method();
 }}
 partial class Test
index 8398378..da4793e 100644 (file)
@@ -34,7 +34,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial int {{|CS8795:Method|}}(out int ret);
 }}";
             await VerifyCS.VerifyCodeFixAsync(
@@ -64,11 +64,11 @@ using System.Runtime.InteropServices;
 partial class Test
 {{
     // P/Invoke
-    [GeneratedDllImport(/*name*/""DoesNotExist"")] // comment
+    [LibraryImport(/*name*/""DoesNotExist"")] // comment
     public static partial int {{|CS8795:Method1|}}(out int ret);
 
     /** P/Invoke **/
-    [GeneratedDllImport(""DoesNotExist"") /*name*/]
+    [LibraryImport(""DoesNotExist"") /*name*/]
     // < ... >
     public static partial int {{|CS8795:Method2|}}(out int ret);
 }}";
@@ -97,11 +97,11 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [System.ComponentModel.Description(""Test""), GeneratedDllImport(""DoesNotExist"")]
+    [System.ComponentModel.Description(""Test""), LibraryImport(""DoesNotExist"")]
     public static partial int {{|CS8795:Method1|}}(out int ret);
 
     [System.ComponentModel.Description(""Test"")]
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.I4)]
     public static partial int {{|CS8795:Method2|}}(out int ret);
 }}";
@@ -128,10 +128,10 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
     public static partial int {{|CS8795:Method1|}}(out int ret);
 
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"", StringMarshalling = StringMarshalling.Utf16)]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"", StringMarshalling = StringMarshalling.Utf16)]
     public static partial string {{|CS8795:Method2|}}(out int ret);
 }}";
             await VerifyCS.VerifyCodeFixAsync(
@@ -166,19 +166,19 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
     public static partial int {{|CS8795:Method|}}(out int ret);
 
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
     public static partial int {{|CS8795:Method1|}}(out int ret);
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial int {{|CS8795:Method2|}}(out int ret);
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial int {{|CS8795:Method3|}}(out int ret);
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial int {{|CS8795:Method4|}}(out int ret);
 }}";
             await VerifyCS.VerifyCodeFixAsync(
@@ -201,7 +201,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
     public static partial int {{|CS8795:Method1|}}(out int ret);
 }}";
             await VerifyCS.VerifyCodeFixAsync(
@@ -228,7 +228,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
     [UnmanagedCallConv(CallConvs = new System.Type[] {{ typeof({callConvType.FullName}) }})]
     public static partial int {{|CS8795:Method1|}}(out int ret);
 }}";
@@ -252,7 +252,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
     public static partial string {{|CS8795:Method|}}(out int ret);
 }}";
             await VerifyCS.VerifyCodeFixAsync(
@@ -276,7 +276,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
     public static partial void {{|CS8795:Method|}}();
 }}";
             await VerifyCS.VerifyCodeFixAsync(source, fixedSourceNoSuffix, ConvertToLibraryImportKey);
@@ -284,7 +284,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry{suffix}"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry{suffix}"")]
     public static partial void {{|CS8795:Method|}}();
 }}";
             await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithSuffix, $"{ConvertToLibraryImportKey}{suffix}");
@@ -304,7 +304,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
     public static partial void {{|CS8795:Method|}}();
 }}";
             await VerifyCS.VerifyCodeFixAsync(source, fixedSourceNoSuffix, ConvertToLibraryImportKey);
@@ -312,7 +312,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""EntryA"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""EntryA"")]
     public static partial void {{|CS8795:Method|}}();
 }}";
             await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A");
@@ -320,7 +320,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""EntryW"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""EntryW"")]
     public static partial void {{|CS8795:Method|}}();
 }}";
             await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithWSuffix, $"{ConvertToLibraryImportKey}W");
@@ -340,7 +340,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""Entry"")]
     public static partial void {{|CS8795:Method|}}();
 }}";
             await VerifyCS.VerifyCodeFixAsync(source, fixedSourceNoSuffix, ConvertToLibraryImportKey);
@@ -348,7 +348,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""EntryA"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""EntryA"")]
     public static partial void {{|CS8795:Method|}}();
 }}";
             await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A");
@@ -370,7 +370,7 @@ using System.Runtime.InteropServices;
 partial class Test
 {{
     private const string EntryPoint = ""Entry"";
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = EntryPoint + ""A"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = EntryPoint + ""A"")]
     public static partial void {{|CS8795:Method|}}();
 }}";
             await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A");
@@ -390,7 +390,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""MethodA"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""MethodA"")]
     public static partial void {{|CS8795:Method|}}();
 }}";
             await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A");
@@ -412,7 +412,7 @@ using System.Runtime.InteropServices;
 partial class Test
 {{
     private const string Foo = ""Bar"";
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = nameof(Foo) + ""A"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = nameof(Foo) + ""A"")]
     public static partial void {{|CS8795:Method|}}();
 }}";
             await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A");
@@ -432,7 +432,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""MethodA"")]
+    [LibraryImport(""DoesNotExist"", EntryPoint = ""MethodA"")]
     public static partial void {{|CS8795:Method|}}();
 }}";
             await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, $"{ConvertToLibraryImportKey}A");
@@ -463,9 +463,9 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial int {|CS8795:VoidMethod|}(int param);
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial int {|CS8795:Method|}(int param, out long @return);
 
     public static void Code()
@@ -519,11 +519,11 @@ partial class Enclosing
 {
     partial class Test
     {
-        [GeneratedDllImport(""DoesNotExist"")]
+        [LibraryImport(""DoesNotExist"")]
         public static partial int {|CS8795:Method|}(out int ret);
-        [GeneratedDllImport(""DoesNotExist"")]
+        [LibraryImport(""DoesNotExist"")]
         public static partial int {|CS8795:Method2|}(out int ret);
-        [GeneratedDllImport(""DoesNotExist"")]
+        [LibraryImport(""DoesNotExist"")]
         public static partial int {|CS8795:Method3|}(out int ret);
     }
 }
@@ -531,11 +531,11 @@ partial class EnclosingPartial
 {
     partial class Test
     {
-        [GeneratedDllImport(""DoesNotExist"")]
+        [LibraryImport(""DoesNotExist"")]
         public static partial int {|CS8795:Method|}(out int ret);
-        [GeneratedDllImport(""DoesNotExist"")]
+        [LibraryImport(""DoesNotExist"")]
         public static partial int {|CS8795:Method2|}(out int ret);
-        [GeneratedDllImport(""DoesNotExist"")]
+        [LibraryImport(""DoesNotExist"")]
         public static partial int {|CS8795:Method3|}(out int ret);
     }
 }";
@@ -559,7 +559,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.Bool)]
     public static partial bool {{|CS8795:Method|}}([MarshalAs(UnmanagedType.Bool)] bool b);
 }}";
index 56ad889..1c7a492 100644 (file)
@@ -25,10 +25,10 @@ namespace LibraryImportGenerator.UnitTests
         {
             string source = $@"
 using System.Runtime.InteropServices;
-{CodeSnippets.GeneratedDllImportAttributeDeclaration}
+{CodeSnippets.LibraryImportAttributeDeclaration}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method();
 }}
 ";
@@ -47,7 +47,7 @@ partial class Test
         [InlineData(TestTargetFramework.Core)]
         [InlineData(TestTargetFramework.Standard)]
         [InlineData(TestTargetFramework.Net5)]
-        public async Task TargetFrameworkNotSupported_NoGeneratedDllImport_NoDiagnostic(TestTargetFramework targetFramework)
+        public async Task TargetFrameworkNotSupported_NoLibraryImport_NoDiagnostic(TestTargetFramework targetFramework)
         {
             string source = @"
 using System.Runtime.InteropServices;
@@ -79,10 +79,10 @@ namespace NS
 }
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method1(NS.MyClass c);
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method2(int i, List<int> list);
 }
 ";
@@ -117,10 +117,10 @@ namespace NS
 }
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial NS.MyClass Method1();
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial List<int> Method2();
 }
 ";
@@ -150,7 +150,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method(char c, string s);
 }
 ";
@@ -178,10 +178,10 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial char Method1();
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial string Method2();
 }
 ";
@@ -209,10 +209,10 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method1([MarshalAs(UnmanagedType.BStr)] int i1, int i2);
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method2(int i1, [MarshalAs(UnmanagedType.FunctionPtr)] bool b2);
 }
 ";
@@ -242,11 +242,11 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.BStr)]
     public static partial int Method1(int i);
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.FunctionPtr)]
     public static partial bool Method2(int i);
 }
@@ -277,11 +277,11 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return: MarshalAs(1)]
     public static partial int Method1(int i);
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial int Method2([MarshalAs((short)0)] bool b);
 }
 ";
@@ -317,11 +317,11 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     [return: MarshalAs(UnmanagedType.I4, SafeArraySubType=VarEnum.VT_I4)]
     public static partial int Method1(int i);
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial int Method2([MarshalAs(UnmanagedType.I1, IidParameterIndex = 1)] bool b);
 }
 ";
@@ -350,10 +350,10 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf8)]
+    [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf8)]
     public static partial void Method1(string s);
 
-    [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(Native))]
+    [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(Native))]
     public static partial void Method2(string s);
 
     struct Native
@@ -362,7 +362,7 @@ partial class Test
         public string ToManaged() => default;
     }
 }
-" + CodeSnippets.GeneratedDllImportAttributeDeclaration;
+" + CodeSnippets.LibraryImportAttributeDeclaration;
 
             // Compile against Standard so that we generate forwarders
             Compilation comp = await TestUtils.CreateCompilation(source, TestTargetFramework.Standard);
@@ -373,13 +373,13 @@ partial class Test
             {
                 (new DiagnosticResult(GeneratorDiagnostics.CannotForwardToDllImport))
                     .WithSpan(6, 32, 6, 39)
-                    .WithArguments($"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}={nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Utf8)}"),
+                    .WithArguments($"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}={nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Utf8)}"),
                 (new DiagnosticResult(GeneratorDiagnostics.CannotForwardToDllImport))
                     .WithSpan(9, 32, 9, 39)
-                    .WithArguments($"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}={nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Custom)}"),
+                    .WithArguments($"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(StringMarshalling)}={nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Custom)}"),
                 (new DiagnosticResult(GeneratorDiagnostics.CannotForwardToDllImport))
                     .WithSpan(9, 32, 9, 39)
-                    .WithArguments($"{nameof(TypeNames.GeneratedDllImportAttribute)}{Type.Delimiter}{nameof(GeneratedDllImportAttribute.StringMarshallingCustomType)}", $"{nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Custom)}"),
+                    .WithArguments($"{nameof(TypeNames.LibraryImportAttribute)}{Type.Delimiter}{nameof(LibraryImportAttribute.StringMarshallingCustomType)}", $"{nameof(StringMarshalling)}{Type.Delimiter}{nameof(StringMarshalling.Custom)}"),
                 (new DiagnosticResult(GeneratorDiagnostics.ParameterTypeNotSupportedWithDetails))
                     .WithSpan(9, 47, 9, 48)
             };
@@ -396,10 +396,10 @@ using System.Runtime.InteropServices;
 {CodeSnippets.DisableRuntimeMarshalling}
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Custom)]
+    [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Custom)]
     public static partial void Method1(out int i);
 
-    [GeneratedDllImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf8, StringMarshallingCustomType = typeof(Native))]
+    [LibraryImport(""DoesNotExist"", StringMarshalling = StringMarshalling.Utf8, StringMarshallingCustomType = typeof(Native))]
     public static partial void Method2(out int i);
 
     struct Native
@@ -417,9 +417,9 @@ partial class Test
             DiagnosticResult[] expectedDiags = new DiagnosticResult[]
             {
                 (new DiagnosticResult(GeneratorDiagnostics.InvalidStringMarshallingConfiguration))
-                    .WithSpan(6, 6, 6, 86),
+                    .WithSpan(6, 6, 6, 81),
                 (new DiagnosticResult(GeneratorDiagnostics.InvalidStringMarshallingConfiguration))
-                    .WithSpan(9, 6, 9, 130)
+                    .WithSpan(9, 6, 9, 125)
             };
             VerifyDiagnostics(expectedDiags, GetSortedDiagnostics(generatorDiags));
             var newCompDiags = newComp.GetDiagnostics();
@@ -433,10 +433,10 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static void Method() { }
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static extern void ExternMethod();
 }
 ";
@@ -465,7 +465,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public partial void Method();
 }
 ";
@@ -492,10 +492,10 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method1<T>();
 
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method2<T, U>();
 }
 ";
@@ -528,7 +528,7 @@ partial class Test
 using System.Runtime.InteropServices;
 {typeKind} Test
 {{
-    [GeneratedDllImport(""DoesNotExist"")]
+    [LibraryImport(""DoesNotExist"")]
     public static partial void Method();
 }}
 ";
@@ -563,7 +563,7 @@ using System.Runtime.InteropServices;
 {{
     partial class TestInner
     {{
-        [GeneratedDllImport(""DoesNotExist"")]
+        [LibraryImport(""DoesNotExist"")]
         static partial void Method();
     }}
 }}
index a5a7073..688b24b 100644 (file)
@@ -76,7 +76,7 @@ namespace LibraryImportGenerator.UnitTests
         }
 
         [ConditionalFact]
-        public async Task AddingFileWithNewGeneratedDllImport_DoesNotRegenerateOriginalMethod()
+        public async Task AddingFileWithNewLibraryImport_DoesNotRegenerateOriginalMethod()
         {
             string source = CodeSnippets.BasicParametersAndModifiers<int>();
 
@@ -106,7 +106,7 @@ namespace LibraryImportGenerator.UnitTests
         }
 
         [ConditionalFact]
-        public async Task ReplacingFileWithNewGeneratedDllImport_DoesNotRegenerateStubsInOtherFiles()
+        public async Task ReplacingFileWithNewLibraryImport_DoesNotRegenerateStubsInOtherFiles()
         {
             Compilation comp1 = await TestUtils.CreateCompilation(new string[] { CodeSnippets.BasicParametersAndModifiers<int>(), CodeSnippets.BasicParametersAndModifiers<bool>() });
 
index 1864d2e..cabfb32 100644 (file)
@@ -75,8 +75,8 @@ namespace LibraryImportGenerator.UnitTests
             var allowedDiagnostics = new HashSet<string>()
             {
                 "CS8795", // Partial method impl missing
-                "CS0234", // Missing type or namespace - GeneratedDllImportAttribute
-                "CS0246", // Missing type or namespace - GeneratedDllImportAttribute
+                "CS0234", // Missing type or namespace - LibraryImportAttribute
+                "CS0246", // Missing type or namespace - LibraryImportAttribute
                 "CS8019", // Unnecessary using
             };
 
@@ -183,7 +183,7 @@ namespace LibraryImportGenerator.UnitTests
         {
             // Include the assembly containing the new attribute and all of its references.
             // [TODO] Remove once the attribute has been added to the BCL
-            var attrAssem = typeof(GeneratedDllImportAttribute).GetTypeInfo().Assembly;
+            var attrAssem = typeof(LibraryImportAttribute).GetTypeInfo().Assembly;
             return MetadataReference.CreateFromFile(attrAssem.Location);
         }
 
index 4a1c833..4d74606 100644 (file)
@@ -10,13 +10,13 @@ namespace Demo
     {
         public const string NativeExportsNE_Binary = "Microsoft.Interop.Tests." + nameof(NativeExportsNE);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sumi")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sumi")]
         public static partial int Sum(int a, int b);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sumouti")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sumouti")]
         public static partial void Sum(int a, int b, out int c);
 
-        [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sumrefi")]
+        [LibraryImport(NativeExportsNE_Binary, EntryPoint = "sumrefi")]
         public static partial void Sum(int a, ref int b);
     }