Zhiyi Zhang zzhang@codeweavers.com wrote:
On 10/13/21 8:04 PM, Dmitry Timoshkov wrote:
v2: Without setting "HardwareInformation.MemorySize" key.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
dlls/winex11.drv/display.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index c8c216c8302..74431a92a6b 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -463,6 +463,11 @@ static BOOL link_device(const WCHAR *instance, const GUID *guid) static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT gpu_index, WCHAR *guid_string, WCHAR *driver, LUID *gpu_luid) {
- static const WCHAR adapter_stringW[] = {'H','a','r','d','w','a','r','e','I','n','f','o','r','m','a','t','i','o','n','.','A','d','a','p','t','e','r','S','t','r','i','n','g',0};
- static const WCHAR bios_stringW[] = {'H','a','r','d','w','a','r','e','I','n','f','o','r','m','a','t','i','o','n','.','B','i','o','s','S','t','r','i','n','g',0};
- static const WCHAR chip_typeW[] = {'H','a','r','d','w','a','r','e','I','n','f','o','r','m','a','t','i','o','n','.','C','h','i','p','T','y','p','e',0};
- static const WCHAR dac_typeW[] = {'H','a','r','d','w','a','r','e','I','n','f','o','r','m','a','t','i','o','n','.','D','a','c','T','y','p','e',0};
- static const WCHAR ramdacW[] = {'I','n','t','e','r','g','r','a','t','e','d',' ','R','A','M','D','A','C',0}; static const BOOL present = TRUE; SP_DEVINFO_DATA device_data = {sizeof(device_data)}; WCHAR instanceW[MAX_PATH];
@@ -551,6 +556,14 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g sprintfW(bufferW, driver_date_fmtW, systemtime.wMonth, systemtime.wDay, systemtime.wYear); if (RegSetValueExW(hkey, driver_dateW, 0, REG_SZ, (BYTE *)bufferW, (strlenW(bufferW) + 1) * sizeof(WCHAR))) goto done;
- if (RegSetValueExW(hkey, adapter_stringW, 0, REG_SZ, (const BYTE *)gpu->name, (strlenW(gpu->name) + 1) * sizeof(WCHAR)))
goto done;
- if (RegSetValueExW(hkey, bios_stringW, 0, REG_SZ, (const BYTE *)gpu->name, (strlenW(gpu->name) + 1) * sizeof(WCHAR)))
goto done;
- if (RegSetValueExW(hkey, chip_typeW, 0, REG_SZ, (const BYTE *)gpu->name, (strlenW(gpu->name) + 1) * sizeof(WCHAR)))
goto done;
- if (RegSetValueExW(hkey, dac_typeW, 0, REG_SZ, (const BYTE *)ramdacW, (strlenW(ramdacW) + 1) * sizeof(WCHAR)))
goto done;
These values should be of type REG_BINARY.
The length of gpu->name is calculated multiple times. Let's avoid that. You can also replace "(strlenW(ramdacW) + 1) * sizeof(WCHAR)" with sizeof(ramdacW).
Also, could you tell us what application this patch fixes? And please apply this to winemac.drv as well.
Thanks, Zhiyi
RegCloseKey(hkey);