winex11.drv: Specify enumerator when calling SetupDiGetClassDevsW.
This reduces some search time. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3ea7ef4098
commit
cb350fc979
|
@ -46,6 +46,8 @@ 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_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};
|
||||
static const WCHAR video_idW[] = {'V','i','d','e','o','I','D',0};
|
||||
static const WCHAR symbolic_link_valueW[]= {'S','y','m','b','o','l','i','c','L','i','n','k','V','a','l','u','e',0};
|
||||
static const WCHAR gpu_idW[] = {'G','P','U','I','D',0};
|
||||
|
@ -309,7 +311,7 @@ static void prepare_devices(HKEY video_hkey)
|
|||
DWORD i = 0;
|
||||
|
||||
/* Remove all monitors */
|
||||
devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_MONITOR, NULL, NULL, 0);
|
||||
devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_MONITOR, displayW, NULL, 0);
|
||||
while (SetupDiEnumDeviceInfo(devinfo, i++, &device_data))
|
||||
{
|
||||
if (!SetupDiRemoveDevice(devinfo, &device_data))
|
||||
|
@ -326,7 +328,7 @@ static void prepare_devices(HKEY video_hkey)
|
|||
* of prefix copying or having devices unplugged. But then we couldn't simply delete GPUs because we need to retain
|
||||
* the same GUID for the same GPU. */
|
||||
i = 0;
|
||||
devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_DISPLAY, NULL, NULL, 0);
|
||||
devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_DISPLAY, pciW, NULL, 0);
|
||||
while (SetupDiEnumDeviceInfo(devinfo, i++, &device_data))
|
||||
{
|
||||
if (!SetupDiSetDevicePropertyW(devinfo, &device_data, &DEVPKEY_Device_IsPresent, DEVPROP_TYPE_BOOLEAN,
|
||||
|
@ -344,7 +346,7 @@ static void cleanup_devices(void)
|
|||
DWORD i = 0;
|
||||
BOOL present;
|
||||
|
||||
devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_DISPLAY, NULL, NULL, 0);
|
||||
devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_DISPLAY, pciW, NULL, 0);
|
||||
while (SetupDiEnumDeviceInfo(devinfo, i++, &device_data))
|
||||
{
|
||||
present = FALSE;
|
||||
|
|
Loading…
Reference in New Issue