Zhiyi Zhang <zzhang(a)codeweavers.com> wrote:
+ 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 types are REG_BINARY in XP, however Windows 10 H1 on real hardware uses REG_SZ.
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).
Fair enough. -- Dmitry.