Some applications (e.g. UE4) requires the DriverVersion string in the registry. The string is taken from `dlls/wbemprox/builtin.c`
-- v6: win32u: Add DriverVersion string for GPUs to registry.
From: Michael Skorokhodov mykhailo.skorokhodov@globallogic.com
Some applications (e.g. UE4) requires the DriverVersion string in the registry.
Signed-off-by: Mykhailo Skorokhodov mykhailo.skorokhodov@globallogic.com --- dlls/win32u/sysparams.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 233e5bb934b..fed309ff3d8 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1230,6 +1230,8 @@ static void add_gpu( const struct gdi_gpu *gpu, void *param ) static const WCHAR ramdacW[] = {'I','n','t','e','r','g','r','a','t','e','d',' ','R','A','M','D','A','C',0}; static const WCHAR driver_dateW[] = {'D','r','i','v','e','r','D','a','t','e',0}; + static const WCHAR driver_versionW[] = + {'D','r','i','v','e','r','V','e','r','s','i','o','n',0};
TRACE( "%s %04X %04X %08X %02X\n", debugstr_w(gpu->name), gpu->vendor_id, gpu->device_id, gpu->subsys_id, gpu->revision_id ); @@ -1374,6 +1376,31 @@ static void add_gpu( const struct gdi_gpu *gpu, void *param ) set_reg_value( hkey, chip_typeW, REG_BINARY, desc, size ); set_reg_value( hkey, dac_typeW, REG_BINARY, ramdacW, sizeof(ramdacW) );
+ if (gpu->vendor_id && gpu->device_id) + { + /* The last seven digits are the driver number. */ + switch (gpu->vendor_id) + { + /* Intel */ + case 0x8086: + sprintf( buffer, "31.0.101.4576" ); + break; + /* AMD */ + case 0x1002: + sprintf( buffer, "31.0.14051.5006" ); + break; + /* Nvidia */ + case 0x10de: + sprintf( buffer, "31.0.15.3625" ); + break; + /* Default value for any other vendor. */ + default: + sprintf( buffer, "31.0.10.1000" ); + break; + } + set_reg_value( hkey, driver_versionW, REG_SZ, bufferW, asciiz_to_unicode( bufferW, buffer ) ); + } + NtClose( hkey );
link_device( ctx->gpuid, guid_devinterface_display_adapterW );
On Mon Jul 31 08:13:26 2023 +0000, Zhiyi Zhang wrote:
I see. Adding a comment saying the last seven digits are the driver number would be beneficial. Also, please add a dot after the commit subject. And you can put the commit message body on a single line. I usually break at 100 characters. Otherwise, it looks good to me. Thanks for looking into this.
Thank you too!