Skip to content

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

Closed
@JeremyKuhne

Description

@JeremyKuhne

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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions