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

Always pass back a managed IDataObject if we can get the original #13051

Open
JeremyKuhne opened this issue Feb 28, 2025 · 0 comments
Open

Always pass back a managed IDataObject if we can get the original #13051

JeremyKuhne opened this issue Feb 28, 2025 · 0 comments
Assignees
Labels
area-Clipboard Issues related to Clipboard area-Serialization-BinaryFormatter-FeatureWork Feature work under the general area of BinaryFormatter related serialization
Milestone

Comments

@JeremyKuhne
Copy link
Member

The unfortunate caveat of returning the original object is that the behavior of calling through the OLE IDataObject proxy results in different behavior than calling through the original object. This primarily happens for autoConvert scenarios, where no such concept exists in the COM interfaces. As such, when calling through the COM interface, autoConvert is always considered to be true.

To mitigate the COM caveat, we do not give back the original DataObject if we created it implicitly via
Clipboard.SetData. This allows the calls to go through the proxy, which gets the expected autoConvert` behavior.

Doing this should avoid BinaryFormatter scenarios when OLE actions are made in process without copy set to true.

@JeremyKuhne JeremyKuhne added area-Clipboard Issues related to Clipboard area-Serialization-BinaryFormatter-FeatureWork Feature work under the general area of BinaryFormatter related serialization labels Feb 28, 2025
@JeremyKuhne JeremyKuhne added this to the .NET 10.0 milestone Feb 28, 2025
@JeremyKuhne JeremyKuhne self-assigned this Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Clipboard Issues related to Clipboard area-Serialization-BinaryFormatter-FeatureWork Feature work under the general area of BinaryFormatter related serialization
Projects
None yet
Development

No branches or pull requests

1 participant