Remove ExactSpelling from GeneratedDllImport (#65343)
authorJeremy Koritzinsky <jekoritz@microsoft.com>
Sat, 19 Feb 2022 06:51:27 +0000 (22:51 -0800)
committerGitHub <noreply@github.com>
Sat, 19 Feb 2022 06:51:27 +0000 (22:51 -0800)
* Update conversion code fix to offer multiple fixes for appending each previously probed entry-point suffix when ExactSpelling is false.

* Remove ExactSpelling property and move properties that were relying on ExactSpelling = false to use explicit entrypoint names.

* Emit ExactSpelling = true for all of our emitted target DllImports.

* Fix a few entry points

* Add a comment around CharSet.Auto

* Update compatibility doc.

* Update docs/design/libraries/DllImportGenerator/Compatibility.md

Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
290 files changed:
docs/design/libraries/DllImportGenerator/Compatibility.md
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/Unix/System.Native/Interop.GetTimestamp.cs
src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ChangeServiceConfig2.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ClearEventLog.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.CreateProcessWithLogon.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateService.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptCreateHash.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.CryptGetHashParam.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.EnumDependentServices.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumServicesStatusEx.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.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.LogonUser.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountNameW.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.OpenSCManager.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenService.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceConfig.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReadEventLog.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.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.StartService.cs
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartServiceCtrlDispatcher.cs
src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.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.BCryptFinishHash.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenerateSymmetricKey.cs
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptKeyDerivation.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_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.CertDeleteCertificateFromStore.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore.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.CertFreeCertificateContext.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.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.CertGetPublicKeyLength.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetValidUsages.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.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_CertEncodingType.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject_CertEncodingType.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.CryptMsgOpenToEncode.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.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.DsRoleGetPrimaryDomainInformation.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/IpHlpApi/Interop.GetNetworkParams.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConditionVariable.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.CreateSymbolicLink.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.EventWaitHandle.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FillConsoleOutputAttribute.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindFirstFileEx.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.GetComputerName.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.GetCurrentThreadId.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.GetFileAttributesEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.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.GetLongPathNameW.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileName.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNamedPipeHandleState.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.GetProcessAffinityMask.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessName.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessWorkingSetSizeEx.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.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.GetUserDefaultLCID.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetVolumeInformation.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalLock.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Globalization.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.MoveFileEx.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.QueryPerformanceCounter.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.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.Semaphore.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.SetFileInformationByHandle.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.TerminateProcess.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TimeZone.cs
src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerLanguageName.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.WaitForSingleObject.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/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.CoGetApartmentType.cs
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoInitializeEx.cs
src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoUninitialize.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.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.FindWindow.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.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.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.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.SendMessage.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.TranslateMessage.cs
src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.cs
src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketSend.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.cs
src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.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.WSADuplicateSocket.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.accept.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.closesocket.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.ioctlsocket.cs
src/libraries/Common/src/Interop/Windows/WinSock/Interop.setsockopt.cs
src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.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/GeneratedDllImportAttribute.cs
src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs
src/libraries/Microsoft.Win32.Registry/tests/Helpers.cs
src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/UnsafeNativeMethods.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/NativeMethods.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.IO.FileSystem.Watcher/tests/FileSystemWatcher.Directory.NotifyFilter.cs
src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.File.NotifyFilter.cs
src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/ConvertToGeneratedDllImportFixer.cs
src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportGenerator.cs
src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/GeneratedDllImportData.cs
src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Resources.Designer.cs
src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Resources.resx
src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/CodeSnippets.cs
src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/ConvertToGeneratedDllImportFixerTests.cs
src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/Verifiers/CSharpCodeFixVerifier.cs

index 9a22b6f..4eee245 100644 (file)
@@ -20,6 +20,8 @@ The built-in system treats `CharSet.None` as `CharSet.Ansi`. The P/Invoke source
 
 [`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`.
 
+[`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.
+
 ### Required references
 
 The following framework references are required:
index 6caa276..1fede6e 100644 (file)
@@ -26,12 +26,12 @@ namespace System.Runtime
     {
         private const string RuntimeLibrary = "*";
 
-        [GeneratedDllImport(RuntimeLibrary, ExactSpelling = true)]
+        [GeneratedDllImport(RuntimeLibrary)]
         [SuppressGCTransition]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static partial ulong RhpGetTickCount64();
 
-        [GeneratedDllImport(RuntimeLibrary, ExactSpelling = true)]
+        [GeneratedDllImport(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, ExactSpelling = true)]
+        [GeneratedDllImport(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, ExactSpelling = true)]
+        [GeneratedDllImport(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, ExactSpelling = true)]
+        [GeneratedDllImport(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, ExactSpelling = true)]
+        [GeneratedDllImport(RuntimeLibrary)]
         internal static unsafe partial void RhAllocateNewArray(IntPtr pArrayEEType, uint numElements, uint flags, void* pResult);
 
-        [GeneratedDllImport(RuntimeLibrary, ExactSpelling = true)]
+        [GeneratedDllImport(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", ExactSpelling = true)]
+        [GeneratedDllImport(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", ExactSpelling = true)]
+        [GeneratedDllImport(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", ExactSpelling = true)]
+        [GeneratedDllImport(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, ExactSpelling = true)]
+        [GeneratedDllImport(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", ExactSpelling = true)]
+        [GeneratedDllImport(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, ExactSpelling = true)]
+        [GeneratedDllImport(RuntimeImports.RuntimeLibrary)]
         internal static unsafe partial void* memmove(byte* dmem, byte* smem, nuint size);
 
-        [GeneratedDllImport(RuntimeImports.RuntimeLibrary, ExactSpelling = true)]
+        [GeneratedDllImport(RuntimeImports.RuntimeLibrary)]
         internal static unsafe partial void* memset(byte* mem, int value, nuint size);
 
 #if TARGET_X86 || TARGET_AMD64
-        [GeneratedDllImport(RuntimeLibrary, ExactSpelling = true)]
+        [GeneratedDllImport(RuntimeLibrary)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
         internal static unsafe partial void RhCpuIdEx(int* cpuInfo, int functionId, int subFunctionId);
 #endif
index a4785f4..c0f0dd1 100644 (file)
@@ -85,7 +85,7 @@ namespace System.Runtime
         internal static unsafe Array RhNewArray(EETypePtr pEEType, int length)
             => RhNewArray(pEEType.ToPointer(), length);
 
-        [GeneratedDllImport(RuntimeLibrary, ExactSpelling = true)]
+        [GeneratedDllImport(RuntimeLibrary)]
         internal static unsafe partial void RhAllocateNewObject(IntPtr pEEType, uint flags, void* pResult);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
index fc0964b..6e0e24a 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Sys
     {
-        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestamp", ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestamp")]
         [SuppressGCTransition]
         internal static partial ulong GetTimestamp();
     }
index cadacc5..7849568 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Activeds
     {
-        [GeneratedDllImport(Interop.Libraries.Activeds, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Interop.Libraries.Activeds, CharSet = CharSet.Unicode)]
         internal static partial int ADsOpenObject(string path, string? userName, string? password, int flags, ref Guid iid, out IntPtr ppObject);
     }
 }
index ad28538..4c3dff1 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ChangeServiceConfig2W", ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ChangeServiceConfig2W", SetLastError = true)]
         public static partial bool ChangeServiceConfig2(SafeServiceHandle serviceHandle, uint infoLevel, ref SERVICE_DESCRIPTION serviceDesc);
 
 #pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
index 0d5be5c..4faa6be 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ClearEventLogW", CharSet = CharSet.Unicode, SetLastError = true)]
         public static partial bool ClearEventLog(SafeEventLogReadHandle hEventLog, string lpBackupFileName);
     }
 }
index 7f2361f..53dfdc4 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
     internal static partial class Advapi32
     {
         [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertSecurityDescriptorToStringSecurityDescriptorW",
-            CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+            CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool ConvertSdToStringSd(
             byte[] securityDescriptor,
             /* DWORD */ uint requestedRevision,
index de48c70..97cd4f0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ConvertSidToStringSidW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ConvertSidToStringSidW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial BOOL ConvertSidToStringSid(IntPtr sid, out string stringSid);
     }
 }
index 84e11c4..82dc0d3 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
     internal static partial class Advapi32
     {
         [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW",
-            CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+            CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool ConvertStringSdToSd(
             string stringSd,
             /* DWORD */ uint stringSdRevision,
index eb87d49..7abb40a 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool ConvertStringSecurityDescriptorToSecurityDescriptor(
             string StringSecurityDescriptor,
             int StringSDRevision,
index 9b9ef01..6f0ce7b 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial BOOL ConvertStringSidToSid(
             string stringSid,
             out IntPtr ByteArray);
index a8bf04d..df499a8 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CreateProcessWithLogonW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CreateProcessWithLogonW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial bool CreateProcessWithLogonW(
             string userName,
             string domain,
index abfe75e..7e8160a 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CreateServiceW", CharSet = CharSet.Unicode, SetLastError = true)]
         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 b57a4b0..3fee379 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
             None = 0,
         }
 
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         internal static partial bool CryptCreateHash(
             SafeProvHandle hProv,
             int Algid,
index 51b77ae..1991f10 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         internal static partial bool CryptDeriveKey(
             SafeProvHandle hProv,
             int Algid,
index 5c2b78f..5391698 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         public static partial bool CryptDestroyHash(IntPtr hHash);
     }
 }
index 0707494..6f8c232 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         public static partial bool CryptDestroyKey(IntPtr hKey);
     }
 }
index 17e50c1..ca4e5bd 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         public static partial bool CryptEncrypt(
             SafeCapiKeyHandle hKey,
             SafeHashHandle hHash,
index 633997f..b85e441 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         public static partial bool CryptExportKey(
             SafeCapiKeyHandle hKey,
             SafeCapiKeyHandle hExpKey,
index cf6aaf3..02da19a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         internal static partial bool CryptGenKey(SafeProvHandle hProv, int Algid, int dwFlags, out SafeCapiKeyHandle phKey);
     }
 }
index 65ba771..50067ac 100644 (file)
@@ -18,7 +18,7 @@ internal static partial class Interop
             HP_TLS1PRF_SEED = 0x0007,  // seed for TLS1 PRF
         }
 
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         public static partial bool CryptGetHashParam(
             SafeHashHandle hHash,
             CryptHashProperty dwParam,
@@ -26,7 +26,7 @@ internal static partial class Interop
             ref int pdwDataLen,
             int dwFlags);
 
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         public static partial bool CryptSetHashParam(SafeHashHandle hHash, CryptHashProperty dwParam, byte[] buffer, int dwFlags);
     }
 }
index 38f4a57..d6d5b21 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         public static partial bool CryptHashData(SafeHashHandle hHash, byte[] pbData, int dwDataLen, int dwFlags);
     }
 }
index 3c8cb90..562b5c4 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         internal static unsafe partial bool CryptImportKey(
             SafeProvHandle hProv,
             byte* pbData,
index bcff544..57f899e 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EnumDependentServicesW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EnumDependentServicesW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool EnumDependentServices(
             SafeServiceHandle serviceHandle,
             int serviceState,
index d51170a..7eee4b4 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EnumServicesStatusExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EnumServicesStatusExW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool EnumServicesStatusEx(
             SafeServiceHandle databaseHandle,
             int infolevel,
index cd7ccb5..49c246f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32)]
         internal static partial int EventActivityIdControl(ActivityControl ControlCode, ref Guid ActivityId);
     }
 }
index c7f7e75..96d26c1 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32)]
         internal static unsafe partial uint EventRegister(
             in Guid providerId,
             EtwEnableCallback enableCallback,
index b865aa9..aa17159 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32)]
         internal static unsafe partial int EventSetInformation(
             long registrationHandle,
             EVENT_INFO_CLASS informationClass,
index 53b7628..f94e895 100644 (file)
@@ -45,7 +45,7 @@ internal static partial class Interop
             public long MatchAllKeyword;
         }
 
-        [GeneratedDllImport(Interop.Libraries.Advapi32, ExactSpelling = true)]
+        [GeneratedDllImport(Interop.Libraries.Advapi32)]
         internal static unsafe partial int EnumerateTraceGuidsEx(
             TRACE_QUERY_INFO_CLASS TraceQueryInfoClass,
             void* InBuffer,
index d717c7d..9fa6b86 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32)]
         internal static partial uint EventUnregister(long registrationHandle);
     }
 }
index f39a759..a2f9238 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Ansi, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Ansi)]
         internal static partial int EventWriteString(
             long registrationHandle,
             byte level,
index 3e2b23f..6b11373 100644 (file)
@@ -36,7 +36,7 @@ internal static partial class Interop
             return HResult;
         }
 
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "EventWriteTransfer", ExactSpelling = true)]
+        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "EventWriteTransfer")]
         private static unsafe partial int EventWriteTransfer_PInvoke(
             long registrationHandle,
             in EventDescriptor eventDescriptor,
index 102d520..fbda39a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         public static partial bool GetNumberOfEventLogRecords(SafeEventLogReadHandle hEventLog, out int NumberOfRecords);
     }
 }
index 1101a63..501889c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool GetOldestEventLogRecord(SafeEventLogReadHandle hEventLog, out int OldestRecord);
     }
index 854c2c6..66e1308 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetSecurityDescriptorLength", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetSecurityDescriptorLength", CharSet = CharSet.Unicode)]
         internal static partial uint GetSecurityDescriptorLength(IntPtr byteArray);
     }
 }
index b67c774..26c444e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetSecurityInfo", ExactSpelling = true)]
+        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetSecurityInfo")]
         internal static unsafe partial uint GetSecurityInfoByHandle(
             SafeHandle handle,
             /*DWORD*/ uint objectType,
index 1af687e..ed4e6c1 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetNamedSecurityInfoW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetNamedSecurityInfoW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial uint GetSecurityInfoByName(
             string name,
             /*DWORD*/ uint objectType,
index d144479..4556380 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetServiceDisplayNameW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetServiceDisplayNameW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial bool GetServiceDisplayName(SafeServiceHandle? SCMHandle, string serviceName, char* displayName, ref int displayNameLength);
     }
 }
index f7f83fe..0d39fdd 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetServiceKeyNameW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetServiceKeyNameW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial bool GetServiceKeyName(SafeServiceHandle? SCMHandle, string displayName, char* KeyName, ref int KeyNameLength);
     }
 }
index d15cad8..d9c69a2 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "LogonUserW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "LogonUserW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial int LogonUser(
             string username,
             string? domain,
index ff9fd2d..ed8fd87 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool LookupAccountNameW(
             string? lpSystemName,
             ref char lpAccountName,
index 667f485..8068ad0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool NotifyChangeEventLog(SafeEventLogReadHandle hEventLog, SafeWaitHandle hEvent);
     }
index 6c32736..1be1ef6 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenEventLogW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial SafeEventLogReadHandle OpenEventLog(string lpUNCServerName, string lpSourceName);
     }
 }
index 190aefa..03e3c70 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenSCManagerW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenSCManagerW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial IntPtr OpenSCManager(string? machineName, string? databaseName, int access);
 
     }
index 47544bc..88758ec 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenServiceW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenServiceW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial IntPtr OpenService(SafeServiceHandle? databaseHandle, string serviceName, int access);
     }
 }
index cf73486..242fb1e 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "QueryServiceConfigW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "QueryServiceConfigW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool QueryServiceConfig(SafeServiceHandle serviceHandle, IntPtr queryServiceConfigPtr, int bufferSize, out int bytesNeeded);
 
     }
index 28369c8..de24de2 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, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ReadEventLogW", SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         public static partial bool ReadEventLog(
             SafeEventLogReadHandle hEventLog,
index f376bc9..94f4c4f 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", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegCreateKeyExW", CharSet = CharSet.Unicode)]
         internal static partial int RegCreateKeyEx(
             SafeRegistryHandle hKey,
             string lpSubKey,
index b511992..2a2a94c 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegDeleteKeyExW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegDeleteKeyExW", CharSet = CharSet.Unicode)]
         internal static partial int RegDeleteKeyEx(
             SafeRegistryHandle hKey,
             string lpSubKey,
index f5a8e05..2a1127e 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegDeleteValueW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegDeleteValueW", CharSet = CharSet.Unicode)]
         internal static partial int RegDeleteValue(
             SafeRegistryHandle hKey,
             string? lpValueName);
index b5b2742..df01f62 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegEnumKeyExW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegEnumKeyExW", CharSet = CharSet.Unicode)]
         internal static partial int RegEnumKeyEx(
             SafeRegistryHandle hKey,
             int dwIndex,
index bb74b7b..dd0b9e7 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegEnumValueW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegEnumValueW", CharSet = CharSet.Unicode)]
         internal static partial int RegEnumValue(
             SafeRegistryHandle hKey,
             int dwIndex,
index 9f9af2c..d51d73c 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", CharSet = CharSet.Unicode)]
         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", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", CharSet = CharSet.Unicode)]
         internal static partial int RegOpenKeyEx(
             IntPtr hKey,
             string? lpSubKey,
index 1bcc4ef..4e4e1ef 100644 (file)
@@ -14,7 +14,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryInfoKeyW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryInfoKeyW", CharSet = CharSet.Unicode)]
         internal static partial int RegQueryInfoKey(
             SafeRegistryHandle hKey,
             [Out] char[]? lpClass,
index 3ee7567..602ceeb 100644 (file)
@@ -13,7 +13,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", CharSet = CharSet.Unicode)]
         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", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", CharSet = CharSet.Unicode)]
         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", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", CharSet = CharSet.Unicode)]
         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", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", CharSet = CharSet.Unicode)]
         internal static partial int RegQueryValueEx(
             SafeRegistryHandle hKey,
             string? lpValueName,
index 5e2e922..a28ac8e 100644 (file)
@@ -12,7 +12,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", CharSet = CharSet.Unicode)]
         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", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", CharSet = CharSet.Unicode)]
         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", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", CharSet = CharSet.Unicode)]
         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", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", CharSet = CharSet.Unicode)]
         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", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", CharSet = CharSet.Unicode)]
         internal static partial int RegSetValueEx(
             SafeRegistryHandle hKey,
             string? lpValueName,
index 0871c0e..e4b39ad 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegisterEventSourceW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial SafeEventLogWriteHandle RegisterEventSource(string lpUNCServerName, string lpSourceName);
     }
 }
index b7bbaeb..c734b07 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegisterServiceCtrlHandlerExW", CharSet = CharSet.Unicode, SetLastError = true)]
         public static partial IntPtr RegisterServiceCtrlHandlerEx(string? serviceName, ServiceControlCallbackEx? callback, IntPtr userData);
     }
 }
index 913ce34..4dadc0c 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ReportEventW", SetLastError = true)]
         public static partial bool ReportEvent(
             SafeEventLogWriteHandle hEventLog,
             short wType,
index 5759eaa..6488722 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)]
         internal static partial bool RevertToSelf();
     }
 }
index b83a0e0..bfae62d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetSecurityInfo", ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetSecurityInfo", SetLastError = true)]
         internal static partial uint SetSecurityInfoByHandle(
             SafeHandle handle,
             /*DWORD*/ uint objectType,
index c89de8a..09c49ae 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
     internal static partial class Advapi32
     {
         [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetNamedSecurityInfoW",
-            CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+            CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial uint SetSecurityInfoByName(
             string name,
             /*DWORD*/ uint objectType,
index a3ac363..6d98b11 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "StartServiceW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "StartServiceW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool StartService(SafeServiceHandle serviceHandle, int argNum, IntPtr argPtrs);
     }
 }
index e307b36..b143203 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Advapi32
     {
-        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "StartServiceCtrlDispatcherW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "StartServiceCtrlDispatcherW", CharSet = CharSet.Unicode, SetLastError = true)]
         public static partial bool StartServiceCtrlDispatcher(IntPtr entry);
     }
 }
index 12a7f80..aee246d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Authz
     {
-        [GeneratedDllImport(Libraries.Authz, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Authz, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool AuthzInitializeResourceManager(
             int flags,
             IntPtr pfnAccessCheck,
index 4cf5791..a8d2988 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(Libraries.BCrypt)]
         internal static partial NTSTATUS BCryptDestroyKey(IntPtr hKey);
     }
 }
index fe03585..9658c17 100644 (file)
@@ -23,7 +23,7 @@ internal static partial class Interop
             return newHash;
         }
 
-        [GeneratedDllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(Libraries.BCrypt)]
         private static partial NTSTATUS BCryptDuplicateHash(
             SafeBCryptHashHandle hHash,
             out SafeBCryptHashHandle phNewHash,
index 5ebad79..fa2080f 100644 (file)
@@ -53,10 +53,10 @@ internal static partial class Interop
             }
         }
 
-        [GeneratedDllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(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, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(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 c91997b..935ed61 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, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(Libraries.BCrypt)]
         private static partial NTSTATUS BCryptFinishHash(SafeBCryptHashHandle hHash, ref byte pbOutput, int cbOutput, int dwFlags);
     }
 }
index 35cb2e8..f2b00b2 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(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, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(Libraries.BCrypt)]
         internal static unsafe partial NTSTATUS BCryptGenerateSymmetricKey(
             nuint hAlgorithm,
             out SafeBCryptKeyHandle phKey,
index 9a0e660..0be0796 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class BCrypt
     {
-        [GeneratedDllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(Libraries.BCrypt)]
         internal static unsafe partial NTSTATUS BCryptKeyDerivation(
             SafeBCryptKeyHandle hKey,
             BCryptBufferDesc* pParameterList,
index 53ff59e..8d37329 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Credui, EntryPoint = "CredUIParseUserNameW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial int CredUIParseUserName(
             string pszUserName,
             char* pszUser,
index 65eb535..50a37b5 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CertAddCertificateContextToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext);
     }
 }
index 599196c..5ff63b9 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CertAddCertificateLinkToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext);
     }
 }
index abecccc..a6dd811 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CertCloseStore(IntPtr hCertStore, uint dwFlags);
     }
 }
index 5d3a993..43844da 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CertControlStore(SafeCertStoreHandle hCertStore, CertControlStoreFlags dwFlags, CertControlStoreType dwControlType, IntPtr pvCtrlPara);
     }
 }
index 65bc29d..00e534f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CertCreateCertificateChainEngine(ref CERT_CHAIN_ENGINE_CONFIG pConfig, out SafeChainEngineHandle hChainEngineHandle);
     }
 }
index df9e431..a6bc806 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, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CertDeleteCertificateFromStore(CERT_CONTEXT* pCertContext);
     }
 }
index e87fbd6..354aa3b 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial SafeCertContextHandle CertDuplicateCertificateContext(IntPtr pCertContext);
     }
 }
index be2172e..a362f7e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         public static unsafe partial CERT_CONTEXT* CertEnumCertificatesInStore(
             IntPtr hCertStore,
             CERT_CONTEXT* pPrevCertContext);
index a3cca96..1170cef 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial CERT_CONTEXT* CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, CERT_CONTEXT* pPrevCertContext);
     }
 }
index 3a54008..d65f23e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial SafeCertContextHandle CertFindCertificateInStore(
             SafeCertStoreHandle hCertStore,
             CertEncodingType dwCertEncodingType,
index da00ba4..f84ced0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial CERT_EXTENSION* CertFindExtension([MarshalAs(UnmanagedType.LPStr)] string pszObjId, int cExtensions, IntPtr rgExtensions);
     }
 }
index c92ccaf..576a2bd 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial void CertFreeCertificateChain(IntPtr pChainContext);
     }
 }
index 11ad3eb..f1fa007 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, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CertFreeCertificateContext(IntPtr pCertContext);
     }
 }
index a6a2001..ea211be 100644 (file)
@@ -9,21 +9,21 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CertGetCertificateContextProperty(
             SafeCertContextHandle pCertContext,
             CertContextPropId dwPropId,
             byte[]? pvData,
             ref int pcbData);
 
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CertGetCertificateContextProperty(
             SafeCertContextHandle pCertContext,
             CertContextPropId dwPropId,
             out IntPtr pvData,
             ref int pcbData);
 
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CertGetCertificateContextProperty(
             SafeCertContextHandle pCertContext,
             CertContextPropId dwPropId,
index 545cbe6..6e2cfa5 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CertGetCertificateContextProperty(
             SafeCertContextHandle pCertContext,
             CertContextPropId dwPropId,
index ab9cb7a..f756b18 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, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CertGetIntendedKeyUsage(
             CertEncodingType dwCertEncodingType,
             CERT_INFO* pCertInfo,
index 7bf838e..e226085 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial int CertGetPublicKeyLength(MsgEncodingType dwCertEncodingType, ref CERT_PUBLIC_KEY_INFO pPublicKey);
     }
 }
index 5e4dcf1..48bfb33 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CertGetValidUsages(int cCerts, ref SafeCertContextHandle rghCerts, out int cNumOIDs, void* rghOIDs, ref int pcbOIDs);
     }
 }
index 9015f6a..98bc90b 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial SafeCertStoreHandle CertOpenStore(IntPtr lpszStoreProvider, CertEncodingType dwMsgAndCertEncodingType, IntPtr hCryptProv, CertStoreFlags dwFlags, [MarshalAs(UnmanagedType.LPWStr)] string? pvPara);
     }
 }
index 56d777d..6355503 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         public static partial bool CertSaveStore(
             SafeCertStoreHandle hCertStore,
             CertEncodingType dwMsgAndCertEncodingType,
index 4eae575..a571ca2 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CertSerializeCertificateStoreElement(SafeCertContextHandle pCertContext, int dwFlags, byte[]? pbElement, ref int pcbElement);
     }
 }
index f66229c..be3aec8 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, CRYPT_KEY_PROV_INFO* pvData);
     }
 }
index 751070f..e5f80ff 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, DATA_BLOB* pvData);
     }
 }
index a59e811..2699b31 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, SafeNCryptKeyHandle keyHandle);
     }
 }
index 5d7a09d..d3cec8d 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial int CertVerifyTimeValidity(ref FILETIME pTimeToVerify, CERT_INFO* pCertInfo);
     }
 }
index 16989e2..30bff95 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CryptAcquireCertificatePrivateKey(
             SafeCertContextHandle pCert,
             CryptAcquireCertificatePrivateKeyFlags dwFlags,
index 24bf185..f6bade4 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         public static partial bool CryptAcquireCertificatePrivateKey(
             SafeCertContextHandle pCert,
             CryptAcquireCertificatePrivateKeyFlags dwFlags,
index 79dbd2e..4f7887b 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CryptDecodeObject(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, byte[] pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, byte[]? pvStructInfo, ref int pcbStructInfo);
     }
 }
index 2884cbe..07090a7 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CryptEncodeObject(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded);
 
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CryptEncodeObject(CertEncodingType dwCertEncodingType, [MarshalAs(UnmanagedType.LPStr)] string lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded);
     }
 }
index 0098acc..d1fc8b7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CryptHashPublicKeyInfo(
             IntPtr hCryptProv,
             int algId,
index 0d0d38f..fc398a2 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CryptImportPublicKeyInfoEx2(
             CertEncodingType dwCertEncodingType,
             CERT_PUBLIC_KEY_INFO* pInfo,
index 03b528c..694e94f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CryptMsgClose(IntPtr hCryptMsg);
     }
 }
index 1be46df..144c9f8 100644 (file)
@@ -8,14 +8,14 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CryptMsgControl(
             SafeCryptMsgHandle hCryptMsg,
             int dwFlags,
             MsgControlType dwCtrlType,
             ref CMSG_CTRL_DECRYPT_PARA pvCtrlPara);
 
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CryptMsgControl(
             SafeCryptMsgHandle hCryptMsg,
             int dwFlags,
index 2d0bfda..d7b6f16 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial SafeCryptMsgHandle CryptMsgOpenToEncode(
             MsgEncodingType dwMsgEncodingType,
             int dwFlags,
index c41e78d..54aa2d9 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CryptProtectData(
             in DATA_BLOB pDataIn,
index 81f1b00..14cb955 100644 (file)
@@ -10,10 +10,10 @@ internal static partial class Interop
         internal const uint CRYPTPROTECTMEMORY_BLOCK_SIZE = 16;
         internal const uint CRYPTPROTECTMEMORY_SAME_PROCESS = 0;
 
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CryptProtectMemory(SafeBuffer pData, uint cbData, uint dwFlags);
 
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool CryptUnprotectMemory(SafeBuffer pData, uint cbData, uint dwFlags);
     }
 }
index 4b58c83..6325cf8 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CryptQueryObject(
             CertQueryObjectType dwObjectType,
             void* pvObject,
@@ -24,7 +24,7 @@ internal static partial class Interop
             out SafeCertContextHandle ppvContext
             );
 
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CryptQueryObject(
             CertQueryObjectType dwObjectType,
             void* pvObject,
@@ -39,7 +39,7 @@ internal static partial class Interop
             IntPtr ppvContext
             );
 
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CryptQueryObject(
             CertQueryObjectType dwObjectType,
             void* pvObject,
index 04475b5..9c69fa0 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static unsafe partial bool CryptQueryObject(
             CertQueryObjectType dwObjectType,
             void* pvObject,
index c29f6a0..4ec072c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial bool PFXExportCertStore(SafeCertStoreHandle hStore, ref DATA_BLOB pPFX, SafePasswordHandle szPassword, PFXExportFlags dwFlags);
     }
 }
index 5738e95..0cd8877 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)]
         internal static partial SafeCertStoreHandle PFXImportCertStore(ref DATA_BLOB pPFX, SafePasswordHandle password, PfxCertStoreFlags dwFlags);
     }
 }
index 6487086..80fcc4b 100644 (file)
@@ -10,11 +10,11 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [GeneratedDllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertFreeCertificateContext(IntPtr pCertContext);
 
-        [GeneratedDllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal static partial bool CertVerifyCertificateChainPolicy(
             IntPtr pszPolicyOID,
index e98d1ae..0b4f552 100644 (file)
@@ -210,11 +210,11 @@ internal static partial class Interop
 #endif
         }
 
-        [GeneratedDllImport(Interop.Libraries.CryptUI, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.CryptUI, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool CryptUIDlgViewCertificateW(
             in CRYPTUI_VIEWCERTIFICATE_STRUCTW ViewInfo, IntPtr pfPropertiesChanged);
 
-        [GeneratedDllImport(Interop.Libraries.CryptUI, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.CryptUI, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial SafeCertContextHandle CryptUIDlgSelectCertificateW(ref CRYPTUI_SELECTCERTIFICATE_STRUCTW csc);
     }
 }
index 97bff61..19ec950 100644 (file)
@@ -16,7 +16,7 @@ internal static partial class Interop
             DsRolePrimaryDomainInfoBasicEx = 4
         }
 
-        [GeneratedDllImport(Libraries.Dsrole, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Dsrole, CharSet = CharSet.Unicode)]
         internal static partial int DsRoleGetPrimaryDomainInformation(
             [MarshalAs(UnmanagedType.LPTStr)] string lpServer,
             DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel,
index 9f9d16d..41bb3d6 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Unicode)]
         public static partial IntPtr CreateDCW(string pwszDriver, string pwszDevice, string? pszPort, IntPtr pdm);
     }
 }
index e291a9e..8f4afcc 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Unicode)]
         public static partial IntPtr CreateFontIndirectW(ref User32.LOGFONT lplf);
     }
 }
index 9602db7..c71e865 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Gdi32
     {
-        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Unicode)]
         public static partial IntPtr CreateICW(string pszDriver, string pszDevice, string? pszPort, IntPtr pdm);
     }
 }
index 0e88f19..992702b 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class IpHlpApi
     {
-        [GeneratedDllImport(Interop.Libraries.IpHlpApi, ExactSpelling = true)]
+        [GeneratedDllImport(Interop.Libraries.IpHlpApi)]
         internal static unsafe partial uint GetNetworkParams(IntPtr pFixedInfo, uint* pOutBufLen);
     }
 }
index af96744..a13a549 100644 (file)
@@ -14,13 +14,13 @@ internal static partial class Interop
             private IntPtr Ptr;
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         internal static unsafe partial void InitializeConditionVariable(CONDITION_VARIABLE* ConditionVariable);
 
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         internal static unsafe partial void WakeConditionVariable(CONDITION_VARIABLE* ConditionVariable);
 
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         internal static unsafe partial bool SleepConditionVariableCS(CONDITION_VARIABLE* ConditionVariable, CRITICAL_SECTION* CriticalSection, int dwMilliseconds);
     }
 }
index fa9cfe3..4b45b56 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CopyFileExW", CharSet = CharSet.Unicode, SetLastError = true)]
         private static partial bool CopyFileExPrivate(
             string src,
             string dst,
index 1ce3534..de0c073 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateDirectoryW", CharSet = CharSet.Unicode, SetLastError = true)]
         private static partial bool CreateDirectoryPrivate(
             string path,
             ref SECURITY_ATTRIBUTES lpSecurityAttributes);
index b62016d..0dd320c 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", CharSet = CharSet.Unicode, SetLastError = true)]
         private static unsafe partial SafeFileHandle CreateFilePrivate(
             string lpFileName,
             int dwDesiredAccess,
index ba3f74a..005311e 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", CharSet = CharSet.Unicode, SetLastError = true)]
         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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial SafeMemoryMappedFileHandle CreateFileMapping(
             IntPtr hFile,
             ref SECURITY_ATTRIBUTES lpFileMappingAttributes,
index 992d446..b53785b 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", CharSet = CharSet.Unicode, SetLastError = true)]
         private static unsafe partial IntPtr CreateFilePrivate_IntPtr(
             string lpFileName,
             int dwDesiredAccess,
index 40a9614..cc727e9 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateSymbolicLinkW", CharSet = CharSet.Unicode, SetLastError = true)]
         private static partial bool CreateSymbolicLinkPrivate(string lpSymlinkFileName, string lpTargetFileName, int dwFlags);
 
         /// <summary>
index cfc24f7..729eb0a 100644 (file)
@@ -19,16 +19,16 @@ internal static partial class Interop
             private UIntPtr SpinCount;
         }
 
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         internal static unsafe partial void InitializeCriticalSection(CRITICAL_SECTION* lpCriticalSection);
 
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         internal static unsafe partial void EnterCriticalSection(CRITICAL_SECTION* lpCriticalSection);
 
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         internal static unsafe partial void LeaveCriticalSection(CRITICAL_SECTION* lpCriticalSection);
 
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         internal static unsafe partial void DeleteCriticalSection(CRITICAL_SECTION* lpCriticalSection);
     }
 }
index 690a8b4..a4868c9 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeleteFileW", CharSet = CharSet.Unicode, SetLastError = true)]
         private static partial bool DeleteFilePrivate(string path);
 
         internal static bool DeleteFile(string path)
index 6283bed..39b3cad 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeleteVolumeMountPointW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool DeleteVolumeMountPointPrivate(string mountPoint);
 
         internal static bool DeleteVolumeMountPoint(string mountPoint)
index 7e6d1da..3029dbc 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeviceIoControl", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool DeviceIoControl(
             SafeHandle hDevice,
             uint dwIoControlCode,
index 07f09df..6223e16 100644 (file)
@@ -18,10 +18,10 @@ internal static partial class Interop
         [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool ResetEvent(SafeWaitHandle handle);
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateEventExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateEventExW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial SafeWaitHandle CreateEventEx(IntPtr lpSecurityAttributes, string? name, uint flags, uint desiredAccess);
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenEventW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenEventW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial SafeWaitHandle OpenEvent(uint desiredAccess, bool inheritHandle, string name);
     }
 }
index 32d81b6..ed5b6a0 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ExpandEnvironmentStringsW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ExpandEnvironmentStringsW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial uint ExpandEnvironmentStrings(string lpSrc, ref char lpDst, uint nSize);
     }
 }
index 9d8542a..080c683 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool FillConsoleOutputAttribute(IntPtr hConsoleOutput, short wColorAttribute, int numCells, COORD startCoord, out int pNumBytesWritten);
     }
 }
index 96f4eb5..c5db774 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FindFirstFileExW", CharSet = CharSet.Unicode, SetLastError = true)]
         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 a013cee..a3340f1 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", ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", SetLastError = true)]
         private static unsafe partial int FormatMessage(
             int dwFlags,
             IntPtr lpSource,
index 7dc7961..59f1ef1 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, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FormatMessageW", CharSet = CharSet.Unicode, SetLastError = true)]
         public static partial int FormatMessage(
             int dwFlags,
             SafeLibraryHandle lpSource,
index 018f15e..52fd619 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         internal static unsafe partial BOOL FreeEnvironmentStringsW(char* lpszEnvironmentBlock);
     }
 }
index 9d8e182..62a5718 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool FreeLibrary(IntPtr hModule);
     }
 }
index d82305b..8faecd4 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetComputerNameW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetComputerNameW", CharSet = CharSet.Unicode)]
         private static unsafe partial int GetComputerName(char* lpBuffer, uint* nSize);
 
         // maximum length of the NETBIOS name (not including NULL)
index f757cfa..3adffc3 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial uint GetConsoleTitleW(char* title, uint nSize);
     }
 }
index 0146786..6996010 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetCurrentDirectoryW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetCurrentDirectoryW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial uint GetCurrentDirectory(uint nBufferLength, ref char lpBuffer);
     }
 }
index 651ee4a..10b761f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         [SuppressGCTransition]
         public static partial int GetCurrentThreadId();
     }
index 06b89ce..ec02db6 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         internal static unsafe partial char* GetEnvironmentStringsW();
     }
 }
index 60dbfc5..35fe168 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetEnvironmentVariableW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetEnvironmentVariableW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial uint GetEnvironmentVariable(string lpName, ref char lpBuffer, uint nSize);
     }
 }
index 3939b90..3c1df29 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetFileAttributesExW", CharSet = CharSet.Unicode, SetLastError = true)]
         private static partial bool GetFileAttributesExPrivate(
             string? name,
             GET_FILEEX_INFO_LEVELS fileInfoLevel,
index 6eb1052..33c771a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial bool GetFileInformationByHandleEx(SafeFileHandle hFile, int FileInformationClass, void* lpFileInformation, uint dwBufferSize);
     }
 }
index 26ded9e..f96916c 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetFinalPathNameByHandleW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial uint GetFinalPathNameByHandle(
             SafeFileHandle hFile,
             char* lpszFilePath,
index 69b6875..e766053 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, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial uint GetFullPathNameW(
             ref char lpFileName,
             uint nBufferLength,
index 1556e3f..ea3e04e 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, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial uint GetLongPathNameW(
             ref char lpszShortPath,
             ref char lpszLongPath,
index 1bf4e59..edb2f70 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetModuleFileNameW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetModuleFileNameW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial uint GetModuleFileName(IntPtr hModule, ref char lpFilename, uint nSize);
     }
 }
index a8c28bf..c1ac58d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial bool GetNamedPipeHandleStateW(
             SafePipeHandle hNamedPipe,
             uint* lpState,
index 1375d0e..b1e6154 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Auto, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial bool GetOverlappedResult(
             SafeFileHandle hFile,
             NativeOverlapped* lpOverlapped,
index 9ce76e6..fc66080 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial int GetPriorityClass(SafeProcessHandle handle);
     }
 }
index ced6021..47f881e 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool GetProcessAffinityMask(SafeProcessHandle handle, out IntPtr processMask, out IntPtr systemMask);
     }
 }
index c3146ab..25dfb72 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "QueryFullProcessImageNameW", ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "QueryFullProcessImageNameW", CharSet = CharSet.Unicode, SetLastError = true)]
         private static unsafe partial bool QueryFullProcessImageName(
             SafeHandle hProcess,
             uint dwFlags,
index 74ce0e8..a73c6e8 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool GetProcessWorkingSetSizeEx(SafeProcessHandle handle, out IntPtr min, out IntPtr max, out int flags);
     }
 }
index 625d689..a1050e8 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial uint GetSystemDirectoryW(ref char lpBuffer, uint uSize);
     }
 }
index 4d08aac..74db080 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial uint GetTempFileNameW(ref char lpPathName, string lpPrefixString, uint uUnique, ref char lpTempFileName);
     }
 }
index f27a00a..719f19c 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode)]
         internal static partial uint GetTempPathW(int bufferLen, ref char buffer);
     }
 }
index 5e30e6b..4a0aef6 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial int GetThreadPriority(SafeThreadHandle handle);
     }
 }
index 18cb3cb..4e1dbb7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool GetThreadPriorityBoost(SafeThreadHandle handle, out bool disabled);
     }
 }
index 0d4d5b0..38a67b4 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool GetThreadTimes(SafeThreadHandle handle, out long creation, out long exit, out long kernel, out long user);
     }
 }
index 3b7a9b7..bfe62ac 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Interop.Libraries.Kernel32, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(Interop.Libraries.Kernel32)]
         internal static partial int GetUserDefaultLCID();
     }
 }
index da80e83..bf1750b 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetVolumeInformationW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetVolumeInformationW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial bool GetVolumeInformation(
             string drive,
             char* volumeName,
index 196db6c..c618bac 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(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, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         public static partial IntPtr GlobalUnlock(IntPtr hMem);
 
         public static IntPtr GlobalUnlock(HandleRef hMem)
index fd08870..de7dbaa 100644 (file)
@@ -136,7 +136,7 @@ internal static partial class Interop
         [GeneratedDllImport("kernel32.dll")]
         internal static partial int GetUserGeoID(int geoClass);
 
-        [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+        [GeneratedDllImport("kernel32.dll", EntryPoint = "GetGeoInfoW", CharSet = CharSet.Unicode)]
         internal static unsafe partial int GetGeoInfo(int location, int geoType, char* lpGeoData, int cchData, int LangId);
 
         [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)]
index 93f0bed..7ba68fe 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "LoadLibraryW", CharSet = CharSet.Unicode, SetLastError = true)]
         public static partial IntPtr LoadLibrary(string libFilename);
     }
 }
index 95ef7bb..248059c 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, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
         public static partial SafeLibraryHandle LoadLibraryExW(string lpwLibFileName, IntPtr hFile, uint dwFlags);
     }
 }
index 78d1c18..4d589ba 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "LoadLibraryExW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial IntPtr LoadLibraryEx(string libFilename, IntPtr reserved, int flags);
     }
 }
index bdd3aa9..f08d5e4 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "MoveFileExW", CharSet = CharSet.Unicode, SetLastError = true)]
         private static partial bool MoveFileExPrivate(
             string src, string dst, uint flags);
 
index 4c09f29..be9e0bf 100644 (file)
@@ -11,10 +11,10 @@ internal static partial class Interop
     {
         internal const uint CREATE_MUTEX_INITIAL_OWNER = 0x1;
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenMutexW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenMutexW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial SafeWaitHandle OpenMutex(uint desiredAccess, bool inheritHandle, string name);
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateMutexExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateMutexExW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial SafeWaitHandle CreateMutexEx(IntPtr lpMutexAttributes, string? name, uint flags, uint desiredAccess);
 
         [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
index 08ce6fc..a60c27f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenFileMappingW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenFileMappingW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial SafeMemoryMappedFileHandle OpenFileMapping(
             int dwDesiredAccess,
             [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle,
index 2cd4051..0fc090a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial SafeProcessHandle OpenProcess(
             int access, bool inherit, int processId);
     }
index dab1c7c..890f72d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial SafeThreadHandle OpenThread(int access, bool inherit, int threadId);
     }
 }
index e7ee12e..5390bf9 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Interop.Libraries.Kernel32, EntryPoint = "OutputDebugStringW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Interop.Libraries.Kernel32, EntryPoint = "OutputDebugStringW", CharSet = CharSet.Unicode)]
         internal static partial void OutputDebugString(string message);
     }
 }
index 241ab3f..f43439a 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, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         [SuppressGCTransition]
         internal static unsafe partial BOOL QueryPerformanceCounter(long* lpPerformanceCount);
     }
index f6c7e9e..2ed59d0 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, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         internal static unsafe partial BOOL QueryPerformanceFrequency(long* lpFrequency);
     }
 }
index ea5abee..abca057 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "RemoveDirectoryW", CharSet = CharSet.Unicode, SetLastError = true)]
         private static partial bool RemoveDirectoryPrivate(string path);
 
         internal static bool RemoveDirectory(string path)
index 4c52342..cd7612c 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReplaceFileW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReplaceFileW", CharSet = CharSet.Unicode, SetLastError = true)]
         private static partial bool ReplaceFilePrivate(
             string replacedFileName, string replacementFileName, string? backupFileName,
             int dwReplaceFlags, IntPtr lpExclude, IntPtr lpReserved);
index 44034fb..4aa1e0b 100644 (file)
@@ -9,10 +9,10 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenSemaphoreW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenSemaphoreW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial SafeWaitHandle OpenSemaphore(uint desiredAccess, bool inheritHandle, string name);
 
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateSemaphoreExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateSemaphoreExW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial SafeWaitHandle CreateSemaphoreEx(IntPtr lpSecurityAttributes, int initialCount, int maximumCount, string? name, uint flags, uint desiredAccess);
 
         [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
index 46af9a9..1abc814 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetCurrentDirectoryW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetCurrentDirectoryW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool SetCurrentDirectory(string path);
     }
 }
index 63b0971..f310466 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool SetEnvironmentVariable(string lpName, string? lpValue);
     }
 }
index c1053c3..a382d01 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", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetFileAttributesW", CharSet = CharSet.Unicode, SetLastError = true)]
         private static partial bool SetFileAttributesPrivate(
             string name,
             int attr);
index 044af52..e366a3b 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial bool SetFileInformationByHandle(
             SafeFileHandle hFile,
             int FileInformationClass,
index 4793622..ca7c069 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool SetPriorityClass(SafeProcessHandle handle, int priorityClass);
     }
 }
index d95af73..ffaab60 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool SetProcessAffinityMask(SafeProcessHandle handle, IntPtr mask);
     }
 }
index 069c1a6..8de5997 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool SetProcessPriorityBoost(SafeProcessHandle handle, bool disabled);
     }
 }
index 069e309..821b056 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool SetProcessWorkingSetSizeEx(SafeProcessHandle handle, IntPtr min, IntPtr max, int flags);
     }
 }
index 32270d3..3831b95 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial IntPtr SetThreadAffinityMask(SafeThreadHandle handle, IntPtr mask);
     }
 }
index 29cc3e9..b0af071 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
     internal static partial class Kernel32
     {
         [SuppressGCTransition]
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool SetThreadErrorMode(
             uint dwNewMode,
             out uint lpOldMode);
index 3614ac2..d8cc9a8 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial int SetThreadIdealProcessor(SafeThreadHandle handle, int processor);
     }
 }
index b7910e8..0adedb6 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool SetThreadPriority(SafeThreadHandle handle, int priority);
     }
 }
index 479acff..ba80db9 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool SetThreadPriorityBoost(SafeThreadHandle handle, bool disabled);
     }
 }
index e835fce..d7a717f 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial bool TerminateProcess(SafeProcessHandle processHandle, int exitCode);
     }
 }
index 7ad0dde..c9e8832 100644 (file)
@@ -83,10 +83,10 @@ internal static partial class Interop
 
         internal const uint TIME_ZONE_ID_INVALID = unchecked((uint)-1);
 
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial uint GetDynamicTimeZoneInformation(out TIME_DYNAMIC_ZONE_INFORMATION pTimeZoneInformation);
 
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial uint GetTimeZoneInformation(out TIME_ZONE_INFORMATION lpTimeZoneInformation);
     }
 }
index af062f0..179b07c 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "VerLanguageNameW")]
+        [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "VerLanguageNameW")]
         internal static unsafe partial int VerLanguageName(uint wLang, char* szLang, uint cchLang);
     }
 }
index 1d5ec8e..d734016 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial IntPtr VirtualAlloc(SafeHandle lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect);
     }
 }
index d432f56..fb9e9d5 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         internal static unsafe partial void* VirtualAlloc(void* lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect);
     }
 }
index 6e75b25..6b0e69c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Kernel32)]
         internal static unsafe partial bool VirtualFree(void* lpAddress, UIntPtr dwSize, int dwFreeType);
     }
 }
index 1dd2029..e9ac4ea 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial UIntPtr VirtualQuery(
             SafeHandle lpAddress,
             ref MEMORY_BASIC_INFORMATION lpBuffer,
index f3fdf78..95f175a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static unsafe partial UIntPtr VirtualQuery(void* lpAddress, ref MEMORY_BASIC_INFORMATION lpBuffer, UIntPtr dwLength);
     }
 }
index 5f3f964..fc879c3 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Kernel32
     {
-        [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
         internal static partial int WaitForSingleObject(SafeWaitHandle handle, int timeout);
     }
 }
index 37f86ad..e9796be 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Logoncli
     {
-        [GeneratedDllImport(Libraries.Logoncli, EntryPoint = "DsGetDcNameW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Logoncli, EntryPoint = "DsGetDcNameW", CharSet = CharSet.Unicode)]
         internal static partial int DsGetDcName(
             string computerName,
             string domainName,
index 7013035..42126dc 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, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(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, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(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 ad3f3c7..d8e8f28 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, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.NtDll, CharSet = CharSet.Unicode)]
         private static unsafe partial uint NtCreateFile(
             IntPtr* FileHandle,
             DesiredAccess DesiredAccess,
index 11fd068..9465891 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, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.NtDll, CharSet = CharSet.Unicode)]
         public static unsafe partial int NtQueryDirectoryFile(
             IntPtr FileHandle,
             IntPtr Event,
index bf8517a..b3acd8b 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class NtDll
     {
-        [GeneratedDllImport(Libraries.NtDll, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.NtDll)]
         internal static unsafe partial int NtQueryInformationFile(
             SafeFileHandle FileHandle,
             out IO_STATUS_BLOCK IoStatusBlock,
index b591db0..5d00c44 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class NtDll
     {
-        [GeneratedDllImport(Libraries.NtDll, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.NtDll)]
         internal static unsafe partial uint NtQueryInformationProcess(SafeProcessHandle ProcessHandle, int ProcessInformationClass, void* ProcessInformation, uint ProcessInformationLength, out uint ReturnLength);
     }
 }
index 6e6ef56..3a31c39 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class NtDll
     {
-        [GeneratedDllImport(Libraries.NtDll, ExactSpelling = true)]
+        [GeneratedDllImport(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 399d0cc..a73a7ef 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class NtDll
     {
-        [GeneratedDllImport(Libraries.NtDll, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.NtDll)]
         private static partial int RtlGetVersion(ref RTL_OSVERSIONINFOEX lpVersionInformation);
 
         internal static unsafe int RtlGetVersionEx(out RTL_OSVERSIONINFOEX osvi)
index 909aa9d..d572883 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, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.NtDll)]
         public static partial uint RtlNtStatusToDosError(int Status);
     }
 }
index 970bd32..be519d9 100644 (file)
@@ -29,7 +29,7 @@ internal static partial class Interop
 
     internal static partial class Ole32
     {
-        [GeneratedDllImport(Interop.Libraries.Ole32, ExactSpelling = true)]
+        [GeneratedDllImport(Interop.Libraries.Ole32)]
         internal static partial int CoGetApartmentType(out APTTYPE pAptType, out APTTYPEQUALIFIER pAptQualifier);
     }
 }
index 394b935..ecef102 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, ExactSpelling = true)]
+        [GeneratedDllImport(Interop.Libraries.Ole32)]
         internal static partial int CoInitializeEx(IntPtr reserved, uint dwCoInit);
     }
 }
index c19f377..461b286 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Ole32
     {
-        [GeneratedDllImport(Interop.Libraries.Ole32, ExactSpelling = true)]
+        [GeneratedDllImport(Interop.Libraries.Ole32)]
         internal static partial int CoUninitialize();
     }
 }
index b9ab8b1..6c93168 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Pdh
     {
-        [GeneratedDllImport(Libraries.Pdh, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(Libraries.Pdh)]
         public static partial int PdhFormatFromRawValue(
             uint dwCounterType,
             uint dwFormat,
index e6208dc..6ceeff0 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class PerfCounter
     {
-        [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32)]
         internal static partial uint PerfStopProvider(
             IntPtr hProvider
         );
@@ -53,14 +53,14 @@ internal static partial class Interop
             internal uint InstanceNameSize;
         }
 
-        [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32)]
         internal static partial uint PerfStartProvider(
             ref Guid ProviderGuid,
             PERFLIBREQUEST ControlCallback,
             out SafePerfProviderHandle phProvider
         );
 
-        [GeneratedDllImport(Libraries.Advapi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
         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, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32)]
         internal static unsafe partial uint PerfSetCounterSetInfo(
             SafePerfProviderHandle hProvider,
             PerfCounterSetInfoStruct* pTemplate,
             uint dwTemplateSize
         );
 
-        [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32)]
         internal static unsafe partial uint PerfDeleteInstance(
             SafePerfProviderHandle hProvider,
             PerfCounterSetInstanceStruct* InstanceBlock
         );
 
-        [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Advapi32)]
         internal static unsafe partial uint PerfSetCounterRefValue(
             SafePerfProviderHandle hProvider,
             PerfCounterSetInstanceStruct* pInstance,
index 5de9607..52b9ab2 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class Secur32
     {
-        [GeneratedDllImport(Libraries.Secur32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Secur32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial BOOLEAN GetUserNameExW(int NameFormat, ref char lpNameBuffer, ref uint lpnSize);
 
         internal const int NameSamCompatible = 2;
index 7e5bf27..108731c 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, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = false)]
+        [GeneratedDllImport(Libraries.Shell32, CharSet = CharSet.Unicode, SetLastError = false)]
         internal static partial int SHGetKnownFolderPath(
             in Guid rfid,
             uint dwFlags,
index b9af6b4..285677d 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, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Shell32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial bool ShellExecuteExW(
             SHELLEXECUTEINFO* pExecInfo);
     }
index 7fd660c..d98fd8c 100644 (file)
@@ -330,38 +330,38 @@ internal static partial class Interop
             public char* pwszSslCtlIdentifier;
         }
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int EncryptMessage(
             ref CredHandle contextHandle,
             uint qualityOfProtection,
             ref SecBufferDesc inputOutput,
             uint sequenceNumber);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(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, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int QuerySecurityContextToken(
             ref CredHandle phContext,
             out SecurityContextTokenHandle handle);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int FreeContextBuffer(
             IntPtr contextBuffer);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int FreeCredentialsHandle(
             ref CredHandle handlePtr);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int DeleteSecurityContext(
             ref CredHandle handlePtr);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static unsafe partial int AcceptSecurityContext(
             ref CredHandle credentialHandle,
             void* inContextPtr,
@@ -373,25 +373,25 @@ internal static partial class Interop
             ref ContextFlags attributes,
             out long timeStamp);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static unsafe partial int QueryContextAttributesW(
             ref CredHandle contextHandle,
             ContextAttribute attribute,
             void* buffer);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int SetContextAttributesW(
             ref CredHandle contextHandle,
             ContextAttribute attribute,
             byte[] buffer,
             int bufferSize);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial int EnumerateSecurityPackagesW(
             out int pkgnum,
             out SafeFreeContextBuffer_SECURITY handle);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial int AcquireCredentialsHandleW(
             string? principal,
             string moduleName,
@@ -403,7 +403,7 @@ internal static partial class Interop
             ref CredHandle handlePtr,
             out long timeStamp);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial int AcquireCredentialsHandleW(
             string? principal,
             string moduleName,
@@ -415,7 +415,7 @@ internal static partial class Interop
             ref CredHandle handlePtr,
             out long timeStamp);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial int AcquireCredentialsHandleW(
             string? principal,
             string moduleName,
@@ -427,7 +427,7 @@ internal static partial class Interop
             ref CredHandle handlePtr,
             out long timeStamp);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial int AcquireCredentialsHandleW(
             string? principal,
             string moduleName,
@@ -439,7 +439,7 @@ internal static partial class Interop
             ref CredHandle handlePtr,
             out long timeStamp);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static unsafe partial int InitializeSecurityContextW(
             ref CredHandle credentialHandle,
             void* inContextPtr,
@@ -454,28 +454,28 @@ internal static partial class Interop
             ref ContextFlags attributes,
             out long timeStamp);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static unsafe partial int CompleteAuthToken(
             void* inContextPtr,
             ref SecBufferDesc inputBuffers);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static unsafe partial int ApplyControlToken(
             void* inContextPtr,
             ref SecBufferDesc inputBuffers);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial SECURITY_STATUS SspiFreeAuthIdentity(
             IntPtr authData);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial SECURITY_STATUS SspiEncodeStringsAsAuthIdentity(
             string userName,
             string domainName,
             string password,
             out SafeSspiAuthDataHandle authData);
 
-        [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)]
         internal static partial SECURITY_STATUS SetCredentialsAttributesW(
             in CredHandle handlePtr,
             long ulAttribute,
index cdff436..a87db60 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, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Ucrtbase)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial void* _aligned_malloc(nuint size, nuint alignment);
 
-        [GeneratedDllImport(Libraries.Ucrtbase, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Ucrtbase)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial void _aligned_free(void* ptr);
 
-        [GeneratedDllImport(Libraries.Ucrtbase, ExactSpelling = true)]
+        [GeneratedDllImport(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, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Ucrtbase)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial void* calloc(nuint num, nuint size);
 
-        [GeneratedDllImport(Libraries.Ucrtbase, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Ucrtbase)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial void free(void* ptr);
 
-        [GeneratedDllImport(Libraries.Ucrtbase, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Ucrtbase)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         internal static partial void* malloc(nuint size);
 
-        [GeneratedDllImport(Libraries.Ucrtbase, ExactSpelling = true)]
+        [GeneratedDllImport(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 98897d8..563b050 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, SetLastError = true)]
         public static partial IntPtr CreateWindowExW(
             int exStyle,
             string lpszClassName,
index 16470a4..e224938 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial IntPtr DefWindowProcW(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
     }
 }
index e54676b..ba677ca 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32)]
         public static partial bool DestroyWindow(IntPtr hWnd);
     }
 }
index 4b3ed61..133cf3a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial int DispatchMessageW(ref MSG msg);
     }
 }
index e41de1e..ac383c8 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial IntPtr FindWindowW(string lpClassName, string lpWindowName);
     }
 }
index 680100d..82c665e 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial bool GetClassInfoW(IntPtr hInst, string lpszClass, ref WNDCLASS wc);
     }
 }
index 5f9af4f..1b002e7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial int GetMessageW(ref MSG msg, IntPtr hwnd, int msgMin, int msgMax);
     }
 }
index fe83921..a63a0e5 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32)]
         internal static partial IntPtr GetProcessWindowStation();
     }
 }
index 2ab7298..96f6201 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         // index that doesn't exist.
 
         [SuppressGCTransition]
-        [GeneratedDllImport(Libraries.User32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32)]
         internal static partial uint GetSysColor(int nIndex);
     }
 }
index ad1e903..16e4936 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, SetLastError = true)]
         public static unsafe partial bool GetUserObjectInformationW(IntPtr hObj, int nIndex, void* pvBuffer, uint nLength, ref uint lpnLengthNeeded);
     }
 }
index 59cf89d..c2b4a2c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
         public static partial int GetWindowTextLengthW(IntPtr hWnd);
     }
 }
index f83224d..152ba30 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, SetLastError = true)]
         public static unsafe partial int GetWindowTextW(IntPtr hWnd, char* lpString, int nMaxCount);
     }
 }
index 375be2c..0b8fecf 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32)]
         public static unsafe partial int GetWindowThreadProcessId(IntPtr handle, int* processId);
     }
 }
index 6a179ac..934f511 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32)]
         public static partial bool IsWindow(IntPtr hWnd);
     }
 }
index 71fb4d2..4d1d766 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32)]
         public static partial bool KillTimer(IntPtr hwnd, IntPtr idEvent);
     }
 }
index 7a74a2f..f07ba15 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, EntryPoint = "LoadStringW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.User32, EntryPoint = "LoadStringW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial int LoadString(IntPtr hInstance, uint uID, char* lpBuffer, int cchBufferMax);
     }
 }
index cc3b1f2..2698b30 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, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32)]
         internal static partial bool MessageBeep(int type);
     }
 }
index 8f1bf5d..0d7e99c 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32)]
         public static partial int MsgWaitForMultipleObjectsEx(int nCount, IntPtr pHandles, int dwMilliseconds, int dwWakeMask, int dwFlags);
     }
 }
index 157e12f..17d66f2 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial int PostMessageW(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);
     }
 }
index 511e68c..47aa4da 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial void PostQuitMessage(int exitCode);
     }
 }
index 7067518..99afb4a 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, SetLastError = true)]
         public static partial short RegisterClassW(ref WNDCLASS wc);
     }
 }
index 978ccf8..3d10e35 100644 (file)
@@ -7,7 +7,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial int RegisterWindowMessageW(string msg);
     }
 }
index 401e1bc..366decf 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial IntPtr SendMessageW(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
     }
 }
index 03228c0..a64170a 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial IntPtr SetClassLongW(IntPtr hwnd, int nIndex, IntPtr dwNewLong);
     }
 }
index 5bcd1f3..fff95d7 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial IntPtr SetClassLongPtrW(IntPtr hwnd, int nIndex, IntPtr dwNewLong);
     }
 }
index 5c5f1cb..efc613f 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32)]
         public static partial IntPtr SetTimer(IntPtr hWnd, IntPtr nIDEvent, int uElapse, IntPtr lpTimerProc);
     }
 }
index 588270b..be280dd 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial IntPtr SetWindowLongW(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
     }
 }
index 9bc08ca..1c3a2f9 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode)]
         public static partial IntPtr SetWindowLongPtrW(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
     }
 }
index be2a58c..b857380 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.User32)]
         public static partial bool TranslateMessage(ref MSG msg);
     }
 }
index 06a552c..64d014d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, SetLastError = true)]
         public static partial short UnregisterClassW(string lpClassName, IntPtr hInstance);
     }
 }
index 2a6c8fd..eb6205f 100644 (file)
@@ -10,14 +10,14 @@ internal static partial class Interop
 {
     internal static partial class WebSocket
     {
-        [GeneratedDllImport(Libraries.WebSocket, EntryPoint = "WebSocketSend", ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")]
         internal static partial int WebSocketSend_Raw(
             SafeHandle webSocketHandle,
             BufferType bufferType,
             ref Buffer buffer,
             IntPtr applicationContext);
 
-        [GeneratedDllImport(Libraries.WebSocket, EntryPoint = "WebSocketSend", ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.WebSocket, EntryPoint = "WebSocketSend")]
         internal static partial int WebSocketSendWithoutBody_Raw(
             SafeHandle webSocketHandle,
             BufferType bufferType,
index c871429..51526b5 100644 (file)
@@ -17,10 +17,10 @@ internal static partial class Interop
         internal const int SND_FILENAME = 0x20000;
         internal const int SND_NOSTOP = 0x10;
 
-        [GeneratedDllImport(Libraries.WinMM, EntryPoint = "PlaySoundW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.WinMM, EntryPoint = "PlaySoundW", CharSet = CharSet.Unicode)]
         internal static partial bool PlaySound(string soundName, IntPtr hmod, int soundFlags);
 
-        [GeneratedDllImport(Libraries.WinMM, EntryPoint = "PlaySoundW", ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.WinMM, EntryPoint = "PlaySoundW")]
         internal static partial bool PlaySound(byte[]? soundName, IntPtr hmod, int soundFlags);
     }
 }
index a1282b1..1439765 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, CharSet = CharSet.Auto)]
+        [GeneratedDllImport(Libraries.WinMM, EntryPoint = "mmioOpenW", CharSet = CharSet.Unicode)]
         internal static partial IntPtr mmioOpen(string fileName, IntPtr not_used, int flags);
     }
 }
index 8083031..11438ec 100644 (file)
@@ -17,7 +17,7 @@ internal static partial class Interop
 
         internal const int NS_ALL = 0;
 
-        [GeneratedDllImport(Libraries.Ws2_32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Ws2_32, CharSet = CharSet.Unicode, SetLastError = true)]
         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, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Ws2_32)]
         internal static unsafe partial int GetAddrInfoExCancel(IntPtr* lpHandle);
 
-        [GeneratedDllImport(Libraries.Ws2_32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Ws2_32)]
         internal static unsafe partial void FreeAddrInfoExW(AddressInfoEx* pAddrInfo);
 
         [StructLayout(LayoutKind.Sequential)]
index bca3683..cd1e42d 100644 (file)
@@ -9,14 +9,14 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Ws2_32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial int GetAddrInfoW(
             string pNameName,
             string? pServiceName,
             AddressInfo* pHints,
             AddressInfo** ppResult);
 
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static unsafe partial void FreeAddrInfoW(AddressInfo* info);
 
         [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
index 25c50d0..8743ea6 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Ws2_32, EntryPoint = "WSADuplicateSocketW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static unsafe partial int WSADuplicateSocket(
             SafeSocketHandle s,
             uint dwProcessId,
index 4e34ee8..2cdc1bb 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial IntPtr accept(
             SafeSocketHandle socketHandle,
             byte[] socketAddress,
index d80768b..c646d47 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError closesocket(IntPtr socketHandle);
     }
 }
index 92e32e6..f539723 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError ioctlsocket(
             IntPtr handle,
             int cmd,
index a8eb5ad..f980e31 100644 (file)
@@ -9,7 +9,7 @@ internal static partial class Interop
 {
     internal static partial class Winsock
     {
-        [GeneratedDllImport(Interop.Libraries.Ws2_32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Ws2_32, SetLastError = true)]
         internal static partial SocketError setsockopt(
             IntPtr handle,
             SocketOptionLevel optionLevel,
index bfc1039..3288f2d 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Wkscli
     {
-        [GeneratedDllImport(Libraries.Wkscli, CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Wkscli, CharSet = CharSet.Unicode)]
         internal static partial int NetWkstaGetInfo(string server, int level, ref IntPtr buffer);
     }
 }
index 84eb36c..043c8da 100644 (file)
@@ -17,11 +17,11 @@ internal static partial class Interop
         [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", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_connect", CharSet = CharSet.Unicode)]
         [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", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Wldap32, EntryPoint = "ldap_unbind", CharSet = CharSet.Unicode)]
         [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
         public static partial int ldap_unbind(IntPtr ldapHandle);
 
index 11350ed..60860a4 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Wtsapi32
     {
-        [GeneratedDllImport(Libraries.Wtsapi32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Wtsapi32)]
         public static partial bool WTSRegisterSessionNotification(IntPtr hWnd, int dwFlags);
     }
 }
index 6620f9c..1034b44 100644 (file)
@@ -8,7 +8,7 @@ internal static partial class Interop
 {
     internal static partial class Wtsapi32
     {
-        [GeneratedDllImport(Libraries.Wtsapi32, ExactSpelling = true)]
+        [GeneratedDllImport(Libraries.Wtsapi32)]
         public static partial bool WTSUnRegisterSessionNotification(IntPtr hWnd);
     }
 }
index 19aeff9..2d6c399 100644 (file)
@@ -21,7 +21,6 @@ namespace System.Runtime.InteropServices
     {
         public CharSet CharSet { get; set; }
         public string? EntryPoint { get; set; }
-        public bool ExactSpelling { get; set; }
         public bool SetLastError { get; set; }
 
         public GeneratedDllImportAttribute(string dllName)
index 7794764..dee1cb8 100644 (file)
@@ -154,7 +154,7 @@ namespace System
             out int pdwReturnedProductType
         );
 
-        [GeneratedDllImport("kernel32.dll", ExactSpelling = true)]
+        [GeneratedDllImport("kernel32.dll")]
         private static partial int GetCurrentApplicationUserModelId(ref uint applicationUserModelIdLength, byte[] applicationUserModelId);
 
         private static volatile Version s_windowsVersionObject;
index ee86aa6..76ebbaf 100644 (file)
@@ -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, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool SetEnvironmentVariable(string lpName, string lpValue);
     }
 }
index f571f02..0e798d0 100644 (file)
@@ -552,7 +552,7 @@ namespace Microsoft.Win32
                             EventLogHandle session,
                             int flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Wevtapi, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool EvtNextChannelPath(
                             EventLogHandle channelEnum,
                             int channelPathBufferSize,
@@ -564,7 +564,7 @@ namespace Microsoft.Win32
                             EventLogHandle session,
                             int flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Wevtapi, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool EvtNextPublisherId(
                             EventLogHandle publisherEnum,
                             int publisherIdBufferSize,
@@ -646,7 +646,7 @@ namespace Microsoft.Win32
                                 string[] valuePaths,
                             EvtRenderContextFlags flags);
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Wevtapi, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool EvtRender(
                             EventLogHandle context,
                             EventLogHandle eventHandle,
@@ -715,7 +715,7 @@ namespace Microsoft.Win32
 #endif
         };
 
-        [GeneratedDllImport(Interop.Libraries.Wevtapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Interop.Libraries.Wevtapi, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial bool EvtFormatMessage(
                              EventLogHandle publisherMetadataHandle,
                              EventLogHandle eventHandle,
index add1853..93371a6 100644 (file)
@@ -393,7 +393,7 @@ namespace System.DirectoryServices.ActiveDirectory
             PDNS_RECORD pRecordList,
             DNS_FREE_TYPE FreeType
             );*/
-        [GeneratedDllImport(global::Interop.Libraries.Dnsapi, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(global::Interop.Libraries.Dnsapi)]
         internal static partial void DnsRecordListFree(
             IntPtr dnsResultList,
             bool dnsFreeType);
index 6f11330..8742875 100644 (file)
@@ -8,10 +8,10 @@ internal static partial class Interop
 {
     internal static partial class Comdlg32
     {
-        [GeneratedDllImport(Libraries.Comdlg32, CharSet = CharSet.Auto, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)]
         internal static partial bool PrintDlg(ref PRINTDLG lppd);
 
-        [GeneratedDllImport(Libraries.Comdlg32, CharSet = CharSet.Auto, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)]
         internal static partial bool PrintDlg(ref PRINTDLGX86 lppd);
 
         [StructLayout(LayoutKind.Sequential)]
index c438ef9..d968f39 100644 (file)
@@ -15,7 +15,7 @@ internal static partial class Interop
         internal const int CHECKJPEGFORMAT = 4119;
         internal const int CHECKPNGFORMAT = 4120;
 
-        [GeneratedDllImport(Libraries.Gdi32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Gdi32, SetLastError = true)]
         internal static partial IntPtr CreateCompatibleBitmap(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -40,49 +40,49 @@ internal static partial class Interop
 #endif
             HandleRef hpal, int iStartIndex, int nEntries, byte[] lppe);
 
-        [GeneratedDllImport(Libraries.Gdi32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(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, CharSet = CharSet.Auto, SetLastError = true)]
+        [GeneratedDllImport(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, CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, SetLastError = true)]
         internal static partial int StartPage(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC);
 
-        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, SetLastError = true)]
         internal static partial int EndPage(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC);
 
-        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, SetLastError = true)]
         internal static partial int AbortDoc(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC);
 
-        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, SetLastError = true)]
         internal static partial int EndDoc(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hDC);
 
-        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, SetLastError = true)]
+        [GeneratedDllImport(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, CharSet = CharSet.Auto, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "AddFontResourceExW", CharSet = CharSet.Unicode, SetLastError = true)]
         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, CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, 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, CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, 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, CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, 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, SetLastError = true)]
+        [GeneratedDllImport(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, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Gdi32, EntryPoint = "GetObjectW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial int GetObject(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
index 5332459..084d23d 100644 (file)
@@ -22,7 +22,7 @@ internal static partial class Interop
             return IntGlobalAlloc(uFlags, new UIntPtr(dwBytes));
         }
 
-        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Gdi32, CharSet = CharSet.Auto, SetLastError = true)]
         internal static partial IntPtr SelectObject(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
index a15f358..0b4506e 100644 (file)
@@ -11,7 +11,7 @@ internal static partial class Interop
 {
     internal static partial class Shell32
     {
-        [GeneratedDllImport(Libraries.Shell32, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport(Libraries.Shell32, EntryPoint = "ExtractAssociatedIconW", CharSet = CharSet.Unicode)]
         internal static unsafe partial IntPtr ExtractAssociatedIcon(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
index 95a82c3..cffb777 100644 (file)
@@ -11,28 +11,28 @@ internal static partial class Interop
 {
     internal static partial class User32
     {
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [GeneratedDllImport(Libraries.User32, EntryPoint = "LoadIconW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial IntPtr LoadIcon(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hInst, IntPtr iconId);
 
-        [GeneratedDllImport(Libraries.User32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
         internal static partial bool DestroyIcon(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
 #endif
             HandleRef hIcon);
 
-        [GeneratedDllImport(Libraries.User32, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(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, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.User32, SetLastError = true)]
         internal static partial bool GetIconInfo(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
@@ -42,7 +42,7 @@ internal static partial class Interop
         [GeneratedDllImport(Libraries.User32, SetLastError = true)]
         public static partial int GetSystemMetrics(int nIndex);
 
-        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
+        [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Auto, SetLastError = true)]
         internal static partial bool DrawIconEx(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
index cc8ced8..9b00c10 100644 (file)
@@ -11,10 +11,10 @@ internal static partial class Interop
 {
     internal static partial class Winspool
     {
-        [GeneratedDllImport(Libraries.Winspool, CharSet = CharSet.Auto, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Winspool, EntryPoint = "DeviceCapabilitiesW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial int DeviceCapabilities(string pDevice, string pPort, short fwCapabilities, IntPtr pOutput, IntPtr /*DEVMODE*/ pDevMode);
 
-        [GeneratedDllImport(Libraries.Winspool, CharSet = CharSet.Auto, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", CharSet = CharSet.Unicode, SetLastError = true)]
         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, CharSet = CharSet.Auto, SetLastError = true)]
+        [GeneratedDllImport(Libraries.Winspool, EntryPoint = "DocumentPropertiesW", CharSet = CharSet.Unicode, SetLastError = true)]
         internal static partial int DocumentProperties(
 #if NET7_0_OR_GREATER
             [MarshalUsing(typeof(HandleRefMarshaller))]
index 3cd50a6..6ce3506 100644 (file)
@@ -118,10 +118,10 @@ namespace System.Drawing
             [GeneratedDllImport(LibraryName)]
             internal static partial int GdipGetNearestColor(IntPtr graphics, out int argb);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipAddPathString(IntPtr path, string s, int lenght, IntPtr family, int style, float emSize, ref RectangleF layoutRect, IntPtr format);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipAddPathStringI(IntPtr path, string s, int lenght, IntPtr family, int style, float emSize, ref Rectangle layoutRect, IntPtr format);
 
             [GeneratedDllImport(LibraryName)]
@@ -145,7 +145,7 @@ namespace System.Drawing
             [GeneratedDllImport(LibraryName)]
             internal static partial int GdipGetImageThumbnail(IntPtr image, uint width, uint height, out IntPtr thumbImage, IntPtr callback, IntPtr callBackData);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipSaveImageToFile(IntPtr image, string filename, ref Guid encoderClsID, IntPtr encoderParameters);
 
             [GeneratedDllImport(LibraryName)]
@@ -347,7 +347,7 @@ namespace System.Drawing
             [GeneratedDllImport(LibraryName)]
             internal static partial int GdipCreateFontFromHfont(IntPtr hdc, out IntPtr font, ref Interop.User32.LOGFONT lf);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipGetMetafileHeaderFromFile(string filename, IntPtr header);
 
             [GeneratedDllImport(LibraryName)]
@@ -398,13 +398,13 @@ namespace System.Drawing
                 StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
                 StreamCloseDelegate close, StreamSizeDelegate size, IntPtr header);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             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, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             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,
index 2e246f7..9e94e7c 100644 (file)
@@ -910,7 +910,7 @@ namespace System.Drawing
             [GeneratedDllImport(LibraryName)]
             internal static partial int GdipGetMetafileHeaderFromEmf(IntPtr hEnhMetafile, MetafileHeaderEmf metafileHeaderEmf);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipGetMetafileHeaderFromFile(string filename, IntPtr header);
 
             [GeneratedDllImport(LibraryName)]
@@ -933,13 +933,13 @@ namespace System.Drawing
             [GeneratedDllImport(LibraryName)]
             internal static partial int GdipCreateMetafileFromStream(IntPtr stream, IntPtr* metafile);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipRecordMetafileStream(IntPtr stream, IntPtr referenceHdc, EmfType emfType, RectangleF* frameRect, MetafileFrameUnit frameUnit, string? description, IntPtr* metafile);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipRecordMetafileStream(IntPtr stream, IntPtr referenceHdc, EmfType emfType, IntPtr pframeRect, MetafileFrameUnit frameUnit, string? description, IntPtr* metafile);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipRecordMetafileStreamI(IntPtr stream, IntPtr referenceHdc, EmfType emfType, Rectangle* frameRect, MetafileFrameUnit frameUnit, string? description, IntPtr* metafile);
 
             [GeneratedDllImport(LibraryName)]
@@ -949,7 +949,7 @@ namespace System.Drawing
 #endif
             HandleRef graphics, int sizeData, byte[] data);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipCreateFontFromLogfontW(IntPtr hdc, ref Interop.User32.LOGFONT lf, out IntPtr font);
 
             [GeneratedDllImport(LibraryName)]
index 8097957..6ebf642 100644 (file)
@@ -2575,10 +2575,10 @@ namespace System.Drawing
             [GeneratedDllImport(LibraryName)]
             internal static partial int GdipDisposeImage(IntPtr image);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipCreateBitmapFromFile(string filename, out IntPtr bitmap);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipCreateBitmapFromFileICM(string filename, out IntPtr bitmap);
 
             [GeneratedDllImport(LibraryName)]
@@ -2695,25 +2695,25 @@ namespace System.Drawing
 #endif
                 WmfPlaceableFileHeader wmfplacealbeHeader, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipCreateMetafileFromFile(string file, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipRecordMetafile(IntPtr referenceHdc, EmfType emfType, IntPtr pframeRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipRecordMetafile(IntPtr referenceHdc, EmfType emfType, ref RectangleF frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipRecordMetafileI(IntPtr referenceHdc, EmfType emfType, ref Rectangle frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipRecordMetafileFileName(string fileName, IntPtr referenceHdc, EmfType emfType, ref RectangleF frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipRecordMetafileFileName(string fileName, IntPtr referenceHdc, EmfType emfType, IntPtr pframeRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipRecordMetafileFileNameI(string fileName, IntPtr referenceHdc, EmfType emfType, ref Rectangle frameRect, MetafileFrameUnit frameUnit, string? description, out IntPtr metafile);
 
             [GeneratedDllImport(LibraryName)]
@@ -3430,10 +3430,10 @@ namespace System.Drawing
 #endif
             HandleRef graphics, int destSpace, int srcSpace, Point* points, int count);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipLoadImageFromFileICM(string filename, out IntPtr image);
 
-            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode, ExactSpelling = true)]
+            [GeneratedDllImport(LibraryName, CharSet = CharSet.Unicode)]
             internal static partial int GdipLoadImageFromFile(string filename, out IntPtr image);
 
             [GeneratedDllImport(LibraryName)]
index 4d6be90..e7623b4 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, ExactSpelling = true, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, CharSet = CharSet.Unicode)]
         private static partial uint SetSecurityInfoByHandle( string name, uint objectType, uint securityInformation,
             IntPtr owner, IntPtr group, IntPtr dacl, IntPtr sacl);
 
index f1aa177..a98d060 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, ExactSpelling = true, CharSet = CharSet.Unicode)]
+        [GeneratedDllImport("advapi32.dll", EntryPoint = "SetNamedSecurityInfoW", SetLastError = true, CharSet = CharSet.Unicode)]
         private static partial uint SetSecurityInfoByHandle(string name, uint objectType, uint securityInformation,
             IntPtr owner, IntPtr group, IntPtr dacl, IntPtr sacl);
 
index bf0c644..e0ad555 100644 (file)
@@ -80,9 +80,51 @@ namespace Microsoft.Interop.Analyzers
                         methodSymbol,
                         dllImportAttr!,
                         generatedDllImportAttrType,
+                        entryPointSuffix: null,
                         cancelToken),
                     equivalenceKey: ConvertToGeneratedDllImportKey),
                 context.Diagnostics);
+
+            DllImportData dllImportData = methodSymbol.GetDllImportData()!;
+            if (!dllImportData.ExactSpelling)
+            {
+                // CharSet.Auto traditionally maps to either an A or W suffix
+                // depending on the default CharSet of the platform.
+                // We will offer both suffix options when CharSet.Auto is provided
+                // to enable developers to pick which variant they mean (since they could explicitly decide they want one or the other)
+                if (dllImportData.CharacterSet is CharSet.None or CharSet.Ansi or CharSet.Auto)
+                {
+                    context.RegisterCodeFix(
+                        CodeAction.Create(
+                            string.Format(Resources.ConvertToGeneratedDllImportWithSuffix, "A"),
+                            cancelToken => ConvertToGeneratedDllImport(
+                                context.Document,
+                                methodSyntax,
+                                methodSymbol,
+                                dllImportAttr!,
+                                generatedDllImportAttrType,
+                                entryPointSuffix: 'A',
+                                cancelToken),
+                            equivalenceKey: ConvertToGeneratedDllImportKey + "A"),
+                        context.Diagnostics);
+                }
+                if (dllImportData.CharacterSet is CharSet.Unicode or CharSet.Auto)
+                {
+                    context.RegisterCodeFix(
+                        CodeAction.Create(
+                            string.Format(Resources.ConvertToGeneratedDllImportWithSuffix, "W"),
+                            cancelToken => ConvertToGeneratedDllImport(
+                                context.Document,
+                                methodSyntax,
+                                methodSymbol,
+                                dllImportAttr!,
+                                generatedDllImportAttrType,
+                                entryPointSuffix: 'W',
+                                cancelToken),
+                            equivalenceKey: ConvertToGeneratedDllImportKey + "W"),
+                        context.Diagnostics);
+                }
+            }
         }
 
         private async Task<Document> ConvertToGeneratedDllImport(
@@ -91,6 +133,7 @@ namespace Microsoft.Interop.Analyzers
             IMethodSymbol methodSymbol,
             AttributeData dllImportAttr,
             INamedTypeSymbol generatedDllImportAttrType,
+            char? entryPointSuffix,
             CancellationToken cancellationToken)
         {
             DocumentEditor editor = await DocumentEditor.CreateAsync(doc, cancellationToken).ConfigureAwait(false);
@@ -105,6 +148,8 @@ namespace Microsoft.Interop.Analyzers
                 dllImportSyntax,
                 methodSymbol.GetDllImportData()!,
                 generatedDllImportAttrType,
+                methodSymbol.Name,
+                entryPointSuffix,
                 out SyntaxNode? unmanagedCallConvAttributeMaybe);
 
             // Add annotation about potential behavioural and compatibility changes
@@ -312,6 +357,8 @@ namespace Microsoft.Interop.Analyzers
             AttributeSyntax dllImportSyntax,
             DllImportData dllImportData,
             INamedTypeSymbol generatedDllImportAttrType,
+            string methodName,
+            char? entryPointSuffix,
             out SyntaxNode? unmanagedCallConvAttributeMaybe)
         {
             unmanagedCallConvAttributeMaybe = null;
@@ -322,6 +369,7 @@ namespace Microsoft.Interop.Analyzers
 
             // Update attribute arguments for GeneratedDllImport
             List<SyntaxNode> argumentsToRemove = new List<SyntaxNode>();
+            AttributeArgumentSyntax? entryPointAttributeArgument = null;
             foreach (SyntaxNode argument in generator.GetAttributeArguments(generatedDllImportSyntax))
             {
                 if (argument is not AttributeArgumentSyntax attrArg)
@@ -356,6 +404,36 @@ namespace Microsoft.Interop.Analyzers
                         argumentsToRemove.Add(argument);
                     }
                 }
+                else if (IsMatchingNamedArg(attrArg, nameof(DllImportAttribute.ExactSpelling)))
+                {
+                    argumentsToRemove.Add(argument);
+                }
+                else if (IsMatchingNamedArg(attrArg, nameof(DllImportAttribute.EntryPoint)))
+                {
+                    entryPointAttributeArgument = attrArg;
+                    if (!dllImportData.ExactSpelling && entryPointSuffix.HasValue)
+                    {
+                        if (entryPointAttributeArgument.Expression.IsKind(SyntaxKind.StringLiteralExpression))
+                        {
+                            string? entryPoint = (string?)((LiteralExpressionSyntax)entryPointAttributeArgument.Expression).Token.Value;
+                            if (entryPoint is not null)
+                            {
+                                entryPointAttributeArgument = entryPointAttributeArgument.WithExpression(
+                                    SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression,
+                                        SyntaxFactory.Literal(entryPoint + entryPointSuffix)));
+                            }
+                        }
+                        else
+                        {
+                            entryPointAttributeArgument = entryPointAttributeArgument.WithExpression(
+                                SyntaxFactory.BinaryExpression(SyntaxKind.AddExpression,
+                                entryPointAttributeArgument.Expression,
+                                SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression,
+                                    SyntaxFactory.Literal(entryPointSuffix.ToString()))));
+                        }
+                    }
+                    argumentsToRemove.Add(attrArg);
+                }
                 else if (IsMatchingNamedArg(attrArg, nameof(DllImportAttribute.PreserveSig)))
                 {
                     // We transform the signature for PreserveSig, so we can remove the argument
@@ -363,7 +441,17 @@ namespace Microsoft.Interop.Analyzers
                 }
             }
 
+            if (entryPointSuffix.HasValue && entryPointAttributeArgument is null)
+            {
+                entryPointAttributeArgument = (AttributeArgumentSyntax)generator.AttributeArgument("EntryPoint",
+                    generator.LiteralExpression(methodName + entryPointSuffix.Value));
+            }
+
             generatedDllImportSyntax = generator.RemoveNodes(generatedDllImportSyntax, argumentsToRemove);
+            if (entryPointAttributeArgument is not null)
+            {
+                generatedDllImportSyntax = generator.AddAttributeArguments(generatedDllImportSyntax, new[] { entryPointAttributeArgument });
+            }
             return SortDllImportAttributeArguments((AttributeSyntax)generatedDllImportSyntax, generator);
         }
 
index 40d8773..92f2c4a 100644 (file)
@@ -355,7 +355,6 @@ namespace Microsoft.Interop
             DllImportMember userDefinedValues = DllImportMember.None;
             CharSet charSet = CharSet.Ansi;
             string? entryPoint = null;
-            bool exactSpelling = false; // VB has different and unusual default behavior here.
             bool setLastError = false;
 
             // All other data on attribute is defined as NamedArguments.
@@ -384,14 +383,6 @@ namespace Microsoft.Interop
                         }
                         entryPoint = (string)namedArg.Value.Value!;
                         break;
-                    case nameof(GeneratedDllImportData.ExactSpelling):
-                        userDefinedValues |= DllImportMember.ExactSpelling;
-                        if (namedArg.Value.Value is not bool)
-                        {
-                            return null;
-                        }
-                        exactSpelling = (bool)namedArg.Value.Value!;
-                        break;
                     case nameof(GeneratedDllImportData.SetLastError):
                         userDefinedValues |= DllImportMember.SetLastError;
                         if (namedArg.Value.Value is not bool)
@@ -413,7 +404,6 @@ namespace Microsoft.Interop
                 IsUserDefined = userDefinedValues,
                 CharSet = charSet,
                 EntryPoint = entryPoint,
-                ExactSpelling = exactSpelling,
                 SetLastError = setLastError,
             };
         }
@@ -603,7 +593,11 @@ namespace Microsoft.Interop
                 AttributeArgument(
                     NameEquals(nameof(DllImportAttribute.EntryPoint)),
                     null,
-                    CreateStringExpressionSyntax(targetDllImportData.EntryPoint!))
+                    CreateStringExpressionSyntax(targetDllImportData.EntryPoint!)),
+                AttributeArgument(
+                    NameEquals(nameof(DllImportAttribute.ExactSpelling)),
+                    null,
+                    CreateBoolExpressionSyntax(true))
             };
 
             if (targetDllImportData.IsUserDefined.HasFlag(DllImportMember.CharSet))
@@ -612,12 +606,6 @@ namespace Microsoft.Interop
                 ExpressionSyntax value = CreateEnumExpressionSyntax(targetDllImportData.CharSet);
                 newAttributeArgs.Add(AttributeArgument(name, null, value));
             }
-            if (targetDllImportData.IsUserDefined.HasFlag(DllImportMember.ExactSpelling))
-            {
-                NameEqualsSyntax name = NameEquals(nameof(DllImportAttribute.ExactSpelling));
-                ExpressionSyntax value = CreateBoolExpressionSyntax(targetDllImportData.ExactSpelling);
-                newAttributeArgs.Add(AttributeArgument(name, null, value));
-            }
             if (targetDllImportData.IsUserDefined.HasFlag(DllImportMember.SetLastError))
             {
                 NameEqualsSyntax name = NameEquals(nameof(DllImportAttribute.SetLastError));
@@ -669,7 +657,6 @@ namespace Microsoft.Interop
             {
                 CharSet = dllImportData.CharSet,
                 EntryPoint = dllImportData.EntryPoint,
-                ExactSpelling = dllImportData.ExactSpelling,
                 SetLastError = dllImportData.SetLastError,
                 IsUserDefined = dllImportData.IsUserDefined & membersToForward
             };
index bf1d5ed..0424e15 100644 (file)
@@ -17,8 +17,7 @@ namespace Microsoft.Interop
         None = 0,
         CharSet = 1 << 0,
         EntryPoint = 1 << 1,
-        ExactSpelling = 1 << 2,
-        SetLastError = 1 << 3,
+        SetLastError = 1 << 2,
         All = ~None
     }
 
@@ -37,7 +36,6 @@ namespace Microsoft.Interop
         public DllImportMember IsUserDefined { get; init; }
         public CharSet CharSet { get; init; }
         public string? EntryPoint { get; init; }
-        public bool ExactSpelling { get; init; }
         public bool SetLastError { get; init; }
     }
 }
index 097bc34..c273935 100644 (file)
@@ -277,6 +277,15 @@ namespace Microsoft.Interop {
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Convert to &apos;GeneratedDllImport&apos; with &apos;{0}&apos; suffix.
+        /// </summary>
+        internal static string ConvertToGeneratedDllImportWithSuffix {
+            get {
+                return ResourceManager.GetString("ConvertToGeneratedDllImportWithSuffix", 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>
         internal static string CustomTypeMarshallingManagedToNativeUnsupported {
index dfb4176..f677665 100644 (file)
     <value>Conversion to 'GeneratedDllImport' may change behavior and compatibility. See {0} for more information.</value>
     <comment>{0} is a documentation link</comment>
   </data>
+  <data name="ConvertToGeneratedDllImportWithSuffix" xml:space="preserve">
+    <value>Convert to 'GeneratedDllImport' with '{0}' suffix</value>
+  </data>
   <data name="CustomTypeMarshallingManagedToNativeUnsupported" xml:space="preserve">
     <value>The specified parameter needs to be marshalled from managed to native, but the native type '{0}' does not support it.</value>
   </data>
index 11fc55a..fa013ff 100644 (file)
@@ -193,7 +193,6 @@ partial class Test
     [GeneratedDllImport(""DoesNotExist"",
         CharSet = CharSet.Unicode,
         EntryPoint = ""UserDefinedEntryPoint"",
-        ExactSpelling = true,
         SetLastError = true)]
     public static partial void Method();
 }
@@ -215,16 +214,20 @@ partial class Test
     [GeneratedDllImport(nameof(Test),
         CharSet = (CharSet)2,
         EntryPoint = EntryPointName,
-        ExactSpelling = 0 != 1,
         SetLastError = IsFalse)]
     public static partial void Method1();
 
     [GeneratedDllImport(nameof(Test),
         CharSet = (CharSet)Two,
         EntryPoint = EntryPointName,
-        ExactSpelling = One != Two,
         SetLastError = !IsTrue)]
     public static partial void Method2();
+
+    [GeneratedDllImport(nameof(Test),
+        CharSet = (CharSet)2,
+        EntryPoint = EntryPointName,
+        SetLastError = 0 != 1)]
+    public static partial void Method3();
 }
 ";
 
index 2335db7..71ab2e5 100644 (file)
@@ -144,6 +144,9 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
+    [DllImport(""DoesNotExist"", EntryPoint = ""Entry"", ExactSpelling = true)]
+    public static extern int [|Method|](out int ret);
+
     [DllImport(""DoesNotExist"", BestFitMapping = false, EntryPoint = ""Entry"")]
     public static extern int [|Method1|](out int ret);
 
@@ -159,6 +162,9 @@ using System.Runtime.InteropServices;
 partial class Test
 {{
     [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+    public static partial int {{|CS8795:Method|}}(out int ret);
+
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
     public static partial int {{|CS8795:Method1|}}(out int ret);
 
     [GeneratedDllImport(""DoesNotExist"")]
@@ -230,7 +236,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [DllImport(""DoesNotExist"", SetLastError = true, EntryPoint = ""Entry"", ExactSpelling = true, CharSet = CharSet.Unicode)]
+    [DllImport(""DoesNotExist"", SetLastError = true, EntryPoint = ""Entry"", CharSet = CharSet.Unicode)]
     public static extern int [|Method|](out int ret);
 }}";
             // Fixed source will have CS8795 (Partial method must have an implementation) without generator run
@@ -238,7 +244,7 @@ partial class Test
 using System.Runtime.InteropServices;
 partial class Test
 {{
-    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"", CharSet = CharSet.Unicode, SetLastError = true)]
     public static partial int {{|CS8795:Method|}}(out int ret);
 }}";
             await VerifyCS.VerifyCodeFixAsync(
@@ -246,6 +252,184 @@ partial class Test
                 fixedSource);
         }
 
+        [InlineData(CharSet.Ansi, 'A')]
+        [InlineData(CharSet.Unicode, 'W')]
+        [ConditionalTheory]
+        public async Task ExactSpelling_False_NoAutoCharSet_Provides_No_Suffix_And_Suffix_Fix(CharSet charSet, char suffix)
+        {
+            string source = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [DllImport(""DoesNotExist"", EntryPoint = ""Entry"", ExactSpelling = false, CharSet = CharSet.{charSet})]
+    public static extern void [|Method|]();
+}}";
+            string fixedSourceNoSuffix = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"", CharSet = CharSet.{charSet})]
+    public static partial void {{|CS8795:Method|}}();
+}}";
+            await VerifyCS.VerifyCodeFixAsync(source, fixedSourceNoSuffix, "ConvertToGeneratedDllImport");
+            string fixedSourceWithSuffix = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry{suffix}"", CharSet = CharSet.{charSet})]
+    public static partial void {{|CS8795:Method|}}();
+}}";
+            await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithSuffix, $"ConvertToGeneratedDllImport{suffix}");
+        }
+
+        [ConditionalFact]
+        public async Task ExactSpelling_False_AutoCharSet_Provides_No_Suffix_And_Both_Suffix_Fixes()
+        {
+            string source = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [DllImport(""DoesNotExist"", EntryPoint = ""Entry"", ExactSpelling = false, CharSet = CharSet.Auto)]
+    public static extern void [|Method|]();
+}}";
+            string fixedSourceNoSuffix = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"", CharSet = CharSet.Auto)]
+    public static partial void {{|CS8795:Method|}}();
+}}";
+            await VerifyCS.VerifyCodeFixAsync(source, fixedSourceNoSuffix, "ConvertToGeneratedDllImport");
+            string fixedSourceWithASuffix = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""EntryA"", CharSet = CharSet.Auto)]
+    public static partial void {{|CS8795:Method|}}();
+}}";
+            await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, "ConvertToGeneratedDllImportA");
+            string fixedSourceWithWSuffix = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""EntryW"", CharSet = CharSet.Auto)]
+    public static partial void {{|CS8795:Method|}}();
+}}";
+            await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithWSuffix, "ConvertToGeneratedDllImportW");
+        }
+
+        [ConditionalFact]
+        public async Task ExactSpelling_False_ImplicitAnsiCharSet_Provides_No_Suffix_And_Suffix_Fix()
+        {
+            string source = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [DllImport(""DoesNotExist"", EntryPoint = ""Entry"", ExactSpelling = false)]
+    public static extern void [|Method|]();
+}}";
+            string fixedSourceNoSuffix = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""Entry"")]
+    public static partial void {{|CS8795:Method|}}();
+}}";
+            await VerifyCS.VerifyCodeFixAsync(source, fixedSourceNoSuffix, "ConvertToGeneratedDllImport");
+            string fixedSourceWithASuffix = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""EntryA"")]
+    public static partial void {{|CS8795:Method|}}();
+}}";
+            await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, "ConvertToGeneratedDllImportA");
+        }
+
+        [ConditionalFact]
+        public async Task ExactSpelling_False_ConstantNonLiteralEntryPoint()
+        {
+            string source = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    private const string EntryPoint = ""Entry"";
+    [DllImport(""DoesNotExist"", EntryPoint = EntryPoint, CharSet = CharSet.Ansi, ExactSpelling = false)]
+    public static extern void [|Method|]();
+}}";
+            string fixedSourceWithASuffix = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    private const string EntryPoint = ""Entry"";
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = EntryPoint + ""A"", CharSet = CharSet.Ansi)]
+    public static partial void {{|CS8795:Method|}}();
+}}";
+            await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, "ConvertToGeneratedDllImportA");
+        }
+
+        [ConditionalFact]
+        public async Task Implicit_ExactSpelling_False_Offers_Suffix_Fix()
+        {
+            string source = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [DllImport(""DoesNotExist"", CharSet = CharSet.Ansi)]
+    public static extern void [|Method|]();
+}}";
+            string fixedSourceWithASuffix = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""MethodA"", CharSet = CharSet.Ansi)]
+    public static partial void {{|CS8795:Method|}}();
+}}";
+            await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, "ConvertToGeneratedDllImportA");
+        }
+
+        [ConditionalFact]
+        public async Task ExactSpelling_False_NameOfEntryPoint()
+        {
+            string source = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    private const string Foo = ""Bar"";
+    [DllImport(""DoesNotExist"", EntryPoint = nameof(Foo), CharSet = CharSet.Ansi, ExactSpelling = false)]
+    public static extern void [|Method|]();
+}}";
+            string fixedSourceWithASuffix = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    private const string Foo = ""Bar"";
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = nameof(Foo) + ""A"", CharSet = CharSet.Ansi)]
+    public static partial void {{|CS8795:Method|}}();
+}}";
+            await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, "ConvertToGeneratedDllImportA");
+        }
+
+        [ConditionalFact]
+        public async Task ExactSpelling_False_ImplicitEntryPointName()
+        {
+            string source = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [DllImport(""DoesNotExist"", CharSet = CharSet.Ansi, ExactSpelling = false)]
+    public static extern void [|Method|]();
+}}";
+            string fixedSourceWithASuffix = $@"
+using System.Runtime.InteropServices;
+partial class Test
+{{
+    [GeneratedDllImport(""DoesNotExist"", EntryPoint = ""MethodA"", CharSet = CharSet.Ansi)]
+    public static partial void {{|CS8795:Method|}}();
+}}";
+            await VerifyCS.VerifyCodeFixAsync(source, fixedSourceWithASuffix, "ConvertToGeneratedDllImportA");
+        }
+
         [ConditionalFact]
         public async Task PreserveSigFalseSignatureModified()
         {
index e873716..4114806 100644 (file)
@@ -45,20 +45,21 @@ namespace DllImportGenerator.UnitTests.Verifiers
         }
 
         /// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.VerifyCodeFixAsync(string, string)"/>
-        public static async Task VerifyCodeFixAsync(string source, string fixedSource)
-            => await VerifyCodeFixAsync(source, DiagnosticResult.EmptyDiagnosticResults, fixedSource);
+        public static async Task VerifyCodeFixAsync(string source, string fixedSource, string? fixEquivalenceKey = null)
+            => await VerifyCodeFixAsync(source, DiagnosticResult.EmptyDiagnosticResults, fixedSource, fixEquivalenceKey);
 
         /// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.VerifyCodeFixAsync(string, DiagnosticResult, string)"/>
-        public static async Task VerifyCodeFixAsync(string source, DiagnosticResult expected, string fixedSource)
-            => await VerifyCodeFixAsync(source, new[] { expected }, fixedSource);
+        public static async Task VerifyCodeFixAsync(string source, DiagnosticResult expected, string fixedSource, string? fixEquivalenceKey = null)
+            => await VerifyCodeFixAsync(source, new[] { expected }, fixedSource, fixEquivalenceKey);
 
         /// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.VerifyCodeFixAsync(string, DiagnosticResult[], string)"/>
-        public static async Task VerifyCodeFixAsync(string source, DiagnosticResult[] expected, string fixedSource)
+        public static async Task VerifyCodeFixAsync(string source, DiagnosticResult[] expected, string fixedSource, string? fixEquivalenceKey = null)
         {
             var test = new Test
             {
                 TestCode = source,
                 FixedCode = fixedSource,
+                CodeActionEquivalenceKey = fixEquivalenceKey,
             };
 
             test.ExpectedDiagnostics.AddRange(expected);