Skip to content

Add DataTransferManger interop APIs - #1528

Merged
Manodasan Wignarajah (manodasanW) merged 9 commits into
microsoft:staging/AOTfrom
Gaoyifei1011:master
Mar 14, 2024
Merged

Manodasan Wignarajah (manodasanW) merged 9 commits into
microsoft:staging/AOTfrom
Gaoyifei1011:master

Conversation

@Gaoyifei1011

Copy link
Copy Markdown
Contributor

Add DataTransferManger interop APIs

#else
public
#endif
static class DataTransferManagerInterop

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might be nice to add XML docs.

@manodasanW

Copy link
Copy Markdown
Member

I think for now as long as this new class is similar for the most part to the other interop classes, it is good. These look to be the docs for this interface. I will be retargeting this PR to the staging branch given this is an API surface change and that is our next planned assembly version change.

@manodasanW
Manodasan Wignarajah (manodasanW) changed the base branch from master to staging/AOT March 8, 2024 03:13
@manodasanW

Copy link
Copy Markdown
Member

Ran CI build.

@Marv51

Copy link
Copy Markdown

Hey this sounds amazing! I would be so happy for this to be properly supported.
I looked at the class and it looks like this would fix my issues:
#970, microsoft/microsoft-ui-xaml#4886, microsoft/CsWin32#246 and microsoft/win32metadata#867
(I really tried to make this happen in 2021...)

…gerInterop

Use IIDataTransferManagerInteropMethods to implement DataTransferManagerInterop.
Because IDataTransferManagerInterop COM interfaces are not inherited from IInspectable, but IUnknown
Co-authored-by: Manodasan Wignarajah <manodasan@hotmail.com>
Co-authored-by: Manodasan Wignarajah <manodasan@hotmail.com>
Update src/cswinrt/strings/ComInteropHelpers.cs
static class DataTransferManagerInterop
{
private static readonly global::System.Guid IDataTransferManagerInterop_IID = new global::System.Guid("3A3DCD6C-3EAB-43DC-BCDE-45671CE800C8");
private static readonly global::System.Guid IDataTransferManagerInterop_IID = new global::System.Guid(0x3A3DCD6C, 0x3EAB, 0x43DC, 0xBC, 0xDE, 0x45, 0x67, 0x1C, 0xE8, 0x00, 0xC8);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is wrong endianess.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Correct me if I am wrong, but this uses the format where the values goes as parameters and not in the byte array where we need to flip it for endianness, so I think this is correct right?

https://learn.microsoft.com/en-us/dotnet/api/system.guid.-ctor?view=net-8.0#system-guid-ctor(system-int32-system-int16-system-int16-system-byte-system-byte-system-byte-system-byte-system-byte-system-byte-system-byte-system-byte)

@manodasanW

Copy link
Copy Markdown
Member

I think once the last set of feedback is addressed, we should be good with this change.

@manodasanW

Copy link
Copy Markdown
Member

Thanks for this change, will merge once CI is done.

@manodasanW

Copy link
Copy Markdown
Member

CI finished and all tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please simply wrap the DataTransferManager interop class

5 participants