Skip to content

Conversation

@JeremyKuhne
Copy link
Member

@JeremyKuhne JeremyKuhne commented Aug 3, 2023

A number of Libarary APIs have had their parameters changed from ref to in (or readonly ref).

This change modifies code that we control and disables the "passing ref to in" warning for the interop assembly until we can get microsoft/CsWin32#1014 resolved.

This change requires a more current Roslyn build and as such I've updated it. Note that VS Intellisense does not support this new feature yet. You can filter out intellisense errors by selecting "Build Only" in the error pane in the meantime (this will not remove red squiggles unfortunately).

Microsoft Reviewers: Open in CodeFlow

A number of Libarary APIs have had their parameters changed from `ref` to `in` (or `readonly ref`).

This change modifies code that we control and disables the "passing ref to in" warning for the interop assembly until we can get microsoft/CsWin32#1014 resolved.

This change requires a more current Roslyn build and as such I've updated it. Note that VS Intellisense does not support this new feature yet. You can filter out intellisense errors by selecting "Build Only" in the error pane in the meantime (this will not remove red squiggles unfortunately).
@JeremyKuhne JeremyKuhne requested a review from a team as a code owner August 3, 2023 20:24
@ghost ghost assigned JeremyKuhne Aug 3, 2023
@JeremyKuhne
Copy link
Member Author

cc: @tannergooding

Copy link
Member

@dreddy-work dreddy-work left a comment

Choose a reason for hiding this comment

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

LGTM.

#if NET8_0_OR_GREATER
int hr = Marshal.QueryInterface(externalComObject, in pictureIID, out IntPtr comObject);
#else
int hr = Marshal.QueryInterface(externalComObject, ref pictureIID, out IntPtr comObject);
Copy link
Member

Choose a reason for hiding this comment

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

As a note, you could alternatively #pragma warning disable CS.... here for the multi-target case.

ref still works, you just get a warning recommending you use in for clarity.

@JeremyKuhne JeremyKuhne merged commit c9aa870 into dotnet:darc-main-502454bc-8214-4404-a7a1-1c966015a8c9 Aug 3, 2023
JeremyKuhne added a commit that referenced this pull request Aug 3, 2023
* Update dependencies from https://github.com/dotnet/runtime build 20230802.13

Microsoft.Internal.Runtime.WindowsDesktop.Transport , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , Microsoft.NETCore.ILDAsm , Microsoft.NETCore.Platforms , Microsoft.Win32.Registry.AccessControl , Microsoft.Win32.SystemEvents , runtime.win-x64.Microsoft.NETCore.ILAsm , runtime.win-x86.Microsoft.NETCore.ILAsm , System.CodeDom , System.ComponentModel.Composition , System.ComponentModel.Composition.Registration , System.Configuration.ConfigurationManager , System.Data.Odbc , System.Data.OleDb , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices , System.DirectoryServices.AccountManagement , System.DirectoryServices.Protocols , System.IO.Packaging , System.IO.Ports , System.Management , System.Reflection.Context , System.Reflection.MetadataLoadContext , System.Resources.Extensions , System.Runtime.Caching , System.Security.Cryptography.Pkcs , System.Security.Cryptography.ProtectedData , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceModel.Syndication , System.ServiceProcess.ServiceController , System.Speech , System.Text.Encoding.CodePages , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Windows.Extensions , VS.Redist.Common.NetCore.SharedFramework.x64.8.0
 From Version 8.0.0-rc.1.23401.22 -> To Version 8.0.0-rc.1.23402.13

* Handle `ref` to `in` change (#9654)

A number of Libarary APIs have had their parameters changed from `ref` to `in` (or `readonly ref`).

This change modifies code that we control and disables the "passing ref to in" warning for the interop assembly until we can get microsoft/CsWin32#1014 resolved.

This change requires a more current Roslyn build and as such I've updated it. Note that VS Intellisense does not support this new feature yet. You can filter out intellisense errors by selecting "Build Only" in the error pane in the meantime (this will not remove red squiggles unfortunately).

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Kuhne <[email protected]>
dreddy-work pushed a commit that referenced this pull request Aug 4, 2023
* [main] Update dependencies from dotnet/runtime (#9648)

* Update dependencies from https://github.com/dotnet/runtime build 20230802.13

Microsoft.Internal.Runtime.WindowsDesktop.Transport , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , Microsoft.NETCore.ILDAsm , Microsoft.NETCore.Platforms , Microsoft.Win32.Registry.AccessControl , Microsoft.Win32.SystemEvents , runtime.win-x64.Microsoft.NETCore.ILAsm , runtime.win-x86.Microsoft.NETCore.ILAsm , System.CodeDom , System.ComponentModel.Composition , System.ComponentModel.Composition.Registration , System.Configuration.ConfigurationManager , System.Data.Odbc , System.Data.OleDb , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices , System.DirectoryServices.AccountManagement , System.DirectoryServices.Protocols , System.IO.Packaging , System.IO.Ports , System.Management , System.Reflection.Context , System.Reflection.MetadataLoadContext , System.Resources.Extensions , System.Runtime.Caching , System.Security.Cryptography.Pkcs , System.Security.Cryptography.ProtectedData , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceModel.Syndication , System.ServiceProcess.ServiceController , System.Speech , System.Text.Encoding.CodePages , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Windows.Extensions , VS.Redist.Common.NetCore.SharedFramework.x64.8.0
 From Version 8.0.0-rc.1.23401.22 -> To Version 8.0.0-rc.1.23402.13

* Handle `ref` to `in` change (#9654)

A number of Libarary APIs have had their parameters changed from `ref` to `in` (or `readonly ref`).

This change modifies code that we control and disables the "passing ref to in" warning for the interop assembly until we can get microsoft/CsWin32#1014 resolved.

This change requires a more current Roslyn build and as such I've updated it. Note that VS Intellisense does not support this new feature yet. You can filter out intellisense errors by selecting "Build Only" in the error pane in the meantime (this will not remove red squiggles unfortunately).

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Kuhne <[email protected]>

* [main] Update dependencies from dotnet/arcade (#9661)

[main] Update dependencies from dotnet/arcade

* [main] Update dependencies from dotnet/runtime (#9662)

[main] Update dependencies from dotnet/runtime

* Enable nullability in DockEditor, ContentAlignmentEditor and SelectionPanelBase (#9649)

* annotate SelectionPanelBase

* annotate DockEditor

* annotate ContentAlignmentEditor

---------

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Kuhne <[email protected]>
Co-authored-by: halgab <[email protected]>
@ghost ghost locked as resolved and limited conversation to collaborators Sep 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants