mirror of https://gitlab.com/baco/winsysinfo.git
Fix in the gathering of video adapter information
Some video adapters do not have registry key "Device Description", instead most of them have the key "DriveDesc" set. Added test for both keys before failing.
This commit is contained in:
parent
5d220ef36b
commit
81b05434f7
|
@ -63,11 +63,21 @@ class SystemInformation:
|
|||
|
||||
video_cards = []
|
||||
for video_card in reg_keys:
|
||||
device_descrption = get_registry_value(
|
||||
'HKEY_LOCAL_MACHINE',
|
||||
'SYSTEM\\CurrentControlSet\\Control\\Video\\'
|
||||
'{}\\0000'.format(video_card),
|
||||
'Device Description')
|
||||
try:
|
||||
device_descrption = get_registry_value(
|
||||
'HKEY_LOCAL_MACHINE',
|
||||
'SYSTEM\\CurrentControlSet\\Control\\Video\\'
|
||||
'{}\\0000'.format(video_card),
|
||||
'Device Description')
|
||||
except:
|
||||
try:
|
||||
device_descrption = get_registry_value(
|
||||
'HKEY_LOCAL_MACHINE',
|
||||
'SYSTEM\\CurrentControlSet\\Control\\Video\\'
|
||||
'{}\\0000'.format(video_card),
|
||||
'DriverDesc')
|
||||
except:
|
||||
device_descrption = 'Failed to obtain video adapter.'
|
||||
video_cards.append(device_descrption)
|
||||
return '\n\t'.join(video_cards)
|
||||
|
||||
|
|
Loading…
Reference in New Issue