-
Notifications
You must be signed in to change notification settings - Fork 509
Add basic implementation of the ComWrappers #8143
Conversation
Fixing the targeting for the tests is non-trivial with the build system in the repo. It would be best to wait with automating these tests after we move CoreRT into dotnet/runtimelab, and we would probably just want to reuse the CoreCLR tests for this. For now, I think it is good enough if you just do a manual testing. |
namespace API | ||
{ | ||
// Documentation found at https://docs.microsoft.com/windows/win32/api/windows.ui.xaml.hosting.referencetracker/ | ||
class DECLSPEC_UUID("64bd43f8-bfee-4ec4-b7eb-2935158dae21") IReferenceTrackerTarget : public IUnknown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think you need to worry about the reference tracking. It is for WinRT only - not required for what you are trying to achieve.
I have mentioned earlier that the implementation should be 99% C# ... I take that back. I think you want to reuse a good chunk of https://github.com/dotnet/runtime/tree/master/src/coreclr/src/interop from CoreCLR. You can reimplement some of it in C#, but it would not be that much of an improvement. |
I see that. Plus one more place
Given that there some interesting scenarios in the test, I decide add implementation blindly trying make tests to pass just to excercise the code paths where it blow up. I have set of questions
|
I do not think there is much to directly reuse for CoreRT from the files under vm.
The equivalent of QCall in CoreRT is The most significant difference between CoreCLR QCalls is that CoreRT does not have exception interop. If you need to throw exception in CoreRT, you need to return an error code and then throw the exception in C#. |
There is an implementation of the identity cache in managed code that you could borrow. https://github.com/microsoft/CsWinRT/blob/master/WinRT.Runtime/ComWrappersSupport.netstandard2.0.cs has an implementation of the identity caching entirely in managed. There's likely some optimizations that could be done. |
I will try to revitalize my attempts to make some progress. |
It has quite a bit of CsWinRT-specific code that you will need to fix up, otherwise sounds reasonable to me. |
Added tests, but they are not working yet due to wrong targeting.
If you would live to continue working on this, could you please open a new PR in https://github.com/dotnet/runtimelab/tree/feature/NativeAOT ? Thank you! The new place should make reusing the coreclr implementation at https://github.com/dotnet/runtime/tree/master/src/coreclr/src/interop easier. |
Added tests, but they are not working yet due to wrong targeting.
See #4219