winemac.drv: Don't fail GPU detection if some IOKit properties are missing.

Fixes GPU detection when running in VMware Fusion, where the GPU entry
lacks a "model" property.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49774
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Brendan Shanks 2020-09-08 16:10:32 -07:00 committed by Alexandre Julliard
parent 7eddd79e4e
commit 0ead40dc9b
1 changed files with 7 additions and 10 deletions

View File

@ -215,18 +215,15 @@ static int macdrv_get_gpu_info_from_entry(struct macdrv_gpu* gpu, io_registry_en
if (IORegistryEntryGetRegistryEntryID(gpu_entry, &gpu->id) != kIOReturnSuccess)
goto done;
if (get_entry_property_uint32(gpu_entry, CFSTR("vendor-id"), &gpu->vendor_id))
goto done;
if (get_entry_property_uint32(gpu_entry, CFSTR("device-id"), &gpu->device_id))
goto done;
if (get_entry_property_uint32(gpu_entry, CFSTR("subsystem-id"), &gpu->subsys_id))
goto done;
if (get_entry_property_uint32(gpu_entry, CFSTR("revision-id"), &gpu->revision_id))
goto done;
if (get_entry_property_string(gpu_entry, CFSTR("model"), gpu->name, sizeof(gpu->name)))
goto done;
ret = 0;
get_entry_property_uint32(gpu_entry, CFSTR("vendor-id"), &gpu->vendor_id);
get_entry_property_uint32(gpu_entry, CFSTR("device-id"), &gpu->device_id);
get_entry_property_uint32(gpu_entry, CFSTR("subsystem-id"), &gpu->subsys_id);
get_entry_property_uint32(gpu_entry, CFSTR("revision-id"), &gpu->revision_id);
get_entry_property_string(gpu_entry, CFSTR("model"), gpu->name, sizeof(gpu->name));
done:
if (gpu_entry != entry)
IOObjectRelease(gpu_entry);