Closed
Description
Issues to address after the initial merge (#59579):
- [DllImportGenerator] Fix inconsistencies in signature of updated p/invokes #61062
- Some arguments converted to pointers for fully blittable signatures, but some left as
out
/ref
and relying on source generation - make sure related functions have consistent arguments
- Some arguments converted to pointers for fully blittable signatures, but some left as
- [DllImportGenerator] Improve handling of blittable signatures in source generator #60596
- Detect blittable signatures and generate
partial extern
p/invokes
- Detect blittable signatures and generate
- Use
GeneratedDllImport
for p/invokes in runtime with blittable signatures- Update analyzer to also flag blittable signatures as candidates for conversion to
GeneratedDllImport
- Remove the mix of
DllImport
andGeneratedDllImport
and the need to think about which to use based on blittability- Use GeneratedDllImport for blittable p/invokes in System.Diagnostics.Process, System.Diagnostics.Process, System.Diagnostics.FileVersionInfo, System.Runtime.InteropServices.RuntimeInformation #61532
- Use GeneratedDllImport for blittable p/invokes in System.IO.Compression, System.IO.Compression.Brotli, System.Net.Http, System.Net.NameResolution #61638
- Use GeneratedDllImport for blittable p/invokes in System.Console, System.IO.FileSystem.Watcher, System.IO.Pipes #61996
- Update analyzer to also flag blittable signatures as candidates for conversion to
- [DllImportGenerator] Support down-level targets #60662
- Allow each marshaller to specify its support
- Fall back to generating
partial extern
p/invoke if target version is less than required
- Enable
DllImportGenerator
by default for all source projects instead of just NETCoreApp (closer to an in-box generator experience) and convert toGeneratedDllImport
- [DllImportGenerator] Enable on projects without System.Memory and System.Runtime.CompilerServices.Unsafe #61704
- Convert to OleDb assembly and last Cryptography DllImport to GeneratedDllImport #61184
- Use DllImportGenerator in System.Diagnostics.PerformanceCounter #61389
- Remove all DLLIMPORTGENERATOR_ENABLED usage. #61476
- Use GeneratedDllImport in Microsoft.Win32.SystemEvents #61609
- Update SPCL to use GeneratedDllImport where possible. #61640
- Use GeneratedDllImport in System.Data.Odbc, System.IO.Ports, System.ServiceProcess.ServiceController #61741
- Convert Crypto P/Invokes to GeneratedDllImport. #61742
- Make System.DirectoryServices.AccountManagement use GeneratedDllImport #61805
- Use GeneratedDllImport in Microsoft.Extensions.Hosting.WindowsServices, System.Drawing.Primitives, System.Management, System.Security.Cryptography.ProtectedData, System.Speech, System.Windows.Extensions #61949
- Use GeneratedDllImport in System.DirectoryServices #61975
- Use GeneratedDllImport in System.Diagnostics.EventLog #61990
- Switch usage of
CallingConvention
field onGeneratedDllImport
toUnmanagedCallConv
attribute #61134 - [DllImportGenerator] Remove unnecessary initialization of return values in generated code #60698
- Make QCalls respect EntryPoint #59823
- Update struct marshalling logic based on updated design – Add design details regarding dynamic buffers in struct marshalling #60374
- Update interop guidelines doc in repo to describe source generator usage
System.Memory
andSystem.Runtime.CompilerServices.Unsafe
for array marshalling- Add comment about using source-generated p/invokes to interop guidelines #63350
- Enable using live ref pack in source generator unit tests #60605
- Add infrastructure to zip live ref assemblies, send to Helix, unzip, and resolve against in source generator unit tests
Runtime issues discovered by DllImportGenerator
- Mono leaks native errno value during UnmanagedCallersOnly prolog/epilog #60271
- JIT assert on arm64 when running DllImportGenerator tests: op2->TypeIs(TYP_LONG) #60624
- Windows x86 CoreCLR assert failure: ExecutionManager::IsManagedCode(GetControlPC(pCF->GetRegisterSet())) #60648
- Mono ARM64 JIT inconsistent with sign-extension #60649
- Mono ignores non-public custom attributes in dynamic assemblies #60650
- JIT assert on arm32 when running DllImportGenerator unit tests: remainingSize == 4 #60705
- Test failure Color.RedirectedOutputDoesNotUseAnsiSequences #60819