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

Migrate System.Drawing.Common from dotnet/runtime into winforms #8633

Merged
merged 804 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
804 commits
Select commit Hold shift + click to select a range
6e98e82
Update System.Drawing to reflect GDI+ changes (dotnet/runtime#32873)
qmfrederik Mar 19, 2020
f055f91
More efficient interop for BITMAPINFOHEADER (dotnet/runtime#33967)
jkotas Mar 23, 2020
44a4e50
Disable Bitmap round-tripping tests for old libgdiplus versions (dotn…
jkotas Apr 1, 2020
c331c8c
Rename CoreFx.Private.TestUtilities and reference it in slns (dotnet/…
ViktorHofer Apr 7, 2020
1b26a8e
Enable xunit1024 (dotnet/runtime#34512)
alexvy86 Apr 8, 2020
f0dec44
[mono] Remove CoreFX.issues_windows.rsp file (dotnet/runtime#32592)
MaximLipnin Apr 10, 2020
cc3298c
Fix PrinterSettings.SupportsColor to use the right PInvoke (dotnet/ru…
safern Apr 15, 2020
1a5fe14
Throw DirectoryNotFoundException on Image.Save with bad directory (do…
Macromullet Apr 17, 2020
c976333
Use attribute Link syntax for Common files (dotnet/runtime#35436)
marcusturewicz Apr 25, 2020
66efac2
Use GDI+1.1 API set in Windows 8 and later (dotnet/runtime#35169)
safern May 2, 2020
46b13b9
Remove TargetsNet* from the runtime repo (dotnet/runtime#35589)
Anipik May 4, 2020
e7f6726
Reduce usage of Win7 and Win8 queues, move to CI and add CI runs in W…
safern May 5, 2020
eb79973
Change netcoreapp5.0 to net5.0 (dotnet/runtime#35176)
ViktorHofer May 6, 2020
d66ae41
Use TargetFramework conditions consistently in libraries (dotnet/runt…
ViktorHofer May 11, 2020
9777340
Remove several unnecessary arrays used with Split (dotnet/runtime#36304)
stephentoub May 13, 2020
17fbfd0
Fix argument exception warnings on runtime (dotnet/runtime#35717)
buyaa-n May 15, 2020
06c6397
Checking strings against length seem to have better perf (dotnet/runt…
Youssef1313 May 19, 2020
8fe5c7c
Ensure Image.Save can handle non readable / seekable Streams (dotnet/…
ericstj May 22, 2020
b3feb46
rearrange tfms for intellisense (dotnet/runtime#37027)
Anipik May 27, 2020
163a5b8
Add linux arm/arm64 libraries checked coreclr test runs (dotnet/runti…
safern May 28, 2020
f22a89b
Add mono interpreter test leg to CI (dotnet/runtime#35568)
steveisok May 28, 2020
44bf500
Use [MemberNotNull] to reduce use of `= null!;` (dotnet/runtime#37490)
stephentoub Jun 9, 2020
b89cdc0
Use ConditionalFact/Theory for skipping RemoteExecutor on unsupported…
akoeplinger Jun 9, 2020
f09b2f9
Remove some stale nullable suppressions / TODOs (dotnet/runtime#37978)
stephentoub Jun 17, 2020
2b85893
Change Activity Default IdFormat to W3C (dotnet/runtime#37686)
tarekgh Jun 19, 2020
1c33f0f
Add attributes to System.Drawing.Printing.PrintDocument (dotnet/runti…
eriawan Jun 23, 2020
573a9cc
Fix CA1805 for unnecessary initialization of fields (dotnet/runtime#3…
stephentoub Jun 26, 2020
d3e56b1
Disable P/Invoke analyzer (dotnet/runtime#38550)
stephentoub Jun 29, 2020
174f40a
Remove some stale pragma warning disables (dotnet/runtime#38551)
stephentoub Jun 30, 2020
0024918
Turn on argument exception analyzer on runtime, fix warnings found (d…
buyaa-n Jul 2, 2020
f588c7e
Use full MD5 to compare bitmap rotate results (dotnet/runtime#38699)
tkp1n Jul 2, 2020
624c721
Return true for PlatformDection.IsMonoInterpreter on WASM (dotnet/run…
akoeplinger Jul 3, 2020
bba8fb3
Disable 2 System.Drawing tests for TailcallStress (dotnet/runtime#38891)
BruceForstall Jul 7, 2020
8cbcf83
Make browser peer for windows_nt and unix (dotnet/runtime#37944)
Anipik Jul 8, 2020
e0b0383
Update license headers (dotnet/runtime#38793)
stephentoub Jul 8, 2020
530afc4
Fix remaining license headers (dotnet/runtime#38953)
stephentoub Jul 9, 2020
e04a615
[wasm] Modify System.Drawing.Common to throw PNSE on Browser (dotnet/…
MaximLipnin Jul 9, 2020
56b7272
Mark Obsoletions for .NET 5 (dotnet/runtime#39269)
jeffhandley Jul 18, 2020
47fa1da
Remove unused local variables and methods from System.Drawing.Common …
MattKotsenas Jul 18, 2020
3d90d6a
Remove depprojs in favor of PackageReferences (dotnet/runtime#35606)
ViktorHofer Jul 23, 2020
176602f
Correcting Mismatch between ref and src (dotnet/runtime#39741)
Anipik Jul 30, 2020
d9318ed
Update Microsoft.CodeAnalysis.NetAnalyzers to 3.3.0-beta3.20407.4 (do…
stephentoub Aug 9, 2020
14e179a
[browser] Mark APIs as unsupported on browser (dotnet/runtime#40612)
MaximLipnin Aug 13, 2020
2c32c88
Fix TailCallStress mode. (dotnet/runtime#40698)
erozenfeld Aug 15, 2020
e507789
Move Font*, Image* and Margins converters to System.Drawing.Common an…
safern Aug 15, 2020
84a0563
Fix packaging for the browser (dotnet/runtime#40814)
Anipik Aug 18, 2020
0ecb8b2
Move Editor Attribute to S.CM.Primitives and apply to types that had …
safern Aug 23, 2020
f10941b
Re-enable testing on OSX 10.15 (dotnet/runtime#40524)
directhex Aug 24, 2020
09bc18c
Search libgdiplus in /usr/local/lib on macOS (dotnet/runtime#41503)
am11 Sep 1, 2020
5c24356
Enabling CA1416: Validate platform compatibility (dotnet/runtime#41760)
tannergooding Sep 10, 2020
43e8a2b
Mark Thread.ResetAbort as obsolete (dotnet/runtime#42228)
Hona Sep 15, 2020
d971d08
Add IDE warnings to code analysis ruleset (dotnet/runtime#42566)
stephentoub Sep 24, 2020
2261734
Enable several more IDE analyzer warnings (dotnet/runtime#42692)
stephentoub Sep 25, 2020
b52c2cb
Remove p/invoke to RtlMoveMemory, cleanup caller (dotnet/runtime#42749)
GrabYourPitchforks Sep 27, 2020
b5abb65
[System.Drawing.Common] Work around libgdiplus use after free (dotnet…
lambdageek Oct 8, 2020
9534e58
Fix various typos (dotnet/runtime#43073)
am11 Oct 10, 2020
4654607
Remove some unnecessary unsafe usage (dotnet/runtime#43430)
stephentoub Oct 17, 2020
a07b86e
Remove stale !s and TODO-NULLABLEs, plus those for indexer nullabilit…
stephentoub Nov 2, 2020
0c10b28
Changing Windows_NT -> Windows for enabling TargetPlatformMoniker fe…
Anipik Nov 2, 2020
33712fe
Remove some unnecessary GetTypeInfo usage (dotnet/runtime#44414)
stephentoub Nov 9, 2020
70ca2bf
Add workflow to update solution files with SlnGen and update them ini…
ViktorHofer Nov 17, 2020
e63aeac
disable restore in vs for projects targeting platform specific old fr…
Anipik Dec 2, 2020
3b2eaaf
FontConverter restore order of font properties (dotnet/runtime#45746)
RussKie Dec 11, 2020
3c55ea9
Inline package descriptions and remove descriptions.json files across…
ViktorHofer Dec 22, 2020
4d1ba26
Remove targets* platform condition from project references (dotnet/ru…
Anipik Jan 4, 2021
c221a00
Update SafeHandle types to have public parameterless constructors and…
jkoritzinsky Jan 20, 2021
2020260
Search libgdiplus in macports install location (dotnet/runtime#47373)
am11 Jan 26, 2021
bbbd619
Consolidate Bitmap(Type, string) constructor (dotnet/runtime#46793)
hughbe Jan 29, 2021
57d88d2
Use [NotNullWhen(true)] in more places (dotnet/runtime#47598)
stephentoub Jan 30, 2021
eb6f2f7
Change C# names of P/Invokes of objc_msgSend to be call-site specific…
jkoritzinsky Feb 2, 2021
fb3a91b
Remove DeviceContext HWND handling (dotnet/runtime#47081)
hughbe Feb 3, 2021
0780327
Handle NativeLibrary.GetExport/Free on libs not loaded through Native…
lateralusX Feb 4, 2021
3119f38
Single Transport Package for aspnetcore (dotnet/runtime#47684)
Anipik Feb 8, 2021
a5ca53b
Fix GDI handle leak in Icon.DrawImage (dotnet/runtime#47836)
safern Feb 8, 2021
66017f4
Optimize Matrix.Elements (dotnet/runtime#47932)
JeremyKuhne Feb 9, 2021
8243a2a
Add Matrix3x2 transform methods (dotnet/runtime#48195)
JeremyKuhne Mar 4, 2021
42ac7ac
Disable IsAtLeastLibgdiplus6 for Apple Silicon (dotnet/runtime#49173)
sdmaclea Mar 5, 2021
03dc2ee
Fix inverted active issues (dotnet/runtime#49265)
sdmaclea Mar 6, 2021
1a15767
Don't include windows PInvokes on Unix for System.Drawing (dotnet/run…
safern Mar 11, 2021
79921d7
Seal private classes in libraries (dotnet/runtime#49969)
stephentoub Mar 23, 2021
a3e9649
Enable CA1052 (static holder types should be static) (dotnet/runtime#…
stephentoub Mar 23, 2021
9feb284
Seal internal types in libraries (dotnet/runtime#50225)
stephentoub Mar 26, 2021
0eb2a26
remove repetitions ';' (dotnet/runtime#50236)
kronic Mar 26, 2021
096f172
Add PropertyItem tests (dotnet/runtime#46794)
hughbe Mar 26, 2021
0d0fdde
Remove some assemblies from ASP.NETCore transport package (dotnet/run…
ericstj Mar 26, 2021
d21a133
Big-endian fix: Accessing OBJECTHEADER in ImageConverter (dotnet/runt…
uweigand Apr 1, 2021
5360ece
Clean up string formatting in a variety of places (dotnet/runtime#50267)
stephentoub Apr 5, 2021
96aaa6a
Cleanup PlatformSpecific/SkipOnMono attributes that skip a platform (…
akoeplinger Apr 9, 2021
af20452
Implement new GetContextInfo API overloads (dotnet/runtime#49186)
JeremyKuhne Apr 16, 2021
8591d45
Include FontName in Font.GetHashCode (dotnet/runtime#47674)
iSatishYadav Apr 23, 2021
072f5fd
Drawing: Replace harvested assets with live config (dotnet/runtime#51…
ViktorHofer Apr 29, 2021
8cb9e3d
fix return value (dotnet/runtime#52206)
hrrrrustic May 5, 2021
0012bcd
Fix ImageAnimator to render the correct frames (dotnet/runtime#52236)
jeffhandley May 6, 2021
be2e691
Adding Infrastructure to run linker on OOB Assemblies by manually cal…
joperezr May 7, 2021
b692e0c
Remove the use of IsPartialFacadeAssembly in refererences (dotnet/run…
ericstj May 19, 2021
3e9c772
Generate targets files that throws for unsupported netstandard applic…
ViktorHofer May 26, 2021
61992a8
Remove NS1.x assets from building and packaging (dotnet/runtime#53283)
ViktorHofer May 26, 2021
08844ce
Use Stopwatch.StartNew() in ImageAnimator (dotnet/runtime#53330)
jeffhandley May 27, 2021
c4d7cfe
Upgrading netcoreapp2.x and NCA3.0 to netcoreapp3.1 (dotnet/runtime#5…
ViktorHofer May 28, 2021
899f34e
Include NetCoreAppCurrent configs in packages (dotnet/runtime#53439)
ViktorHofer Jun 8, 2021
f127620
Don't reference the netstandard shim inside the shared framework (dot…
ViktorHofer Jun 10, 2021
06f6bc7
Remove System.Drawing code that doesn't work (dotnet/runtime#54245)
eerhardt Jun 16, 2021
ffd3603
Resolving first part of System.Drawing.Common IlLink warnings (dotnet…
joperezr Jun 17, 2021
28f90e6
Remove BitmapSelector.Suffix property (dotnet/runtime#54364)
eerhardt Jun 21, 2021
cb01ccc
[main] Update dependencies from 9 repositories (dotnet/runtime#54218)
dotnet-maestro[bot] Jun 22, 2021
dde380c
Revert "[main] Update dependencies from 9 repositories (dotnet/runtim…
premun Jun 22, 2021
d8e66f0
[main] Update dependencies from 9 repositories (dotnet/runtime#54543)
premun Jun 25, 2021
b84304a
First round of converting System.Drawing.Common to COMWrappers (dotne…
eerhardt Jun 28, 2021
d18d273
Add NetCoreAppCurrent configuration to libs (Phase 1) (dotnet/runtime…
ViktorHofer Jun 29, 2021
1f32939
Fix typo in variable name (dotnet/runtime#54989)
kant2002 Jul 1, 2021
60113c2
Finish migrating System.Drawing.Common to ComWrappers (dotnet/runtime…
eerhardt Jul 6, 2021
7ad670f
Add nullable annotations to System.ComponentModel.TypeConverter (dotn…
krwq Jul 8, 2021
40218a6
Enable CA1419 (SafeHandle public parameterless ctor) (dotnet/runtime#…
stephentoub Jul 12, 2021
5fd2890
Use interpolated strings in more places
stephentoub Jul 12, 2021
df6c9e3
Disable some System.Drawing.Common tests failing on Windows Mono (dot…
akoeplinger Jul 14, 2021
d8e5dcb
Make System.Drawing.Common throw on Unix unless a config switch is se…
safern Jul 21, 2021
796925b
[iOS/tvOS/MacCatalyst] Disable some of the library tests due to failu…
MaximLipnin Jul 22, 2021
193bf6c
Prevent divide-by-zero in ImageAnimator for images with 0 delay betwe…
jeffhandley Jul 24, 2021
97cd237
Tighten up some ArrayPool.Return usage (dotnet/runtime#56229)
stephentoub Jul 27, 2021
8abdeba
Update libraries solution and NuGet.config files (dotnet/runtime#56430)
ViktorHofer Jul 28, 2021
251af9a
Disable failing arm64 win10 Graphics.FromHdc tests (dotnet/runtime#5…
mateoatr Aug 2, 2021
b5cc83b
Remove old fwlink from Obsolete messages and make message improvement…
jeffhandley Aug 4, 2021
14ade70
Replace all remaining pkgprojs with NuGet Pack task (dotnet/runtime#5…
ViktorHofer Aug 5, 2021
b409f70
Strong name key id cleanup and pkg testing move (dotnet/runtime#57044)
ViktorHofer Aug 9, 2021
8d4bfbf
Automatically generate .NETStandard compat errors (dotnet/runtime#57057)
ViktorHofer Aug 10, 2021
c3d50b0
Disable System.Drawing.Common tests for mobile workloads and skip a f…
steveisok Aug 13, 2021
2cf6e86
Update CompatibilitySuppressions after updating APICompat that uses r…
joperezr Sep 1, 2021
bee2a04
Update solution files for correct ordering of elements (dotnet/runtim…
ViktorHofer Sep 3, 2021
7acf05b
Upgrade to net7.0 and remove target frameworks (dotnet/runtime#58011)
ViktorHofer Sep 8, 2021
a22bd20
Add SetLastError to GdiPlus methods (dotnet/runtime#59096)
ericstj Sep 15, 2021
4522c27
Run slngen to regenerate the solution files.
jkoritzinsky Sep 20, 2021
a3a7917
Merge branch 'main' of github.com:dotnet/runtime into merge-main
jkoritzinsky Sep 24, 2021
12e0dd5
System.Drawing.Common.Tests updated ConvertTo_String tests for null v…
AlexRadch Sep 30, 2021
33e321b
Merge branch 'main' into feature/use-dllimport-generator
jkoritzinsky Oct 2, 2021
b008c1c
Update CompatibilitySuppressions files after upgrading Package Valida…
joperezr Oct 5, 2021
2a35b88
Merge branch 'main' into feature/use-dllimport-generator
jkoritzinsky Oct 7, 2021
49210cf
System.Drawing.Common.Tests fail ToLogFont_Invoke tests on non Englis…
AlexRadch Oct 14, 2021
c27b3eb
Undo solution and config changes from DllImportGenerator (dotnet/runt…
elinor-fung Oct 15, 2021
f8822a7
Merge branch 'main' into feature/use-dllimport-generator
elinor-fung Oct 15, 2021
4d2edb9
Fix of https://github.com/dotnet/runtime/issues/60480 issue (dotnet/r…
AlexRadch Oct 16, 2021
7b7b66c
Merge feature/use-dllimport-generator to main dotnet/runtime#59579
safern Oct 18, 2021
648aca6
Move 2 Drawing APIs that are not implemented in netfx to netcoreapp (…
safern Oct 19, 2021
b40732a
Disable a couple of pen tests on Windows (dotnet/runtime#60746)
safern Oct 21, 2021
4d5ac08
Update slngen and solution files (dotnet/runtime#60871)
ViktorHofer Oct 26, 2021
b6f9183
Update previous netcoreapp version to run API Compat against 6.0 ref …
safern Dec 4, 2021
cae2de0
Convert System.DirectoryServices.Protocols and System.Drawing.Common …
jkoritzinsky Dec 7, 2021
5f60b10
Remove AOT warnings for S.Drawing.Common (dotnet/runtime#61567)
kant2002 Dec 14, 2021
10e4daa
Fix null ref for null Stream input in Icon.Save (dotnet/runtime#63369)
stephentoub Jan 5, 2022
e1148ca
Added DrawRectangle overload accepting RectangleF (dotnet/runtime#62385)
medo64 Jan 11, 2022
92c7691
Enable IDE0059 analyzer: Unnecessary assignment of a value (dotnet/ru…
marek-safar Jan 12, 2022
d0fb9a2
Update XUnit to 2.4.2-pre.22 (dotnet/runtime#63948)
ericstj Jan 20, 2022
a3ad280
Remove commented code (dotnet/runtime#63869)
wrzucher Jan 21, 2022
af75fba
Remove enable drawing on unix switch (dotnet/runtime#64084)
safern Jan 21, 2022
9cf5b5a
Implement IEquatable<T> on value types overriding Equals (and enable …
stephentoub Jan 24, 2022
db3b58b
Fix formatting of resource string where excess arguments are passed (…
Marusyk Jan 25, 2022
173b98b
Remove some of the unused resource strings (dotnet/runtime#64379)
adamsitnik Jan 27, 2022
b8713fa
Initial roll out of !! (dotnet/runtime#64720)
stephentoub Feb 8, 2022
d3a2445
Move DllImportGenerator to use DisableRuntimeMarshalling for its blit…
jkoritzinsky Feb 10, 2022
3c480bd
Update StyleCopAnalyzers to 1.2.0-beta.406 (dotnet/runtime#65142)
stephentoub Feb 11, 2022
85c927e
Don't use Targets* helper properties in libs (dotnet/runtime#64500)
ViktorHofer Feb 12, 2022
be7cb33
Disable tests on Debug CoreClr that are already disabled on Checked C…
danmoseley Feb 12, 2022
77b7d4e
Remove ExactSpelling from GeneratedDllImport (dotnet/runtime#65343)
jkoritzinsky Feb 19, 2022
875fb4c
Remove S.R.CS.Unsafe and Intrinsify Unsafe (dotnet/runtime#64861)
Wraith2 Feb 20, 2022
4ae011e
Fix slngen.proj and update solution files (dotnet/runtime#65711)
ViktorHofer Feb 22, 2022
f5266aa
Update GeneratedDllImportAttribute CharSet -> StringMarshalling (dotn…
elinor-fung Feb 24, 2022
2271263
Improve nullability for TypeConverter.CanConvertTo (dotnet/runtime#63…
MichaelKetting Mar 1, 2022
2e1f2e4
Keep Obsolete and EditorBrowsable attributes consistent between ref a…
ViktorHofer Mar 1, 2022
64fe068
Use generic `Enum` methods when possible. (dotnet/runtime#64850)
teo-tsirpanis Mar 2, 2022
cdf764f
Disable default marshalling for bool (dotnet/runtime#65749)
jkoritzinsky Mar 3, 2022
7b37e06
Mark ImageAnimator.UpdateFrames to accept a nullable Image (dotnet/ru…
jeffhandley Mar 3, 2022
f396d61
Rename `DllImportGenerator` project to `LibraryImportGenerator` (dotn…
elinor-fung Mar 4, 2022
0e27b14
Rename `GeneratedDllImportAttribute` -> `LibraryImportAttribute` (dot…
elinor-fung Mar 10, 2022
b2c7372
Add the CustomTypeMarshallerAttribute type to make it easier to ident…
jkoritzinsky Mar 23, 2022
fd8584b
Update coding-style to include target-typed new() guideline (dotnet/r…
eerhardt Mar 24, 2022
7df0c64
Fix entry point for EnumPrinters (dotnet/runtime#67081)
elinor-fung Mar 24, 2022
6d03469
Enable CA1822 (Mark members as static) analyzer (dotnet/runtime#66333)
marek-safar Mar 25, 2022
6e0ccdb
Minor fixes (dotnet/runtime#67931)
danmoseley Apr 13, 2022
19373f5
[LibraryImportGenerator] Add/use CustomTypeMarshaller implementations…
elinor-fung Apr 14, 2022
838128b
Clean-up `System.Drawing.Common` and remove the Unix code. (dotnet/ru…
teo-tsirpanis Apr 20, 2022
96a3cdf
Remove usage of !! from dotnet/runtime (dotnet/runtime#68178)
stephentoub Apr 21, 2022
6e00c15
Enable new CA1311 (ToLower/Upper culture) and CA1852 (seal internal/p…
stephentoub Apr 21, 2022
7da639f
Use "..."u8 to simplify some `ReadOnlySpan<byte>` constructions (dotn…
stephentoub Apr 21, 2022
e5058eb
Change Nullable to default to enable in libraries src and ref project…
eerhardt Apr 25, 2022
1b7bd54
Fix VS complaining about missing projects in slns (dotnet/runtime#68488)
ViktorHofer Apr 25, 2022
817ccb4
Move `CustomTypeMarshaller` APIs to `System.Runtime.InteropServices.M…
elinor-fung May 5, 2022
c6cbbd6
Call simpler overloads of Substring and Slice (dotnet/runtime#68937)
GrabYourPitchforks May 11, 2022
5cf5368
Updating to a version of Roslyn that contains the NumericIntPtr featu…
tannergooding May 21, 2022
6bf6428
Use u8 in more places (dotnet/runtime#69995)
stephentoub Jun 7, 2022
cf87e91
[main] Update dependencies from 8 repositories (dotnet/runtime#69709)
dotnet-maestro[bot] Jun 8, 2022
2397719
Enable IDE0074 (Use compound assignment) (dotnet/runtime#70402)
stephentoub Jun 9, 2022
9a23edd
Remove some more unnecessary pragma warning disables (dotnet/runtime#…
stephentoub Jun 11, 2022
ef35f58
Enable IDE1005 (Delegate invocation can be simplified) (dotnet/runtim…
stephentoub Jun 16, 2022
b8a7be6
Enable IDE0054 (Use compound assignment) (dotnet/runtime#70564)
stephentoub Jun 17, 2022
0fa8473
Enable IDE0071 (Simplify interpolation) (dotnet/runtime#70918)
stephentoub Jun 19, 2022
d9e4772
Enable IDE0100 (Remove redundant equality) (dotnet/runtime#70896)
stephentoub Jun 19, 2022
e9c6bc5
Enable IDE0065 (Misplaced using directive) (dotnet/runtime#70919)
stephentoub Jun 19, 2022
5b93a34
Fix manual delegate interop in System.Drawing.Common to handle nulls …
jkoritzinsky Jun 23, 2022
c9abcd9
Mark EnumerateMetafileProc's callbackData parameter as nullable (dotn…
jkoritzinsky Jun 24, 2022
d5845f7
Custom marshallers v2 usage (dotnet/runtime#71238)
jkoritzinsky Jun 25, 2022
df8e46c
Remove unused property from ImageConverter (dotnet/runtime#71294)
stephentoub Jun 26, 2022
2a479be
Use null coalescing in many more places (dotnet/runtime#71361)
stephentoub Jun 28, 2022
75041bb
Update to use CustomMarshaller entry point type (dotnet/runtime#71398)
elinor-fung Jun 28, 2022
b81ce86
Add `System.Drawing.Imaging.ImageFormat.Heif` and `Webp`. (dotnet/run…
teo-tsirpanis Jun 29, 2022
4d6bfdc
Disable failing graphics tests on windows 7 (dotnet/runtime#71151)
ViktorHofer Jun 29, 2022
47d4068
Update design and expose new attributes for the CustomTypeMarshaller …
jkoritzinsky Jul 6, 2022
2602c9d
Update all internal marshallers to the new model (dotnet/runtime#71470)
jkoritzinsky Jul 7, 2022
b8ce67a
Fix more warnings from updated IDE rules (dotnet/runtime#71779)
stephentoub Jul 8, 2022
34a1ac3
Enabling 9 new libraries tests for NativeAOT (dotnet/runtime#72167)
MichalStrehovsky Jul 15, 2022
89196d6
Add diagnostic suppressor for the MarkMethodsAsStatic diagnostics on …
jkoritzinsky Jul 15, 2022
29629f2
Fix typos (dotnet/runtime#72314)
am11 Jul 17, 2022
a259894
Block SaveWmfAsPngDoesntChangeImageBoundaries (dotnet/runtime#72416)
MichalStrehovsky Jul 19, 2022
5d608ab
Utilize new C# support for nameof in attributes in same signature (do…
stephentoub Jul 22, 2022
aa4f6d3
Fix typos (dotnet/runtime#72709)
am11 Jul 24, 2022
cc2ecf7
Add stateful marshaller support to the CustomMarshallerAttributeAnaly…
jkoritzinsky Jul 29, 2022
7fce419
Fix typos (dotnet/runtime#73122)
am11 Aug 1, 2022
995dd0b
Change to GetLastPInvokeError where possible (dotnet/runtime#73980)
danmoseley Aug 18, 2022
1dbb9f8
Update CompatibilitySuppressions.xml after sorting (dotnet/runtime#74…
smasher164 Sep 1, 2022
24c07e0
Update APICompat and compatibility suppression files (dotnet/runtime#…
ViktorHofer Sep 12, 2022
f281539
Fix Interop.Gdi32.StartDoc p/invoke (dotnet/runtime#76569)
elinor-fung Oct 4, 2022
52be1bc
Fix numeric IntPtr behavioral changes analyzer findings (dotnet/runti…
buyaa-n Oct 5, 2022
733bfc2
Add basic test for `PrintDocument.Print` using the default print cont…
elinor-fung Oct 10, 2022
ee4ca35
Leverage the shipping, roslyn based ApiCompat in dotnet/runtime (dotn…
ViktorHofer Oct 16, 2022
4bd7c05
Move Interop code from System.Drawings.Common to Common directory (do…
hangy Oct 31, 2022
4d3392f
Enable IDE0060 (Remove unused parameter) analyzer (dotnet/runtime#72667)
marek-safar Nov 8, 2022
b76aeec
Add README.md for System.Drawing.Common (dotnet/runtime#78121)
ViktorHofer Nov 9, 2022
5ff4b37
Add NetCoreAppPrevious tfm to out-of-band projects
ViktorHofer Nov 16, 2022
5c2331e
Update reference source projects with new tfm
ViktorHofer Nov 18, 2022
25058a9
Update suppression files for tfm change
ViktorHofer Nov 18, 2022
aa84547
Use ASCII strings in source files (dotnet/runtime#78265)
am11 Nov 23, 2022
0329d43
Merge branch 'main' into Net8ChangesSecondAttempt
ViktorHofer Nov 29, 2022
64dfe0b
Fix typos (dotnet/runtime#79136)
am11 Dec 4, 2022
c582503
Merge pull request dotnet/runtime#78354 from carlossanlop/Net8Changes…
ViktorHofer Dec 5, 2022
9ca5933
Rewrite Enum and add {ISpanFormattable}.TryFormat (dotnet/runtime#78580)
stephentoub Dec 6, 2022
c21ab37
Remove Drawing.Common .NETCoreApp PNSEs (dotnet/runtime#80435)
ViktorHofer Jan 11, 2023
a1504e4
Fix most violations of new CA1859 (dotnet/runtime#80335)
stephentoub Jan 12, 2023
14495d4
EnableAotAnalyzer by default for src libraries (dotnet/runtime#81608)
eerhardt Feb 6, 2023
c598035
remove test references to archaic Linux versions (dotnet/runtime#81992)
wfurt Feb 12, 2023
66d39fc
Merge branch 'main' of ../runtime into DrawingMigration
dotnet-bot Feb 13, 2023
61f3ede
Integrate System.Drawing.Common into winforms repo
dotnet-bot Feb 13, 2023
d30eb69
Merge branch 'main' into DrawingMigration
ViktorHofer Feb 13, 2023
ee24b18
Make repo build successfully and package S.D.Common
ViktorHofer Feb 14, 2023
dd4a26e
Don't run failing tests
ViktorHofer Feb 14, 2023
5b99ce8
Fix notrait syntax
ViktorHofer Feb 14, 2023
b5be700
Merge branch 'main' into DrawingMigration
ViktorHofer Feb 14, 2023
85c1475
Make DllImports available for net6.0
ViktorHofer Mar 13, 2023
b597fd6
Merge remote-tracking branch 'origin/main' into DrawingMigration
ViktorHofer Mar 13, 2023
dbb8913
Fix ordering of modifiers
ViktorHofer Mar 13, 2023
3ae88a6
Update private winforms package
ViktorHofer Mar 13, 2023
7d16942
Manually apply commits since Feb 12th 2023
ViktorHofer Mar 13, 2023
821937c
Merge remote-tracking branch 'upstream/main' into DrawingMigration
ViktorHofer Mar 13, 2023
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
  •  
  •  
  •  
35 changes: 34 additions & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<!-- to prevent using MS.NC.Platforms from SDK, which is lagging behind the version that WinForms gets from the CoreFx packages -->
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Platforms" Version="$(MicrosoftNETCorePlatformsPackageVersion)" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="$(MicrosoftNETCorePlatformsPackageVersion)" PrivateAssets="all" />
</ItemGroup>

<!-- Set code coverage properties that reference properties not available in Directory.Build.props -->
Expand Down Expand Up @@ -87,4 +87,37 @@
<RuntimeFrameworkVersion Condition="!$(TargetFramework.StartsWith('$(RedistTargetFrameworkName)'))" />
</PropertyGroup>

<!-- Adds Nullable annotation attributes to C# non .NETCoreApp builds. -->
<ItemGroup Condition="'$(Nullable)' != '' and
'$(Nullable)' != 'disable' and
'$(MSBuildProjectExtension)' == '.csproj' and
'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
<Compile Include="$(RepoRoot)src\Common\src\NullableAttributes.cs" />
</ItemGroup>

<Choose>
<When Condition="'$(IncludeInternalObsoleteAttribute)' == 'true' and '$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
<ItemGroup>
<Compile Include="$(RepoRoot)src\Common\src\ObsoleteAttribute.cs" />
</ItemGroup>
<PropertyGroup>
<!-- Suppress CS0436 to allow ObsoleteAttribute to be internally defined and used in .NET Standard. -->
<NoWarn>$(NoWarn);CS0436</NoWarn>
</PropertyGroup>
</When>
</Choose>

<!-- If a tfm doesn't target .NETCoreApp but uses the platform support attributes, then we include the
System.Runtime.Versioning*Platform* annotation attribute classes in the project as internal.

If a project has specified assembly-level SupportedOSPlatforms or UnsupportedOSPlatforms,
we can infer the need without having IncludePlatformAttributes set. -->
<PropertyGroup>
<IncludePlatformAttributes Condition="'$(IncludePlatformAttributes)' == '' and ('$(SupportedOSPlatforms)' != '' or '$(UnsupportedOSPlatforms)' != '')">true</IncludePlatformAttributes>
</PropertyGroup>

<ItemGroup Condition="'$(IncludePlatformAttributes)' == 'true' and '$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
<Compile Include="$(RepoRoot)src\Common\src\PlatformAttributes.cs" />
</ItemGroup>

</Project>
4 changes: 0 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ Note: if the Uri is a new place, you will need to add a subscription from that p
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>252018c3d3fffdb592413cf61d5b80cf751e0a59</Sha>
</Dependency>
<Dependency Name="System.Drawing.Common" Version="8.0.0-preview.2.23112.4">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>252018c3d3fffdb592413cf61d5b80cf751e0a59</Sha>
</Dependency>
<Dependency Name="System.Resources.Extensions" Version="8.0.0-preview.2.23112.4">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>252018c3d3fffdb592413cf61d5b80cf751e0a59</Sha>
Expand Down
4 changes: 3 additions & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
<MicrosoftWin32SystemEventsPackageVersion>8.0.0-preview.2.23112.4</MicrosoftWin32SystemEventsPackageVersion>
<SystemCodeDomPackageVersion>8.0.0-preview.2.23112.4</SystemCodeDomPackageVersion>
<SystemConfigurationConfigurationManagerPackageVersion>8.0.0-preview.2.23112.4</SystemConfigurationConfigurationManagerPackageVersion>
<SystemDrawingCommonPackageVersion>8.0.0-preview.2.23112.4</SystemDrawingCommonPackageVersion>
<SystemResourcesExtensionsPackageVersion>8.0.0-preview.2.23112.4</SystemResourcesExtensionsPackageVersion>
<SystemSecurityPermissionsPackageVersion>8.0.0-preview.2.23112.4</SystemSecurityPermissionsPackageVersion>
<SystemWindowsExtensionsPackageVersion>8.0.0-preview.2.23112.4</SystemWindowsExtensionsPackageVersion>
Expand Down Expand Up @@ -76,6 +75,9 @@
<!-- This is needed for Verify.Xunit to pull correct version of System.Speech -->
<MicrosoftWindowsCompatibilityVersion>8.0.0-preview.2.23112.4</MicrosoftWindowsCompatibilityVersion>
<MoqPackageVersion>4.10.0</MoqPackageVersion>
<SystemComponentModelTypeConverterTestDataVersion>8.0.0-beta.23107.1</SystemComponentModelTypeConverterTestDataVersion>
<SystemDrawingCommonTestDataVersion>8.0.0-beta.23107.1</SystemDrawingCommonTestDataVersion>
<SystemWindowsExtensionsTestDataVersion>8.0.0-beta.23107.1</SystemWindowsExtensionsTestDataVersion>
<VerifyXunitVersion>14.2.0</VerifyXunitVersion>
</PropertyGroup>
<!-- Code Coverage -->
Expand Down
5 changes: 5 additions & 0 deletions src/Common/src/DisableRuntimeMarshalling.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

// Used to indicate that runtime marshalling should be disabled.
[assembly: System.Runtime.CompilerServices.DisableRuntimeMarshalling]
27 changes: 27 additions & 0 deletions src/Common/src/HandleRefMarshaller.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics.CodeAnalysis;

namespace System.Runtime.InteropServices.Marshalling
{
[CustomMarshaller(typeof(HandleRef), MarshalMode.ManagedToUnmanagedIn, typeof(KeepAliveMarshaller))]
internal static class HandleRefMarshaller
{
internal struct KeepAliveMarshaller
{
private HandleRef _handle;

public void FromManaged(HandleRef handle)
{
_handle = handle;
}

public IntPtr ToUnmanaged() => _handle.Handle;

public void OnInvoked() => GC.KeepAlive(_handle.Wrapper);

public void Free() { }
}
}
}
63 changes: 63 additions & 0 deletions src/Common/src/LocalAppContextSwitches.Common.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

// Copied from https://raw.githubusercontent.com/dotnet/runtime/main/src/libraries/Common/src/System/LocalAppContextSwitches.Common.cs

using System.Runtime.CompilerServices;

namespace System
{
// Helper method for local caching of compatibility quirks. Keep this lean and simple - this file is included into
// every framework assembly that implements any compatibility quirks.
internal static partial class LocalAppContextSwitches
{
// Returns value of given switch using provided cache.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static bool GetSwitchValue(string switchName, ref bool switchValue) =>
AppContext.TryGetSwitch(switchName, out switchValue);

// Returns value of given switch using provided cache.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static bool GetCachedSwitchValue(string switchName, ref int cachedSwitchValue)
{
// The cached switch value has 3 states: 0 - unknown, 1 - true, -1 - false
if (cachedSwitchValue < 0) return false;
if (cachedSwitchValue > 0) return true;

return GetCachedSwitchValueInternal(switchName, ref cachedSwitchValue);
}

private static bool GetCachedSwitchValueInternal(string switchName, ref int cachedSwitchValue)
{
bool hasSwitch = AppContext.TryGetSwitch(switchName, out bool isSwitchEnabled);
if (!hasSwitch)
{
isSwitchEnabled = GetSwitchDefaultValue(switchName);
}

AppContext.TryGetSwitch("TestSwitch.LocalAppContext.DisableCaching", out bool disableCaching);
if (!disableCaching)
{
cachedSwitchValue = isSwitchEnabled ? 1 /*true*/ : -1 /*false*/;
}

return isSwitchEnabled;
}

// Provides default values for switches if they're not always false by default
private static bool GetSwitchDefaultValue(string switchName)
{
if (switchName == "Switch.System.Runtime.Serialization.SerializationGuard")
{
return true;
}

if (switchName == "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization")
{
return true;
}

return false;
}
}
}
196 changes: 196 additions & 0 deletions src/Common/src/NullableAttributes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.Diagnostics.CodeAnalysis
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to add these files?

{
#if !NETSTANDARD2_1
/// <summary>Specifies that null is allowed as an input even if the corresponding type disallows it.</summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class AllowNullAttribute : Attribute { }

/// <summary>Specifies that null is disallowed as an input even if the corresponding type allows it.</summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class DisallowNullAttribute : Attribute { }

/// <summary>Specifies that an output may be null even if the corresponding type disallows it.</summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class MaybeNullAttribute : Attribute { }

/// <summary>Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns.</summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class NotNullAttribute : Attribute { }

/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter may be null even if the corresponding type disallows it.</summary>
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class MaybeNullWhenAttribute : Attribute
{
/// <summary>Initializes the attribute with the specified return value condition.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter may be null.
/// </param>
public MaybeNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;

/// <summary>Gets the return value condition.</summary>
public bool ReturnValue { get; }
}

/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter will not be null even if the corresponding type allows it.</summary>
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class NotNullWhenAttribute : Attribute
{
/// <summary>Initializes the attribute with the specified return value condition.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter will not be null.
/// </param>
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;

/// <summary>Gets the return value condition.</summary>
public bool ReturnValue { get; }
}

/// <summary>Specifies that the output will be non-null if the named parameter is non-null.</summary>
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class NotNullIfNotNullAttribute : Attribute
{
/// <summary>Initializes the attribute with the associated parameter name.</summary>
/// <param name="parameterName">
/// The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null.
/// </param>
public NotNullIfNotNullAttribute(string parameterName) => ParameterName = parameterName;

/// <summary>Gets the associated parameter name.</summary>
public string ParameterName { get; }
}

/// <summary>Applied to a method that will never return under any circumstance.</summary>
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class DoesNotReturnAttribute : Attribute { }

/// <summary>Specifies that the method will not return if the associated Boolean parameter is passed the specified value.</summary>
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class DoesNotReturnIfAttribute : Attribute
{
/// <summary>Initializes the attribute with the specified parameter value.</summary>
/// <param name="parameterValue">
/// The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to
/// the associated parameter matches this value.
/// </param>
public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue;

/// <summary>Gets the condition parameter value.</summary>
public bool ParameterValue { get; }
}
#endif

/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values.</summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class MemberNotNullAttribute : Attribute
{
/// <summary>Initializes the attribute with a field or property member.</summary>
/// <param name="member">
/// The field or property member that is promised to be not-null.
/// </param>
public MemberNotNullAttribute(string member) => Members = new[] { member };

/// <summary>Initializes the attribute with the list of field and property members.</summary>
/// <param name="members">
/// The list of field and property members that are promised to be not-null.
/// </param>
public MemberNotNullAttribute(params string[] members) => Members = members;

/// <summary>Gets field or property member names.</summary>
public string[] Members { get; }
}

/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.</summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class MemberNotNullWhenAttribute : Attribute
{
/// <summary>Initializes the attribute with the specified return value condition and a field or property member.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter will not be null.
/// </param>
/// <param name="member">
/// The field or property member that is promised to be not-null.
/// </param>
public MemberNotNullWhenAttribute(bool returnValue, string member)
{
ReturnValue = returnValue;
Members = new[] { member };
}

/// <summary>Initializes the attribute with the specified return value condition and list of field and property members.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter will not be null.
/// </param>
/// <param name="members">
/// The list of field and property members that are promised to be not-null.
/// </param>
public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
{
ReturnValue = returnValue;
Members = members;
}

/// <summary>Gets the return value condition.</summary>
public bool ReturnValue { get; }

/// <summary>Gets field or property member names.</summary>
public string[] Members { get; }
}
}
Loading