v2: Without setting "HardwareInformation.MemorySize" key. v3: strlen() -> sizeof().
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/winex11.drv/display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index c8c216c8302..2930f6062c7 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,15 @@ 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; + size = (strlenW(gpu->name) + 1) * sizeof(WCHAR); + if (RegSetValueExW(hkey, adapter_stringW, 0, REG_SZ, (const BYTE *)gpu->name, size)) + goto done; + if (RegSetValueExW(hkey, bios_stringW, 0, REG_SZ, (const BYTE *)gpu->name, size)) + goto done; + if (RegSetValueExW(hkey, chip_typeW, 0, REG_SZ, (const BYTE *)gpu->name, size)) + goto done; + if (RegSetValueExW(hkey, dac_typeW, 0, REG_SZ, (const BYTE *)ramdacW, sizeof(ramdacW))) + goto done;
RegCloseKey(hkey);
On 10/13/21 9:41 PM, Dmitry Timoshkov wrote:
v2: Without setting "HardwareInformation.MemorySize" key. v3: strlen() -> sizeof().
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
dlls/winex11.drv/display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index c8c216c8302..2930f6062c7 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,15 @@ 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;
- size = (strlenW(gpu->name) + 1) * sizeof(WCHAR);
The DriverDesc value also uses gpu->name, let's move this calculation before that.
- if (RegSetValueExW(hkey, adapter_stringW, 0, REG_SZ, (const BYTE *)gpu->name, size))
goto done;
- if (RegSetValueExW(hkey, bios_stringW, 0, REG_SZ, (const BYTE *)gpu->name, size))
goto done;
- if (RegSetValueExW(hkey, chip_typeW, 0, REG_SZ, (const BYTE *)gpu->name, size))
goto done;
- if (RegSetValueExW(hkey, dac_typeW, 0, REG_SZ, (const BYTE *)ramdacW, sizeof(ramdacW)))
goto done;
I just checked on XP and Win7 on VirtualBox and Windows 10 21H1 on a physical machine with a AMD GPU. They are all REG_BINARY.
RegCloseKey(hkey);
On 10/13/21 17:21, Zhiyi Zhang wrote:
I just checked on XP and Win7 on VirtualBox and Windows 10 21H1 on a physical machine with a AMD GPU. They are all REG_BINARY.
I guess it is GPU driver supposed to set that, probably driver specific?
Zhiyi Zhang zzhang@codeweavers.com wrote:
- if (RegSetValueExW(hkey, adapter_stringW, 0, REG_SZ, (const BYTE *)gpu->name, size))
goto done;
- if (RegSetValueExW(hkey, bios_stringW, 0, REG_SZ, (const BYTE *)gpu->name, size))
goto done;
- if (RegSetValueExW(hkey, chip_typeW, 0, REG_SZ, (const BYTE *)gpu->name, size))
goto done;
- if (RegSetValueExW(hkey, dac_typeW, 0, REG_SZ, (const BYTE *)ramdacW, sizeof(ramdacW)))
goto done;
I just checked on XP and Win7 on VirtualBox and Windows 10 21H1 on a physical machine with a AMD GPU. They are all REG_BINARY.
I have an NVidia card on that box, I'd guess then that it depends on a driver. Having REG_SZ type seems more logical for string values, however if you insist I could use REG_BINARY instead.