corert icon indicating copy to clipboard operation
corert copied to clipboard

[Port] Type.GetTypeFromCLSID() and Type.GetTypeFromProgID()

Open ghost opened this issue 10 years ago • 7 comments

  • System.Type::Type.GetTypeFromCLSID(Guid, string, bool)
  • System.Type::Type.GetTypeFromProgID(string, string, bool)

ghost avatar Aug 31 '16 14:08 ghost

Irrelevant to porting-from-Android effort as it's interop. Long term, we would need for console apps.

danmoseley avatar Sep 02 '16 22:09 danmoseley

Can now create type. Need to make CreateInstance() work by filling in the "NotImplemented" site at:

https://github.com/dotnet/corert/blob/nmirror/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimeClsIdNullaryConstructorInfo.cs#L61

ghost avatar Feb 27 '17 15:02 ghost

Reflection side is done. The instantiation side should be on the interop side.

Ideally, the approach would be for S.P.Interop.dll to expose a method like McgMarshal.CoCreateInstanceEx(Guid clsid, string server) and replace the NYI site at (https://github.com/dotnet/corert/blob/nmirror/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/MethodInfos/RuntimeClsIdNullaryConstructorInfo.cs#L61) with a call to it.

S.P.Interop can then do the appropriate actions on Win32/WinRt/Unix and S.P.R.Core can remain platform agnostic.

ghost avatar Feb 27 '17 15:02 ghost

This might be helpful for UWP applications but the value is pretty low. There are only a handful of CLSIDs that are whitelisted under HKLM\Software\Microsoft\WindowsRuntime\AllowedCLSIDs supported through CoCreateInstanceFromApp. The most interesting ones are probably DirectX COM objects which are already wrapped by popular libraries such as as SharpDX.

yizhang82 avatar Feb 27 '17 19:02 yizhang82

@AtsushiKan Can you change it to PNSE for now?

yizhang82 avatar Feb 27 '17 19:02 yizhang82

We just had a customer report this missing API so we probably should just go ahead and implement it. @shrah Can you take a look?

yizhang82 avatar Jun 02 '17 18:06 yizhang82

Sure, I'll look into it.

shrah avatar Jun 02 '17 18:06 shrah