[PATCH 1/5] winex11: Add DriverDate registry property to display adapters.

Zhiyi Zhang zzhang at codeweavers.com
Wed Sep 30 08:58:01 CDT 2020



On 9/30/20 6:55 PM, Matteo Bruni wrote:
> Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
> ---
>  dlls/winex11.drv/display.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c
> index 3e9e4474d4c6..9b6edba6eae4 100644
> --- a/dlls/winex11.drv/display.c
> +++ b/dlls/winex11.drv/display.c
> @@ -51,6 +51,7 @@ DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_RCWORK, 0x233a9ef3, 0xafc4, 0x4abd, 0x
>  DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_ADAPTERNAME, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 5);
>  
>  static const WCHAR driver_date_dataW[] = {'D','r','i','v','e','r','D','a','t','e','D','a','t','a',0};
> +static const WCHAR driver_dateW[] = {'D','r','i','v','e','r','D','a','t','e',0};
>  static const WCHAR driver_descW[] = {'D','r','i','v','e','r','D','e','s','c',0};
>  static const WCHAR displayW[] = {'D','I','S','P','L','A','Y',0};
>  static const WCHAR pciW[] = {'P','C','I',0};
> @@ -107,6 +108,7 @@ static const WCHAR monitor_instance_fmtW[] = {
>  static const WCHAR monitor_hardware_idW[] = {
>      'M','O','N','I','T','O','R','\\',
>      'D','e','f','a','u','l','t','_','M','o','n','i','t','o','r',0,0};
> +static const WCHAR driver_date_fmtW[] = {'%','u','.','%','u',0};
I think this is depended on locale. For example, It is something like 9-4-2020 in my Win7 and Win10 VMs.

>  
>  static struct x11drv_display_device_handler host_handler;
>  struct x11drv_display_device_handler desktop_handler;
> @@ -403,14 +405,15 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g
>      SP_DEVINFO_DATA device_data = {sizeof(device_data)};
>      WCHAR instanceW[MAX_PATH];
>      DEVPROPTYPE property_type;
> +    SYSTEMTIME systemtime;
>      WCHAR bufferW[1024];
> +    FILETIME filetime;
>      HKEY hkey = NULL;
>      GUID guid;
>      LUID luid;
>      INT written;
>      DWORD size;
>      BOOL ret = FALSE;
> -    FILETIME filetime;
>  
>      TRACE("GPU id:0x%s name:%s.\n", wine_dbgstr_longlong(gpu->id), wine_dbgstr_w(gpu->name));
>  
> @@ -468,6 +471,11 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g
>      if (RegSetValueExW(hkey, driver_date_dataW, 0, REG_BINARY, (BYTE *)&filetime, sizeof(filetime)))
>          goto done;
>  
> +    GetSystemTime(&systemtime);
> +    sprintfW(bufferW, driver_date_fmtW, systemtime.wYear, systemtime.wMonth);
> +    if (RegSetValueExW(hkey, driver_dateW, 0, REG_SZ, (BYTE *)bufferW, (strlenW(bufferW) + 1) * sizeof(WCHAR)))
> +        goto done;
> +
>      RegCloseKey(hkey);
>  
>      /* Retrieve driver value for adapters */




More information about the wine-devel mailing list