-
Notifications
You must be signed in to change notification settings - Fork 206
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
Add basic implementation of the ComWrappers #653
Merged
Merged
Changes from 44 commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
28bf64b
Add basic implementation of the ComWrappers
kant2002 d8daea1
Fixes after refactoring in dotnet/runtime
kant2002 3328c6d
Rough attempt to move forward. Attempt to create CCW
kant2002 b328e48
Slight push toward CCW.
kant2002 f8165c6
Move configuration for FeatureComWrappers outside of project file
kant2002 fb2233f
More implementation for the MOW
kant2002 e35695b
Slightly more changes based on feedback.
kant2002 868b1bf
Delagate IUnknown implementation to MOW
kant2002 017e907
Implement IUnknown interface for CCW
kant2002 d4e3188
Return proper pointer to IUnknown
kant2002 3d5867c
Update src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtim…
kant2002 dd7ebdd
Update src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtim…
kant2002 f03e3c8
Apply suggestions from code review
kant2002 b2b33ff
Apply suggestions from code review
kant2002 75145a8
Apply suggestions from code review
kant2002 ac4d949
Address PR feedback
kant2002 fa87e37
Cleanup code
kant2002 8c89b5a
Fix build
kant2002 3aafcd6
Apply suggestions from code review
kant2002 72da0c7
Fix compilation errrors
kant2002 3c93e34
Introduce InternalComInterfaceDispatch
kant2002 b1dfda4
Reuse variable
kant2002 c4dca94
Delegate conversion of runtime object to COM object to ComWrappers in…
kant2002 367e5f4
Change message when ComWrappers are required.
kant2002 7577418
Attempt to fix compilation error.
kant2002 2fead1d
Minimal amount of working COM
kant2002 c7a5d1e
Fix typo
kant2002 08d92c2
Update src/coreclr/tools/Common/TypeSystem/IL/Stubs/PInvokeILEmitter.cs
jkotas 3e8a8c2
Apply code review suggestions
kant2002 d9a65a0
Apply code review suggestions
kant2002 c06f5e2
Add tests for the CCW release process
kant2002 577f34a
Apply suggestions from code review
kant2002 ae0c824
Fix compilation errors
kant2002 a36de92
Remove Destroyed field from MOW
kant2002 7ee193a
Ignore COM related functions in native tests code
kant2002 70dd962
Fix random crash on debug builds.
kant2002 847a68e
Apply suggestions from code review
kant2002 0cf1003
Apply suggestions from code review
kant2002 479e306
Add validation of call for DoWork
kant2002 62acb0b
Fix PR feedback
kant2002 b021ef8
Switch to COM interface
kant2002 7abba2f
Pass type to which convert COM instance.
kant2002 3b2848a
Create separate tests for ComWrappers feature
kant2002 87213bb
Fix Pinvoke name of the DLL with test functions
kant2002 acfaca8
Fix code review comments
kant2002 ecbd14e
Remove incomplete PreserveSig implementation
kant2002 3dce725
Update src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.cs
kant2002 359c53d
Update src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.cs
kant2002 e761497
Update src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.csproj
kant2002 5a6d6eb
Update src/tests/nativeaot/SmokeTests/ComWrappers/ComWrappers.cs
kant2002 716d585
Fix compilation errors
kant2002 218a300
Read GUID directly from metadata instead of relying on Reflection
kant2002 e7b0b59
Remove leftover
kant2002 bdba4ea
Improve GUID creation
kant2002 1db71ff
Fix stupid compilation error
kant2002 2f826ce
Add missing using
kant2002 0b90983
Another round of stupidity
kant2002 f9acd5c
One more try
kant2002 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It would be more inline with the NativeAOT design printiples for the GUID to be passed as an argument into this method by the toolchain instead of computing it at runtime via reflection.
@MichalStrehovsky Do you expect that there are going to be special measures required to make the interface reflectable going forward, or is this going to just work?
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.
Using reflection to fetch the GUID here is also going to make the marshalling much slower compared to regular CLR.
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 think the design we will have to settle with is that types are always reflectable, so fetching a GUID should be reliable, but yes, this is not going to be very fast.
It shouldn't be too much of a problem to change this signature of this helper to take an actual GUID, and in the compiler:
.GetDecodedCustomAttributes
to get the attributes on the type.Guid(Int32, Int16, Int16, Byte, Byte, Byte, Byte, Byte, Byte, Byte, Byte)
constructor with the parsed GUID values.We can scope out types that don't have a GuidAttribute for now (runtime reflection would not compute the correct GUID for them either).
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.
@MichalStrehovsky I'm not sure that I properly understand how to jump from
TypeDesc
toEcmaType
.I plan to use following
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.
(this.ManagedParameterType as EcmaType)?.GetDecodedCustomAttribute("System.Runtime.InteropServices", "GuidAttribute")
GetTypeDefinition
would be only needed for generic types. Built-in COM interop does not work for generic types so you can just skip that part.