or libraries are expected to go through CoCreate* equivalent to import something like IMap which is so basic that it belongs to a standard library, if that exists for winrt.
Yeah, at least that is what I wish to do. The idea is that dlls/windows.devices.enumeration/information.c:device_information_create would roughly look something like this:
```c HRESULT device_information_create( const WCHAR *path, const DEVPROPERTY **properties, ULONG len, IDeviceInformation **info ) { struct device_information *impl; IPropertyValueStatics *statics; ULONG i;
/* initialize impl fields */ RoActivateInstance( "Windows.Foundation.Collections.PropertySet", &impl->properties); RoGetActivationFactory( "Windows.Foundation.Collections.PropertyValue", &IID_PropertyValueStatics, &statics);
for (i = 0; i < len; i++) { WCHAR *name; HSTRING key; IInspectable *val;
PSGetNameFromPropertyKey( &properties[i].CompKey.Key, &name); WindowsCreateString( name, wcslen(name), &key ); switch (properties[i].Type) { case DEVPROP_TYPE_INT16: IPropertyValueStatics_CreateInt16( statics, (INT16 *)properties[i].Buffer, &val ); break; /* Handle other DEVPROP_TYPE_* -> IPropertyValue conversions */ } IPropertySet_Insert( impl->properties, key, val ); IInspectable_Release( val ); }
IPropertyValueStatics_Release( statics ); *info = &impl->IDeviceInformation_iface; return S_OK; } ```
So, even if Windows.Devices.Enumeration has its own key-value collection code, we would still need to "import" (I think the term is "activate" in WinRT parlance) [`Windows.Foundation.Collections.PropertyValue`](https://learn.microsoft.com/en-us/uwp/api/windows.foundation.ipropertyvalue?...) for creating boxed WinRT values.