Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make CryptQueryObject call compliant to interop guidelines #60218

Closed
wants to merge 309 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
309 commits
Select commit Hold shift + click to select a range
d24260a
Support arrays of types with simple custom marshalling (dotnet/runtim…
jkoritzinsky Dec 10, 2020
9bc3120
Implement support for configurable generator options. (dotnet/runtime…
jkoritzinsky Jan 4, 2021
6f0fd0d
Add handling for [In, Out] attributes. (dotnet/runtimelab#380)
jkoritzinsky Jan 4, 2021
c64f379
Update Compatibility doc for struct marshalling (dotnet/runtimelab#548)
jkoritzinsky Jan 11, 2021
14ae620
Add Benchmarks project. (dotnet/runtimelab#538)
jkoritzinsky Jan 11, 2021
8ba6bf0
Test fill-in (dotnet/runtimelab#535)
elinor-fung Jan 11, 2021
5a89cbb
Handle enums when checking if type is considered blittable (dotnet/ru…
elinor-fung Jan 15, 2021
7d5caa0
Add fixer for converting to GeneratedDllImport (dotnet/runtimelab#564)
elinor-fung Jan 20, 2021
a4330b4
Update SafeHandle codegen to match the approved API. (dotnet/runtimel…
jkoritzinsky Jan 20, 2021
06f7050
Fix build errors from an updated SDK/compiler and floating package ve…
jkoritzinsky Apr 9, 2021
59aa9c7
Fix cases when preprocessor definitions are surrounding the method we…
jkoritzinsky Apr 12, 2021
8429569
Rename MarshalEx.SetLastWin32Error -> SetLastPInvokeError (dotnet/run…
elinor-fung Apr 24, 2021
01325b1
Update to Arcade 6.0.0-beta.21222.1 (dotnet/runtimelab#1008)
elinor-fung Apr 26, 2021
c6ccabb
Stop using myget feed (dotnet/runtimelab#1022)
elinor-fung Apr 26, 2021
27ab2e9
Update analysis warning location model to new syntax and clean up ana…
jkoritzinsky Apr 28, 2021
a20fbed
Merge latest standalone-template into feature/DllImportGenerator (dot…
elinor-fung Apr 28, 2021
f524afa
Move docs to top-level directory (dotnet/runtimelab#1034)
elinor-fung Apr 28, 2021
d7a6a6f
Add DLLIMPORTGENERATOR_ENABLED when DllImportGenerator package is ref…
elinor-fung Apr 30, 2021
016ae6f
Switch to the now-built-in Marshal APIs from MarshalEx (dotnet/runtim…
jkoritzinsky Apr 30, 2021
5a0fc06
Handle function pointers (dotnet/runtimelab#1043)
elinor-fung Apr 30, 2021
a4e4279
Fix link (dotnet/runtimelab#1065)
kant2002 May 3, 2021
1e3f71c
Add support for null arrays in the blittable array marshaller's pinni…
jkoritzinsky May 4, 2021
bdd2d21
Add support for abstract SafeHandle types for by-value marshalling. (…
jkoritzinsky May 5, 2021
83a0fe2
Disable the test for the Marshal switch now that it currently is a no…
jkoritzinsky May 6, 2021
4dc5101
Keep target DllImport info in structured data before converting to sy…
jkoritzinsky May 7, 2021
7cd59c4
Make DllImport target function local. (dotnet/runtimelab#1090)
jkoritzinsky May 8, 2021
7570027
Basic infrastructure to enable DllImportGenerator (#52486)
elinor-fung May 10, 2021
1cba6dc
Prepend identifiers with @ symbol since the Roslyn Symbol API strips …
jkoritzinsky May 10, 2021
d205672
Use SemanticModel to discover GeneratedDllImportAttribute. (dotnet/ru…
jkoritzinsky May 18, 2021
7d9a4d9
Support implicit blittability for structs declared in and not exposed…
jkoritzinsky May 18, 2021
cd04650
Move to DllImportGenerator 1.0.0-alpha.21268.4 (#52981)
elinor-fung May 19, 2021
5513d61
Use GeneratedDllImport in System.Diagnostics.FileVersionInfo and Syst…
elinor-fung May 20, 2021
9f32647
Use GeneratedDllImport in System.Console (#52740)
elinor-fung May 20, 2021
0fd1fa1
Require that methods marked with GeneratedDllImport are in types that…
jkoritzinsky May 21, 2021
cbf6a82
Merge remote-tracking branch 'upstream/main' into feature/use-dllimpo…
elinor-fung May 25, 2021
36955b1
Use GeneratedDllImport in System.Security.Cryptography.Encoding (#53111)
elinor-fung May 25, 2021
efaa1fe
Use GeneratedDllImport in System.Security.Cryptography.Algorithms (#5…
elinor-fung May 25, 2021
4f834bc
Use GeneratedDllImport in System.Security.Cryptography.X509Certificat…
elinor-fung May 27, 2021
a7c64c1
Introduce design doc for Span/ReadOnlySpan<T> marshalling (dotnet/run…
jkoritzinsky May 27, 2021
51aaa63
Handle case where void* is a field. (dotnet/runtimelab#1195)
AaronRobinsonMSFT Jun 1, 2021
2ee7b3e
Fix memory leaks for return values and some out params. (dotnet/runti…
jkoritzinsky Jun 3, 2021
3b2fbee
Use GeneratedDllImport in System.Diagnostics.Process (#53702)
elinor-fung Jun 4, 2021
42e903c
Use GeneratedDllImport in System.IO.FileSystem (#53830)
AaronRobinsonMSFT Jun 7, 2021
3a66ebf
Use GeneratedDllImport in System.Net.Security (#53839)
elinor-fung Jun 7, 2021
95552f4
Comment in source that source file is auto-generated. (dotnet/runtime…
AaronRobinsonMSFT Jun 8, 2021
f85171f
Use GeneratedDllImport in System.IO.FileSystem.AccessControl (#53845)
elinor-fung Jun 8, 2021
614ba84
Use GeneratedDllImport in System.Net.Sockets (#53844)
elinor-fung Jun 8, 2021
4aad39d
Use GeneratedDllImport in System.Security.Principal.Windows (#53903)
elinor-fung Jun 8, 2021
061e414
Use GeneratedDllImport in System.Net.Http (#53885)
elinor-fung Jun 8, 2021
9c3d860
Use GeneratedDllImport in System.Net.HttpListener (#53904)
elinor-fung Jun 9, 2021
a3d954f
Implement collection marshaller spec (dotnet/runtimelab#1197)
jkoritzinsky Jun 9, 2021
f8c34f5
Use GeneratedDllImport in System.IO.Pipes (#53947)
elinor-fung Jun 9, 2021
d101839
Add configuration option for Unsafe type name. (dotnet/runtimelab#1217)
jkoritzinsky Jun 9, 2021
3ebfc68
Don't enable DllImport generator for shims (#53973)
elinor-fung Jun 10, 2021
3004aa2
Use GeneratedDllImport in System.Net.NetworkInformation (#53966)
AaronRobinsonMSFT Jun 10, 2021
f0e3844
Use GeneratedDllImport in System.IO.MemoryMappedFiles (#53978)
elinor-fung Jun 10, 2021
e1cab80
Use DLLIMPORTGENERATOR_ENABLED ifdefs for files shared with Microsoft…
elinor-fung Jun 10, 2021
2f50d95
Enable marshalling collections of types with marshallers that have a …
jkoritzinsky Jun 10, 2021
247fb4d
Handle native identifiers for escaped managed identifiers. (dotnet/ru…
jkoritzinsky Jun 10, 2021
6271751
Merge remote-tracking branch 'upstream/main' into HEAD
elinor-fung Jun 11, 2021
bb804ab
Make HmacOneShot blittable
elinor-fung Jun 11, 2021
dca91d1
Implement support for collections of collections marshalling (dotnet/…
jkoritzinsky Jun 12, 2021
f38351f
Implement marshallers for Span and ReadOnlySpan (dotnet/runtimelab#1222)
jkoritzinsky Jun 12, 2021
83d8624
Use GeneratedDllImport in System.IO.Compression.Brotli (#54173)
elinor-fung Jun 14, 2021
557cd36
Use GeneratedDllImport in System.IO.FileSystem.DriveInfo (#54181)
elinor-fung Jun 14, 2021
bfe2f7f
Use GeneratedDllImport in System.IO.FileSystem.Watcher (#54183)
elinor-fung Jun 14, 2021
c0d6093
Use GeneratedDllImport in System.Net.NameResolution (#54191)
elinor-fung Jun 15, 2021
2d929b4
Fix table display (dotnet/runtimelab#1242)
kant2002 Jun 15, 2021
21d9495
Use GeneratedDllImport in System.Net.Ping (#54232)
elinor-fung Jun 15, 2021
37b9b4e
Remove fixed workarounds (dotnet/runtimelab#1247)
AaronRobinsonMSFT Jun 16, 2021
907dec0
Use GeneratedDllImport in Microsoft.Win32.Registry (#54236)
AaronRobinsonMSFT Jun 16, 2021
78804fb
Use GeneratedDllImport in System.Security.Cryptography.Csp (#54290)
elinor-fung Jun 16, 2021
b3d6fb1
Merge remote-tracking branch 'upstream/main' into mergeMain
elinor-fung Jun 18, 2021
b021efe
Forward special P/Invoke attributes to the target DllImport method (d…
jkoritzinsky Jun 22, 2021
0fc1ca2
Fix SafeHandle benchmarks and add string benchmarks (dotnet/runtimela…
jkoritzinsky Jun 22, 2021
9f1e3ea
Only run GuaranteedUnmarshal statements if invoke was successful. (do…
jkoritzinsky Jul 1, 2021
76b147a
Don't emit SkipLocalsInit when it's already active (dotnet/runtimelab…
jkoritzinsky Jul 1, 2021
d7b3dc2
Require using UnmanagedCallConv instead of the CallingConvention fiel…
jkoritzinsky Jul 2, 2021
adf085f
Report diagnostics for bad opt-in marshallers at MarshalUsing use-sit…
jkoritzinsky Jul 7, 2021
9285a1e
Resolve SizeParamIndex to a TypePositionInfo during MarshallingInfo p…
jkoritzinsky Jul 7, 2021
5bc2e29
Update analyzer to correctly handle collection marshallers (dotnet/ru…
jkoritzinsky Jul 8, 2021
86f35c3
Improve diagnostics messages for invalid custom native type marshalli…
jkoritzinsky Jul 9, 2021
108fcdb
Merge branch 'main' of github.com:dotnet/runtime into feature/use-dll…
jkoritzinsky Jul 29, 2021
5f0f7a1
Merge pull request #56565 from jkoritzinsky/merge-main
jkoritzinsky Jul 29, 2021
802e7b9
Update compat doc (dotnet/runtimelab#1379)
elinor-fung Aug 4, 2021
9cdc1e5
Use the repo-local NuGet.config with GetReferenceAssemblies so we can…
jkoritzinsky Aug 6, 2021
02fa63e
Plan for .NET 7 integration (dotnet/runtimelab#1378)
AaronRobinsonMSFT Aug 6, 2021
d8775ee
Move to using the new Roslyn IIncrementalGenerator API for better in-…
jkoritzinsky Sep 8, 2021
2449c46
Refactor DllImportGenerator project for easier extensibility (dotnet/…
jkoritzinsky Sep 10, 2021
7eea82a
Remove duplicate TypeNames.cs and create IntPtr constant. (dotnet/run…
AaronRobinsonMSFT Sep 11, 2021
5b8ce63
Update DllImportGenerator to the latest version (#59117)
jkoritzinsky Sep 14, 2021
81293bf
Merge branch 'main' of https://github.com/dotnet/runtime into merge-main
jkoritzinsky Sep 14, 2021
84796a6
Fix failures in the AllConfigurations build.
jkoritzinsky Sep 14, 2021
111f57b
Merge pull request #59119 from jkoritzinsky/merge-main
jkoritzinsky Sep 15, 2021
fc18f4d
Merge branch 'feature/DllImportGenerator' of /home/jekoritz/scratch/b…
jkoritzinsky Sep 20, 2021
4cfb51f
Hook up DllImportGenerator to the libraries build (excluding solution…
jkoritzinsky Sep 20, 2021
27034bc
Run slngen to regenerate the solution files.
jkoritzinsky Sep 20, 2021
3f1789d
Merge pull request #59363 from jkoritzinsky/port-dllimport-generator
jkoritzinsky Sep 24, 2021
d924fbc
Merge branch 'main' of github.com:dotnet/runtime into merge-main
jkoritzinsky Sep 24, 2021
d7fe7a6
Merge pull request #59577 from jkoritzinsky/merge-main
jkoritzinsky Sep 24, 2021
06b4592
Remove target framework in the call to DllImportGenerator.csproj.
jkoritzinsky Sep 24, 2021
7c87cc1
Add license banner to source. (#59586)
AaronRobinsonMSFT Sep 24, 2021
3f78928
Enable running analyzers on DllImportGenerator and Microsoft.Interop.…
elinor-fung Sep 28, 2021
b7283ef
Make Utf16CharMarshaller pin ref parameters (#59700)
elinor-fung Sep 28, 2021
27d5e8d
Fix null termination for generated marshalling of read-only ref strin…
elinor-fung Sep 28, 2021
752533d
Merge branch 'main' into feature/use-dllimport-generator
jkoritzinsky Sep 30, 2021
853297a
Update DllImportGenerator style to match repo conventions (#59753)
elinor-fung Sep 30, 2021
c97c4df
Change some P/Invokes back to non-blittable + GeneratedDllImport for …
elinor-fung Oct 1, 2021
ea7e817
Merge branch 'main' into feature/use-dllimport-generator
jkoritzinsky Oct 2, 2021
c4a164b
Merge branch 'main' into feature/use-dllimport-generator
jkoritzinsky Oct 4, 2021
b4773b0
Fix IDE0008 in DllImportGenerator and Microsoft.Interop.SourceGenerat…
elinor-fung Oct 4, 2021
d81945e
Fix inconsistencies in order of GeneratedDllImport fields (#60049)
elinor-fung Oct 6, 2021
2dff7cd
Dllimport generator build and test fixes (#59658)
jkoritzinsky Oct 6, 2021
a8b691d
Fix incorrect endif location that broke the build.
jkoritzinsky Oct 6, 2021
78f4fa8
Merge branch 'main' into feature/use-dllimport-generator
jkoritzinsky Oct 7, 2021
e2774e3
make CryptQueryObject call compliant to interop guidelines
pedrobsaila Oct 9, 2021
fdee5ec
build KO on system.windows.extensions
pedrobsaila Oct 9, 2021
9fbc728
[mono][interp] Fix unboxing during CALLI (#59747)
BrzVlad Oct 9, 2021
cc8ed00
Updates to DllImportGenerator docs (#60211)
elinor-fung Oct 9, 2021
9381777
Add ISMETHOD and ISMETHODHASH macros (#59993)
EgorBo Oct 9, 2021
2e8615b
Fix a build break (#60222)
SingleAccretion Oct 9, 2021
ab9bc60
refactor class and structs
pedrobsaila Oct 10, 2021
6c09f34
[mono][interp] Avoid calls to m_class_get_mem_manager () in get_virtu…
vargaz Oct 10, 2021
4a42b37
fallocate sets errno on error, posix_fallocate did not (#60185)
adamsitnik Oct 11, 2021
565ff52
Fixed exception type for ConnectionShutdownInitiatedByTransport (#60181)
ManickaP Oct 11, 2021
5f9fec9
Fix test sensitivity to PKCS7 certificate ordering (#59818)
vcsjones Oct 11, 2021
9dcde5f
Remove assert preventing empty PKCS7 exports (#59812)
vcsjones Oct 11, 2021
5aad989
make System.Security.Cryptography.Pkcs conform to interop guidelines …
pedrobsaila Oct 11, 2021
5dc5e0d
Reenable ExportCertificatePems_MultiCert test on Android (#60251)
akoeplinger Oct 11, 2021
5f3062d
Add runtime-community.yml pipeline and add s390x job (#60255)
akoeplinger Oct 11, 2021
bda8727
[reflection] Return n2m wrapper from RuntimeMethodHandle.GetFunctionP…
lambdageek Oct 11, 2021
45c1dc3
Re-enable running DllImportGenerator.Tests suite on Mono. (#60259)
jkoritzinsky Oct 11, 2021
7088332
Some more cleanups in Assembly/Binder/Loader area (#59590)
VSadov Oct 11, 2021
937d451
[wasm][aot] Disable System.Runtime.Serialization.Xml.Tests, till they…
radical Oct 11, 2021
825b264
Fallback to read/write if pread/pwrite fails (#59846)
jozkee Oct 11, 2021
c028f39
Build using `build.cmd/sh`, not `bootstrap.cmd/sh` (#60264)
BruceForstall Oct 11, 2021
8990b0a
Disable ClearPreviousError test on Mono (#60272)
jkoritzinsky Oct 11, 2021
4b84451
Fix runtime-staging trigger and one bug (#60257)
akoeplinger Oct 11, 2021
debe671
Take write lock in PEImage::LoadFlat/LoadImage (#60277)
elinor-fung Oct 12, 2021
df42364
Add C# multi-dimension array versions of the Benchstones tests (#60192)
BruceForstall Oct 12, 2021
383a479
[mono][interp] Fix short branches (#58806)
BrzVlad Oct 12, 2021
d6c3ad1
[wasm] Fixing compilation on windows using debug mode. (#60260)
thaystg Oct 12, 2021
31c38ef
Update dependencies from https://github.com/dotnet/linker build 20211…
dotnet-maestro[bot] Oct 12, 2021
784687f
Prevent runtime prop metadata retrieval when [JsonIgnore] is used (#6…
layomia Oct 12, 2021
d4e4d33
Improve SortedSet DeepCopy performance (#56561)
johnthcall Oct 12, 2021
3d8a6e6
Some Antigen pipeline fixes (#60284)
kunalspathak Oct 12, 2021
e734fde
Fix VS4Mac crash report and core dump generation perf problems (#60205)
mikem8361 Oct 12, 2021
68042e1
Better codegen for `(T)x | (T)y` (#58727)
Oct 12, 2021
83024a1
Make upgrade install new host first, then uninstall old (#60307)
ericstj Oct 12, 2021
e152d75
fix for GC.GetGCMemoryInfo (#60309)
Maoni0 Oct 12, 2021
477789e
Fix: CTS.TryReset() concurrency issue #60182 (#60224)
sakno Oct 13, 2021
6033ef2
[Group 3] Enable nullable annotations for `Microsoft.Extensions.Confi…
maxkoshevoi Oct 13, 2021
97fcaf5
Fix typo in comment for UseUtcTimestamp (#60043)
GitHubPang Oct 13, 2021
80e843f
Fix license header in a few new files (#59910)
am11 Oct 13, 2021
9dc925d
Add runtime.osx-arm64.runtime.native.System.IO.Ports proj file for pa…
SeanMollet Oct 13, 2021
6890b50
lateapexearlyspeed-issue-30778 Create method: TryReadExact(). (#57921)
lateapexearlyspeed Oct 13, 2021
082bb6c
Remove ObjectDisposedException from the docs of the Task.ContinueWith…
Marusyk Oct 13, 2021
09c1a1f
Remove `Microsoft.IO.Redist`. (#58359)
teo-tsirpanis Oct 13, 2021
845e66c
JIT: Optimize redundant memory barriers on arm/arm64 (#60219)
EgorBo Oct 13, 2021
d01cb54
[mono][interp] Change GC state explicitly (#60242)
BrzVlad Oct 13, 2021
5829730
Fix GCC build break (#60333)
mangod9 Oct 13, 2021
c4a15de
Implement RSA-PSS signature for CmsSigner
vcsjones Oct 13, 2021
2265a61
Fix build with clang 13 (#60328)
am11 Oct 13, 2021
1a214ca
[main] Update dependencies from 9 repositories (#60216)
dotnet-maestro[bot] Oct 13, 2021
0cb73e8
Add tizen armel build CI for pull request (#56281)
clamp03 Oct 13, 2021
49cf05c
Don't include s390x in coreclr outerloop runs (#60351)
akoeplinger Oct 13, 2021
c2f287c
Support unseekable filestream when ReadAllBytes[Async] (#58434)
lateapexearlyspeed Oct 13, 2021
5b1ebf7
Fix CRC32 encoding (#60329)
BruceForstall Oct 13, 2021
51c16ae
Fix System.Numerics.Vectors tests on iOS and other FullAOT targets (#…
akoeplinger Oct 13, 2021
11adf85
Adjust SkipOnCoreClr for Match_ExcessPrefix test (#59564)
am11 Oct 13, 2021
51d43eb
JIT: Remove DIV(NEG(a), C) => DIV(a, NEG(C)) opt (#60312)
EgorBo Oct 13, 2021
cfe257f
Add design details regarding dynamic buffers in struct marshalling (#…
AaronRobinsonMSFT Oct 14, 2021
56b9b82
Fix StartTLS in DirectoryService.Protocols in 6.0 and backport change…
hoyosjs Oct 14, 2021
a546fa4
[wasm] rationalize internal exports (#60075)
pavelsavara Oct 14, 2021
1ebec9a
Fix PerformanceCounter tests (#60372)
danmoseley Oct 14, 2021
dac1290
Run on both Win and Linux, but in OuterLoop with longer timeout. (#60…
carlossanlop Oct 14, 2021
f77e586
[metadata] Replace uses of MonoType:byref by a getter (#60313)
lambdageek Oct 14, 2021
37d2514
Follow up on Scatter/Gather API changes (#58447)
teo-tsirpanis Oct 14, 2021
a0cd08b
Disabled NoCallback_RevokedCertificate_NoRevocationChecking_Succeeds …
CarnaViire Oct 14, 2021
92bfaea
fix TestOnStartWithArgsThenStop (#60386)
danmoseley Oct 14, 2021
3e98517
[reflection] Initialize default ALC gchandle in GetLoadContext (#60350)
lambdageek Oct 14, 2021
edf638f
Fix HTTP/3 loopback server WaitForCancellationAsync and aborting on f…
CarnaViire Oct 14, 2021
cf49643
File.*AllText* optimizations (#58167)
adamsitnik Oct 14, 2021
10d8964
[docs] Add LLDB debugging instructions for Mono running a runtime tes…
lambdageek Oct 14, 2021
abd6ea4
Sod pre command fix (#60413)
LoopedBard3 Oct 14, 2021
2ccf1ab
Remove RC2 EffectiveKeyLength plumbing
vcsjones Oct 14, 2021
56d807d
Don't error out from GetOrCreateLayout in the DAC if no layout creati…
hoyosjs Oct 14, 2021
feed66d
Update SuperPMI CI automation (#60375)
BruceForstall Oct 14, 2021
97ef512
Remove extra call to PropertyInfo.GetValue(object) (#60415)
danielmpetrov Oct 14, 2021
c968447
Add section with design alternatives (#60426)
terrajobst Oct 14, 2021
e7709b6
[wasm][test] BrowserHttpHandler stream large responses with SetBrowse…
pavelsavara Oct 14, 2021
4768646
System.Drawing.Common.Tests fail ToLogFont_Invoke tests on non Englis…
AlexRadch Oct 14, 2021
7752313
Finish SuperPMI collect testing (#60432)
BruceForstall Oct 14, 2021
1174290
Remove duplicate entries from dotnet --info (#60376)
ericstj Oct 14, 2021
33c0b57
[mono][interp] Add a missing else to the delegate init code. (#60433)
vargaz Oct 15, 2021
8076775
Optimize indirection cell call sequences more generally (#59602)
jakobbotsch Oct 15, 2021
f40247e
Unify set-reg-to-imm functions and optimize with LEA at runtime on x6…
jakobbotsch Oct 15, 2021
7ecced4
Improve value numbering for casts (#59841)
SingleAccretion Oct 15, 2021
af4efb1
Apply custom Message and Url to all [RequiresPreviewFeatures] attribu…
buyaa-n Oct 15, 2021
39048dd
Undo solution and config changes from DllImportGenerator (#60481)
elinor-fung Oct 15, 2021
f246a5a
Eliminate pre-built assets during source-build (#60370)
eerhardt Oct 15, 2021
7c4e606
[mono/win] Increase stack size (reserve) to 8MB (#60265)
radekdoulik Oct 15, 2021
027ea7f
Fix null being passed to g_path_get_dirname when probing in wasm (#60…
kg Oct 15, 2021
e1179b8
[main] Update dependencies from dnceng/internal/dotnet-optimization d…
dotnet-maestro[bot] Oct 15, 2021
22cb0e5
Update dependencies from https://github.com/dotnet/linker build 20211…
dotnet-maestro[bot] Oct 15, 2021
53590db
disable flaky ReadAllBytes_NonSeekableFileStream_InWindows (#60471)
adamsitnik Oct 15, 2021
5a79d96
Merge branch 'main' into feature/use-dllimport-generator
elinor-fung Oct 15, 2021
ea58ba6
Fix Int32 overflow bug in buffering logic (#60459)
adamsitnik Oct 15, 2021
becd013
string interpolation instead of concatenation (#60490)
pavelsavara Oct 16, 2021
972891f
Fix of https://github.com/dotnet/runtime/issues/60480 issue (#60502)
AlexRadch Oct 16, 2021
53e8c7c
Reflection Invoke share more coreclr/mono (#60270)
AaronRobinsonMSFT Oct 16, 2021
8608dca
[interp] Fix sufficient stack check when using interpreter (#60514)
BrzVlad Oct 17, 2021
0d350e9
[main] Update dependencies from dnceng/internal/dotnet-optimization d…
dotnet-maestro[bot] Oct 18, 2021
074e8f0
Fixed outerloop tests after #60181 (#60465)
ManickaP Oct 18, 2021
0586b15
Implement IAsyncEnumerable<T>.ToBlockingEnumerable (#60363)
eiriktsarpalis Oct 18, 2021
d57ccc2
Remove FlakyAppHostTests category in installer tests (#60354)
akoeplinger Oct 18, 2021
862a90f
Disable PerformanceCounter_NextValue_ProcessorCounter on Windows ARM6…
krwq Oct 18, 2021
fc3787d
Avoid a small int[] allocation in StringBuilder.Replace (#60406)
stephentoub Oct 18, 2021
66d2600
[metadata] Cleanup some uses of m_class_get_this_arg (#60557)
lambdageek Oct 18, 2021
efa6163
[mono] Fix more usages of MonoType:byref (#60551)
akoeplinger Oct 18, 2021
1c949ac
Fix for #60532 (#60572)
trylek Oct 18, 2021
b201a16
Merge feature/use-dllimport-generator to main #59579
safern Oct 18, 2021
14089cf
Sort oper stats for COUNT_AST_OPERS (#60223)
SingleAccretion Oct 18, 2021
730d1f4
Add Fuzzlyn to CI (#60344)
jakobbotsch Oct 18, 2021
ba01c59
Avoid unnecessary cached char[] in StringParsingHelpers (#60409)
stephentoub Oct 19, 2021
75b03e0
Fix argument for continuing on error for spmi replay pipeline (#60594)
BruceForstall Oct 19, 2021
f40d005
Add fibers API shim that's included in the latest Windows SDKs as nee…
SteveDunn Oct 19, 2021
661a0cd
Move NoInt32OverflowInTheBufferingLogic to OuterLoop and address pend…
jozkee Oct 19, 2021
1bf02cc
[main] Update dependencies from dotnet/runtime dnceng/internal/dotnet…
dotnet-maestro[bot] Oct 19, 2021
f4ba253
Disable Linux arm64 llvm full aot runtime tests (#60576)
steveisok Oct 19, 2021
c204a0a
Apply style changes to System.Text.Json (#60509)
deeprobin Oct 19, 2021
6841da3
Avoid cached int[] in Console on Unix (#60411)
stephentoub Oct 19, 2021
8676d97
Add RegexOptions.NonBacktracking (#60607)
stephentoub Oct 19, 2021
f518b2e
Disable CounterSample_Calculate_CalculateCounterSample on Win10 ARM64…
krwq Oct 19, 2021
838fed9
Add managed implementation of Math.ILogB and MathF.ILogB (#56236)
alexcovington Oct 19, 2021
3126d58
JIT: fix interaction of GDV and boxing (#60355)
AndyAyersMS Oct 19, 2021
881ee50
Make bounds check nodes ordinary binary opers (#59963)
SingleAccretion Oct 19, 2021
ed91cea
Maui Android Size on Disk Integration (#60425)
LoopedBard3 Oct 19, 2021
07fff0a
fix rid processing on macOS (#60494)
wfurt Oct 19, 2021
3893508
Update mac installers location string (#60499)
sfoslund Oct 19, 2021
9824543
DotNetHost packages are not created during source-build (#60575)
eerhardt Oct 19, 2021
6122bba
Unified request/response logging for H/2 and H/3 (#60418)
ManickaP Oct 19, 2021
9362323
Update IntelliSense package (#60487)
carlossanlop Oct 19, 2021
21bdf48
Move 2 Drawing APIs that are not implemented in netfx to netcoreapp (…
safern Oct 19, 2021
494f3af
Improve FileProviders.Physical tests to reuse existing helper types (…
jozkee Oct 19, 2021
693cb0c
rebase from master 1
pedrobsaila Oct 9, 2021
ef1abb6
build KO on system.windows.extensions
pedrobsaila Oct 9, 2021
e5b0071
merge from master 2
pedrobsaila Oct 10, 2021
f456227
merge from master 4
pedrobsaila Oct 19, 2021
de022c0
merge from master 5
pedrobsaila Oct 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "1.0.0-prerelease.21508.1",
"version": "1.0.0-prerelease.21511.3",
"commands": [
"xharness"
]
Expand Down
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/02_api_proposal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ body:
```
validations:
required: true
- type: textarea
id: alternative-designs
attributes:
label: Alternative Designs
description: |
Please provide alternative designs. This might not be APIs; for example instead of providing new APIs an option might be to change the behavior of an existing API.
placeholder: Alternative designs
validations:
required: false
- type: textarea
id: risks
attributes:
Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@

<NetFrameworkMinimum>net462</NetFrameworkMinimum>
<NetFrameworkToolCurrent>net472</NetFrameworkToolCurrent>
<!-- Don't build for NETFramework during source-build. -->
<NetFrameworkToolCurrent Condition="'$(DotNetBuildFromSource)' == 'true'" />
</PropertyGroup>

<PropertyGroup>
Expand Down
5 changes: 3 additions & 2 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="$(RepositoryEngineeringDir)liveBuilds.targets" />
<Import Project="$(RepositoryEngineeringDir)generators.targets" />
<Import Project="$(RepositoryEngineeringDir)python.targets" />

<PropertyGroup>
Expand All @@ -17,14 +18,14 @@
unconditionally in Microsoft.NETCoreSdk.BundledVersions.props.
-->
<NETCoreAppMaximumVersion>$(MajorVersion).$(MinorVersion)</NETCoreAppMaximumVersion>
<EnableNETAnalyzers Condition="'$(EnableAnalyzers)' != 'true'">false</EnableNETAnalyzers>
<EnableNETAnalyzers Condition="'$(EnableNETAnalyzers)' == ''">$(RunAnalyzers)</EnableNETAnalyzers>
<!-- SDK sets product to assembly but we want it to be our product name -->
<Product>Microsoft%AE .NET</Product>
<!-- Use the .NET product branding version for informational version description -->
<InformationalVersion Condition="'$(InformationalVersion)' == '' and '$(VersionSuffix)' == ''">$(ProductVersion)</InformationalVersion>
<InformationalVersion Condition="'$(InformationalVersion)' == '' and '$(VersionSuffix)' != ''">$(ProductVersion)-$(VersionSuffix)</InformationalVersion>
</PropertyGroup>

<!-- The Default behavior in VS is to show files for the first target framework in TargetFrameworks property.
This is required to show all the files corresponding to all target frameworks in VS. -->
<ItemGroup Condition="'$(DefaultLanguageSourceExtension)' != '' and
Expand Down
95 changes: 95 additions & 0 deletions docs/design/libraries/DllImportGenerator/Compatibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Semantic Compatibility

Documentation on compatibility guidance and the current state. The version headings act as a rolling delta between the previous version.

## Version 1

The focus of version 1 is to support `NetCoreApp`. This implies that anything not needed by `NetCoreApp` is subject to change. Only .NET 6+ is supported.

### Semantic changes compared to `DllImportAttribute`

The default value of [`CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) is runtime/language-defined. In the built-in system, the default value of the `CharSet` property is `CharSet.Ansi`. The P/Invoke source generator makes no assumptions about the `CharSet` if it is not explicitly set on `GeneratedDllImportAttribute`. Marshalling of `char` or `string` requires explicitly specifying marshalling information.

The built-in system treats `CharSet.None` as `CharSet.Ansi`. The P/Invoke source generator will treat `CharSet.None` as if the `CharSet` was not set.

[`BestFitMapping`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.bestfitmapping) and [`ThrowOnUnmappableChar`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.throwonunmappablechar) will not be supported for `GeneratedDllImportAttribute`. These values only have meaning on Windows when marshalling string data (`char`, `string`, `StringBuilder`) as [ANSI](https://docs.microsoft.com/windows/win32/intl/code-pages). As the general recommendation - including from Windows - is to move away from ANSI, the P/Invoke source generator will not support these fields.

[`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`.

### Required references

The following framework references are required:
- `System.Memory`
- `System.Runtime`
- `System.Runtime.InteropServices`

These are all part of `NetCoreApp` and will be referenced by default unless [implicit framework references are disabled](https://docs.microsoft.com/dotnet/core/project-sdk/msbuild-props#disableimplicitframeworkreferences).

### `char` marshalling

Marshalling of `char` will not be supported when configured with any of the following:
- [`CharSet.Ansi`, `CharSet.Auto`, or `CharSet.None`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.charset) will not be supported.
- [`UnmangedType.U1` or `UnmangedType.I1`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype)
- No explicit marshalling information - either [`DllImportAttribute.CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute)

For `CharSet.Ansi` and `CharSet.None`, the built-in system used the [system default Windows ANSI code page](https://docs.microsoft.com/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte) when on Windows and took the first byte of the UTF-8 encoding on non-Windows platforms. The above reasoning also applies to marshalling of a `char` as `UnmanagedType.U1` and `UnmanagedType.I1`. All approaches are fundamentally flawed and therefore not supported. If a single-byte character is expected to be marshalled it is left to the caller to convert a .NET `char` into a single `byte` prior to calling the native function.

For `CharSet.Auto`, the built-in system relied upon detection at runtime of the platform when determining the targeted encoding. Performing this check in generated code violates the "pay-for-play" principle. Given that there are no scenarios for this feature in `NetCoreApp` it will not be supported.

### `string` marshalling

Marshalling of `string` will not be supported when configured with any of the following:
- [`CharSet.None`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.charset)
- [`UnmangedType.VBByRefStr`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype)
- No explicit marshalling information - either [`DllImportAttribute.CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute)

When converting from native to managed, the built-in system would throw a [`MarshalDirectiveException`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshaldirectiveexception) if the string's length is over 0x7ffffff0. The generated marshalling code will no longer perform this check.

In the built-in system, marshalling a `string` contains an optimization for parameters passed by value to allocate on the stack (instead of through [`AllocCoTaskMem`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.alloccotaskmem)) if the string is below a certain length (MAX_PATH). For UTF-16, this optimization was also applied for parameters passed by read-only reference. The generated marshalling code will include this optimization for read-only reference parameters for non-UTF-16 as well.

When marshalling as [ANSI](https://docs.microsoft.com/windows/win32/intl/code-pages) on Windows (using `CharSet.Ansi` or `UnmanagedType.LPStr`):
- Best-fit mapping will be disabled and no exception will be thrown for unmappable characters. In the built-in system, this behaviour was configured through [`DllImportAttribute.BestFitMapping`] and [`DllImportAttribute.ThrowOnUnmappableChar`]. The generated marshalling code will have the equivalent behaviour of `BestFitMapping=false` and `ThrowOnUnmappableChar=false`.
- No optimization for stack allocation will be performed. Marshalling will always allocate through `AllocCoTaskMem`.

On Windows, marshalling using `CharSet.Auto` is treated as UTF-16. When marshalling a string as UTF-16 by value or by read-only reference, the string is pinned and the pointer passed to the P/Invoke. The generated marshalling code will always pin the input string - even on non-Windows.

### Custom marshaller support

Using a custom marshaller (i.e. [`ICustomMarshaler`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.icustommarshaler)) with the `UnmanagedType.CustomMarshaler` value on `MarshalAsAttribute` is not supported. This also implies `MarshalAsAttribute` fields: [`MarshalTypeRef`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.marshaltyperef), [`MarshalType`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.marshaltype), and [`MarshalCookie`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.marshalcookie) are unsupported.

### Array marshalling

Marshalling of arrays will not be supported when using [`UnmangedType.SafeArray`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype). This implies that the following `MarshalAsAttribute` fields are unsupported: [`SafeArraySubType`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.safearraysubtype) and [`SafeArrayUserDefinedSubType`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.safearrayuserdefinedsubtype)

Specifying array-specific marshalling members on the `MarshalAsAttribute` such as [`SizeConst`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.sizeconst), [`ArraySubType`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.arraysubtype), and [`SizeParamIndex`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.sizeparamindex) with non-array `UnmanagedType` types is unsupported.

Only single-dimensional arrays are supported for source generated marshalling.

In the source-generated marshalling, arrays will be allocated on the stack (instead of through [`AllocCoTaskMem`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.alloccotaskmem)) if they are passed by value or by read-only reference if they contain at most 256 bytes of data. The built-in system does not support this optimization for arrays.

### `in` keyword

For some types - blittable or Unicode `char` - passed by read-only reference via the [`in` keyword](https://docs.microsoft.com/dotnet/csharp/language-reference/keywords/in-parameter-modifier), the built-in system simply pins the parameter. The generated marshalling code does the same, such that there is no behavioural difference. A consequence of this behaviour is that any modifications made by the invoked function will be reflected in the caller. It is left to the user to avoid the situation in which `in` is used for a parameter that will actually be modified by the invoked function.

### `LCIDConversion` support

[`LCIDConversionAttribute`](`https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.lcidconversionattribute`) will not be supported for methods marked with `GeneratedDllImportAttribute`.

### `[In, Out]` Attributes

In the source generated marshalling, the `[In]` and `[Out]` attributes will only be supported on parameters passed by value. For by-ref parameters, users should use the `in`, `ref`, or `out` keywords respectively. Additionally, they will only be supported in scenarios where applying them would result in behavior different from the default, such as applying `[Out]` or `[In, Out]` to a by-value non-blittable array parameter. This is in contrast to the built-in system which will allow them in all cases even when they have no effect.

### Struct marshalling

Support for struct marshalling in the source-generated marshalling is described in [StructMarshalling.md](StructMarshalling.md).

### Unsupported types

Unlike the built-in system, the source generator does not support marshalling for the following types:
- [`CriticalHandle`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.criticalhandle)
- [`HandleRef`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.handleref)
- [`StringBuilder`](https://docs.microsoft.com/dotnet/api/system.text.stringbuilder)

## Version 0

This version is the built-in IL Stub generation system that is triggered whenever a method marked with `DllImport` is invoked.
47 changes: 47 additions & 0 deletions docs/design/libraries/DllImportGenerator/Diagnostics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Generator Diagnostics

For all [Roslyn diagnostics](https://docs.microsoft.com/dotnet/api/microsoft.codeanalysis.diagnostic) reported by the P/Invoke source generator:

| Setting | Value |
| -------- | ------------------ |
| Category | SourceGeneration |
| Severity | Error |
| Enabled | True |

The P/Invoke source generator emits the following diagnostics.

## `DLLIMPORTGEN001`: Specified type is not supported by source-generated P/Invokes

A method marked `GeneratedDllImport` has a parameter or return type that is not supported by source-generated P/Invokes.

```C#
// 'object' without any specific marshalling configuration
[GeneratedDllImport("NativeLib")]
public static partial void Method(object o);
```

## `DLLIMPORTGEN002`: Specified configuration is not supported by source-generated P/Invokes

A method marked `GeneratedDllImport` has configuration that is not supported by source-generated P/Invokes. This may be configuration of the method itself or its parameter or return types.

```C#
// MarshalAs value that does not map to an UnmanagedType
[GeneratedDllImport("NativeLib")]
public static partial void Method([MarshalAs(1)] int i);

// Unsupported field on MarshalAs (SafeArraySubType, SafeArrayUserDefinedSubType, IidParameterIndex)
[GeneratedDllImport("NativeLib")]
public static partial void Method([MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BOOL)] bool[] bArr);

// Unsupported combination of MarshalAs and type being marshalled
[GeneratedDllImport("NativeLib")]
public static partial void Method([MarshalAs(UnmanagedType.LPStr)] bool b);
```

## `DLLIMPORTGEN003`: Current target framework is not supported by source-generated P/Invokes

The `GeneratedDllImport` is being used when targeting a framework that is not supported by source-generated P/Invokes. The generated code is currently only compatible with .NET 5.0 or above.

# Analyzer Diagnostics

The P/Invoke source generator library also contains analyzers that emit diagnostics. These diagnostics flag issues around usage (i.e. of P/Invoke and marshalling attributes) rather than the source generation scenario support issues flagged by the generator itself.
Loading