Rémi Bernon (@rbernon) commented about dlls/windows.devices.enumeration/information.c:
- if (FAILED(hr = RoGetActivationFactory( str, &IID_IPropertyValueStatics, (void **)&propval_statics ))) goto done;
- for (i = 0; i < len; i++)
- {
const DEVPROPERTY *prop = &props[i];
const DEVPROPKEY *propkey = &prop->CompKey.Key;
HSTRING canonical_name;
IInspectable *val;
boolean replaced;
WCHAR *name;
if (SUCCEEDED(hr = PSGetNameFromPropertyKey( (PROPERTYKEY *)propkey, &name )))
{
hr = WindowsCreateString( name, wcslen( name ), &canonical_name );
CoTaskMemFree( name );
}
What about moving the name query after the property creation and use WindowsCreateStringReference too?