forked from Mirrors/wine-wine
winemac.drv: Allocate LUID for GPUs.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Ken Thomases <ken@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>feature/deterministic
parent
de94f8a1d6
commit
31b112e718
|
@ -51,6 +51,8 @@ struct display_mode_descriptor
|
|||
|
||||
BOOL CDECL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode, LPDEVMODEW devmode, DWORD flags);
|
||||
|
||||
DEFINE_DEVPROPKEY(DEVPROPKEY_GPU_LUID, 0x60b193cb, 0x5276, 0x4d0f, 0x96, 0xfc, 0xf1, 0x73, 0xab, 0xad, 0x3e, 0xc6, 2);
|
||||
|
||||
/* Wine specific monitor properties */
|
||||
DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_STATEFLAGS, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 2);
|
||||
DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_RCMONITOR, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 3);
|
||||
|
@ -1313,11 +1315,13 @@ static BOOL macdrv_init_gpu(HDEVINFO devinfo, const struct macdrv_gpu *gpu, int
|
|||
static const BOOL present = TRUE;
|
||||
SP_DEVINFO_DATA device_data = {sizeof(device_data)};
|
||||
WCHAR instanceW[MAX_PATH];
|
||||
DEVPROPTYPE property_type;
|
||||
WCHAR nameW[MAX_PATH];
|
||||
WCHAR bufferW[1024];
|
||||
FILETIME filetime;
|
||||
HKEY hkey = NULL;
|
||||
GUID guid;
|
||||
LUID luid;
|
||||
INT written;
|
||||
DWORD size;
|
||||
BOOL ret = FALSE;
|
||||
|
@ -1343,6 +1347,20 @@ static BOOL macdrv_init_gpu(HDEVINFO devinfo, const struct macdrv_gpu *gpu, int
|
|||
(const BYTE *)&present, sizeof(present), 0))
|
||||
goto done;
|
||||
|
||||
/* Write DEVPROPKEY_GPU_LUID property */
|
||||
if (!SetupDiGetDevicePropertyW(devinfo, &device_data, &DEVPROPKEY_GPU_LUID, &property_type,
|
||||
(BYTE *)&luid, sizeof(luid), NULL, 0))
|
||||
{
|
||||
if (!AllocateLocallyUniqueId(&luid))
|
||||
goto done;
|
||||
|
||||
if (!SetupDiSetDevicePropertyW(devinfo, &device_data, &DEVPROPKEY_GPU_LUID,
|
||||
DEVPROP_TYPE_UINT64, (const BYTE *)&luid, sizeof(luid), 0))
|
||||
goto done;
|
||||
}
|
||||
TRACE("GPU id:0x%s name:%s LUID:%08x:%08x.\n", wine_dbgstr_longlong(gpu->id), gpu->name,
|
||||
luid.HighPart, luid.LowPart);
|
||||
|
||||
/* Open driver key.
|
||||
* This is where HKLM\System\CurrentControlSet\Control\Video\{GPU GUID}\{Adapter Index} links to */
|
||||
hkey = SetupDiCreateDevRegKeyW(devinfo, &device_data, DICS_FLAG_GLOBAL, 0, DIREG_DRV, NULL, NULL);
|
||||
|
|
Loading…
Reference in New Issue