Rémi Bernon (@rbernon) commented about dlls/windows.devices.enumeration/tests/devices.c:
for(idx = 0; idx < copied; idx++)
{
IDeviceInformation *info = NULL;
HSTRING id1 = NULL, id2 = NULL;
winetest_push_context("devices %u", idx);
hr = IDeviceInformation_get_Id( devices[idx], &id1 );
ok( SUCCEEDED( hr ), "got %#lx\n", hr );
hr = IVectorView_DeviceInformation_GetAt( info_collection, idx, &info);
ok( SUCCEEDED( hr ), "got %#lx\n", hr );
if (SUCCEEDED( hr ))
{
hr = IDeviceInformation_get_Id( info, &id2 );
ok( SUCCEEDED( hr ), "got %#lx\n", hr );
}
if (id1 && id2)
NULL is a valid HSTRING value, so you shouldn't need to check before calling WindowsCompareStringOrdinal.