mirror of https://gitlab.com/baco/winsysinfo.git
Fix in video devices registry keys request
Also treated keys as sets to avoid duplicated hardware.
This commit is contained in:
parent
98f1483e2e
commit
911495fdfa
|
@ -49,23 +49,23 @@ class SystemInformation:
|
|||
'HKEY_LOCAL_MACHINE',
|
||||
'HARDWARE\\DEVICEMAP\\VIDEO',
|
||||
'\Device\Video{}'.format(device))
|
||||
reg_key = video_card_string.split('\\')[-2]
|
||||
reg_key = '\\'.join(video_card_string.split('\\')[-2:])
|
||||
# Probe keys to avoid software devices
|
||||
get_registry_value(
|
||||
'HKEY_LOCAL_MACHINE',
|
||||
'SYSTEM\\CurrentControlSet\\Control\\Video\\'
|
||||
'{}\\0000'.format(reg_key),
|
||||
'{}'.format(reg_key),
|
||||
'HardwareInformation.AdapterString')
|
||||
reg_keys.append(reg_key)
|
||||
except:
|
||||
pass
|
||||
|
||||
video_cards = []
|
||||
for video_card in reg_keys:
|
||||
for video_card in set(reg_keys):
|
||||
device_descrption = get_registry_value(
|
||||
'HKEY_LOCAL_MACHINE',
|
||||
'SYSTEM\\CurrentControlSet\\Control\\Video\\'
|
||||
'{}\\0000'.format(video_card),
|
||||
'{}'.format(video_card),
|
||||
'Device Description')
|
||||
video_cards.append(device_descrption)
|
||||
return '\n\t'.join(video_cards)
|
||||
|
|
Loading…
Reference in New Issue