On Thu, Jun 11, 2020 at 11:15:50AM +0100, Huw Davies wrote:
On Thu, Jun 11, 2020 at 05:19:17PM +0800, Zhiyi Zhang wrote:
@@ -1369,6 +1403,35 @@ NTSTATUS WINAPI D3DKMTOpenAdapterFromGdiDisplayName( D3DKMT_OPENADAPTERFROMGDIDI if (!adapter) return STATUS_NO_MEMORY;
+ /* Get adapter LUID from SetupAPI */ + mutex = get_display_device_init_mutex(); + + size = sizeof( bufferW ); + sprintfW( key_nameW, video_value_fmtW, index ); + if (RegGetValueW( HKEY_LOCAL_MACHINE, video_keyW, key_nameW, RRF_RT_REG_SZ, NULL, bufferW, &size )) + goto done; + + /* Strip \Registry\Machine\ prefix */ + lstrcpyW( key_nameW, bufferW + 18 ); + size = sizeof( state_flags ); + if (RegGetValueW( HKEY_CURRENT_CONFIG, key_nameW, state_flagsW, RRF_RT_REG_DWORD, NULL, + &state_flags, &size )) + goto done;
\Registry\Machine is HKLM not HKCC; I know what Wine has the information in both places, but still.
Oh, I've figured it out now, this is the Wine specific data set by the driver. Could you add a comment to this effect? Something like: /* Retrieve Wine specific data set by the display driver */
It might be better to use the Nt registry functions here (of course you'd then lose the RegGetValue() helper).
So this now becomes irrelevant. Huw.